linux.h (ASAN_CC1_SPEC): Define.
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 15 Feb 2019 23:08:49 +0000 (23:08 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 15 Feb 2019 23:08:49 +0000 (23:08 +0000)
* config/sparc/linux.h (ASAN_CC1_SPEC): Define.
(CC1_SPEC): Use GNU_USER_TARGET_CC1_SPEC and ASAN_CC1_SPEC.
* config/sparc/linux64.h (ASAN_CC1_SPEC): Likewise.
(CC1_SPEC): Likewise.
* config/sparc/sparc.c (sparc_asan_shadow_offset): Adjust for 64-bit.

From-SVN: r268950

gcc/ChangeLog
gcc/config/sparc/linux.h
gcc/config/sparc/linux64.h
gcc/config/sparc/sparc.c

index 63d1f4198694d66e180bef8fa85549c34867221d..c430cfd96770609674b75637cf59931daf362c5f 100644 (file)
@@ -1,3 +1,11 @@
+2019-02-15  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * config/sparc/linux.h (ASAN_CC1_SPEC): Define.
+       (CC1_SPEC): Use GNU_USER_TARGET_CC1_SPEC and ASAN_CC1_SPEC.
+       * config/sparc/linux64.h (ASAN_CC1_SPEC): Likewise.
+       (CC1_SPEC): Likewise.
+       * config/sparc/sparc.c (sparc_asan_shadow_offset): Adjust for 64-bit.
+
 2019-02-15  Eric Botcazou  <ebotcazou@adacore.com>
 
        * asan.c (asan_emit_stack_protection): Use full-sized mask to align
index 2db9ea2172e233129037417ebfb20e3b2c53c642..08476f1d94d45f11ae9624fba783bd7408caa430 100644 (file)
@@ -54,10 +54,11 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
 
 #define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
 
-/* This is for -profile to use -lc_p instead of -lc.  */
-#undef CC1_SPEC
-#define        CC1_SPEC "%{profile:-p} \
-"
+#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
 
 #undef SIZE_TYPE
 #define SIZE_TYPE "unsigned int"
index 21e130019511ba39f89b9367eeb0f3e34f2af825..bbf5bab3b40927c1257bfc302d4dafc4f924b165 100644 (file)
@@ -143,24 +143,25 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
 
 #define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
 
-#undef CC1_SPEC
+#undef  ASAN_CC1_SPEC
+#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+
+#undef  CC1_SPEC
 #if DEFAULT_ARCH32_P
-#define CC1_SPEC "%{profile:-p} \
-%{m32:%{m64:%emay not use both -m32 and -m64}} \
+#define CC1_SPEC GNU_USER_TARGET_CC1_SPEC ASAN_CC1_SPEC \
+"%{m32:%{m64:%emay not use both -m32 and -m64}} \
 %{m64:-mptr64 -mstack-bias -mlong-double-128 \
   %{!mcpu*:-mcpu=ultrasparc} \
-  %{!mno-vis:%{!mcpu=v9:-mvis}}} \
-"
+  %{!mno-vis:%{!mcpu=v9:-mvis}}}"
 #else
-#define CC1_SPEC "%{profile:-p} \
-%{m32:%{m64:%emay not use both -m32 and -m64}} \
+#define CC1_SPEC GNU_USER_TARGET_CC1_SPEC ASAN_CC1_SPEC \
+"%{m32:%{m64:%emay not use both -m32 and -m64}} \
 %{m32:-mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \
   %{!mcpu*:-mcpu=cypress}} \
 %{mv8plus:-mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \
   %{!mcpu*:-mcpu=v9}} \
 %{!m32:%{!mcpu*:-mcpu=ultrasparc}} \
-%{!mno-vis:%{!m32:%{!mcpu=v9:-mvis}}} \
-"
+%{!mno-vis:%{!m32:%{!mcpu=v9:-mvis}}}"
 #endif
 
 /* Support for a compile-time default CPU, et cetera.  The rules are:
index 8bb59a6bd417809dbbd543e3491d5d63757e0e47..faddd0661dbea34386291c7c33f0762c50db01b6 100644 (file)
@@ -12524,7 +12524,7 @@ sparc_init_machine_status (void)
 static unsigned HOST_WIDE_INT
 sparc_asan_shadow_offset (void)
 {
-  return TARGET_ARCH64 ? HOST_WIDE_INT_C (0x7fff8000) : (HOST_WIDE_INT_1 << 29);
+  return TARGET_ARCH64 ? (HOST_WIDE_INT_1 << 43) : (HOST_WIDE_INT_1 << 29);
 }
 \f
 /* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL.