aboutsummaryrefslogtreecommitdiffstats
path: root/main/libunwind/fix-test-coredump-unwind.patch
blob: ff3bc5a87dfc50bd01e630809cadb10e3493f696 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- a/tests/test-coredump-unwind.c
+++ b/tests/test-coredump-unwind.c
@@ -57,7 +57,11 @@
 #include <grp.h>
 
 /* For SIGSEGV handler code */
-#include <execinfo.h>
+#if HAVE_EXECINFO_H
+# include <execinfo.h>
+#else
+  extern int backtrace (void **, int);
+#endif
 #include <sys/ucontext.h>
 
 #include <libunwind-coredump.h>
@@ -242,7 +246,7 @@
     void *array[50];
     int size;
     size = backtrace(array, 50);
-#ifdef __linux__
+#if defined __linux__ && HAVE_EXECINFO_H
     backtrace_symbols_fd(array, size, 2);
 #endif
   }