[compiler-rt] r191954 - [TSan] Automatically pick up llvm-symbolizer from PATH, as we do in another sanitizers
Alexey Samsonov
samsonov at google.com
Fri Oct 4 06:38:36 PDT 2013
Author: samsonov
Date: Fri Oct 4 08:38:35 2013
New Revision: 191954
URL: http://llvm.org/viewvc/llvm-project?rev=191954&view=rev
Log:
[TSan] Automatically pick up llvm-symbolizer from PATH, as we do in another sanitizers
Modified:
compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg
compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc
Modified: compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg?rev=191954&r1=191953&r2=191954&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/Unit/lit.cfg Fri Oct 4 08:38:35 2013
@@ -21,11 +21,3 @@ config.test_exec_root = os.path.join(llv
"compiler-rt", "lib",
"tsan", "tests")
config.test_source_root = config.test_exec_root
-
-# Get path to external LLVM symbolizer to run ThreadSanitizer unit tests.
-llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
-if llvm_tools_dir:
- llvm_symbolizer_path = os.path.join(llvm_tools_dir, "llvm-symbolizer")
- config.environment['TSAN_OPTIONS'] = ("external_symbolizer_path=" +
- llvm_symbolizer_path)
-
Modified: compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg?rev=191954&r1=191953&r2=191954&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/lit.cfg Fri Oct 4 08:38:35 2013
@@ -53,8 +53,6 @@ if llvm_src_root is None:
# Setup environment variables for running ThreadSanitizer.
tsan_options = "atexit_sleep_ms=0"
-# Set path to external LLVM symbolizer to run ThreadSanitizer output tests.
-tsan_options += " " + "external_symbolizer_path=" + config.llvm_symbolizer_path
config.environment['TSAN_OPTIONS'] = tsan_options
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc?rev=191954&r1=191953&r2=191954&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc Fri Oct 4 08:38:35 2013
@@ -238,12 +238,13 @@ void Initialize(ThreadState *thr) {
InitializeLibIgnore();
// Initialize external symbolizer before internal threads are started.
const char *external_symbolizer = flags()->external_symbolizer_path;
- if (external_symbolizer != 0 && external_symbolizer[0] != '\0') {
- if (!getSymbolizer()->InitializeExternal(external_symbolizer)) {
- Printf("Failed to start external symbolizer: '%s'\n",
- external_symbolizer);
- Die();
- }
+ bool symbolizer_started =
+ getSymbolizer()->InitializeExternal(external_symbolizer);
+ if (external_symbolizer != 0 && external_symbolizer[0] != '\0' &&
+ !symbolizer_started) {
+ Printf("Failed to start external symbolizer: '%s'\n",
+ external_symbolizer);
+ Die();
}
#endif
internal_start_thread(&BackgroundThread, 0);
More information about the llvm-commits
mailing list