64 lines
2.3 KiB
Diff
64 lines
2.3 KiB
Diff
|
From 445907a8a98e5d14f9c0042aa6849bdad4b0af5b Mon Sep 17 00:00:00 2001
|
||
|
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||
|
Date: Thu, 23 Jul 2020 22:28:55 +0200
|
||
|
Subject: [PATCH] absl/debugging: use <execinfo.h> only when available
|
||
|
|
||
|
Instead of relying on __GLIBC__ or other unreliable detection
|
||
|
mechanism, simply detect if <execinfo.h> is available before using the
|
||
|
stacktrace_generic-inl.inc implementation.
|
||
|
|
||
|
Upstream: https://github.com/abseil/abseil-cpp/pull/746
|
||
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||
|
---
|
||
|
absl/debugging/CMakeLists.txt | 7 +++++++
|
||
|
absl/debugging/internal/stacktrace_config.h | 6 +++---
|
||
|
2 files changed, 10 insertions(+), 3 deletions(-)
|
||
|
|
||
|
diff --git a/absl/debugging/CMakeLists.txt b/absl/debugging/CMakeLists.txt
|
||
|
index 7733615..285c5a8 100644
|
||
|
--- a/absl/debugging/CMakeLists.txt
|
||
|
+++ b/absl/debugging/CMakeLists.txt
|
||
|
@@ -14,6 +14,13 @@
|
||
|
# limitations under the License.
|
||
|
#
|
||
|
|
||
|
+include(CheckIncludeFileCXX)
|
||
|
+
|
||
|
+check_include_file_cxx(execinfo.h HAVE_EXECINFO_H)
|
||
|
+if(HAVE_EXECINFO_H)
|
||
|
+ add_definitions(-DHAVE_EXECINFO_H)
|
||
|
+endif()
|
||
|
+
|
||
|
absl_cc_library(
|
||
|
NAME
|
||
|
stacktrace
|
||
|
diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
|
||
|
index d4e8480..2e17ca3 100644
|
||
|
--- a/absl/debugging/internal/stacktrace_config.h
|
||
|
+++ b/absl/debugging/internal/stacktrace_config.h
|
||
|
@@ -40,7 +40,7 @@
|
||
|
# elif defined(__aarch64__)
|
||
|
#define ABSL_STACKTRACE_INL_HEADER \
|
||
|
"absl/debugging/internal/stacktrace_aarch64-inl.inc"
|
||
|
-# elif defined(__arm__)
|
||
|
+# elif defined(__arm__) && defined(HAVE_EXECINFO_H)
|
||
|
// Note: When using glibc this may require -funwind-tables to function properly.
|
||
|
#define ABSL_STACKTRACE_INL_HEADER \
|
||
|
"absl/debugging/internal/stacktrace_generic-inl.inc"
|
||
|
@@ -49,10 +49,10 @@
|
||
|
"absl/debugging/internal/stacktrace_unimplemented-inl.inc"
|
||
|
# endif
|
||
|
#else // defined(NO_FRAME_POINTER)
|
||
|
-# if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
|
||
|
+# if (defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)) && defined(HAVE_EXECINFO_H)
|
||
|
#define ABSL_STACKTRACE_INL_HEADER \
|
||
|
"absl/debugging/internal/stacktrace_generic-inl.inc"
|
||
|
-# elif defined(__ppc__) || defined(__PPC__)
|
||
|
+# elif (defined(__ppc__) || defined(__PPC__)) && defined(HAVE_EXECINFO_H)
|
||
|
#define ABSL_STACKTRACE_INL_HEADER \
|
||
|
"absl/debugging/internal/stacktrace_generic-inl.inc"
|
||
|
# else
|
||
|
--
|
||
|
2.26.2
|
||
|
|