diff options
Diffstat (limited to 'community/chromium/no-execinfo.patch')
-rw-r--r-- | community/chromium/no-execinfo.patch | 100 |
1 files changed, 57 insertions, 43 deletions
diff --git a/community/chromium/no-execinfo.patch b/community/chromium/no-execinfo.patch index 5e1a1652bad..b1705f5d85f 100644 --- a/community/chromium/no-execinfo.patch +++ b/community/chromium/no-execinfo.patch @@ -1,54 +1,68 @@ ---- ./base/debug/stack_trace_posix.cc -+++ ./base/debug/stack_trace_posix.cc -@@ -27,7 +27,7 @@ - #if !defined(USE_SYMBOLIZE) - #include <cxxabi.h> - #endif --#if !defined(__UCLIBC__) && !defined(_AIX) -+#if defined(__GLIBC__) && !defined(_AIX) +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 - -@@ -88,7 +88,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. -@@ -135,7 +135,7 @@ - virtual ~BacktraceOutputHandler() = default; - }; ++#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 --#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. -@@ -834,7 +834,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. + /* 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,7 @@ + } + std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const { + std::stringstream stream; -#if !defined(__UCLIBC__) && !defined(_AIX) +#if defined(__GLIBC__) && !defined(_AIX) - // Though the backtrace API man page does not list any possible negative - // return values, we take no chance. - return base::saturated_cast<size_t>(backtrace(trace, count)); -@@ -847,13 +847,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 (ShouldSuppressOutput()) { + return "Backtrace suppressed."; + } +@@ -301,7 +301,7 @@ + } + std::ostream& operator<<(std::ostream& os, const StackTrace& s) { -#if !defined(__UCLIBC__) && !defined(_AIX) +#if defined(__GLIBC__) && !defined(_AIX) - PrintBacktraceOutputHandler handler; - ProcessBacktrace(trace_, count_, prefix_string, &handler); + s.OutputToStream(&os); + #else + os << "StackTrace::OutputToStream not implemented."; +--- a/base/debug/stack_trace_unittest.cc ++++ b/base/debug/stack_trace_unittest.cc +@@ -33,7 +33,7 @@ + typedef testing::Test StackTraceTest; #endif - } -#if !defined(__UCLIBC__) && !defined(_AIX) -+#if defined(__GLIBC__) && !defined(_AIX) - void StackTrace::OutputToStreamWithPrefix(std::ostream* os, - const char* prefix_string) const { - StreamBacktraceOutputHandler handler(os); ++#if !defined(__UCLIBC__) && !defined(_AIX) && defined(__GLIBC__) + // StackTrace::OutputToStream() is not implemented under uclibc, nor AIX. + // See https://crbug.com/706728 + |