summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/selinux/android-tools/android-tools/core/0014-patching-libbacktrace.mk-to-build-in-yocto-environme.patch
blob: 433caf248169c5128c24a00a37a2cf22af9a4254 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From a99b74f25c7f786e26b5400218090d86596d4541 Mon Sep 17 00:00:00 2001
From: Etienne Cordonnier <ecordonnier@snap.com>
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 <Nisha.Parrakat@kpit.com>

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