From 5a85c65255c300a2affed941d495cf1d9a505f43 Mon Sep 17 00:00:00 2001 From: Christy Norman Date: Tue, 31 Jul 2018 16:11:46 -0400 Subject: fix multiple define problem with ppc64le building anything, e.g. envoy, that also builds gperftools, results in the error that StacktracePowerPCDummyFunction was previously defined. Rename this one, as its only a dummy function and is only used in this one place. Signed-off-by: Christy Norman --- absl/debugging/internal/stacktrace_powerpc-inl.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/absl/debugging/internal/stacktrace_powerpc-inl.inc b/absl/debugging/internal/stacktrace_powerpc-inl.inc index 297bdadf..edf1947d 100644 --- a/absl/debugging/internal/stacktrace_powerpc-inl.inc +++ b/absl/debugging/internal/stacktrace_powerpc-inl.inc @@ -150,8 +150,8 @@ static void **NextStackFrame(void **old_sp, const void *uc) { } // This ensures that absl::GetStackTrace sets up the Link Register properly. -void StacktracePowerPCDummyFunction() __attribute__((noinline)); -void StacktracePowerPCDummyFunction() { __asm__ volatile(""); } +void AbslStacktracePowerPCDummyFunction() __attribute__((noinline)); +void AbslStacktracePowerPCDummyFunction() { __asm__ volatile(""); } template ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack. @@ -176,7 +176,7 @@ static int UnwindImpl(void** result, int* sizes, int max_depth, int skip_count, // want here. While the compiler will always(?) set up LR for // subroutine calls, it may not for leaf functions (such as this one). // This routine forces the compiler (at least gcc) to push it anyway. - StacktracePowerPCDummyFunction(); + AbslStacktracePowerPCDummyFunction(); // The LR save area is used by the callee, so the top entry is bogus. skip_count++; -- cgit v1.2.3 From b876d861b0a1dcc092e8b28a2fefa63dece84c33 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Wed, 1 Aug 2018 13:56:45 -0400 Subject: Tweak pull request #152 to fix multiple define problem with ppc64le. --- absl/debugging/internal/stacktrace_powerpc-inl.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/absl/debugging/internal/stacktrace_powerpc-inl.inc b/absl/debugging/internal/stacktrace_powerpc-inl.inc index edf1947d..860ac2b3 100644 --- a/absl/debugging/internal/stacktrace_powerpc-inl.inc +++ b/absl/debugging/internal/stacktrace_powerpc-inl.inc @@ -31,6 +31,8 @@ #include #include +#include "absl/base/attributes.h" +#include "absl/base/optimization.h" #include "absl/base/port.h" #include "absl/debugging/stacktrace.h" #include "absl/debugging/internal/address_is_readable.h" @@ -150,8 +152,9 @@ static void **NextStackFrame(void **old_sp, const void *uc) { } // This ensures that absl::GetStackTrace sets up the Link Register properly. -void AbslStacktracePowerPCDummyFunction() __attribute__((noinline)); -void AbslStacktracePowerPCDummyFunction() { __asm__ volatile(""); } +ABSL_ATTRIBUTE_NOINLINE static void AbslStacktracePowerPCDummyFunction() { + ABSL_BLOCK_TAIL_CALL_OPTIMIZATION(); +} template ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // May read random elements from stack. -- cgit v1.2.3