void-packages/srcpkgs/chromium/patches/no-execinfo.patch

104 lines
3.6 KiB
Diff

--- base/debug/stack_trace_posix.cc.orig 2017-07-27 14:05:05.534241443 +0000
+++ base/debug/stack_trace_posix.cc 2017-07-27 14:07:54.669231362 +0000
@@ -26,7 +26,7 @@
#if !defined(USE_SYMBOLIZE)
#include <cxxabi.h>
#endif
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
#include <execinfo.h>
#endif
@@ -80,7 +80,7 @@
// Note: code in this function is NOT async-signal safe (std::string uses
// malloc internally).
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
std::string::size_type search_from = 0;
while (search_from < text->size()) {
// Look for the start of a mangled symbol, from search_from.
@@ -115,7 +115,7 @@
search_from = mangled_start + 2;
}
}
-#endif // !defined(__UCLIBC__) && !defined(_AIX)
+#endif // defined(__GLIBC__) && !defined(_AIX)
}
#endif // !defined(USE_SYMBOLIZE)
@@ -127,7 +127,7 @@
virtual ~BacktraceOutputHandler() {}
};
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
// This should be more than enough to store a 64-bit number in hex:
// 16 hex digits + 1 for null-terminator.
@@ -204,7 +204,7 @@
}
#endif // defined(USE_SYMBOLIZE)
}
-#endif // !defined(__UCLIBC__) && !defined(_AIX)
+#endif // defined(__GLIBC__) && !defined(_AIX)
void PrintToStderr(const char* output) {
// NOTE: This code MUST be async-signal safe (it's used by in-process
@@ -721,7 +721,7 @@
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
count = std::min(arraysize(trace_), count);
// Though the backtrace API man page does not list any possible negative
@@ -736,13 +736,13 @@
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
PrintBacktraceOutputHandler handler;
ProcessBacktrace(trace_, count_, &handler);
#endif
}
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
void StackTrace::OutputToStream(std::ostream* os) const {
StreamBacktraceOutputHandler handler(os);
ProcessBacktrace(trace_, count_, &handler);
--- third_party/WebKit/Source/platform/wtf/Assertions.cpp.orig 2017-09-11 12:27:06.948854813 +0000
+++ third_party/WebKit/Source/platform/wtf/Assertions.cpp 2017-09-11 12:29:34.639862433 +0000
@@ -56,7 +56,7 @@
#include <windows.h>
#endif
-#if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
+#if defined(OS_MACOSX) || (defined(OS_LINUX) && defined(__GLIBC__))
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
--- third_party/webrtc/rtc_base/checks.cc.orig
+++ third_party/webrtc/rtc_base/checks.cc
@@ -16,7 +16,7 @@
#include <cstdio>
#include <cstdlib>
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+#if defined(__GLIBC__) && defined(__GLIBCXX__) && !defined(__UCLIBC__)
#include <cxxabi.h>
#include <execinfo.h>
#endif
@@ -60,7 +60,7 @@
// to get usable symbols on Linux. This is copied from V8. Chromium has a more
// advanced stace trace system; also more difficult to copy.
void DumpBacktrace() {
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+#if defined(__GLIBC__) && defined(__GLIBCXX__) && !defined(__UCLIBC__)
void* trace[100];
int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
char** symbols = backtrace_symbols(trace, size);