1From d5fb34aef65b5c5472544e4f42ad777d8fa16ba9 Mon Sep 17 00:00:00 2001 2From: Etienne Cordonnier <ecordonnier@snap.com> 3Date: Fri, 3 Mar 2023 13:41:52 +0100 4Subject: [PATCH] patching libundwind to build in yocto environment. 5 6Changes include: 7Introduced an output folder which will keep all the outputs from the 8android-tools. 9 10Adding an include file that is setting the common flags. 11Changed the cppflag to include the headers from other components 12of android-tools 13 14Modified LDflags so that the libraries that are coming from other android-tools 15are searched in the output folder. 16 17Modified the build rule so that it outputs the binary to the OUT_DIR 18 19Passing the architecture details($CPU)from the recipe. 20 21Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com> 22 23Upstream-Status: Pending 24--- 25 debian/libunwind.mk | 14 ++++++++------ 26 1 file changed, 8 insertions(+), 6 deletions(-) 27 28diff --git a/debian/libunwind.mk b/debian/libunwind.mk 29index 738b205..ada4ef9 100644 30--- a/debian/libunwind.mk 31+++ b/debian/libunwind.mk 32@@ -1,4 +1,4 @@ 33-include debian/detect_arch.mk 34+include ../../rules_yocto.mk 35 36 ARCH_SOURCES = is_fpreg.c \ 37 regname.c \ 38@@ -131,10 +131,12 @@ CFLAGS += -DHAVE_CONFIG_H -DNDEBUG -D_GNU_SOURCE -Werror -Wno-unused-parameter - 39 CPPFLAGS += -Iinclude -Isrc $($(CPU)_INCLUDES) -Idebian/include 40 LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ 41 -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ 42- -lpthread -nostdlib -lc -lgcc -Ldebian/out -l7z 43+ -lpthread -nostdlib -lc -lgcc -l7z -Wno-error=unused-command-line-argument 44 45 build: $(SOURCES) 46- mkdir --parents debian/out 47- ln -s /usr/lib/p7zip/7z.so debian/out/lib7z.so 48- $(CC) $^ -o debian/out/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) 49- ln -s $(NAME).so.0 debian/out/$(NAME).so 50+ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ 51+ mkdir --parents $(OUT_DIR)/usr/include/android/libunwind 52+ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wno-header-guard -Wno-absolute-value 53+ ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so 54+ cp -r include/* debian/include/* $(OUT_DIR)/usr/include/android/libunwind/ 55+ 56-- 572.36.1.vfs.0.0 58 59