summaryrefslogtreecommitdiffstats
path: root/chromium/patches/019-musl-no-execinfo.patch
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/patches/019-musl-no-execinfo.patch')
-rw-r--r--chromium/patches/019-musl-no-execinfo.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/chromium/patches/019-musl-no-execinfo.patch b/chromium/patches/019-musl-no-execinfo.patch
new file mode 100644
index 0000000..7447919
--- /dev/null
+++ b/chromium/patches/019-musl-no-execinfo.patch
@@ -0,0 +1,68 @@
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@@ -291,7 +291,9 @@
41 }
42
43 void StackTrace::OutputToStream(std::ostream* os) const {
44+#if defined(__GLIBC__)
45 OutputToStreamWithPrefix(os, {});
46+#endif
47 }
48
49 void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
50@@ -311,7 +313,7 @@
51
52 std::string StackTrace::ToStringWithPrefix(cstring_view prefix_string) const {
53 std::stringstream stream;
54-#if !defined(__UCLIBC__) && !defined(_AIX)
55+#if defined(__GLIBC__) && !defined(_AIX)
56 OutputToStreamWithPrefix(&stream, prefix_string);
57 #endif
58 return stream.str();
59@@ -335,7 +335,7 @@
60 }
61
62 std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
63-#if !defined(__UCLIBC__) && !defined(_AIX)
64+#if defined(__GLIBC__) && !defined(_AIX)
65 s.OutputToStream(&os);
66 #else
67 os << "StackTrace::OutputToStream not implemented.";
68