Skip to contentSkip to conversation

libunwind: Fix build on aarch64/musl

PATCH Superseded Khem Raj 1 participant 1 message Jun 4, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 libunwind: Fix build on aarch64/musl

Although this patch should be applied irrespective of libc but kept it musl specific to avoid extra testing.

---
 .../libunwind/libunwind/sigset_t.patch        | 29 +++++++++++++++++++
 .../libunwind/libunwind_1.4.0.bb              |  5 +++-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libunwind/libunwind/sigset_t.patch
meta/recipes-support/libunwind/libunwind/sigset_t.patch new file +29 -0
new file mode 100644
index 0000000000..4fb7744cdf
@@ -0,0 +1,29 @@
+Do no use __sigset_t which is in private libc namespace
+replace it with sigset_t, This also makes it portable
+to musl.
+
+Fixes
+
+../../libunwind-1.4.0/include/libunwind-aarch64.h:195:2: error: unknown type name '__sigset_t'
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+--- a/include/libunwind-aarch64.h
++++ b/include/libunwind-aarch64.h
+@@ -34,6 +34,7 @@ extern "C" {
+ #include <inttypes.h>
+ #include <stddef.h>
+ #include <ucontext.h>
++#include <signal.h>
+ 
+ #define UNW_TARGET      aarch64
+ #define UNW_TARGET_AARCH64      1
+@@ -192,7 +193,7 @@ typedef struct
+ 	unsigned long uc_flags;
+ 	struct ucontext *uc_link;
+ 	stack_t uc_stack;
+-	__sigset_t uc_sigmask;
++	sigset_t uc_sigmask;
+ 	struct unw_sigcontext uc_mcontext;
+   } unw_tdep_context_t;
+ 
meta/recipes-support/libunwind/libunwind_1.4.0.bb +4 -1
index f50205f1b9..f9036326d5 100644
@@ -8,7 +8,10 @@ SRC_URI = "http://download.savannah.nongnu.org/releases/libunwind/libunwind-${PV
            file://0005-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch \
            file://0006-Fix-for-X32.patch \
            "
-SRC_URI_append_libc-musl = " file://musl-header-conflict.patch"
+SRC_URI_append_libc-musl = "\
+           file://musl-header-conflict.patch \
+           file://sigset_t.patch \                   
+           "
 
 SRC_URI[md5sum] = "5114504c74ac3992ac06aa551cd55678"
 SRC_URI[sha256sum] = "df59c931bd4d7ebfd83ee481c943edf015138089b8e50abed8d9c57ba9338435"
Signature · 1 line
2.27.0