]> git.armaanb.net Git - asd-repo.git/blob - extra/chromium/patches/musl-no-execinfo.patch
Switch browser to Chromium
[asd-repo.git] / extra / chromium / patches / musl-no-execinfo.patch
1 diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
2 index bf4b854..554fb6f 100644
3 --- a/base/debug/stack_trace_posix.cc
4 +++ b/base/debug/stack_trace_posix.cc
5 @@ -27,7 +27,7 @@
6  #if !defined(USE_SYMBOLIZE)
7  #include <cxxabi.h>
8  #endif
9 -#if !defined(__UCLIBC__) && !defined(_AIX)
10 +#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
11  #include <execinfo.h>
12  #endif
13  
14 @@ -88,7 +88,7 @@ void DemangleSymbols(std::string* text) {
15    // Note: code in this function is NOT async-signal safe (std::string uses
16    // malloc internally).
17  
18 -#if !defined(__UCLIBC__) && !defined(_AIX)
19 +#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
20    std::string::size_type search_from = 0;
21    while (search_from < text->size()) {
22      // Look for the start of a mangled symbol, from search_from.
23 @@ -123,7 +123,7 @@ void DemangleSymbols(std::string* text) {
24        search_from = mangled_start + 2;
25      }
26    }
27 -#endif  // !defined(__UCLIBC__) && !defined(_AIX)
28 +#endif  // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
29  }
30  #endif  // !defined(USE_SYMBOLIZE)
31  
32 @@ -135,7 +135,7 @@ class BacktraceOutputHandler {
33    virtual ~BacktraceOutputHandler() = default;
34  };
35  
36 -#if !defined(__UCLIBC__) && !defined(_AIX)
37 +#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
38  void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
39    // This should be more than enough to store a 64-bit number in hex:
40    // 16 hex digits + 1 for null-terminator.
41 @@ -218,7 +218,7 @@ void ProcessBacktrace(void* const* trace,
42    }
43  #endif  // defined(USE_SYMBOLIZE)
44  }
45 -#endif  // !defined(__UCLIBC__) && !defined(_AIX)
46 +#endif  // defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
47  
48  void PrintToStderr(const char* output) {
49    // NOTE: This code MUST be async-signal safe (it's used by in-process
50 @@ -827,7 +827,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
51    // NOTE: This code MUST be async-signal safe (it's used by in-process
52    // stack dumping signal handler). NO malloc or stdio is allowed here.
53  
54 -#if !defined(__UCLIBC__) && !defined(_AIX)
55 +#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
56    // Though the backtrace API man page does not list any possible negative
57    // return values, we take no chance.
58    return base::saturated_cast<size_t>(backtrace(trace, count));
59 @@ -840,13 +840,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
60  // NOTE: This code MUST be async-signal safe (it's used by in-process
61  // stack dumping signal handler). NO malloc or stdio is allowed here.
62  
63 -#if !defined(__UCLIBC__) && !defined(_AIX)
64 +#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
65    PrintBacktraceOutputHandler handler;
66    ProcessBacktrace(trace_, count_, prefix_string, &handler);
67  #endif
68  }
69  
70 -#if !defined(__UCLIBC__) && !defined(_AIX)
71 +#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
72  void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
73                                            const char* prefix_string) const {
74    StreamBacktraceOutputHandler handler(os);
75 diff --git 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
76 index 2f860e1..36f3c33 100644
77 --- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
78 +++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
79 @@ -14,7 +14,7 @@
80  #define ENABLE_CRASH_OVERRIDES 0
81  
82  /* Define to 1 if you have the `backtrace' function. */
83 -#define HAVE_BACKTRACE 1
84 +/* #undef HAVE_BACKTRACE */
85  
86  /* Define to 1 if you have the <CrashReporterClient.h> header file. */
87  /* #undef HAVE_CRASHREPORTERCLIENT_H */
88 @@ -55,7 +55,7 @@
89  #define HAVE_ERRNO_H 1
90  
91  /* Define to 1 if you have the <execinfo.h> header file. */
92 -#define HAVE_EXECINFO_H 1
93 +/* #undef HAVE_EXECINFO_H */
94  
95  /* Define to 1 if you have the <fcntl.h> header file. */
96  #define HAVE_FCNTL_H 1