void-packages/srcpkgs/freecad/patches/002-execinfo.patch
2019-04-17 13:11:53 -03:00

30 lines
755 B
Diff

--- src/App/Application.cpp.orig 2019-03-08 18:56:16.000000000 +0100
+++ src/App/Application.cpp 2019-03-13 21:36:38.873587534 +0100
@@ -1163,7 +1163,9 @@
#endif
#if defined(FC_OS_LINUX)
+#ifdef __GLIBC__
#include <execinfo.h>
+#endif
#include <dlfcn.h>
#include <cxxabi.h>
@@ -1175,6 +1177,7 @@
// This function produces a stack backtrace with demangled function & method names.
void printBacktrace(size_t skip=0)
{
+#ifdef __GLIBC__
void *callstack[128];
size_t nMaxFrames = sizeof(callstack) / sizeof(callstack[0]);
size_t nFrames = backtrace(callstack, nMaxFrames);
@@ -1205,6 +1208,9 @@
}
free(symbols);
+#else
+ std::cerr << "sorry, no backtrace on musl libc";
+#endif
}
#endif