summaryrefslogtreecommitdiffstats
path: root/chromium/patches/019-musl-no-execinfo.patch
blob: 74479195e3b219f44ab773a40a7c62e5de7e3392 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
musl does not have execinfo.h, and hence no implementation of
. backtrace()
. backtrace_symbols()
for discussion about this, see https://www.openwall.com/lists/musl/2021/07/16/1
--
--- a/v8/src/codegen/external-reference-table.cc
+++ b/v8/src/codegen/external-reference-table.cc
@@ -11,7 +11,9 @@

 #if defined(DEBUG) && defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID)
 #define SYMBOLIZE_FUNCTION
+#if defined(__GLIBC__)
 #include <execinfo.h>
+#endif

 #include <vector>

@@ -96,7 +98,7 @@
 }

 const char* ExternalReferenceTable::ResolveSymbol(void* address) {
-#ifdef SYMBOLIZE_FUNCTION
+#if defined(SYMBOLIZE_FUNCTION) && defined(__GLIBC__)
   char** names = backtrace_symbols(&address, 1);
   const char* name = names[0];
   // The array of names is malloc'ed. However, each name string is static
--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
@@ -58,7 +58,7 @@
 #define HAVE_ERRNO_H 1
 
 /* Define to 1 if you have the <execinfo.h> header file. */
-#define HAVE_EXECINFO_H 1
+/* #define HAVE_EXECINFO_H 1 */
 
 /* Define to 1 if you have the <fcntl.h> header file. */
 #define HAVE_FCNTL_H 1
--- a/base/debug/stack_trace.cc
+++ b/base/debug/stack_trace.cc
@@ -291,7 +291,9 @@
 }
 
 void StackTrace::OutputToStream(std::ostream* os) const {
+#if defined(__GLIBC__)
   OutputToStreamWithPrefix(os, {});
+#endif
 }
 
 void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
@@ -311,7 +313,7 @@
 
 std::string StackTrace::ToStringWithPrefix(cstring_view prefix_string) const {
   std::stringstream stream;
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
   OutputToStreamWithPrefix(&stream, prefix_string);
 #endif
   return stream.str();
@@ -335,7 +335,7 @@
 }
 
 std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
   s.OutputToStream(&os);
 #else
   os << "StackTrace::OutputToStream not implemented.";