void-packages/srcpkgs/mongodb/patches/musl-backtrace.patch

32 lines
1.1 KiB
Diff
Raw Normal View History

2015-08-27 00:54:48 +02:00
There is no walkcontext(3) for musl libc, so we effectively
disable backtracing symbols without removing the functions.
They just always return zero symbols.
--- src/mongo/platform/backtrace.cpp 2015-08-24 02:39:52.000000000 +0200
+++ src/mongo/platform/backtrace.cpp 2015-08-26 19:27:26.738866698 +0200
@@ -81,7 +81,7 @@
// to Linux's display, but slightly different.
//
int addrtosymstr(void* address, char* outputBuffer, int outputBufferSize) {
- Dl_info_t symbolInfo;
+ Dl_info symbolInfo;
if (dladdr(address, &symbolInfo) == 0) { // no info: "[address]"
return snprintf(outputBuffer, outputBufferSize, "[0x%p]", address);
}
@@ -113,10 +113,15 @@
+#if defined(__sunos__)
if (getcontext(&context) != 0) {
return 0;
}
int wcReturn = walkcontext(
&context,
reinterpret_cast<WalkcontextCallbackFunc>(WalkcontextCallback::callbackFunction),
static_cast<void*>(&walkcontextCallback));
+#else
+ // We have no walkcontext(3) for musl libc
+ int wcReturn = -1;
+#endif
if (wcReturn == 0) {
return walkcontextCallback.getCount();
}