diff --git a/compiler-rt/lib/tsan/lit_tests/Unit/lit.cfg b/compiler-rt/lib/tsan/lit_tests/Unit/lit.cfg index c7aa0c17c20e..36585df1c671 100644 --- a/compiler-rt/lib/tsan/lit_tests/Unit/lit.cfg +++ b/compiler-rt/lib/tsan/lit_tests/Unit/lit.cfg @@ -21,11 +21,3 @@ config.test_exec_root = os.path.join(llvm_obj_root, "projects", "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) - diff --git a/compiler-rt/lib/tsan/lit_tests/lit.cfg b/compiler-rt/lib/tsan/lit_tests/lit.cfg index 600290d2360b..0cdb4d838941 100644 --- a/compiler-rt/lib/tsan/lit_tests/lit.cfg +++ b/compiler-rt/lib/tsan/lit_tests/lit.cfg @@ -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 diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index 9703bb46a892..cb95df4e90aa 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -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);