diff options
author | Rainer Orth <ro@gcc.gnu.org> | 2018-11-05 19:22:54 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2018-11-05 19:22:54 +0000 |
commit | 806654dc1d1d759cbb0b67df43f839655eda148b (patch) | |
tree | f956f539125e7b2c1416e7147257f5162a849578 /lib/sanitizer_common/sanitizer_stacktrace.h | |
parent | 20da481a84b8cac4f69335b303354d8c97fd5759 (diff) | |
download | compiler-rt-806654dc1d1d759cbb0b67df43f839655eda148b.tar.gz |
[Sanitizers] Disable SANITIZER_CAN_FAST_UNWIND on all SPARC targets
While testing my to-be-submitted Solaris sanitizer support on gcc mainline, I ran into
an issue on Solaris/SPARC (sparc-sun-solaris2.11). Initially libasan.so failed to link:
Undefined first referenced
symbol in file
__sanitizer::BufferedStackTrace::FastUnwindStack(unsigned long, unsigned long, unsigned long, unsigned long, unsigned int) /var/gcc/gcc-9.0.0-20181024/11.5-gcc-gas/sparc-sun-solaris2.11/./libsanitizer/asan/.libs/libasan.so
This happens because SANITIZER_CAN_FAST_UNWIND is enabled on non-Linux
SPARC targets (cf. sanitizer_stacktrace.h), but the guard around the SPARCv8-only
definition in sanitizer_stacktrace_sparc.cc only works with clang:
clang predefines __sparcv8__ on non-Solaris, and __sparcv8 only on Solaris
gcc predefines __sparcv8 on Solaris, but __sparc_v8__ on non-Solaris
The attached patch allows for all three variants.
However, disabling SANITIZER_CAN_FAST_UNWIND on all SPARC targets
fixes a couple of testsuite failures in the Solaris asan testsuite, so for now it's better
to keep it disabled everywhere.
This allowed the libsanitizer build to complete and gave reasonable (though slightly
worse than on Solaris/x86) testsuite results.
Differential Revision: https://reviews.llvm.org/D54099
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_stacktrace.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_stacktrace.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_stacktrace.h b/lib/sanitizer_common/sanitizer_stacktrace.h index 562d2e9f7..450a40a90 100644 --- a/lib/sanitizer_common/sanitizer_stacktrace.h +++ b/lib/sanitizer_common/sanitizer_stacktrace.h @@ -19,7 +19,7 @@ namespace __sanitizer { static const u32 kStackTraceMax = 256; -#if SANITIZER_LINUX && (defined(__sparc__) || defined(__mips__)) +#if defined(__sparc__) || (SANITIZER_LINUX && defined(__mips__)) # define SANITIZER_CAN_FAST_UNWIND 0 #elif SANITIZER_WINDOWS # define SANITIZER_CAN_FAST_UNWIND 0 |