PR target/91441 - Turn off -fsanitize=kernel-address if TARGET_ASAN_SHADOW_OFFSET...
authorKito Cheng <kito.cheng@sifive.com>
Mon, 19 Aug 2019 03:21:44 +0000 (03:21 +0000)
committerKito Cheng <kito@gcc.gnu.org>
Mon, 19 Aug 2019 03:21:44 +0000 (03:21 +0000)
commit6490e2556dc1ae5346ef73022ff1e415c35742ad
treeaf44f80923754951c1b569f8d66cda8eaf956d12
parent88898d1e1ec4e2240b52818cef4981dd85585a31
PR target/91441 - Turn off -fsanitize=kernel-address if TARGET_ASAN_SHADOW_OFFSET is not implemented.

 - -fsanitize=kernel-address will call targetm.asan_shadow_offset ()
   at asan_shadow_offset, so it will crash if TARGET_ASAN_SHADOW_OFFSET
   is not implemented, that's mean -fsanitize=kernel-address is not
   supported for target without TARGET_ASAN_SHADOW_OFFSET implementation.

gcc/ChangeLog:

PR target/91441
* toplev.c (process_options): Check TARGET_ASAN_SHADOW_OFFSET is
implemented for -fsanitize=kernel-address, and merge check logic
with -fsanitize=address.

testsuite/ChangeLog:

PR target/91441
* gcc.target/riscv/pr91441.c: New.

From-SVN: r274631
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/riscv/pr91441.c [new file with mode: 0644]
gcc/toplev.c