With the same error message as on SPARC/Solaris (as I have neither the time
nor the energy to get through the awkward upstream submission process again).
Tested on SPARC/Solaris and SPARC/Linux, applied on the mainline.
2019-04-02 Eric Botcazou <ebotca...@adacore.com>
* config/sparc/linux64.h (ASAN_REJECT_SPEC): New macro.
(ASAN_CC1_SPEC): Use it in 64-bit mode.
* config/sparc/sol2.h (ASAN_REJECT_SPEC): Remove superfluous colon.
--
Eric Botcazou
Index: config/sparc/linux64.h
===================================================================
--- config/sparc/linux64.h (revision 270031)
+++ config/sparc/linux64.h (working copy)
@@ -143,8 +143,18 @@ extern const char *host_detect_local_cpu
#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
+/* -fsanitize=address is currently only supported for 32-bit. */
+#define ASAN_REJECT_SPEC \
+ "%{!%:sanitize(thread):%e-fsanitize=address is not supported in this configuration}"
+
#undef ASAN_CC1_SPEC
-#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+#if DEFAULT_ARCH32_P
+#define ASAN_CC1_SPEC \
+ "%{%:sanitize(address):-funwind-tables %{m64:" ASAN_REJECT_SPEC "}}"
+#else
+#define ASAN_CC1_SPEC \
+ "%{%:sanitize(address):-funwind-tables %{!m32:" ASAN_REJECT_SPEC "}}"
+#endif
#undef CC1_SPEC
#if DEFAULT_ARCH32_P
Index: config/sparc/sol2.h
===================================================================
--- config/sparc/sol2.h (revision 270031)
+++ config/sparc/sol2.h (working copy)
@@ -324,7 +324,7 @@ extern const char *host_detect_local_cpu
/* -fsanitize=address is currently only supported for 32-bit. */
#define ASAN_REJECT_SPEC \
- DEF_ARCH64_SPEC("%e:-fsanitize=address is not supported in this configuration")
+ DEF_ARCH64_SPEC("%e-fsanitize=address is not supported in this configuration")
/* Register the Solaris-specific #pragma directives. */