diff options
author | Tony Kelman <tony@kelman.net> | 2016-01-31 08:31:04 +0000 |
---|---|---|
committer | Dave Watson <davejwatson@fb.com> | 2017-01-13 08:28:21 -0800 |
commit | 5dcb7cd3cb63bf8a3a5f7531d10f937053930a25 (patch) | |
tree | e2ec58de0c15eb03e281dc13a04c0127b4fb45a4 /configure.ac | |
parent | fd44f596b2dad70acdc81cc76983585f888e045d (diff) | |
download | libunwind-5dcb7cd3cb63bf8a3a5f7531d10f937053930a25.tar.gz |
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
`backtrace_symbols_fd'
collect2: error: ld returned 1 exit status
Makefile:1187: recipe for target 'test-coredump-unwind' failed
```
and
```
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
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 6c46cf35..21bae907 100644 --- a/configure.ac +++ b/configure.ac @@ -373,6 +373,10 @@ old_LIBS="$LIBS" LIBS="" AC_SEARCH_LIBS(backtrace, execinfo) LIBS="$old_LIBS" +case "$ac_cv_search_backtrace" in + -l*) BACKTRACELIB=$ac_cv_search_backtrace;; + *) BACKTRACELIB="";; +esac AC_SUBST(build_arch) AC_SUBST(target_os) @@ -388,6 +392,7 @@ AC_SUBST(PKG_MAINTAINER) AC_SUBST(enable_cxx_exceptions) AC_SUBST(enable_debug_frame) AC_SUBST(DLLIB) +AC_SUBST(BACKTRACELIB) AC_PATH_PROG([LATEX2MAN],[latex2man]) if test "x$LATEX2MAN" = "x"; then |