sys-libs/libunwind: fix compilation with musl
authorMatthias Maier <tamiko@gentoo.org>
Sun, 1 Jul 2018 04:08:36 +0000 (23:08 -0500)
committerMatthias Maier <tamiko@gentoo.org>
Sun, 1 Jul 2018 04:11:31 +0000 (23:11 -0500)
Package-Manager: Portage-2.3.41, Repoman-2.3.9

sys-libs/libunwind/files/libunwind-1.2.1-only-include-execinfo_h-if-avaliable.patch [new file with mode: 0644]
sys-libs/libunwind/libunwind-1.2.1-r1.ebuild

diff --git a/sys-libs/libunwind/files/libunwind-1.2.1-only-include-execinfo_h-if-avaliable.patch b/sys-libs/libunwind/files/libunwind-1.2.1-only-include-execinfo_h-if-avaliable.patch
new file mode 100644 (file)
index 0000000..ee11149
--- /dev/null
@@ -0,0 +1,51 @@
+From 0f3f41a86842f2b19aa07af5242cb775ef9b20d3 Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy@gentoo.org>
+Date: Sat, 30 Jun 2018 22:44:22 -0500
+Subject: [PATCH] Only include execinfo.h where avaliable
+
+Signed-off-by: Jory A. Pratt <anarchy@gentoo.org>
+---
+ tests/test-coredump-unwind.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
+index 5254708..33f92b0 100644
+--- a/tests/test-coredump-unwind.c
++++ b/tests/test-coredump-unwind.c
+@@ -57,7 +57,9 @@
+ #include <grp.h>
+ /* For SIGSEGV handler code */
++#if HAVE_EXECINFO_H
+ #include <execinfo.h>
++#endif
+ #include <sys/ucontext.h>
+ #include <libunwind-coredump.h>
+@@ -202,7 +204,7 @@ void die_out_of_memory(void)
+ /* End of utility logging functions */
+-
++#if HAVE_EXECINFO_H
+ static
+ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
+ {
+@@ -249,12 +251,14 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
+   _exit(1);
+ }
+-
++#endif
+ static void install_sigsegv_handler(void)
+ {
+   struct sigaction sa;
+   memset(&sa, 0, sizeof(sa));
++#if HAVE_EXECINFO_H
+   sa.sa_sigaction = handle_sigsegv;
++#endif
+   sa.sa_flags = SA_SIGINFO;
+   sigaction(SIGSEGV, &sa, NULL);
+   sigaction(SIGILL, &sa, NULL);
+-- 
+2.18.0
index 8bdde358d133d762775842c673467bf39589f851..a4690fc050ec60d27c1f1f17f8837a56976c410b 100644 (file)
@@ -48,6 +48,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-1.2-ia64-ptrace-coredump.patch
        "${FILESDIR}"/${PN}-1.2-ia64-missing.patch
        "${FILESDIR}"/${PN}-1.2.1-fix_version_macros.patch
+       "${FILESDIR}"/${PN}-1.2.1-only-include-execinfo_h-if-avaliable.patch
 )
 
 src_prepare() {