Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1719)

Unified Diff: base/debug/stack_trace_posix.cc

Issue 1422623002: Build fixes for fnl/musl (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: update README.chromium in //third_party Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/debug/stack_trace.cc ('k') | base/files/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/stack_trace_posix.cc
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
index 2eac14e35380d12dd426add3001de08d910ecc08..176d463353b4b09c8d59a746871fc5da43630fc7 100644
--- a/base/debug/stack_trace_posix.cc
+++ b/base/debug/stack_trace_posix.cc
@@ -22,7 +22,7 @@
#if defined(__GLIBCXX__)
#include <cxxabi.h>
#endif
-#if !defined(__UCLIBC__)
+#if !defined(__UCLIBC__) && !defined(FNL_MUSL)
#include <execinfo.h>
#endif
@@ -73,7 +73,7 @@ void DemangleSymbols(std::string* text) {
// Note: code in this function is NOT async-signal safe (std::string uses
// malloc internally).
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+#if defined(__GLIBCXX__) && !defined(__UCLIBC__) && !defined(FNL_MUSL)
std::string::size_type search_from = 0;
while (search_from < text->size()) {
@@ -110,7 +110,7 @@ void DemangleSymbols(std::string* text) {
}
}
-#endif // defined(__GLIBCXX__) && !defined(__UCLIBC__)
+#endif // defined(__GLIBCXX__) && !defined(__UCLIBC__) && !defined(FNL_MUSL)
}
#endif // !defined(USE_SYMBOLIZE)
@@ -122,6 +122,7 @@ class BacktraceOutputHandler {
virtual ~BacktraceOutputHandler() {}
};
+#if !defined(__UCLIBC__) && !defined(FNL_MUSL)
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.
@@ -169,7 +170,7 @@ void ProcessBacktrace(void *const *trace,
handler->HandleOutput("\n");
}
-#elif !defined(__UCLIBC__)
+#elif !defined(__UCLIBC__) && !defined(FNL_MUSL)
bool printed = false;
// Below part is async-signal unsafe (uses malloc), so execute it only
@@ -198,6 +199,7 @@ void ProcessBacktrace(void *const *trace,
}
#endif // defined(USE_SYMBOLIZE)
}
+#endif
void PrintToStderr(const char* output) {
// NOTE: This code MUST be async-signal safe (it's used by in-process
@@ -738,7 +740,7 @@ StackTrace::StackTrace() {
// 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__)
+#if !defined(__UCLIBC__) && !defined(FNL_MUSL)
// Though the backtrace API man page does not list any possible negative
// return values, we take no chance.
count_ = base::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));
@@ -751,13 +753,13 @@ void StackTrace::Print() 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__)
+#if !defined(__UCLIBC__) && !defined(FNL_MUSL)
PrintBacktraceOutputHandler handler;
ProcessBacktrace(trace_, count_, &handler);
#endif
}
-#if !defined(__UCLIBC__)
+#if !defined(__UCLIBC__) && !defined(FNL_MUSL)
void StackTrace::OutputToStream(std::ostream* os) const {
StreamBacktraceOutputHandler handler(os);
ProcessBacktrace(trace_, count_, &handler);
« no previous file with comments | « base/debug/stack_trace.cc ('k') | base/files/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698