83 lines
3.6 KiB
Diff
83 lines
3.6 KiB
Diff
From 8023dc2b7c6a3c1a2e51ffed30986df879060ca0 Mon Sep 17 00:00:00 2001
|
|
From: Khem Raj <raj.khem@gmail.com>
|
|
Date: Wed, 13 Feb 2019 09:51:14 -0800
|
|
Subject: [PATCH] execinfo implementation is glibc specific
|
|
|
|
Upstream-Status: Pending
|
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
|
|
|
---
|
|
base/debug/stack_trace_posix.cc | 12 ++++++------
|
|
.../build/Linux/include/llvm/Config/config.h | 2 +-
|
|
2 files changed, 7 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
|
|
index 679118e189..94890f32b6 100644
|
|
--- a/base/debug/stack_trace_posix.cc
|
|
+++ b/base/debug/stack_trace_posix.cc
|
|
@@ -31,7 +31,7 @@
|
|
#if !defined(USE_SYMBOLIZE)
|
|
#include <cxxabi.h>
|
|
#endif
|
|
-#if !defined(__UCLIBC__) && !defined(_AIX)
|
|
+#if !defined(__UCLIBC__) && defined(__GLIBC__) && !defined(_AIX)
|
|
#include <execinfo.h>
|
|
#endif
|
|
|
|
@@ -98,7 +98,7 @@ void DemangleSymbols(std::string* text) {
|
|
// Note: code in this function is NOT async-signal safe (std::string uses
|
|
// malloc internally).
|
|
|
|
-#if !defined(__UCLIBC__) && !defined(_AIX)
|
|
+#if !defined(__UCLIBC__) && 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.
|
|
@@ -145,7 +145,7 @@ class BacktraceOutputHandler {
|
|
virtual ~BacktraceOutputHandler() = default;
|
|
};
|
|
|
|
-#if !defined(__UCLIBC__) && !defined(_AIX)
|
|
+#if !defined(__UCLIBC__) && 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.
|
|
@@ -872,7 +872,7 @@ size_t CollectStackTrace(void** trace, size_t count) {
|
|
// If we do not have unwind tables, then try tracing using frame pointers.
|
|
return base::debug::TraceStackFramePointers(const_cast<const void**>(trace),
|
|
count, 0);
|
|
-#elif !defined(__UCLIBC__) && !defined(_AIX)
|
|
+#elif !defined(__UCLIBC__) && 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>(
|
|
@@ -886,13 +886,13 @@ void StackTrace::PrintWithPrefix(const char* prefix_string) const {
|
|
// 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 !defined(__UCLIBC__) && !defined(_AIX)
|
|
+#if !defined(__UCLIBC__) && defined(__GLIBC__) && !defined(_AIX)
|
|
PrintBacktraceOutputHandler handler;
|
|
ProcessBacktrace(trace_, count_, prefix_string, &handler);
|
|
#endif
|
|
}
|
|
|
|
-#if !defined(__UCLIBC__) && !defined(_AIX)
|
|
+#if !defined(__UCLIBC__) && defined(__GLIBC__) && !defined(_AIX)
|
|
void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
|
|
const char* prefix_string) const {
|
|
StreamBacktraceOutputHandler handler(os);
|
|
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
|
|
index 0ffd1bf775..0e413c69a5 100644
|
|
--- 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 0
|
|
|
|
/* Define to 1 if you have the <fcntl.h> header file. */
|
|
#define HAVE_FCNTL_H 1
|