From: Christophe Lyon Date: Fri, 26 Sep 2014 13:07:42 +0000 (+0000) Subject: [AArch64] Enable Address Sanitizer. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a3125fc2339aea0f552800ae4a052af49e16e54e;p=gcc.git [AArch64] Enable Address Sanitizer. 2014-09-26 Christophe Lyon [AArch64] Enable Address Sanitizer. gcc/ * config/aarch64/aarch64-linux.h (ASAN_CC1_SPEC): Define. (CC1_SPEC): Define. * config/aarch64/aarch64.c (aarch64_asan_shadow_offset): New function. (TARGET_ASAN_SHADOW_OFFSET): Define. libsanitzer/ * configure.tgt: Enable build on aarch64*-linux. From-SVN: r215642 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d92a705edf3..b0039237492 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-09-26 Christophe Lyon + + * config/aarch64/aarch64-linux.h (ASAN_CC1_SPEC): Define. + (CC1_SPEC): Define. + * config/aarch64/aarch64.c (aarch64_asan_shadow_offset): New function. + (TARGET_ASAN_SHADOW_OFFSET): Define. + 2014-09-26 Martin Liska * cgraph.c (cgraph_node::release_body): New argument keep_arguments diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h index 1731432a4d1..3fbde938805 100644 --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h @@ -23,6 +23,12 @@ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" +#undef ASAN_CC1_SPEC +#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" + +#undef CC1_SPEC +#define CC1_SPEC GNU_USER_TARGET_CC1_SPEC ASAN_CC1_SPEC + #define CPP_SPEC "%{pthread:-D_REENTRANT}" #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 68c78f64306..5144c35e29f 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -9777,6 +9777,14 @@ aarch64_expand_movmem (rtx *operands) return true; } +/* Implement the TARGET_ASAN_SHADOW_OFFSET hook. */ + +static unsigned HOST_WIDE_INT +aarch64_asan_shadow_offset (void) +{ + return (HOST_WIDE_INT_1 << 36); +} + #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST aarch64_address_cost @@ -10023,6 +10031,9 @@ aarch64_expand_movmem (rtx *operands) #undef TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS #define TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS true +#undef TARGET_ASAN_SHADOW_OFFSET +#define TARGET_ASAN_SHADOW_OFFSET aarch64_asan_shadow_offset + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-aarch64.h" diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 75c24b4756b..eaabf43f7cc 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,7 @@ +2014-09-26 Christophe Lyon + + * configure.tgt: Enable build on aarch64*-linux. + 2014-09-19 Kostya Serebryany * All source files: Merge from upstream r218156. diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt index 6de4a65715b..2c302ab6489 100644 --- a/libsanitizer/configure.tgt +++ b/libsanitizer/configure.tgt @@ -35,6 +35,8 @@ case "${target}" in ;; arm*-*-linux*) ;; + aarch64*-*-linux*) + ;; x86_64-*-darwin[1]* | i?86-*-darwin[1]*) TSAN_SUPPORTED=no ;;