[TSan] Automatically pick up llvm-symbolizer from PATH, as we do in another sanitizers

llvm-svn: 191954
This commit is contained in:
Alexey Samsonov 2013-10-04 13:38:35 +00:00
parent 21bf6ed730
commit 50ec07c196
3 changed files with 7 additions and 16 deletions

View File

@ -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)

View File

@ -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

View File

@ -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);