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

30 lines
722 B
Diff
Raw Normal View History

2016-06-06 16:01:10 +02:00
--- sigsegv.c.orig 2016-06-06 15:56:47.355074711 +0200
+++ sigsegv.c 2016-06-06 15:55:40.740071274 +0200
@@ -28,7 +28,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>
@@ -145,13 +147,15 @@
ip = bp[1];
bp = (void**)bp[0];
}
-#else
+#elif defined(__GLIBC__)
a2j_error("Stack trace (non-dedicated):");
sz = backtrace(bt, 20);
strings = backtrace_symbols(bt, sz);
for(i = 0; i < sz; ++i)
a2j_error("%s", strings[i]);
+#else
+ a2j_error("Stack trace unavailable");
#endif
a2j_error("End of stack trace");
exit (-1);