summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-05-16 20:33:56 +0000
committerAlexey Samsonov <samsonov@google.com>2014-05-16 20:33:56 +0000
commit41c73028887080eb61ef843db16fc188bcae6c5b (patch)
treea88d771a7316493529b2235a5f26c0ff534d73a0
parent995bdd43f8577df97f20be4fff6148f9080744ba (diff)
downloadbcm5719-llvm-41c73028887080eb61ef843db16fc188bcae6c5b.tar.gz
bcm5719-llvm-41c73028887080eb61ef843db16fc188bcae6c5b.zip
[TSan] Improve support for running TSan test suite with GCC-TSan.
Test results with GCC-4.9.0: 78 expected passes, 74 unexpected failures. llvm-svn: 209014
-rw-r--r--compiler-rt/test/tsan/lit.cfg10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler-rt/test/tsan/lit.cfg b/compiler-rt/test/tsan/lit.cfg
index ef9ac91d7f1..ae2197135a7 100644
--- a/compiler-rt/test/tsan/lit.cfg
+++ b/compiler-rt/test/tsan/lit.cfg
@@ -22,14 +22,18 @@ tsan_options = "atexit_sleep_ms=0"
config.environment['TSAN_OPTIONS'] = tsan_options
+# GCC driver doesn't add necessary compile/link flags with -fsanitize=thread.
+if config.compiler_id == 'GNU':
+ extra_cflags = ["-fPIE", "-lpthread", "-ldl", "-lstdc++", "-lrt", "-pie"]
+else:
+ extra_cflags = []
+
# Setup default compiler flags used with -fsanitize=thread option.
# FIXME: Review the set of required flags and check if it can be reduced.
clang_tsan_cflags = ["-fsanitize=thread",
"-g",
"-Wall",
- "-lpthread",
- "-ldl",
- "-m64"]
+ "-m64"] + extra_cflags
clang_tsan_cxxflags = config.cxx_mode_flags + clang_tsan_cflags
# Add additional flags if we're using instrumented libc++.
if config.has_libcxx:
OpenPOWER on IntegriCloud