1From 3e660564c5318079f085596344972f57d680f72a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 13 Feb 2019 09:51:14 -0800
4Subject: [PATCH] debug: Fix build with musl
5
6Check for glibc instead of assuming it to be default since same may not hold
7for musl
8
9This fixes build errors like
10
11base/debug/stack_trace.cc:237: undefined reference to `base::debug::StackTrace::OutputToStreamWithPrefix(std::__1::basic_ostream<char, std::__1::char_traits<char> >*, char const*) const'
12clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
13
14Upstream-Status: Pending
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16
17---
18 base/debug/stack_trace.cc | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc
22index 3debc8bd07..0cc88aa79f 100644
23--- a/base/debug/stack_trace.cc
24+++ b/base/debug/stack_trace.cc
25@@ -281,14 +281,14 @@ std::string StackTrace::ToString() const {
26 }
27 std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
28   std::stringstream stream;
29-#if !defined(__UCLIBC__) && !defined(_AIX)
30+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
31   OutputToStreamWithPrefix(&stream, prefix_string);
32 #endif
33   return stream.str();
34 }
35
36 std::ostream& operator<<(std::ostream& os, const StackTrace& s) {
37-#if !defined(__UCLIBC__) && !defined(_AIX)
38+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(_AIX)
39   s.OutputToStream(&os);
40 #else
41   os << "StackTrace::OutputToStream not implemented.";
42