This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Don't run tsan tests if a trivial test doesn't work
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Dmitry Vyukov <dvyukov at google dot com>
- Date: Fri, 31 Jan 2014 12:34:46 +0100
- Subject: [PATCH] Don't run tsan tests if a trivial test doesn't work
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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