From 33604a56dc35a04c6b4233f2030cebc60e8dcfe9 Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Fri, 3 Mar 2023 11:26:18 +0100 Subject: android-tools: make it work with devtool devtool modify android-tools was failing with an error: - regenerate patches in the git format working with devtool - add debian patches to yocto instead of applying them manually with do_unpack_and_patch_debian, to make it work with devtool Signed-off-by: Etienne Cordonnier --- ...k-modifications-to-make-it-build-in-yocto.patch | 41 ++++++ ...ls.mk-modifications-to-make-it-build-in-y.patch | 54 ++++++++ ...-libundwind-to-build-in-yocto-environment.patch | 58 ++++++++ .../0002-libfec-change-out_dir-in-makefile.patch | 49 +++++++ .../android-tools/adb_mk_change_out_dir.patch | 50 ------- .../core-debian/Added-missing-headers.patch | 94 +++++++++++++ .../android-tools/core-debian/Nonnull.patch | 20 +++ .../android-tools/core-debian/Vector-cast.patch | 14 ++ .../core-debian/add-missing-headers.patch | 20 +++ .../core-debian/fix-attribute-issue-with-gcc.patch | 17 +++ .../core-debian/fix-build-on-non-x86.patch | 24 ++++ .../core-debian/fix-gcc-11-ftbfs.patch | 22 +++ .../fix-gettid-exception-declaration.patch | 22 +++ .../android-tools/core-debian/fix-gnu-hurd.patch | 150 +++++++++++++++++++++ .../core-debian/hard-code-build-number.patch | 43 ++++++ .../core-debian/libusb-header-path.patch | 16 +++ .../core-debian/move-log-file-to-proper-dir.patch | 18 +++ .../core-debian/simg_dump-python3.patch | 62 +++++++++ .../android-tools/core-debian/stdatomic.patch | 74 ++++++++++ .../throw-exception-on-unknown-os.patch | 15 +++ .../core-debian/use-Python-3-for-mkbootimg.patch | 18 +++ ...xpected-primary-expression-before-.-token.patch | 31 +++++ ...hing-adb.mk-to-build-in-yocto-environment.patch | 62 +++++++++ ...odifications-to-make-it-build-in-yocto-en.patch | 56 ++++++++ ...003-socket.h-removing-dependency-of-gtest.patch | 61 +++++++++ ...fastboot.mk-to-build-in-yocto-environment.patch | 63 +++++++++ ...n-t-use-sparse_file_import_auto-in-load_b.patch | 54 ++++++++ ...modifications-to-make-it-build-in-yocto-e.patch | 45 +++++++ ...tils.mk-modifications-to-make-it-build-in.patch | 51 +++++++ ...odifications-to-make-it-build-in-yocto-en.patch | 41 ++++++ ...img2simg.mk-to-build-in-yocto-environment.patch | 52 +++++++ ...simg2img.mk-to-build-in-yocto-environment.patch | 52 +++++++ ...g-liblog.mk-to-build-in-yocto-environment.patch | 53 ++++++++ ...ibsparse.mk-to-build-in-yocto-environment.patch | 58 ++++++++ ...bziparchive.mk-to-build-in-yocto-environm.patch | 59 ++++++++ ...bbacktrace.mk-to-build-in-yocto-environme.patch | 69 ++++++++++ ...Use-namespace-std-to-compile-libbacktrace.patch | 32 +++++ .../fastboot_compile_remove_gtest.patch | 51 ------- ...se_sparse_file_import_auto_in_load_buf_fd.patch | 42 ------ .../android-tools/fastboot_mk_change_out_dir.patch | 52 ------- .../android-tools/img2simg_change_out_dir.patch | 41 ------ .../android-tools/libadb_mk_change_out_dir.patch | 44 ------ .../libbacktrace_mk_change_out_dir.patch | 58 -------- .../android-tools/libbase_mk_change_out_dir.patch | 33 ----- .../libcrypto_mk_change_out_dir.patch | 30 ----- .../libcrypto_utils_mk_change_out_dir.patch | 4 +- .../libcutils_mk_change_out_dir.patch | 27 ---- .../libext4_utils_mk_change_out_dir.patch | 42 ------ .../android-tools/libfec_mk_change_out_dir.patch | 35 ----- .../android-tools/liblog_mk_change_out_dir.patch | 42 ------ .../libsparse_mk_change_out_dir.patch | 47 ------- .../20150704-CVE-2015-3239_dwarf_i.h.patch | 14 ++ .../legacy_built-in_sync_functions.patch | 25 ++++ .../android-tools/libunwind-debian/series | 3 + .../libunwind-debian/user_pt_regs.patch | 23 ++++ .../libunwind_mk_change_out_dir.patch | 47 ------- .../libziparchive_mk_change_out_dir.patch | 47 ------- .../android-tools/simg2img_change_out_dir.patch | 41 ------ ...se_name_space_std_to_compile_libbacktrace.patch | 19 --- .../android-tools/android-tools_10.0.0.r36.bb | 87 +++++++----- 60 files changed, 1790 insertions(+), 784 deletions(-) create mode 100644 dynamic-layers/selinux/android-tools/android-tools/0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/0001-patching-libundwind-to-build-in-yocto-environment.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/0002-libfec-change-out_dir-in-makefile.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/Added-missing-headers.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/Nonnull.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/Vector-cast.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/add-missing-headers.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-attribute-issue-with-gcc.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-build-on-non-x86.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gcc-11-ftbfs.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gettid-exception-declaration.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gnu-hurd.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/hard-code-build-number.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/libusb-header-path.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/move-log-file-to-proper-dir.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/simg_dump-python3.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/stdatomic.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/throw-exception-on-unknown-os.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/use-Python-3-for-mkbootimg.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core-debian/workaround-error-expected-primary-expression-before-.-token.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0003-socket.h-removing-dependency-of-gtest.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0006-libbase.mk-modifications-to-make-it-build-in-yocto-e.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0007-libcrypto_utils.mk-modifications-to-make-it-build-in.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0008-libcutils-modifications-to-make-it-build-in-yocto-en.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0009-patching-img2simg.mk-to-build-in-yocto-environment.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0010-patching-simg2img.mk-to-build-in-yocto-environment.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0011-patching-liblog.mk-to-build-in-yocto-environment.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0012-patching-libsparse.mk-to-build-in-yocto-environment.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0013-patching-libziparchive.mk-to-build-in-yocto-environm.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/core/0015-Use-namespace-std-to-compile-libbacktrace.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/20150704-CVE-2015-3239_dwarf_i.h.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/legacy_built-in_sync_functions.patch create mode 100644 dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/series create mode 100644 dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/user_pt_regs.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch delete mode 100644 dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch (limited to 'dynamic-layers') diff --git a/dynamic-layers/selinux/android-tools/android-tools/0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch b/dynamic-layers/selinux/android-tools/android-tools/0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch new file mode 100644 index 0000000..7d6d588 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch @@ -0,0 +1,41 @@ +From 30193c177138551a9aa269ae249ed2800811b223 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:24:11 +0100 +Subject: [PATCH] libcrypto.mk: modifications to make it build in yocto + environment + +Adding an include file that is setting the common flags. + +Modified the build rule so that it outputs the binary and include +to the OUT_DIR + +Signed-off-by: Nisha Parrakat +--- + debian/libcrypto.mk | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/debian/libcrypto.mk b/debian/libcrypto.mk +index 4c0268e..8b41056 100644 +--- a/debian/libcrypto.mk ++++ b/debian/libcrypto.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + include sources.mk + + NAME = libcrypto +@@ -26,6 +27,8 @@ CPPFLAGS += -Isrc/include -Isrc/crypto + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread + + build: $(SOURCES) +- mkdir --parents debian/out +- $(CC) $^ -o debian/out/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 debian/out/$(NAME).so +\ No newline at end of file ++ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ ++ mkdir --parents $(OUT_DIR)/usr/include ++ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DOPENSSL_NO_ASM ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r include/openssl $(OUT_DIR)/usr/include +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch b/dynamic-layers/selinux/android-tools/android-tools/0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch new file mode 100644 index 0000000..04592da --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch @@ -0,0 +1,54 @@ +From e284ceac2b10133ca916bbae8055f040607b506c Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:21:49 +0100 +Subject: [PATCH 1/2] libext4_utils.mk: modifications to make it build in yocto + environment + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary and header to the OUT_DIR + +Signed-off-by: Nisha Parrakat +--- + debian/libext4_utils.mk | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/debian/libext4_utils.mk b/debian/libext4_utils.mk +index 868e790..2e93158 100644 +--- a/debian/libext4_utils.mk ++++ b/debian/libext4_utils.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libext4_utils + + ext4_utils_SOURCES := \ +@@ -17,14 +18,16 @@ CPPFLAGS += \ + -Iext4_utils/include \ + -Ilibfec/include \ + -Isquashfs_utils \ +- -I/usr/include/android \ ++ -I/usr/include/android -I$(OUT_DIR)/usr/include \ + -D_GNU_SOURCE -DFEC_NO_KLOG -DSQUASHFS_NO_KLOG -D_LARGEFILE64_SOURCE + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ + -lbase -lsparse -lselinux + + build: $(SOURCES) +- mkdir --parents $(OUT_DIR) +- $(CC) $^ -o $(OUT_DIR)/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(OUT_DIR)/$(NAME).so ++ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ ++ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r ext4_utils/include/* $(OUT_DIR)/usr/include/ ++ +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/0001-patching-libundwind-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/0001-patching-libundwind-to-build-in-yocto-environment.patch new file mode 100644 index 0000000..f6bea17 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/0001-patching-libundwind-to-build-in-yocto-environment.patch @@ -0,0 +1,58 @@ +From d5fb34aef65b5c5472544e4f42ad777d8fa16ba9 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:41:52 +0100 +Subject: [PATCH] patching libundwind to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Passing the architecture details($CPU)from the recipe. + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- + debian/libunwind.mk | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/debian/libunwind.mk b/debian/libunwind.mk +index 738b205..ada4ef9 100644 +--- a/debian/libunwind.mk ++++ b/debian/libunwind.mk +@@ -1,4 +1,4 @@ +-include debian/detect_arch.mk ++include ../../rules_yocto.mk + + ARCH_SOURCES = is_fpreg.c \ + regname.c \ +@@ -131,10 +131,12 @@ CFLAGS += -DHAVE_CONFIG_H -DNDEBUG -D_GNU_SOURCE -Werror -Wno-unused-parameter - + CPPFLAGS += -Iinclude -Isrc $($(CPU)_INCLUDES) -Idebian/include + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -lpthread -nostdlib -lc -lgcc -Ldebian/out -l7z ++ -lpthread -nostdlib -lc -lgcc -l7z -Wno-error=unused-command-line-argument + + build: $(SOURCES) +- mkdir --parents debian/out +- ln -s /usr/lib/p7zip/7z.so debian/out/lib7z.so +- $(CC) $^ -o debian/out/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 debian/out/$(NAME).so ++ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ ++ mkdir --parents $(OUT_DIR)/usr/include/android/libunwind ++ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wno-header-guard -Wno-absolute-value ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r include/* debian/include/* $(OUT_DIR)/usr/include/android/libunwind/ ++ +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/0002-libfec-change-out_dir-in-makefile.patch b/dynamic-layers/selinux/android-tools/android-tools/0002-libfec-change-out_dir-in-makefile.patch new file mode 100644 index 0000000..25f8efe --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/0002-libfec-change-out_dir-in-makefile.patch @@ -0,0 +1,49 @@ +From 3be070a1fe2efa2877684f95c6a5643f76ee8bbc Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:32:11 +0100 +Subject: [PATCH 2/2] libfec: change out_dir in makefile + +--- + debian/libfec.mk | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/debian/libfec.mk b/debian/libfec.mk +index 1d48392..dea9316 100644 +--- a/debian/libfec.mk ++++ b/debian/libfec.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libfec + + # copied from libfec/Android.bp +@@ -12,20 +13,21 @@ CXXSOURCES := $(foreach source, $(filter %.cpp, $(SOURCES)), libfec/$(source)) + CXXFLAGS += -fno-strict-aliasing -std=g++17 + CPPFLAGS += \ + -Iext4_utils/include \ +- -Ilibfec/include \ ++ -Ilibfec/include -I $(OUT_DIR)/usr/include \ + -D_GNU_SOURCE -DFEC_NO_KLOG -D_LARGEFILE64_SOURCE + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -lbase -lsparse -lselinux + + build: $(COBJECTS) $(CXXOBJECTS) +- mkdir -p $(OUT_DIR) +- $(CXX) $^ -o $(OUT_DIR)/$(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(OUT_DIR)/$(NAME).so ++ mkdir -p $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r libfec/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* ++ $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(COBJECTS): %.o: %.c + $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch deleted file mode 100644 index 8c07e13..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch +++ /dev/null @@ -1,50 +0,0 @@ -patching adb.mk to build in yocto environment. - -Changes include: -Introduced an output folder which will keep all the outputs from the -android-tools. - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - -Upstream-Status: Pending ---- git/system/core/debian/adb.mk 2021-04-29 21:11:00.617892503 +0200 -+++ git/system/core/debian/adb.mk 2021-04-29 21:17:33.256016600 +0200 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME = adb - - SOURCES = client/adb_client.cpp \ -@@ -12,10 +13,10 @@ - - SOURCES := $(foreach source, $(SOURCES), adb/$(source)) - CXXFLAGS += -std=gnu++2a --CPPFLAGS += -Iinclude -Iadb -Ibase/include \ -+CPPFLAGS += -Iinclude -Iadb -Ibase/include -I$(OUT_DIR)/usr/include/ \ - -DADB_VERSION='"$(DEB_VERSION)"' -DADB_HOST=1 -D_GNU_SOURCE --LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=. \ -- -lpthread -L. -ladb -lbase -+LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ -+ -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -ladb -lbase - - # -latomic should be the last library specified - # https://github.com/android/ndk/issues/589 -@@ -24,7 +25,8 @@ - endif - - build: $(SOURCES) -- $(CXX) $^ -o adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -+ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb -+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) - - clean: -- $(RM) adb/$(NAME) -+ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/Added-missing-headers.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/Added-missing-headers.patch new file mode 100644 index 0000000..2820e79 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/Added-missing-headers.patch @@ -0,0 +1,94 @@ +Description: Added missing headers causing compile errors +Author: Umang Parmar +Forwarded: not-needed + +--- a/adb/sysdeps/posix/network.cpp ++++ b/adb/sysdeps/posix/network.cpp +@@ -22,6 +22,7 @@ + #include + + #include ++#include + + #include + #include +--- a/base/errors_unix.cpp ++++ b/base/errors_unix.cpp +@@ -17,6 +17,7 @@ + #include "android-base/errors.h" + + #include ++#include + + namespace android { + namespace base { +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include + #include +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + // For getprogname(3) or program_invocation_short_name. + #if defined(__ANDROID__) || defined(__APPLE__) +--- a/libcutils/include/cutils/jstring.h ++++ b/libcutils/include/cutils/jstring.h +@@ -19,6 +19,7 @@ + + #include + #include ++#include + + #ifdef __cplusplus + extern "C" { +--- a/libbacktrace/BacktraceMap.cpp ++++ b/libbacktrace/BacktraceMap.cpp +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include + +--- a/demangle/Demangler.cpp ++++ b/demangle/Demangler.cpp +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + #include "Demangler.h" + +--- a/libbacktrace/UnwindStackMap.cpp ++++ b/libbacktrace/UnwindStackMap.cpp +@@ -20,6 +20,7 @@ + + #include + #include ++#include + + #include + #include +--- a/adb/types.h ++++ b/adb/types.h +@@ -17,6 +17,7 @@ + #pragma once + + #include ++#include + #include + #include + #include diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/Nonnull.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/Nonnull.patch new file mode 100644 index 0000000..a7e0fa8 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/Nonnull.patch @@ -0,0 +1,20 @@ +Description: Bring Clang's _Nonnull keyword to GCC +Author: Kai-Chung Yan +Forwarded: not-needed +--- a/adb/sysdeps.h ++++ b/adb/sysdeps.h +@@ -40,11 +40,12 @@ + #include "sysdeps/network.h" + #include "sysdeps/stat.h" + ++#define _Nonnull ++#define _Nullable ++ + #ifdef _WIN32 + + // Clang-only nullability specifiers +-#define _Nonnull +-#define _Nullable + + #include + #include diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/Vector-cast.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/Vector-cast.patch new file mode 100644 index 0000000..dd39d1e --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/Vector-cast.patch @@ -0,0 +1,14 @@ +Description: Fix the wired error by GCC7 that fails to match the correct parent method. +Author: Kai-Chung Yan +Forwarded: not-needed +--- a/libutils/include/utils/Vector.h ++++ b/libutils/include/utils/Vector.h +@@ -256,7 +256,7 @@ + + template inline + const Vector& Vector::operator = (const Vector& rhs) const { +- VectorImpl::operator = (static_cast(rhs)); ++ VectorImpl::operator = (rhs); + return *this; + } + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/add-missing-headers.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/add-missing-headers.patch new file mode 100644 index 0000000..62a8ba2 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/add-missing-headers.patch @@ -0,0 +1,20 @@ +--- a/fs_mgr/liblp/reader.cpp ++++ b/fs_mgr/liblp/reader.cpp +@@ -21,6 +21,7 @@ + #include + + #include ++#include + + #include + #include +--- a/fs_mgr/liblp/writer.cpp ++++ b/fs_mgr/liblp/writer.cpp +@@ -20,6 +20,7 @@ + #include + + #include ++#include + + #include + #include diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-attribute-issue-with-gcc.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-attribute-issue-with-gcc.patch new file mode 100644 index 0000000..771f0e7 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-attribute-issue-with-gcc.patch @@ -0,0 +1,17 @@ +Description: remove clang-ism +Forwarded: not-needed + +--- a/base/include/android-base/logging.h ++++ b/base/include/android-base/logging.h +@@ -484,10 +484,7 @@ + // -Wno-user-defined-warnings to CPPFLAGS. + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wgcc-compat" +-#define OSTREAM_STRING_POINTER_USAGE_WARNING \ +- __attribute__((diagnose_if(true, "Unexpected logging of string pointer", "warning"))) +-inline std::ostream& operator<<(std::ostream& stream, const std::string* string_pointer) +- OSTREAM_STRING_POINTER_USAGE_WARNING { ++inline std::ostream& operator<<(std::ostream& stream, const std::string* string_pointer) { + return stream << static_cast(string_pointer); + } + #pragma clang diagnostic pop diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-build-on-non-x86.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-build-on-non-x86.patch new file mode 100644 index 0000000..66d1ddd --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-build-on-non-x86.patch @@ -0,0 +1,24 @@ +Description: non-x86 arches do not have PAGE_SIZE +Forwarded: not-needed +--- a/base/cmsg.cpp ++++ b/base/cmsg.cpp +@@ -33,7 +33,8 @@ + const std::vector& fds) { + size_t cmsg_space = CMSG_SPACE(sizeof(int) * fds.size()); + size_t cmsg_len = CMSG_LEN(sizeof(int) * fds.size()); +- if (cmsg_space >= PAGE_SIZE) { ++ size_t pagesize = static_cast(sysconf(_SC_PAGE_SIZE)); ++ if (cmsg_space >= pagesize) { + errno = ENOMEM; + return -1; + } +@@ -75,7 +76,8 @@ + fds->clear(); + + size_t cmsg_space = CMSG_SPACE(sizeof(int) * max_fds); +- if (cmsg_space >= PAGE_SIZE) { ++ size_t pagesize = static_cast(sysconf(_SC_PAGE_SIZE)); ++ if (cmsg_space >= pagesize) { + errno = ENOMEM; + return -1; + } diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gcc-11-ftbfs.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gcc-11-ftbfs.patch new file mode 100644 index 0000000..8a21054 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gcc-11-ftbfs.patch @@ -0,0 +1,22 @@ +Index: android-platform-system-core/libunwindstack/include/unwindstack/DwarfMemory.h +=================================================================== +--- android-platform-system-core.orig/libunwindstack/include/unwindstack/DwarfMemory.h ++++ android-platform-system-core/libunwindstack/include/unwindstack/DwarfMemory.h +@@ -29,7 +29,7 @@ class DwarfMemory { + DwarfMemory(Memory* memory) : memory_(memory) {} + virtual ~DwarfMemory() = default; + +- bool ReadBytes(void* dst, size_t num_bytes); ++ bool ReadBytes(void* dst, std::size_t num_bytes); + + template + bool ReadSigned(uint64_t* value); +@@ -39,7 +39,7 @@ class DwarfMemory { + bool ReadSLEB128(int64_t* value); + + template +- size_t GetEncodedSize(uint8_t encoding); ++ std::size_t GetEncodedSize(uint8_t encoding); + + bool AdjustEncodedValue(uint8_t encoding, uint64_t* value); + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gettid-exception-declaration.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gettid-exception-declaration.patch new file mode 100644 index 0000000..3622d7e --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gettid-exception-declaration.patch @@ -0,0 +1,22 @@ +--- a/libcutils/include/cutils/threads.h ++++ b/libcutils/include/cutils/threads.h +@@ -33,7 +33,7 @@ + // Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows. + // + +-extern pid_t gettid(); ++extern pid_t gettid(void) __THROW; + + // + // Deprecated: use `_Thread_local` in C or `thread_local` in C++. +--- a/libcutils/threads.cpp ++++ b/libcutils/threads.cpp +@@ -33,7 +33,7 @@ + + // No definition needed for Android because we'll just pick up bionic's copy. + #ifndef __ANDROID__ +-pid_t gettid() { ++pid_t gettid(void) __THROW { + #if defined(__APPLE__) + uint64_t tid; + pthread_threadid_np(NULL, &tid); diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gnu-hurd.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gnu-hurd.patch new file mode 100644 index 0000000..6c21022 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/fix-gnu-hurd.patch @@ -0,0 +1,150 @@ +From: Roger Shimizu +Date: Sun, 10 Jan 2021 19:03:17 +0900 +Subject: Fix GNU/Hurd + +Reference: +- https://www.gnu.org/software/hurd/hurd/porting/guidelines.html + +Closes: #915762 +--- + base/cmsg.cpp | 2 ++ + base/threads.cpp | 2 +- + libcutils/ashmem-host.cpp | 20 +++++++++++++++++--- + libcutils/canned_fs_config.cpp | 2 +- + libcutils/fs.cpp | 20 ++++++++++++++++---- + 5 files changed, 37 insertions(+), 9 deletions(-) + +diff --git a/base/cmsg.cpp b/base/cmsg.cpp +index ae5bb16..e5ec321 100644 +--- a/base/cmsg.cpp ++++ b/base/cmsg.cpp +@@ -20,7 +20,9 @@ + #include + #include + #include ++#ifndef __GNU__ + #include ++#endif + + #include + +diff --git a/base/threads.cpp b/base/threads.cpp +index 48f6197..19cc293 100644 +--- a/base/threads.cpp ++++ b/base/threads.cpp +@@ -47,7 +47,7 @@ uint64_t GetThreadId() { + } // namespace base + } // namespace android + +-#if defined(__GLIBC__) ++#if defined(__GLIBC__) && !defined(__GNU__) + int tgkill(int tgid, int tid, int sig) { + return syscall(__NR_tgkill, tgid, tid, sig); + } +diff --git a/libcutils/ashmem-host.cpp b/libcutils/ashmem-host.cpp +index 32446d4..83dd622 100644 +--- a/libcutils/ashmem-host.cpp ++++ b/libcutils/ashmem-host.cpp +@@ -31,16 +31,30 @@ + #include + #include + #include ++#include + + #include + + int ashmem_create_region(const char* /*ignored*/, size_t size) { +- char pattern[PATH_MAX]; +- snprintf(pattern, sizeof(pattern), "/tmp/android-ashmem-%d-XXXXXXXXX", getpid()); ++ char *pattern; ++ size_t pattern_size = 128; ++ while(1) { ++ pattern = (char*) malloc(pattern_size); ++ if(snprintf(pattern, strlen(pattern), "/tmp/android-ashmem-%d-XXXXXXXXX", getpid()) < pattern_size) ++ break; ++ free(pattern); ++ pattern_size *= 2; ++ if(pattern_size >= INT_LEAST16_MAX) ++ return -1; ++ } + int fd = mkstemp(pattern); +- if (fd == -1) return -1; ++ if (fd == -1) { ++ free(pattern); ++ return -1; ++ } + + unlink(pattern); ++ free(pattern); + + if (TEMP_FAILURE_RETRY(ftruncate(fd, size)) == -1) { + close(fd); +diff --git a/libcutils/canned_fs_config.cpp b/libcutils/canned_fs_config.cpp +index 2772ef0..1e41f37 100644 +--- a/libcutils/canned_fs_config.cpp ++++ b/libcutils/canned_fs_config.cpp +@@ -42,7 +42,7 @@ static int path_compare(const void* a, const void* b) { + } + + int load_canned_fs_config(const char* fn) { +- char buf[PATH_MAX + 200]; ++ char buf[1024]; + FILE* f; + + f = fopen(fn, "r"); +diff --git a/libcutils/fs.cpp b/libcutils/fs.cpp +index ef85acc..2884835 100644 +--- a/libcutils/fs.cpp ++++ b/libcutils/fs.cpp +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + + #include + +@@ -150,15 +151,24 @@ fail: + } + + int fs_write_atomic_int(const char* path, int value) { +- char temp[PATH_MAX]; +- if (snprintf(temp, PATH_MAX, "%s.XXXXXX", path) >= PATH_MAX) { +- ALOGE("Path too long"); +- return -1; ++ char *temp; ++ size_t temp_size = 128; ++ while(1) { ++ temp = (char*) malloc(temp_size); ++ if(snprintf(temp, strlen(temp), "%s.XXXXXX", path) < temp_size) ++ break; ++ free(temp); ++ temp_size *= 2; ++ if(temp_size >= INT_LEAST16_MAX) { ++ ALOGE("Path too long"); ++ return -1; ++ } + } + + int fd = TEMP_FAILURE_RETRY(mkstemp(temp)); + if (fd == -1) { + ALOGE("Failed to open %s: %s", temp, strerror(errno)); ++ free(temp); + return -1; + } + +@@ -182,12 +192,14 @@ int fs_write_atomic_int(const char* path, int value) { + goto fail_closed; + } + ++ free(temp); + return 0; + + fail: + close(fd); + fail_closed: + unlink(temp); ++ free(temp); + return -1; + } + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/hard-code-build-number.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/hard-code-build-number.patch new file mode 100644 index 0000000..ccc7655 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/hard-code-build-number.patch @@ -0,0 +1,43 @@ +Description: just hard code rather than deal with circular deps +Forwarded: not-needed +--- a/adb/adb.cpp ++++ b/adb/adb.cpp +@@ -44,8 +44,6 @@ + #include + #include + #include +-#include +-#include + + #include "adb_auth.h" + #include "adb_io.h" +@@ -69,7 +67,7 @@ + "Version %s-%s\n" + "Installed as %s\n", + ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION, +- PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str(), ++ PLATFORM_TOOLS_VERSION, "debian", + android::base::GetExecutablePath().c_str()); + } + +--- a/fastboot/fastboot.cpp ++++ b/fastboot/fastboot.cpp +@@ -58,9 +58,7 @@ + #include + #include + #include +-#include + #include +-#include + #include + #include + +@@ -1680,7 +1678,7 @@ + setvbuf(stdout, nullptr, _IONBF, 0); + setvbuf(stderr, nullptr, _IONBF, 0); + } else if (name == "version") { +- fprintf(stdout, "fastboot version %s-%s\n", PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str()); ++ fprintf(stdout, "fastboot version %s-%s\n", PLATFORM_TOOLS_VERSION, "debian"); + fprintf(stdout, "Installed as %s\n", android::base::GetExecutablePath().c_str()); + return 0; + #if !defined(_WIN32) diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/libusb-header-path.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/libusb-header-path.patch new file mode 100644 index 0000000..d507eab --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/libusb-header-path.patch @@ -0,0 +1,16 @@ +Description: libusb.h comes from different location +Author: Umang Parmar +Forwarded: not-needed +Last-Update: 2018-05-26 + +--- a/adb/client/usb_libusb.cpp ++++ b/adb/client/usb_libusb.cpp +@@ -30,7 +30,7 @@ + #include + #include + +-#include ++#include + + #include + #include diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/move-log-file-to-proper-dir.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/move-log-file-to-proper-dir.patch new file mode 100644 index 0000000..e71af86 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/move-log-file-to-proper-dir.patch @@ -0,0 +1,18 @@ +Description: Update log file directory. +Author: Umang Parmar +Last Updated: 2018-05-17 + +--- a/adb/adb_utils.cpp ++++ b/adb/adb_utils.cpp +@@ -339,6 +339,11 @@ + + return temp_path_utf8 + log_name; + #else ++ std::string log_dir = android::base::StringPrintf("/run/user/%u/adb.log", getuid()); ++ struct stat st = {0}; ++ if (stat(log_dir.c_str(), &st) == 0) { ++ return log_dir; ++ } + const char* tmp_dir = getenv("TMPDIR"); + if (tmp_dir == nullptr) tmp_dir = "/tmp"; + return android::base::StringPrintf("%s/adb.%u.log", tmp_dir, getuid()); diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/simg_dump-python3.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/simg_dump-python3.patch new file mode 100644 index 0000000..947b526 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/simg_dump-python3.patch @@ -0,0 +1,62 @@ +Description: Port simg_dump to Python 3. +Author: Antonio Russo +Forwarded: no +Last-Update: 2019-01-05 +Origin: https://bugs.debian.org/945646 + +--- +Index: android-platform-system-core/libsparse/simg_dump.py +=================================================================== +--- android-platform-system-core.orig/libsparse/simg_dump.py ++++ android-platform-system-core/libsparse/simg_dump.py +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#! /usr/bin/env python3 + + # Copyright (C) 2012 The Android Open Source Project + # +@@ -14,7 +14,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-from __future__ import print_function ++ + import csv + import getopt + import hashlib +@@ -47,7 +47,7 @@ def main(): + opts, args = getopt.getopt(sys.argv[1:], + "vsc:", + ["verbose", "showhash", "csvfile"]) +- except getopt.GetoptError, e: ++ except getopt.GetoptError as e: + print(e) + usage(me) + for o, a in opts: +@@ -66,7 +66,7 @@ def main(): + usage(me) + + if csvfilename: +- csvfile = open(csvfilename, "wb") ++ csvfile = open(csvfilename, "w", newline='') + csvwriter = csv.writer(csvfile) + + output = verbose or csvfilename or showhash +@@ -121,7 +121,7 @@ def main(): + "output offset", "output blocks", "type", "hash"]) + + offset = 0 +- for i in xrange(1, total_chunks + 1): ++ for i in range(1, total_chunks + 1): + header_bin = FH.read(12) + header = struct.unpack("<2H2I", header_bin) + chunk_type = header[0] +@@ -160,7 +160,7 @@ def main(): + if showhash: + h = hashlib.sha1() + data = fill_bin * (blk_sz / 4); +- for block in xrange(chunk_sz): ++ for block in range(chunk_sz): + h.update(data) + curhash = h.hexdigest() + elif chunk_type == 0xCAC3: diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/stdatomic.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/stdatomic.patch new file mode 100644 index 0000000..8de0035 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/stdatomic.patch @@ -0,0 +1,74 @@ +Description: Fix incompatibility between and + This 2 headers combined will cause errors for both GCC and Clang. This patch + makes sure only one of them is present at any time. +Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932 +Bug: https://reviews.llvm.org/D45470 +--- a/libcutils/include/cutils/trace.h ++++ b/libcutils/include/cutils/trace.h +@@ -18,7 +18,14 @@ + #define _LIBS_CUTILS_TRACE_H + + #include ++#ifdef __cplusplus ++#include ++using std::atomic_bool; ++using std::atomic_load_explicit; ++using std::memory_order_acquire; ++#else + #include ++#endif + #include + #include + #include +--- a/libcutils/include/cutils/atomic.h ++++ b/libcutils/include/cutils/atomic.h +@@ -19,7 +19,23 @@ + + #include + #include ++#ifdef __cplusplus ++#include ++using std::atomic_compare_exchange_strong_explicit; ++using std::atomic_fetch_add_explicit; ++using std::atomic_fetch_or_explicit; ++using std::atomic_fetch_sub_explicit; ++using std::atomic_int_least32_t; ++using std::atomic_load_explicit; ++using std::atomic_store_explicit; ++using std::atomic_thread_fence; ++using std::memory_order::memory_order_acquire; ++using std::memory_order::memory_order_relaxed; ++using std::memory_order::memory_order_release; ++using std::memory_order::memory_order_seq_cst; ++#else + #include ++#endif + + #ifndef ANDROID_ATOMIC_INLINE + #define ANDROID_ATOMIC_INLINE static inline +--- a/liblog/logger.h ++++ b/liblog/logger.h +@@ -16,7 +16,13 @@ + + #pragma once + ++#ifdef __cplusplus ++#include ++using std::atomic_int; ++using std::atomic_uintptr_t; ++#else + #include ++#endif + #include + + #include +--- a/liblog/logger_write.cpp ++++ b/liblog/logger_write.cpp +@@ -15,7 +15,6 @@ + */ + + #include +-#include + #include + #include + #include diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/throw-exception-on-unknown-os.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/throw-exception-on-unknown-os.patch new file mode 100644 index 0000000..5e239b7 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/throw-exception-on-unknown-os.patch @@ -0,0 +1,15 @@ +Description: Turn #error into exceptions + So the library can be built on non-Linux platforms too, although can't + guarauntee its functionality regarding that piece of code. +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -422,7 +422,8 @@ + path[PATH_MAX - 1] = 0; + return path; + #else +-#error unknown OS ++#include ++ throw std::runtime_error(std::string("Unknown OS!")); + #endif + } + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/use-Python-3-for-mkbootimg.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/use-Python-3-for-mkbootimg.patch new file mode 100644 index 0000000..a14261a --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/use-Python-3-for-mkbootimg.patch @@ -0,0 +1,18 @@ +Description: Use Python 3 for `mkbootimg` +Bug: https://android.googlesource.com/platform/system/core/+/c434cf82d526f07cd3dcebf53582eeddf12b0a74 +--- a/mkbootimg/mkbootimg.py ++++ b/mkbootimg/mkbootimg.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # Copyright 2015, The Android Open Source Project + # + # Licensed under the Apache License, Version 2.0 (the "License"); +--- a/mkbootimg/unpack_bootimg.py ++++ b/mkbootimg/unpack_bootimg.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # Copyright 2018, The Android Open Source Project + # + # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/dynamic-layers/selinux/android-tools/android-tools/core-debian/workaround-error-expected-primary-expression-before-.-token.patch b/dynamic-layers/selinux/android-tools/android-tools/core-debian/workaround-error-expected-primary-expression-before-.-token.patch new file mode 100644 index 0000000..5e153b0 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core-debian/workaround-error-expected-primary-expression-before-.-token.patch @@ -0,0 +1,31 @@ +Description: code uses C99/C++20 constructs that g++ does not support + $ g++ liblog/fake_writer.cpp -o liblog/fake_writer.o -c -std=c++17 -fPIC -Iliblog/include -Iinclude -DLIBLOG_LOG_TAG=1006 -DFAKE_LOG_DEVICE=1 -DSNET_EVENT_LOG_TAG=1397638484 +liblog/fake_writer.cpp:36:5: error: expected primary-expression before ‘.’ token + .context.priv = &logFds, + ^ + This is an ugly hack. The actual fix is probably to compile using + clang. Otherwise, these .context.priv elements shuld be initialized + in a different way. + +Forwarded: not-needed + +--- a/liblog/fake_writer.cpp ++++ b/liblog/fake_writer.cpp +@@ -33,7 +33,6 @@ + + struct android_log_transport_write fakeLoggerWrite = { + .node = {&fakeLoggerWrite.node, &fakeLoggerWrite.node}, +- .context.priv = &logFds, + .name = "fake", + .available = NULL, + .open = fakeOpen, +--- a/liblog/stderr_write.cpp ++++ b/liblog/stderr_write.cpp +@@ -56,7 +56,6 @@ + + struct android_log_transport_write stderrLoggerWrite = { + .node = {&stderrLoggerWrite.node, &stderrLoggerWrite.node}, +- .context.priv = NULL, + .name = "stderr", + .available = stderrAvailable, + .open = stderrOpen, diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch new file mode 100644 index 0000000..d2ba525 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch @@ -0,0 +1,62 @@ +From d133fc2c71fb6b0358af453b03bcb6d1874e902a Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 12:25:40 +0100 +Subject: [PATCH 01/15] patching adb.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- + debian/adb.mk | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/debian/adb.mk b/debian/adb.mk +index 8dbacf9a..97c9d6ca 100644 +--- a/debian/adb.mk ++++ b/debian/adb.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = adb + + SOURCES = client/adb_client.cpp \ +@@ -12,10 +13,10 @@ SOURCES = client/adb_client.cpp \ + + SOURCES := $(foreach source, $(SOURCES), adb/$(source)) + CXXFLAGS += -std=gnu++2a +-CPPFLAGS += -Iinclude -Iadb -Ibase/include \ ++CPPFLAGS += -Iinclude -Iadb -Ibase/include -I$(OUT_DIR)/usr/include/ \ + -DADB_VERSION='"$(DEB_VERSION)"' -DADB_HOST=1 -D_GNU_SOURCE +-LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=. \ +- -lpthread -L. -ladb -lbase ++LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ ++ -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -ladb -lbase + + # -latomic should be the last library specified + # https://github.com/android/ndk/issues/589 +@@ -24,7 +25,8 @@ ifneq ($(filter armel mipsel,$(DEB_HOST_ARCH)),) + endif + + build: $(SOURCES) +- $(CXX) $^ -o adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) + + clean: +- $(RM) adb/$(NAME) ++ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch new file mode 100644 index 0000000..1281caa --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch @@ -0,0 +1,56 @@ +From f802e7685cfbdd66d74da2975b3a1c6d77f1a2de Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 12:28:10 +0100 +Subject: [PATCH 02/15] libadb.mk: modifications to make it build in yocto + environment + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat +--- + debian/libadb.mk | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/debian/libadb.mk b/debian/libadb.mk +index ae240c98..db5da353 100644 +--- a/debian/libadb.mk ++++ b/debian/libadb.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME := libadb + + LIBADB_SRC_FILES := \ +@@ -43,18 +44,18 @@ CPPFLAGS += \ + -Ibase/include \ + -Idiagnose_usb/include \ + -Ilibcrypto_utils/include \ +- -Iinclude \ ++ -Iinclude -I$(OUT_DIR)/usr/include \ + -DPLATFORM_TOOLS_VERSION='"$(PLATFORM_TOOLS_VERSION)"' \ + -DADB_HOST=1 -DADB_VERSION='"$(DEB_VERSION)"' + + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ +- -lpthread -L. -lbase -lcutils -lcrypto_utils -lusb-1.0 ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ ++ -lpthread -lbase -lcutils -lcrypto_utils -lusb-1.0 + + $(NAME).so: $(SOURCES) +- $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so + + transport_mdns_unsupported.cpp: + echo 'void init_mdns_transport_discovery(void) {}' > transport_mdns_unsupported.cpp +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0003-socket.h-removing-dependency-of-gtest.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0003-socket.h-removing-dependency-of-gtest.patch new file mode 100644 index 0000000..56c25ea --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0003-socket.h-removing-dependency-of-gtest.patch @@ -0,0 +1,61 @@ +From 4fdd086c2e9c85bc5a367a861696191e190cebc9 Mon Sep 17 00:00:00 2001 +From: Nisha Parrakat +Date: Thu, 2 Mar 2023 17:20:48 +0100 +Subject: [PATCH 03/15] socket.h: removing dependency of gtest + +Removed the dependency of gtest on the build of fastboot binary. +Fixes below error + +In file included from fastboot/fastboot.cpp:70: +| In file included from fastboot/tcp.h:36: +| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found +| #include +| ^~~~~~~~~~~~~~~~~~~~ +| 1 error generated. +| In file included from fastboot/socket.cpp:29: +| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found +| #include +| ^~~~~~~~~~~~~~~~~~~~ +| 1 error generated. +| In file included from fastboot/tcp.cpp:29: +| In file included from fastboot/tcp.h:36: +| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found +| #include +| ^~~~~~~~~~~~~~~~~~~~ +| 1 error generated. +| In file included from fastboot/udp.cpp:31: +| In file included from fastboot/udp.h:34: +| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found +| #include +| ^~~~~~~~~~~~~~~~~~~~ +| 1 error generated. + +Signed-off-by: Nisha Parrakat +--- + fastboot/socket.h | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/fastboot/socket.h b/fastboot/socket.h +index e791f2c8..671fc115 100644 +--- a/fastboot/socket.h ++++ b/fastboot/socket.h +@@ -40,7 +40,6 @@ + + #include + #include +-#include + + // Socket interface to be implemented for each platform. + class Socket { +@@ -119,8 +118,6 @@ class Socket { + socket_send_buffers_function_ = &socket_send_buffers; + + private: +- FRIEND_TEST(SocketTest, TestTcpSendBuffers); +- FRIEND_TEST(SocketTest, TestUdpSendBuffers); + + DISALLOW_COPY_AND_ASSIGN(Socket); + }; +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch new file mode 100644 index 0000000..82ec560 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch @@ -0,0 +1,63 @@ +From e826f68c68e05b0f5cc3b3c10d7d9e4deb135114 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:14:15 +0100 +Subject: [PATCH 04/15] patching fastboot.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- + debian/fastboot.mk | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/debian/fastboot.mk b/debian/fastboot.mk +index d1aba626..e75fa87c 100644 +--- a/debian/fastboot.mk ++++ b/debian/fastboot.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = fastboot + fastboot_SOURCES = \ + bootimg_utils.cpp \ +@@ -38,11 +39,11 @@ CPPFLAGS += \ + -Ifs_mgr/liblp/include \ + -I/usr/include/android/openssl \ + -Ilibsparse/include \ +- -Ilibziparchive/include ++ -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ + LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -fuse-ld=gold \ +- -Wl,-rpath-link=. \ +- -L. -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ ++ -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ + -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -l7z \ + +@@ -53,7 +54,8 @@ ifneq ($(filter armel mipsel,$(DEB_HOST_ARCH)),) + endif + + build: $(SOURCES) +- $(CXX) $^ -o fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ mkdir --parents $(OUT_DIR)/usr/bin/fastboot ++ $(CXX) $^ -o $(OUT_DIR)/usr/bin/fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) + + clean: +- $(RM) fastboot/$(NAME) ++ $(RM) $(OUT_DIR)/usr/bin/fastboot/$(NAME) +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch new file mode 100644 index 0000000..d465ad6 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch @@ -0,0 +1,54 @@ +From a4839f29e1286b0c53208a45b9c237d81021f829 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:15:47 +0100 +Subject: [PATCH 05/15] fastboot: don't use sparse_file_import_auto() in + load_buf_fd() + +upstream commit taken as below Original Issue link https://android-review.googlesource.com/c/platform/system/core/+/1123485 + +Commit taken below: + +fastboot: don't use sparse_file_import_auto() in load_buf_fd() + +load_buf_fd() attempts to find the size of the file that it is about +to load by first calling sparse_file_import_auto() then using +sparse_file_len() upon success or falling back to the file size on the +filesystem on failure. + +This is problematic however as sparse_file_import_auto() creates a +sparse_file out of the normal file, but does not resparse it, so an +assertion fails during the sparse_file_len() call. + +This is fixed by using sparse_file_import() instead. This will fail +in the case that the file is not sparse and the call to +sparse_file_len() will be properly skipped. + +Bug: 140538105 +Test: flash blueline factory image with assertions enabled in + libsparse/sparse.cpp + +Change-Id: I0283be33563a3301ce5b09bde41105a20f91086c + +https://android.googlesource.com/platform/system/core/+/fbb9535aaea5ae4011f3c3edf4c00b27452f57ec +Upstream-Status: Backport [commit fbb9535aaea5ae4011f3c3edf4c00b27452f57ec] +Signed-off-by: Nisha Parrakat +--- + fastboot/fastboot.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp +index 3b7b5571..0ae9402e 100644 +--- a/fastboot/fastboot.cpp ++++ b/fastboot/fastboot.cpp +@@ -869,7 +869,7 @@ static bool load_buf_fd(int fd, struct fastboot_buffer* buf) { + return false; + } + +- if (sparse_file* s = sparse_file_import_auto(fd, false, false)) { ++ if (sparse_file* s = sparse_file_import(fd, false, false)) { + buf->image_size = sparse_file_len(s, false, false); + sparse_file_destroy(s); + } else { +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0006-libbase.mk-modifications-to-make-it-build-in-yocto-e.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0006-libbase.mk-modifications-to-make-it-build-in-yocto-e.patch new file mode 100644 index 0000000..6211f04 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0006-libbase.mk-modifications-to-make-it-build-in-yocto-e.patch @@ -0,0 +1,45 @@ +From 22c7140dc170ecb26bde33fed4c9249b164f8d3c Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:19:08 +0100 +Subject: [PATCH 06/15] libbase.mk: modifications to make it build in yocto + environment + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat +--- + debian/libbase.mk | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/debian/libbase.mk b/debian/libbase.mk +index 80da48f3..e6c3e365 100644 +--- a/debian/libbase.mk ++++ b/debian/libbase.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libbase + SOURCES = \ + chrono_utils.cpp \ +@@ -20,8 +21,9 @@ CPPFLAGS += -Iinclude -Ibase/include + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 + + build: $(SOURCES) +- $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r base/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(NAME).so* ++ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0007-libcrypto_utils.mk-modifications-to-make-it-build-in.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0007-libcrypto_utils.mk-modifications-to-make-it-build-in.patch new file mode 100644 index 0000000..af92726 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0007-libcrypto_utils.mk-modifications-to-make-it-build-in.patch @@ -0,0 +1,51 @@ +From cae154ec12a864ada8372b393fceb1d682c78c60 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 14:38:05 +0100 +Subject: [PATCH 07/15] libcrypto_utils.mk: modifications to make it build in + yocto environment + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary and header to the OUT_DIR + +Signed-off-by: Nisha Parrakat +--- + debian/libcrypto_utils.mk | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/debian/libcrypto_utils.mk b/debian/libcrypto_utils.mk +index 3afd4124..80c52f30 100644 +--- a/debian/libcrypto_utils.mk ++++ b/debian/libcrypto_utils.mk +@@ -1,15 +1,17 @@ ++include ../../rules_yocto.mk + NAME:= libcrypto_utils + SOURCES := android_pubkey.c + SOURCES := $(foreach source, $(SOURCES), libcrypto_utils/$(source)) +-CPPFLAGS += -Ilibcrypto_utils/include -Iinclude ++CPPFLAGS += -Ilibcrypto_utils/include -Iinclude -I$(OUT_DIR)/usr/include + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -lcrypto -Wl,-z,defs ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -l:libcrypto.so.0 -Wl,-z,defs + + build: $(SOURCES) +- $(CC) $^ -o $(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r libcrypto_utils/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(NAME).so* ++ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0008-libcutils-modifications-to-make-it-build-in-yocto-en.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0008-libcutils-modifications-to-make-it-build-in-yocto-en.patch new file mode 100644 index 0000000..b876229 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0008-libcutils-modifications-to-make-it-build-in-yocto-en.patch @@ -0,0 +1,41 @@ +From 4af9cc9e93e5cb09583c0fedeccae3fa195dbe7b Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:26:08 +0100 +Subject: [PATCH 08/15] libcutils: modifications to make it build in yocto + environment +--- + debian/libcutils.mk | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/debian/libcutils.mk b/debian/libcutils.mk +index 7cd18d87..bb45fb57 100644 +--- a/debian/libcutils.mk ++++ b/debian/libcutils.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libcutils + + # copied from libcutils/Android.bp +@@ -50,14 +51,15 @@ CPPFLAGS += \ + -Iinclude \ + + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ +- -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L. -llog -lbase ++ -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -llog -lbase + + build: $(COBJECTS) $(CXXOBJECTS) +- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r libcutils/include/cutils $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* ++ $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(COBJECTS): %.o: %.c + $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0009-patching-img2simg.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0009-patching-img2simg.mk-to-build-in-yocto-environment.patch new file mode 100644 index 0000000..4ecfa6f --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0009-patching-img2simg.mk-to-build-in-yocto-environment.patch @@ -0,0 +1,52 @@ +From bea40821d787ca31b38d5879fbf751be1dbea622 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:33:30 +0100 +Subject: [PATCH 09/15] patching img2simg.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- + debian/img2simg.mk | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/debian/img2simg.mk b/debian/img2simg.mk +index f1036cef..94772381 100644 +--- a/debian/img2simg.mk ++++ b/debian/img2simg.mk +@@ -1,13 +1,14 @@ ++include ../../rules_yocto.mk + NAME = img2simg + SOURCES = img2simg.cpp + SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) + CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 +-LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -Wl,-rpath-link=. \ +- -L. -lsparse ++LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -lsparse + + build: $(SOURCES) +- $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) ++ $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) + + clean: +- $(RM) libsparse/$(NAME) ++ $(RM) $(OUT_DIR)/usr/bin/$(NAME) +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0010-patching-simg2img.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0010-patching-simg2img.mk-to-build-in-yocto-environment.patch new file mode 100644 index 0000000..aa60058 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0010-patching-simg2img.mk-to-build-in-yocto-environment.patch @@ -0,0 +1,52 @@ +From 08441cf4334b911dba8c493dca3b1e2166c7d322 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:34:34 +0100 +Subject: [PATCH 10/15] patching simg2img.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- + debian/simg2img.mk | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/debian/simg2img.mk b/debian/simg2img.mk +index 07fb56b4..d319c87e 100644 +--- a/debian/simg2img.mk ++++ b/debian/simg2img.mk +@@ -1,13 +1,14 @@ ++include ../../rules_yocto.mk + NAME = simg2img + SOURCES = simg2img.cpp sparse_crc32.cpp + SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) + CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 +-LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -Wl,-rpath-link=. \ +- -L. -lsparse ++LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lsparse + + build: $(SOURCES) +- $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) ++ $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) + + clean: +- $(RM) libsparse/$(NAME) ++ $(RM) $(OUT_DIR)/usr/bin/$(NAME) +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0011-patching-liblog.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0011-patching-liblog.mk-to-build-in-yocto-environment.patch new file mode 100644 index 0000000..7a37757 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0011-patching-liblog.mk-to-build-in-yocto-environment.patch @@ -0,0 +1,53 @@ +From 99e46ec157e6fb912258ac6506896196e53d790b Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:35:44 +0100 +Subject: [PATCH 11/15] patching liblog.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- + debian/liblog.mk | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/debian/liblog.mk b/debian/liblog.mk +index eb1909b9..3b40d710 100644 +--- a/debian/liblog.mk ++++ b/debian/liblog.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = liblog + + # copied from liblog/Android.bp +@@ -39,11 +40,12 @@ CPPFLAGS += \ + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread + + build: $(COBJECTS) $(CXXOBJECTS) +- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r liblog/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* ++ $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(COBJECTS): %.o: %.c + $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0012-patching-libsparse.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0012-patching-libsparse.mk-to-build-in-yocto-environment.patch new file mode 100644 index 0000000..029cc1c --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0012-patching-libsparse.mk-to-build-in-yocto-environment.patch @@ -0,0 +1,58 @@ +From 65ddf7ea7daae721b2d331164155542820ed3e33 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:36:58 +0100 +Subject: [PATCH 12/15] patching libsparse.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- + debian/libsparse.mk | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/debian/libsparse.mk b/debian/libsparse.mk +index de280def..64caa45f 100644 +--- a/debian/libsparse.mk ++++ b/debian/libsparse.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libsparse + SOURCES = \ + backed_block.cpp \ +@@ -18,16 +19,16 @@ LDFLAGS += \ + -shared -Wl,-soname,$(NAME).so.0 \ + -lz \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L. \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ + -lbase + + + build: $(COBJECTS) $(CXXOBJECTS) +- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so + + clean: +- $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* ++ $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(COBJECTS): %.o: %.c + $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0013-patching-libziparchive.mk-to-build-in-yocto-environm.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0013-patching-libziparchive.mk-to-build-in-yocto-environm.patch new file mode 100644 index 0000000..b49ec3b --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0013-patching-libziparchive.mk-to-build-in-yocto-environm.patch @@ -0,0 +1,59 @@ +From ae2bf1925fe02ea040005df27842c77c6d02b051 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:39:24 +0100 +Subject: [PATCH 13/15] patching libziparchive.mk to build in yocto + environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- + debian/libziparchive.mk | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/debian/libziparchive.mk b/debian/libziparchive.mk +index 803ea58e..6a697059 100644 +--- a/debian/libziparchive.mk ++++ b/debian/libziparchive.mk +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libziparchive + SOURCES = zip_archive.cc \ + zip_archive_stream_entry.cc\ +@@ -5,14 +6,15 @@ SOURCES = zip_archive.cc \ + SOURCES := $(foreach source, $(SOURCES), libziparchive/$(source)) + CXXFLAGS += -std=gnu++17 + CPPFLAGS += -DZLIB_CONST -D_FILE_OFFSET_BITS=64 \ +- -Iinclude -Ibase/include -Ilibziparchive/include ++ -Iinclude -Ibase/include -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -lz -L. -llog -lbase ++ -lz -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -llog -lbase + + build: $(SOURCES) +- $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r libziparchive/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(NAME).so* ++ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch new file mode 100644 index 0000000..433caf2 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch @@ -0,0 +1,69 @@ +From a99b74f25c7f786e26b5400218090d86596d4541 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:40:32 +0100 +Subject: [PATCH 14/15] patching libbacktrace.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- + debian/libbacktrace.mk | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/debian/libbacktrace.mk b/debian/libbacktrace.mk +index 330d211c..229b39d9 100644 +--- a/debian/libbacktrace.mk ++++ b/debian/libbacktrace.mk +@@ -1,5 +1,5 @@ + +-include /usr/share/dpkg/architecture.mk ++include ../../rules_yocto.mk + + NAME = libbacktrace + +@@ -88,11 +88,11 @@ CPPFLAGS += \ + -Ilibprocinfo/include \ + -Ilibunwindstack/include \ + -I/usr/include/android/lzma \ +- -I/usr/include/android/unwind ++ -I$(OUT_DIR)/usr/include/android/libunwind + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ +- -L. -lbase -llog -lpthread -l7z ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ ++ -lbase -llog -lpthread -l7z + + # -latomic should be the last library specified + # https://github.com/android/ndk/issues/589 +@@ -104,11 +104,11 @@ ifeq ($(DEB_HOST_ARCH), mipsel) + endif + + build: $(COBJECTS) $(CXXOBJECTS) $(OBJECTS_ASSEMBLY) +- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -sf $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(NAME).so + + clean: +- $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* ++ $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(CXXOBJECTS): %.o: %.cpp + $(CXX) $< -o $@ $(CXXFLAGS) $(CPPFLAGS) +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0015-Use-namespace-std-to-compile-libbacktrace.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0015-Use-namespace-std-to-compile-libbacktrace.patch new file mode 100644 index 0000000..d8fee66 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/core/0015-Use-namespace-std-to-compile-libbacktrace.patch @@ -0,0 +1,32 @@ +From 19a16829ef7b7ffd6466b9b90585d667a1663969 Mon Sep 17 00:00:00 2001 +From: Etienne Cordonnier +Date: Fri, 3 Mar 2023 13:43:50 +0100 +Subject: [PATCH 15/15] Use namespace std to compile libbacktrace + +To Fix the below error + + In file included from libunwindstack/DwarfSection.cpp:21: +| libunwindstack/include/unwindstack/DwarfMemory.h:32:29: error: unknown type name 'size_t'; did you mean 'std::size_t'? +| bool ReadBytes(void* dst, size_t num_bytes); +| ^~~~~~ +| std::size_t +--- + libunwindstack/include/unwindstack/DwarfMemory.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libunwindstack/include/unwindstack/DwarfMemory.h b/libunwindstack/include/unwindstack/DwarfMemory.h +index 244c0e12..0a3fefeb 100644 +--- a/libunwindstack/include/unwindstack/DwarfMemory.h ++++ b/libunwindstack/include/unwindstack/DwarfMemory.h +@@ -23,7 +23,7 @@ namespace unwindstack { + + // Forward declarations. + class Memory; +- ++using namespace std; + class DwarfMemory { + public: + DwarfMemory(Memory* memory) : memory_(memory) {} +-- +2.36.1.vfs.0.0 + diff --git a/dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch b/dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch deleted file mode 100644 index a04f27f..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch +++ /dev/null @@ -1,51 +0,0 @@ -socket.h: removing dependency of gtest - -Removed the dependency of gtest on the build of fastboot binary. -Fixes below error - -In file included from fastboot/fastboot.cpp:70: -| In file included from fastboot/tcp.h:36: -| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found -| #include -| ^~~~~~~~~~~~~~~~~~~~ -| 1 error generated. -| In file included from fastboot/socket.cpp:29: -| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found -| #include -| ^~~~~~~~~~~~~~~~~~~~ -| 1 error generated. -| In file included from fastboot/tcp.cpp:29: -| In file included from fastboot/tcp.h:36: -| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found -| #include -| ^~~~~~~~~~~~~~~~~~~~ -| 1 error generated. -| In file included from fastboot/udp.cpp:31: -| In file included from fastboot/udp.h:34: -| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found -| #include -| ^~~~~~~~~~~~~~~~~~~~ -| 1 error generated. - - -Signed-off-by: Nisha Parrakat - ---- a/system/core/fastboot/socket.h 2021-04-14 21:14:00.355973915 +0000 -+++ b/system/core/fastboot/socket.h 2021-04-14 21:14:21.879680699 +0000 -@@ -40,7 +40,6 @@ - - #include - #include --#include - - // Socket interface to be implemented for each platform. - class Socket { -@@ -119,8 +118,6 @@ - socket_send_buffers_function_ = &socket_send_buffers; - - private: -- FRIEND_TEST(SocketTest, TestTcpSendBuffers); -- FRIEND_TEST(SocketTest, TestUdpSendBuffers); - - DISALLOW_COPY_AND_ASSIGN(Socket); - }; diff --git a/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch b/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch deleted file mode 100644 index 0deb0b2..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch +++ /dev/null @@ -1,42 +0,0 @@ -upstream commit taken as below -Original Issue link -https://android-review.googlesource.com/c/platform/system/core/+/1123485 - -Commit taken below: - -fastboot: don't use sparse_file_import_auto() in load_buf_fd() - -load_buf_fd() attempts to find the size of the file that it is about -to load by first calling sparse_file_import_auto() then using -sparse_file_len() upon success or falling back to the file size on the -filesystem on failure. - -This is problematic however as sparse_file_import_auto() creates a -sparse_file out of the normal file, but does not resparse it, so an -assertion fails during the sparse_file_len() call. - -This is fixed by using sparse_file_import() instead. This will fail -in the case that the file is not sparse and the call to -sparse_file_len() will be properly skipped. - -Bug: 140538105 -Test: flash blueline factory image with assertions enabled in - libsparse/sparse.cpp - -Change-Id: I0283be33563a3301ce5b09bde41105a20f91086c - -https://android.googlesource.com/platform/system/core/+/fbb9535aaea5ae4011f3c3edf4c00b27452f57ec -Upstream-Status: Backport [commit fbb9535aaea5ae4011f3c3edf4c00b27452f57ec] -Signed-off-by: Nisha Parrakat - ---- git/system/core/fastboot/fastboot.cpp 2021-05-28 09:24:15.583963227 +0000 -+++ git/system/core/fastboot/fastboot.cpp 2021-05-28 09:25:09.948974990 +0000 -@@ -869,7 +869,7 @@ - return false; - } - -- if (sparse_file* s = sparse_file_import_auto(fd, false, false)) { -+ if (sparse_file* s = sparse_file_import(fd, false, false)) { - buf->image_size = sparse_file_len(s, false, false); - sparse_file_destroy(s); - } else { diff --git a/dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch deleted file mode 100644 index c8904f0..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch +++ /dev/null @@ -1,52 +0,0 @@ -patching fastboot.mk to build in yocto environment. - -Changes include: -Introduced an output folder which will keep all the outputs from the -android-tools. - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - -Upstream-Status: Pending - ---- git/system/core/debian/fastboot.mk 2021-05-17 07:47:56.800224043 +0000 -+++ git/system/core/debian/fastboot.mk 2021-05-17 07:49:40.130383096 +0000 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME = fastboot - fastboot_SOURCES = \ - bootimg_utils.cpp \ -@@ -38,11 +39,11 @@ - -Ifs_mgr/liblp/include \ - -I/usr/include/android/openssl \ - -Ilibsparse/include \ -- -Ilibziparchive/include -+ -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ - LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ - -fuse-ld=gold \ -- -Wl,-rpath-link=. \ -- -L. -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ -+ -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -+ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ - -l7z \ - -@@ -53,7 +54,8 @@ - endif - - build: $(SOURCES) -- $(CXX) $^ -o fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -+ mkdir --parents $(OUT_DIR)/usr/bin/fastboot -+ $(CXX) $^ -o $(OUT_DIR)/usr/bin/fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) - - clean: -- $(RM) fastboot/$(NAME) -+ $(RM) $(OUT_DIR)/usr/bin/fastboot/$(NAME) diff --git a/dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch deleted file mode 100644 index 6913c4b..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch +++ /dev/null @@ -1,41 +0,0 @@ -patching img2simg.mk to build in yocto environment. - -Changes include: -Introduced an output folder which will keep all the outputs from the -android-tools. - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - -Upstream-Status: Pending - ---- git/system/core/debian/img2simg.mk 2021-05-12 09:05:38.580607289 +0000 -+++ git/system/core/debian/img2simg.mk 2021-05-12 09:09:04.331908253 +0000 -@@ -1,13 +1,14 @@ -+include ../../rules_yocto.mk - NAME = img2simg - SOURCES = img2simg.cpp - SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) - CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 --LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -- -Wl,-rpath-link=. \ -- -L. -lsparse -+LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -+ -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ -+ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -lsparse - - build: $(SOURCES) -- $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) -+ $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) - - clean: -- $(RM) libsparse/$(NAME) -+ $(RM) $(OUT_DIR)/usr/bin/$(NAME) diff --git a/dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch deleted file mode 100644 index 21598b1..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch +++ /dev/null @@ -1,44 +0,0 @@ -libadb.mk: modifications to make it build in yocto environment - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - ---- git/system/core/debian/libadb.mk 2021-04-30 16:29:34.596618862 +0200 -+++ git/system/core/debian/libadb.mk 2021-04-30 16:36:53.932837490 +0200 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME := libadb - - LIBADB_SRC_FILES := \ -@@ -43,18 +44,18 @@ - -Ibase/include \ - -Idiagnose_usb/include \ - -Ilibcrypto_utils/include \ -- -Iinclude \ -+ -Iinclude -I$(OUT_DIR)/usr/include \ - -DPLATFORM_TOOLS_VERSION='"$(PLATFORM_TOOLS_VERSION)"' \ - -DADB_HOST=1 -DADB_VERSION='"$(DEB_VERSION)"' - - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ - -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ -- -lpthread -L. -lbase -lcutils -lcrypto_utils -lusb-1.0 -+ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ -+ -lpthread -lbase -lcutils -lcrypto_utils -lusb-1.0 - - $(NAME).so: $(SOURCES) -- $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -- ln -s $(NAME).so.0 $(NAME).so -+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so - - transport_mdns_unsupported.cpp: - echo 'void init_mdns_transport_discovery(void) {}' > transport_mdns_unsupported.cpp diff --git a/dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch deleted file mode 100644 index 6ae9793..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch +++ /dev/null @@ -1,58 +0,0 @@ -patching libbacktrace.mk to build in yocto environment. - -Changes include: -Introduced an output folder which will keep all the outputs from the -android-tools. - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - -Upstream-Status: Pending - ---- git/system/core/debian/libbacktrace.mk 2021-05-21 23:51:55.022408433 +0000 -+++ git/system/core/debian/libbacktrace.mk 2021-05-21 23:53:07.487543521 +0000 -@@ -1,5 +1,5 @@ - --include /usr/share/dpkg/architecture.mk -+include ../../rules_yocto.mk - - NAME = libbacktrace - -@@ -88,11 +89,11 @@ - -Ilibprocinfo/include \ - -Ilibunwindstack/include \ - -I/usr/include/android/lzma \ -- -I/usr/include/android/unwind -+ -I$(OUT_DIR)/usr/include/android/libunwind - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ - -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ -- -L. -lbase -llog -lpthread -l7z -+ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ -+ -lbase -llog -lpthread -l7z - - # -latomic should be the last library specified - # https://github.com/android/ndk/issues/589 -@@ -104,11 +105,11 @@ - endif - - build: $(COBJECTS) $(CXXOBJECTS) $(OBJECTS_ASSEMBLY) -- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) -- ln -s $(NAME).so.0 $(NAME).so -+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) -+ ln -sf $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(NAME).so - - clean: -- $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* -+ $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* - - $(CXXOBJECTS): %.o: %.cpp - $(CXX) $< -o $@ $(CXXFLAGS) $(CPPFLAGS) diff --git a/dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch deleted file mode 100644 index ca56f8c..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch +++ /dev/null @@ -1,33 +0,0 @@ -libbase.mk: modifications to make it build in yocto environment - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - ---- git/system/core/debian/libbase.mk 2021-04-29 22:01:13.664181133 +0200 -+++ git/system/core/debian/libbase.mk 2021-04-29 22:04:52.328123833 +0200 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME = libbase - SOURCES = \ - chrono_utils.cpp \ -@@ -20,8 +21,9 @@ - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 - - build: $(SOURCES) -- $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -- ln -s $(NAME).so.0 $(NAME).so -+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so -+ cp -r base/include/* $(OUT_DIR)/usr/include/ - - clean: -- $(RM) $(NAME).so* -+ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* diff --git a/dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch deleted file mode 100644 index 642d6d3..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch +++ /dev/null @@ -1,30 +0,0 @@ -libcrypto.mk: modifications to make it build in yocto environment - -Adding an include file that is setting the common flags. - -Modified the build rule so that it outputs the binary and include -to the OUT_DIR - - -Signed-off-by: Nisha Parrakat - ---- git/external/boringssl/debian/libcrypto.mk 2021-04-30 11:32:40.610312307 +0000 -+++ git/external/boringssl/debian/libcrypto.mk 2021-04-30 11:36:47.738318880 +0000 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - include sources.mk - - NAME = libcrypto -@@ -26,6 +27,8 @@ - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread - - build: $(SOURCES) -- mkdir --parents debian/out -- $(CC) $^ -o debian/out/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -- ln -s $(NAME).so.0 debian/out/$(NAME).so -\ No newline at end of file -+ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -+ mkdir --parents $(OUT_DIR)/usr/include -+ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DOPENSSL_NO_ASM -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so -+ cp -r include/openssl $(OUT_DIR)/usr/include diff --git a/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch index ec0db57..668338d 100644 --- a/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch +++ b/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch @@ -11,8 +11,8 @@ Modified the build rule so that it outputs the binary and header to the OUT_DIR Signed-off-by: Nisha Parrakat ---- git/system/core/debian/libcrypto_utils.mk 2021-04-30 14:18:54.071379767 +0200 -+++ git/system/core/debian/libcrypto_utils.mk 2021-04-30 14:22:46.179047308 +0200 +--- git/debian/libcrypto_utils.mk 2021-04-30 14:18:54.071379767 +0200 ++++ git/debian/libcrypto_utils.mk 2021-04-30 14:22:46.179047308 +0200 @@ -1,15 +1,17 @@ +include ../../rules_yocto.mk NAME:= libcrypto_utils diff --git a/dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch deleted file mode 100644 index 4914654..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- git/system/core/debian/libcutils.mk 2021-05-17 06:38:40.105161629 +0000 -+++ git/system/core/debian/libcutils.mk 2021-05-17 06:42:37.141912366 +0000 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME = libcutils - - # copied from libcutils/Android.bp -@@ -50,14 +51,15 @@ - -Iinclude \ - - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ -- -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L. -llog -lbase -+ -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -llog -lbase - - build: $(COBJECTS) $(CXXOBJECTS) -- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) -- ln -s $(NAME).so.0 $(NAME).so -+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so -+ cp -r libcutils/include/cutils $(OUT_DIR)/usr/include/ - - clean: -- $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* -+ $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* - - $(COBJECTS): %.o: %.c - $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) diff --git a/dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch deleted file mode 100644 index 0c31e5d..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch +++ /dev/null @@ -1,42 +0,0 @@ -libext4_utils.mk: modifications to make it build in yocto environment - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary and header to the OUT_DIR - -Signed-off-by: Nisha Parrakat - ---- git/system/extras/debian/libext4_utils.mk 2021-04-29 21:46:39.384394114 +0000 -+++ git/system/extras/debian/libext4_utils.mk 2021-04-29 21:49:53.808605543 +0000 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME = libext4_utils - - ext4_utils_SOURCES := \ -@@ -17,14 +18,16 @@ - -Iext4_utils/include \ - -Ilibfec/include \ - -Isquashfs_utils \ -- -I/usr/include/android \ -+ -I/usr/include/android -I$(OUT_DIR)/usr/include \ - -D_GNU_SOURCE -DFEC_NO_KLOG -DSQUASHFS_NO_KLOG -D_LARGEFILE64_SOURCE - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ - -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -+ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ - -lbase -lsparse -lselinux - - build: $(SOURCES) -- mkdir --parents $(OUT_DIR) -- $(CC) $^ -o $(OUT_DIR)/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -- ln -s $(NAME).so.0 $(OUT_DIR)/$(NAME).so -+ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -+ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so -+ cp -r ext4_utils/include/* $(OUT_DIR)/usr/include/ -+ diff --git a/dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch deleted file mode 100644 index 6e63e4f..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- git/system/extras/debian/libfec.mk 2021-05-17 06:55:51.973044031 +0000 -+++ git/system/extras/debian/libfec.mk 2021-05-17 06:56:41.940185413 +0000 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME = libfec - - # copied from libfec/Android.bp -@@ -12,20 +13,21 @@ - CXXFLAGS += -fno-strict-aliasing -std=g++17 - CPPFLAGS += \ - -Iext4_utils/include \ -- -Ilibfec/include \ -+ -Ilibfec/include -I $(OUT_DIR)/usr/include \ - -D_GNU_SOURCE -DFEC_NO_KLOG -D_LARGEFILE64_SOURCE - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ - -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -+ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ - -lbase -lsparse -lselinux - - build: $(COBJECTS) $(CXXOBJECTS) -- mkdir -p $(OUT_DIR) -- $(CXX) $^ -o $(OUT_DIR)/$(NAME).so.0 $(LDFLAGS) -- ln -s $(NAME).so.0 $(OUT_DIR)/$(NAME).so -+ mkdir -p $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so -+ cp -r libfec/include/* $(OUT_DIR)/usr/include/ - - clean: -- $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* -+ $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* - - $(COBJECTS): %.o: %.c - $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) diff --git a/dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch deleted file mode 100644 index 38cfa88..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch +++ /dev/null @@ -1,42 +0,0 @@ -patching liblog.mk to build in yocto environment. - -Changes include: -Introduced an output folder which will keep all the outputs from the -android-tools. - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - -Upstream-Status: Pending - ---- git/system/core/debian/liblog.mk 2021-05-17 08:13:28.304700936 +0000 -+++ git/system/core/debian/liblog.mk 2021-05-17 08:15:59.590064282 +0000 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME = liblog - - # copied from liblog/Android.bp -@@ -39,11 +40,12 @@ - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread - - build: $(COBJECTS) $(CXXOBJECTS) -- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) -- ln -s $(NAME).so.0 $(NAME).so -+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so -+ cp -r liblog/include/* $(OUT_DIR)/usr/include/ - - clean: -- $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* -+ $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* - - $(COBJECTS): %.o: %.c - $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) diff --git a/dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch deleted file mode 100644 index bf439ef..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch +++ /dev/null @@ -1,47 +0,0 @@ -patching libsparse.mk to build in yocto environment. - -Changes include: -Introduced an output folder which will keep all the outputs from the -android-tools. - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - -Upstream-Status: Pending - ---- git/system/core/debian/libsparse.mk 2021-05-17 08:13:34.764584388 +0000 -+++ git/system/core/debian/libsparse.mk 2021-05-17 08:15:34.850492654 +0000 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME = libsparse - SOURCES = \ - backed_block.cpp \ -@@ -18,16 +19,16 @@ - -shared -Wl,-soname,$(NAME).so.0 \ - -lz \ - -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -- -L. \ -+ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ - -lbase - - - build: $(COBJECTS) $(CXXOBJECTS) -- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) -- ln -s $(NAME).so.0 $(NAME).so -+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so - - clean: -- $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* -+ $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* - - $(COBJECTS): %.o: %.c - $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) diff --git a/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/20150704-CVE-2015-3239_dwarf_i.h.patch b/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/20150704-CVE-2015-3239_dwarf_i.h.patch new file mode 100644 index 0000000..cc1a8cb --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/20150704-CVE-2015-3239_dwarf_i.h.patch @@ -0,0 +1,14 @@ +Description: Fixes "20150704-CVE-2015-3239" +Index: pkg-libunwind/include/dwarf_i.h +=================================================================== +--- pkg-libunwind.orig/include/dwarf_i.h 2015-07-04 10:57:29.000000000 +0900 ++++ pkg-libunwind/include/dwarf_i.h 2015-07-04 11:06:08.675616821 +0900 +@@ -20,7 +20,7 @@ + extern const uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH]; + /* REG is evaluated multiple times; it better be side-effects free! */ + # define dwarf_to_unw_regnum(reg) \ +- (((reg) <= DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0) ++ (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0) + #endif + + #ifdef UNW_LOCAL_ONLY diff --git a/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/legacy_built-in_sync_functions.patch b/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/legacy_built-in_sync_functions.patch new file mode 100644 index 0000000..8d78faa --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/legacy_built-in_sync_functions.patch @@ -0,0 +1,25 @@ +Description: Replace the legacy __sync built-in functions with __atomic ones + libunwind uses the built-in __sync_* functions which are deprecated by GCC and + should be replaced by __atomic_* ones. See the official manuals [1]. + . + The legacy __sync functions do not require to specify the memory order but + __atomic ones do, so we choose the strongest one: __ATOMIC_SEQ_CST. + . + We do this because __sync_fetch_and_add() is not supported on armel. + . + [1]: https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html +Author: Kai-Chung Yan () +Last-Update: 2016-10-04 +--- a/include/libunwind_i.h ++++ b/include/libunwind_i.h +@@ -155,8 +155,8 @@ + u.vp = addr; + return __sync_bool_compare_and_swap(u.vlp, (long) old, (long) new); + } +-# define fetch_and_add1(_ptr) __sync_fetch_and_add(_ptr, 1) +-# define fetch_and_add(_ptr, value) __sync_fetch_and_add(_ptr, value) ++# define fetch_and_add1(_ptr) __atomic_fetch_add(_ptr, 1, __ATOMIC_SEQ_CST) ++# define fetch_and_add(_ptr, value) __atomic_fetch_add(_ptr, value, __ATOMIC_SEQ_CST) + # define HAVE_CMPXCHG + # define HAVE_FETCH_AND_ADD + #endif diff --git a/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/series b/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/series new file mode 100644 index 0000000..9cac341 --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/series @@ -0,0 +1,3 @@ +user_pt_regs.patch +legacy_built-in_sync_functions.patch +20150704-CVE-2015-3239_dwarf_i.h.patch diff --git a/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/user_pt_regs.patch b/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/user_pt_regs.patch new file mode 100644 index 0000000..8051b6d --- /dev/null +++ b/dynamic-layers/selinux/android-tools/android-tools/libunwind-debian/user_pt_regs.patch @@ -0,0 +1,23 @@ +Author: Kai-Chung Yan +Last-Update: 2016-08-24 +Description: Manual definition of struct user_pt_regs + On ARM64, libunwind uses struct user_pt_regs which is not defined in + anywhere, which causes FTBFS. +--- a/src/ptrace/_UPT_access_reg.c ++++ b/src/ptrace/_UPT_access_reg.c +@@ -26,6 +26,15 @@ + + #include "_UPT_internal.h" + ++#if defined(__aarch64__) ++ struct user_pt_regs { ++ __u64 regs[31]; ++ __u64 sp; ++ __u64 pc; ++ __u64 pstate; ++ }; ++#endif ++ + #if UNW_TARGET_IA64 + # include + # ifdef HAVE_ASM_PTRACE_OFFSETS_H diff --git a/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch deleted file mode 100644 index 967c573..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch +++ /dev/null @@ -1,47 +0,0 @@ -patching libundwind to build in yocto environment. - -Changes include: -Introduced an output folder which will keep all the outputs from the -android-tools. - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Passing the architecture details($CPU)from the recipe. - -Signed-off-by: Nisha Parrakat - -Upstream-Status: Pending - ---- git/external/libunwind/debian/libunwind.mk 2021-05-22 02:29:52.950324653 +0000 -+++ git/external/libunwind/debian/libunwind.mk 2021-05-22 02:30:48.535322846 +0000 -@@ -1,4 +1,4 @@ --include debian/detect_arch.mk -+include ../../rules_yocto.mk - - ARCH_SOURCES = is_fpreg.c \ - regname.c \ -@@ -131,10 +131,12 @@ - CPPFLAGS += -Iinclude -Isrc $($(CPU)_INCLUDES) -Idebian/include - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ - -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -- -lpthread -nostdlib -lc -lgcc -Ldebian/out -l7z -+ -lpthread -nostdlib -lc -lgcc -l7z -Wno-error=unused-command-line-argument - - build: $(SOURCES) -- mkdir --parents debian/out -- ln -s /usr/lib/p7zip/7z.so debian/out/lib7z.so -- $(CC) $^ -o debian/out/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -- ln -s $(NAME).so.0 debian/out/$(NAME).so -+ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -+ mkdir --parents $(OUT_DIR)/usr/include/android/libunwind -+ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wno-header-guard -Wno-absolute-value -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so -+ cp -r include/* debian/include/* $(OUT_DIR)/usr/include/android/libunwind/ -+ diff --git a/dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch deleted file mode 100644 index 4f88b0a..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch +++ /dev/null @@ -1,47 +0,0 @@ -patching libziparchive.mk to build in yocto environment. - -Changes include: -Introduced an output folder which will keep all the outputs from the -android-tools. - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - -Upstream-Status: Pending - ---- git/system/core/debian/libziparchive.mk 2021-05-17 08:13:41.684459540 +0000 -+++ git/system/core/debian/libziparchive.mk 2021-05-17 08:16:19.293722572 +0000 -@@ -1,3 +1,4 @@ -+include ../../rules_yocto.mk - NAME = libziparchive - SOURCES = zip_archive.cc \ - zip_archive_stream_entry.cc\ -@@ -5,14 +6,15 @@ - SOURCES := $(foreach source, $(SOURCES), libziparchive/$(source)) - CXXFLAGS += -std=gnu++17 - CPPFLAGS += -DZLIB_CONST -D_FILE_OFFSET_BITS=64 \ -- -Iinclude -Ibase/include -Ilibziparchive/include -+ -Iinclude -Ibase/include -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ - LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ - -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -- -lz -L. -llog -lbase -+ -lz -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -llog -lbase - - build: $(SOURCES) -- $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -- ln -s $(NAME).so.0 $(NAME).so -+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so -+ cp -r libziparchive/include/* $(OUT_DIR)/usr/include/ - - clean: -- $(RM) $(NAME).so* -+ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* diff --git a/dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch b/dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch deleted file mode 100644 index d17adff..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch +++ /dev/null @@ -1,41 +0,0 @@ -patching simg2img.mk to build in yocto environment. - -Changes include: -Introduced an output folder which will keep all the outputs from the -android-tools. - -Adding an include file that is setting the common flags. -Changed the cppflag to include the headers from other components -of android-tools - -Modified LDflags so that the libraries that are coming from other android-tools -are searched in the output folder. - -Modified the build rule so that it outputs the binary to the OUT_DIR - -Signed-off-by: Nisha Parrakat - -Upstream-Status: Pending - ---- git/system/core/debian/simg2img.mk 2021-05-12 09:47:52.577840520 +0000 -+++ git/system/core/debian/simg2img.mk 2021-05-12 09:51:43.525678276 +0000 -@@ -1,13 +1,14 @@ -+include ../../rules_yocto.mk - NAME = simg2img - SOURCES = simg2img.cpp sparse_crc32.cpp - SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) - CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 --LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -- -Wl,-rpath-link=. \ -- -L. -lsparse -+LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -+ -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ -+ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lsparse - - build: $(SOURCES) -- $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) -+ $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) - - clean: -- $(RM) libsparse/$(NAME) -+ $(RM) $(OUT_DIR)/usr/bin/$(NAME) diff --git a/dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch b/dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch deleted file mode 100644 index 079ade4..0000000 --- a/dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch +++ /dev/null @@ -1,19 +0,0 @@ -To Fix the below error - - In file included from libunwindstack/DwarfSection.cpp:21: -| libunwindstack/include/unwindstack/DwarfMemory.h:32:29: error: unknown type name 'size_t'; did you mean 'std::size_t'? -| bool ReadBytes(void* dst, size_t num_bytes); -| ^~~~~~ -| std::size_t - ---- ./system/core/libunwindstack/include/unwindstack/DwarfMemory.h 2021-05-22 00:52:15.132452862 +0000 -+++ ./system/core/libunwindstack/include/unwindstack/DwarfMemory.h 2021-05-22 00:53:09.793416724 +0000 -@@ -23,7 +23,7 @@ - - // Forward declarations. - class Memory; -- -+using namespace std; - class DwarfMemory { - public: - DwarfMemory(Memory* memory) : memory_(memory) {} diff --git a/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb b/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb index 0d7a972..b943a5d 100644 --- a/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb +++ b/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb @@ -26,25 +26,59 @@ SRC_URI = " \ git://${ANDROID_MIRROR}/platform/hardware/libhardware;name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware \ git://salsa.debian.org/android-tools-team/android-platform-build.git;name=build;protocol=https;nobranch=1;destsuffix=git/build \ git://salsa.debian.org/android-tools-team/android-platform-external-libunwind.git;protocol=https;name=libunwind;nobranch=1;destsuffix=git/external/libunwind \ - file://adb_mk_change_out_dir.patch \ - file://libadb_mk_change_out_dir.patch \ - file://fastboot_compile_remove_gtest.patch \ - file://fastboot_mk_change_out_dir.patch \ - file://fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch \ - file://libbase_mk_change_out_dir.patch \ - file://libext4_utils_mk_change_out_dir.patch \ - file://libcrypto_mk_change_out_dir.patch \ - file://libcrypto_utils_mk_change_out_dir.patch \ - file://libcutils_mk_change_out_dir.patch \ - file://libfec_mk_change_out_dir.patch \ - file://img2simg_change_out_dir.patch \ - file://simg2img_change_out_dir.patch \ - file://liblog_mk_change_out_dir.patch \ - file://libsparse_mk_change_out_dir.patch \ - file://libziparchive_mk_change_out_dir.patch \ - file://libbacktrace_mk_change_out_dir.patch \ - file://libunwind_mk_change_out_dir.patch \ - file://use_name_space_std_to_compile_libbacktrace.patch \ +" + +# Patches copied from android-platform-system-core/debian/patches +# and applied in the order defined by the "series" file +SRC_URI += " \ + file://core-debian/move-log-file-to-proper-dir.patch;patchdir=system/core \ + file://core-debian/Added-missing-headers.patch;patchdir=system/core \ + file://core-debian/libusb-header-path.patch;patchdir=system/core \ + file://core-debian/stdatomic.patch;patchdir=system/core \ + file://core-debian/Nonnull.patch;patchdir=system/core \ + file://core-debian/Vector-cast.patch;patchdir=system/core \ + file://core-debian/use-Python-3-for-mkbootimg.patch;patchdir=system/core \ + file://core-debian/throw-exception-on-unknown-os.patch;patchdir=system/core \ + file://core-debian/simg_dump-python3.patch;patchdir=system/core \ + file://core-debian/fix-attribute-issue-with-gcc.patch;patchdir=system/core \ + file://core-debian/workaround-error-expected-primary-expression-before-.-token.patch;patchdir=system/core \ + file://core-debian/fix-gettid-exception-declaration.patch;patchdir=system/core \ + file://core-debian/fix-build-on-non-x86.patch;patchdir=system/core \ + file://core-debian/add-missing-headers.patch;patchdir=system/core \ + file://core-debian/hard-code-build-number.patch;patchdir=system/core \ + file://core-debian/fix-gcc-11-ftbfs.patch;patchdir=system/core \ + file://core-debian/fix-gnu-hurd.patch;patchdir=system/core \ +" + +# Patches copied from android-platform-external-libunwind/debian/patches +# and applied in the order defined by the "series" file +SRC_URI += " \ + file://libunwind-debian/user_pt_regs.patch;patchdir=external/libunwind \ + file://libunwind-debian/legacy_built-in_sync_functions.patch;patchdir=external/libunwind \ + file://libunwind-debian/20150704-CVE-2015-3239_dwarf_i.h.patch;patchdir=external/libunwind \ +" + +# meta-clang specific patches + files: +SRC_URI += " \ + file://core/0001-patching-adb.mk-to-build-in-yocto-environment.patch;patchdir=system/core \ + file://core/0002-libadb.mk-modifications-to-make-it-build-in-yocto-en.patch;patchdir=system/core \ + file://core/0003-socket.h-removing-dependency-of-gtest.patch;patchdir=system/core \ + file://core/0004-patching-fastboot.mk-to-build-in-yocto-environment.patch;patchdir=system/core \ + file://core/0005-fastboot-don-t-use-sparse_file_import_auto-in-load_b.patch;patchdir=system/core \ + file://core/0006-libbase.mk-modifications-to-make-it-build-in-yocto-e.patch;patchdir=system/core \ + file://core/0007-libcrypto_utils.mk-modifications-to-make-it-build-in.patch;patchdir=system/core \ + file://core/0008-libcutils-modifications-to-make-it-build-in-yocto-en.patch;patchdir=system/core \ + file://core/0009-patching-img2simg.mk-to-build-in-yocto-environment.patch;patchdir=system/core \ + file://core/0010-patching-simg2img.mk-to-build-in-yocto-environment.patch;patchdir=system/core \ + file://core/0011-patching-liblog.mk-to-build-in-yocto-environment.patch;patchdir=system/core \ + file://core/0012-patching-libsparse.mk-to-build-in-yocto-environment.patch;patchdir=system/core \ + file://core/0013-patching-libziparchive.mk-to-build-in-yocto-environm.patch;patchdir=system/core \ + file://core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch;patchdir=system/core \ + file://core/0015-Use-namespace-std-to-compile-libbacktrace.patch;patchdir=system/core \ + file://0001-libcrypto.mk-modifications-to-make-it-build-in-yocto.patch;patchdir=external/boringssl \ + file://0001-patching-libundwind-to-build-in-yocto-environment.patch;patchdir=external/libunwind \ + file://0001-libext4_utils.mk-modifications-to-make-it-build-in-y.patch;patchdir=system/extras \ + file://0002-libfec-change-out_dir-in-makefile.patch;patchdir=system/extras \ file://rules_yocto.mk;subdir=git \ file://android-tools-adbd.service \ " @@ -52,21 +86,6 @@ SRC_URI = " \ S = "${WORKDIR}/git" B = "${WORKDIR}/${BPN}" -#apply all the patches maintained in the debian version. -do_unpack_and_patch_debian() { - cd ${S}/system/core - for i in `find ${S}/system/core/debian/patches -name "*.patch"`; do - patch -p1 < $i - done - #a patch with no .patch extention, lets apply that - patch -p1 < ${S}/system/core/debian/patches/Added-missing-headers - cd ${S}/external/libunwind - for i in `find ${S}/external/libunwind/debian/patches -name "*.patch"`; do - patch -p1 < $i - done -} -addtask unpack_and_patch_debian after do_unpack before do_patch - # http://errors.yoctoproject.org/Errors/Details/1debian881/ ARM_INSTRUCTION_SET:armv4 = "arm" ARM_INSTRUCTION_SET:armv5 = "arm" -- cgit v1.2.3-54-g00ecf