aboutsummaryrefslogtreecommitdiffstats
path: root/testing/shiboken2/musl-execinfo.patch
blob: e62166cdcd7f8eb20dbfdb59311ed16f02e8f949 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- a/sources/shiboken2/libshiboken/signature.cpp
+++ b/sources/shiboken2/libshiboken/signature.cpp
@@ -473,12 +473,15 @@
 ////////////////////////////////////////////////////////////////////////////
 // a stack trace for linux-like platforms
 #include <stdio.h>
+#if defined(__GLIBC__)
 #include <execinfo.h>
+#endif
 #include <signal.h>
 #include <stdlib.h>
 #include <unistd.h>
 
 void handler(int sig) {
+#if defined(__GLIBC__)
     void *array[30];
     size_t size;
 
@@ -486,8 +489,13 @@
     size = backtrace(array, 30);
 
     // print out all the frames to stderr
+#endif
     fprintf(stderr, "Error: signal %d:\n", sig);
+#if defined(__GLIBC__)
     backtrace_symbols_fd(array, size, STDERR_FILENO);
+#else
+    fprintf(stderr, "sorry, no backtrace on musl libc\n");
+#endif
     exit(1);
 }