void-packages/srcpkgs/ladish/patches/musl-no-execinfo.patch

30 lines
729 B
Diff

--- a/daemon/sigsegv.c 2016-06-06 16:11:21.506119807 +0200
+++ b/daemon/sigsegv.c 2016-06-06 16:11:26.667120074 +0200
@@ -39,7 +39,9 @@
#include <signal.h>
#include <ucontext.h>
#include <dlfcn.h>
+#if defined(__GLIBC__)
#include <execinfo.h>
+#endif
#include <errno.h>
#ifndef NO_CPP_DEMANGLE
//#include <cxxabi.h>
@@ -154,13 +156,15 @@
ip = bp[1];
bp = (void**)bp[0];
}
-#else
+#elif defined(__GLIBC__)
log_error("Stack trace (non-dedicated):");
sz = backtrace(bt, 20);
strings = backtrace_symbols(bt, sz);
for(i = 0; i < sz; ++i)
log_error("%s", strings[i]);
+#else
+ log_error("Stack trace not available");
#endif
log_error("End of stack trace");
#endif