Hi!

While these two sanitizing modes don't conflict on the compiler side, the
runtimes are incompatible with each other (each assumes different memory
layout).  We'd need a special runtime library that would handle both at the
same time, probably not worth the hassle.

Ok for trunk/4.8?

2013-05-06  Jakub Jelinek  <ja...@redhat.com>

        * gcc.c (SANITIZER_SPEC): Reject -fsanitize=address -fsanitize=thread
        linking.

--- gcc/gcc.c.jj        2013-04-15 16:55:04.000000000 +0200
+++ gcc/gcc.c   2013-05-06 17:25:42.306455151 +0200
@@ -716,7 +716,8 @@ proper position among the other output f
 #ifndef SANITIZER_SPEC
 #define SANITIZER_SPEC "\
 %{!nostdlib:%{!nodefaultlibs:%{fsanitize=address:" LIBASAN_SPEC "\
-    %{static:%ecannot specify -static with -fsanitize=address}}\
+    %{static:%ecannot specify -static with -fsanitize=address}\
+    %{fsanitize=thread:%e-fsanitize=address is incompatible with 
-fsanitize=thread}}\
     %{fsanitize=thread:" LIBTSAN_SPEC "\
     %{!pie:%{!shared:%e-fsanitize=thread linking must be done with -pie or 
-shared}}}}}"
 #endif

        Jakub

Reply via email to