summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch
blob: 967c5738fbe7a2e8655e768871bd08b43b4d98db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 <Nisha.Parrakat@kpit.com>

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/
+