diff options
author | Xi Ruoyao <xry111@mengyan1223.wang> | 2022-03-11 11:07:00 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@mengyan1223.wang> | 2022-03-15 00:39:47 +0800 |
commit | 344e6f9f2abcff9b2bb4b26b693be4a599272f43 (patch) | |
tree | 8e6197eecc695f4abb1e8179a27cde47a9ebc509 /gcc/config/mips/mips.h | |
parent | a60a3a95d0f6bb11567a13b8684c97671ef12e1d (diff) | |
download | gcc-344e6f9f2abcff9b2bb4b26b693be4a599272f43.zip gcc-344e6f9f2abcff9b2bb4b26b693be4a599272f43.tar.gz gcc-344e6f9f2abcff9b2bb4b26b693be4a599272f43.tar.bz2 |
Enable libsanitizer build on mips64
Bootstrapped and regtested on mips64-linux-gnuabi64.
bootstrap-ubsan revealed 3 bugs (PR 104842, 104843, 104851).
bootstrap-asan did not reveal any new bug.
gcc/
* config/mips/mips.h (SUBTARGET_SHADOW_OFFSET): Define.
* config/mips/mips.cc (mips_option_override): Make
-fsanitize=address imply -fasynchronous-unwind-tables. This is
needed by libasan for stack backtrace on MIPS.
(mips_asan_shadow_offset): Return SUBTARGET_SHADOW_OFFSET.
gcc/testsuite:
* c-c++-common/asan/global-overflow-1.c: Skip for MIPS with some
optimization levels because inaccurate debug info is causing
dg-output mismatch on line numbers.
* g++.dg/asan/large-func-test-1.C: Likewise.
libsanitizer/
* configure.tgt: Enable build on mips*64*-*-linux*.
Diffstat (limited to 'gcc/config/mips/mips.h')
-rw-r--r-- | gcc/config/mips/mips.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 0029864..858bbba 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -3463,3 +3463,10 @@ struct GTY(()) machine_function { && !TARGET_MICROMIPS && !TARGET_FIX_24K) #define NEED_INDICATE_EXEC_STACK 0 + +/* Define the shadow offset for asan. Other OS's can override in the + respective tm.h files. */ +#ifndef SUBTARGET_SHADOW_OFFSET +#define SUBTARGET_SHADOW_OFFSET \ + (POINTER_SIZE == 64 ? HOST_WIDE_INT_1 << 37 : HOST_WIDE_INT_C (0x0aaa0000)) +#endif |