Skip to contentSkip to conversation

strace: Fix build with mips/mips64 on musl

PATCH New Khem Raj 1 participant 2 messages Aug 8, 2016

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 strace: Fix build with mips/mips64 on musl

SIGEMT doesnt exist on musl

---
 .../strace/strace/mips-SIGEMT.patch                | 24 ++++++++++++++++++++++
 meta/recipes-devtools/strace/strace_4.13.bb        |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 meta/recipes-devtools/strace/strace/mips-SIGEMT.patch
meta/recipes-devtools/strace/strace/mips-SIGEMT.patch new file +24 -0
new file mode 100644
index 0000000..b24378b
@@ -0,0 +1,24 @@
+SIGEMT is not defined everywhere e.g musl does
+not define it. Therefore check it being defined
+before using it.
+
+Fixes errors e.g.
+../../strace-4.13/tests/signal2name.c:45:7: error: 'SIGEMT' undeclared (first use in this function)
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Pending
+
+Index: strace-4.13/tests/signal2name.c
+===================================================================
+--- strace-4.13.orig/tests/signal2name.c
++++ strace-4.13/tests/signal2name.c
+@@ -42,7 +42,9 @@ signal2name(int sig)
+ 	CASE(SIGEMT);
+ 	CASE(SIGLOST);
+ #elif defined MIPS
++#ifdef SIGEMT
+ 	CASE(SIGEMT);
++#endif
+ 	CASE(SIGIOT);
+ 	CASE(SIGPWR);
+ #else
meta/recipes-devtools/strace/strace_4.13.bb +1 -0
index 51ff41e..cae7f21 100644
@@ -12,6 +12,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \
            file://Makefile-ptest.patch \
            file://run-ptest \
            file://0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch \
+           file://mips-SIGEMT.patch \
            "
 
 SRC_URI[md5sum] = "4b78c7febdd24c79d5147824d1a080a3"
Signature · 1 line
2.9.2
author
#1 lore raw

PATCH 1/1 world-broken: Add libunwind for musl/arm

gcc and libunwind race and when libunwind wins results are build fails for gcc as described this is only seen on musl/arm since on musl /usr/include is search before gcc fixed headers and unwind.h is in fixed headers. So it works ok on glibc but not on musl due to reversed search order.

---
 meta/conf/distro/include/world-broken.inc | 7 +++++++
 1 file changed, 7 insertions(+)
meta/conf/distro/include/world-broken.inc +7 -0
index a5f6371..d4bdddf 100644
@@ -47,3 +47,10 @@ EXCLUDE_FROM_WORLD_pn-perf_libc-musl = "1"
 
 # error: 'RTLD_NEXT' was not declared in this scope
 EXCLUDE_FROM_WORLD_pn-gcc-sanitizers_libc-musl = "1"
+
+# gcc fails to build when libuwind is staged before building gcc since
+# it then finds the unwind.h header from libunwind and not from libgcc
+# and on arm specially they are different since libgcc defines some functions
+# as macros which are functions in libunwind and it fails during linking
+# libbacktrace/backtrace.c:76: undefined reference to `_Unwind_GetIP'
+EXCLUDE_FROM_WORLD_pn-libunwind_libc-musl_arm = "1"
Signature · 1 line
2.9.2