From 5dcb7cd3cb63bf8a3a5f7531d10f937053930a25 Mon Sep 17 00:00:00 2001
From: Tony Kelman <tony@kelman.net>
Date: Sun, 31 Jan 2016 08:31:04 +0000
Subject: [PATCH] Fix compilation of tests on alpine linux (musl libc)
If we don't link to libexecinfo, as detected by the
AC_SEARCH_LIBS(backtrace, execinfo) configure probe, we get
test-coredump-unwind.o: In function `handle_sigsegv':
/home/libunwind/tests/test-coredump-unwind.c:246: undefined reference to
collect2: error: ld returned 1 exit status
Makefile:1187: recipe for target 'test-coredump-unwind' failed
Gtest-init.o: In function `do_backtrace()':
Gtest-init.cxx:(.text+0x2f): undefined reference to `_Ux86_64_getcontext'
Gtest-init.cxx:(.text+0x48): undefined reference to `_Ux86_64_init_local'
Gtest-init.cxx:(.text+0x63): undefined reference to `_Ux86_64_get_reg'
Gtest-init.cxx:(.text+0x96): undefined reference to `_Ux86_64_get_proc_name'
Gtest-init.cxx:(.text+0x171): undefined reference to `_Ux86_64_step'
collect2: error: ld returned 1 exit status
Makefile:1063: recipe for target 'Gtest-init' failed
There are 2 XFAIL and 6 FAIL tests, but it's a start
Backported from upstream master branch:
https://github.com/libunwind/libunwind/commit/5dcb7cd3cb63bf8a3a5f7531d10f937053930a25
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
tests/Makefile.am | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6c46cf3..21bae90 100644
@@ -373,6 +373,10 @@ old_LIBS="$LIBS"
AC_SEARCH_LIBS(backtrace, execinfo)
+case "$ac_cv_search_backtrace" in
+ -l*) BACKTRACELIB=$ac_cv_search_backtrace;;
@@ -388,6 +392,7 @@ AC_SUBST(PKG_MAINTAINER)
AC_SUBST(enable_cxx_exceptions)
AC_SUBST(enable_debug_frame)
AC_PATH_PROG([LATEX2MAN],[latex2man])
if test "x$LATEX2MAN" = "x"; then