[PATCH] Don't run tsan tests if a trivial test doesn't work

Jakub Jelinek jakub@redhat.com
Fri Jan 31 12:10:00 GMT 2014


Hi!

Apparently tsan doesn't work e.g. under setarch x86_64 -R, at which point
all tests fail.  This patch just disables the tests in that case.

Tested on x86_64-linux both under setarch x86_64 -R and without, committed
to trunk as obvious.

Of course it would be nicer if libtsan actually supported that (and didn't
rely on PIEs etc.), but I don't see that as a priority for upstream :(.

2014-01-31  Jakub Jelinek  <jakub@redhat.com>

	* lib/tsan-dg.exp (tsan_init): Try to run a trivial program,
	if it fails don't run any tsan tests.

--- gcc/testsuite/lib/tsan-dg.exp.jj	2014-01-03 11:40:40.000000000 +0100
+++ gcc/testsuite/lib/tsan-dg.exp	2014-01-31 12:15:06.659406282 +0100
@@ -93,7 +93,11 @@ proc tsan_init { args } {
 	}
     }
     if { $link_flags != "" } {
-	return 1
+	if [check_runtime_nocache tsan_works {
+		int main () { return 0; }
+	    } "-fPIE -pie -fsanitize=thread -g"] {
+	    return 1
+	}
     }
     return 0
 }

	Jakub



More information about the Gcc-patches mailing list