projects/aports·blob master · refs

68 lines · 2.2 KiB

1musl does not have execinfo.h, and hence no implementation of
2. backtrace()
3. backtrace_symbols()
4for discussion about this, see https://www.openwall.com/lists/musl/2021/07/16/1
5--
6--- a/v8/src/codegen/external-reference-table.cc
7+++ b/v8/src/codegen/external-reference-table.cc
8@@ -11,7 +11,9 @@
9
10 #if defined(DEBUG) && defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID)
11 #define SYMBOLIZE_FUNCTION
12+#if defined(__GLIBC__)
13 #include <execinfo.h>
14+#endif
15
16 #include <vector>
17
18@@ -96,7 +98,7 @@
19 }
20
21 const char* ExternalReferenceTable::ResolveSymbol(void* address) {
22-#ifdef SYMBOLIZE_FUNCTION
23+#if defined(SYMBOLIZE_FUNCTION) && defined(__GLIBC__)
24 char** names = backtrace_symbols(&address, 1);
25 const char* name = names[0];
26 // The array of names is malloc'ed. However, each name string is static
27--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
28+++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
29@@ -58,7 +58,7 @@
30 #define HAVE_ERRNO_H 1
31
32 /* Define to 1 if you have the <execinfo.h> header file. */
33-#define HAVE_EXECINFO_H 1
34+/* #define HAVE_EXECINFO_H 1 */
35
36 /* Define to 1 if you have the <fcntl.h> header file. */
37 #define HAVE_FCNTL_H 1
38--- a/base/debug/stack_trace.cc
39+++ b/base/debug/stack_trace.cc
40@@ -311,7 +311,7 @@
41
42 std::string StackTrace::ToStringWithPrefix(cstring_view prefix_string) const {
43 std::stringstream stream;
44-#if !defined(__UCLIBC__) && !defined(_AIX)
45+#if defined(__GLIBC__) && !defined(_AIX)
46 OutputToStreamWithPrefix(&stream, prefix_string);
47 #endif
48 return stream.str();
49@@ -335,7 +335,7 @@
50 }
51
52 std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
53-#if !defined(__UCLIBC__) && !defined(_AIX)
54+#if defined(__GLIBC__) && !defined(_AIX)
55 s.OutputToStream(&os);
56 #else
57 os << "StackTrace::OutputToStream not implemented.";
58--- a/base/debug/stack_trace_unittest.cc
59+++ b/base/debug/stack_trace_unittest.cc
60@@ -33,7 +33,7 @@
61 typedef testing::Test StackTraceTest;
62 #endif
63
64-#if !defined(__UCLIBC__) && !defined(_AIX)
65+#if !defined(__UCLIBC__) && !defined(_AIX) && defined(__GLIBC__)
66 // StackTrace::OutputToStream() is not implemented under uclibc, nor AIX.
67 // See https://crbug.com/706728
68