void-packages/srcpkgs/shiboken2/patches/musl-execinfo.patch

33 lines
806 B
Diff

--- sources/shiboken2/libshiboken/signature.cpp.ORIG
+++ 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);
}