ayaports/backports/electron/no-execinfo.patch

69 lines
2.2 KiB
Diff
Raw Normal View History

2023-05-05 05:10:04 +00:00
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
--
2023-01-11 00:40:45 +00:00
--- 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
2024-11-01 13:59:14 +00:00
@@ -311,7 +311,7 @@
std::string StackTrace::ToStringWithPrefix(cstring_view prefix_string) const {
2024-06-02 23:02:17 +00:00
std::stringstream stream;
-#if !defined(__UCLIBC__) && !defined(_AIX)
2023-01-11 00:40:45 +00:00
+#if defined(__GLIBC__) && !defined(_AIX)
2024-11-01 13:59:14 +00:00
OutputToStreamWithPrefix(&stream, prefix_string);
#endif
return stream.str();
@@ -335,7 +335,7 @@
2023-01-11 00:40:45 +00:00
}
2024-06-02 23:02:17 +00:00
std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
2023-01-11 00:40:45 +00:00
-#if !defined(__UCLIBC__) && !defined(_AIX)
+#if defined(__GLIBC__) && !defined(_AIX)
2024-06-02 23:02:17 +00:00
s.OutputToStream(&os);
#else
os << "StackTrace::OutputToStream not implemented.";
2023-05-05 05:10:04 +00:00
--- 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(__UCLIBC__) && !defined(_AIX) && defined(__GLIBC__)
// StackTrace::OutputToStream() is not implemented under uclibc, nor AIX.
// See https://crbug.com/706728