gcc.c (SANITIZER_SPEC): Don't error on -fsanitize=thread without -pie or -shared...
authorJakub Jelinek <jakub@redhat.com>
Wed, 26 Nov 2014 19:54:49 +0000 (20:54 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 26 Nov 2014 19:54:49 +0000 (20:54 +0100)
* gcc.c (SANITIZER_SPEC): Don't error on -fsanitize=thread
without -pie or -shared, error on -fsanitize=thread -static instead.

* lib/tsan-dg.exp (check_effective_target_fsanitize_thread,
tsan_init): Don't use -fPIE or -pie.

From-SVN: r218097

gcc/ChangeLog
gcc/gcc.c
gcc/testsuite/ChangeLog
gcc/testsuite/lib/tsan-dg.exp

index 62dcb381af711db96f80ceffd5099fb0b31f08bb..b05939e178933b5834a0ad88bb4af46ffa965e7e 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c (SANITIZER_SPEC): Don't error on -fsanitize=thread
+       without -pie or -shared, error on -fsanitize=thread -static instead.
+
 2014-11-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
        PR ipa/61190
index b730ba53d7e33a051565643c397170c60e37a8ce..4cb4ba32618e1ea2a19d99297ad0692de29c2c14 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -794,7 +794,7 @@ proper position among the other output files.  */
 %{!nostdlib:%{!nodefaultlibs:%{%:sanitize(address):" LIBASAN_SPEC "\
     %{static:%ecannot specify -static with -fsanitize=address}}\
     %{%:sanitize(thread):" LIBTSAN_SPEC "\
-    %{!pie:%{!shared:%e-fsanitize=thread linking must be done with -pie or -shared}}}\
+    %{static:%ecannot specify -static with -fsanitize=thread}}\
     %{%:sanitize(undefined):" LIBUBSAN_SPEC "}\
     %{%:sanitize(leak):" LIBLSAN_SPEC "}}}"
 #endif
index c3dcfd2cbf466bf63d157bde889c94b76cc141d6..b8239da914864e347c13b2435f51772571c558a4 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * lib/tsan-dg.exp (check_effective_target_fsanitize_thread,
+       tsan_init): Don't use -fPIE or -pie.
+
 2014-11-26  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
        PR ipa/61190
index 77c85ff24cac78ffc96bfaaed2f4fca2eb299548..db3c263c9ac2947edbbb9c87adaf55684c01b7f5 100644 (file)
@@ -18,9 +18,9 @@
 # code, 0 otherwise.
 
 proc check_effective_target_fsanitize_thread {} {
-    return [check_no_compiler_messages fanitize_thread executable {
+    return [check_no_compiler_messages fsanitize_thread executable {
        int main (void) { return 0; }
-    } "-fPIE -pie -fsanitize=thread"]
+    } "-fsanitize=thread"]
 }
 
 #
@@ -93,12 +93,12 @@ proc tsan_init { args } {
     if [info exists ALWAYS_CXXFLAGS] {
        set tsan_saved_ALWAYS_CXXFLAGS $ALWAYS_CXXFLAGS
        set ALWAYS_CXXFLAGS [concat "{ldflags=$link_flags}" $ALWAYS_CXXFLAGS]
-       set ALWAYS_CXXFLAGS [concat "{additional_flags=-fPIE -pie -fsanitize=thread -g}" $ALWAYS_CXXFLAGS]
+       set ALWAYS_CXXFLAGS [concat "{additional_flags=-fsanitize=thread -g}" $ALWAYS_CXXFLAGS]
     } else {
        if [info exists TEST_ALWAYS_FLAGS] {
-           set TEST_ALWAYS_FLAGS "$link_flags -fPIE -pie -fsanitize=thread -g $TEST_ALWAYS_FLAGS"
+           set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=thread -g $TEST_ALWAYS_FLAGS"
        } else {
-           set TEST_ALWAYS_FLAGS "$link_flags -fPIE -pie -fsanitize=thread -g"
+           set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=thread -g"
        }
     }
 
@@ -110,7 +110,7 @@ proc tsan_init { args } {
        set individual_timeout 20
        if [check_runtime_nocache tsan_works {
                int main () { return 0; }
-           } "-fPIE -pie -fsanitize=thread -g"] {
+           } "-fsanitize=thread -g"] {
            set dg-do-what-default run
        } else {
            set dg-do-what-default compile