[TSan] Automatically pick up llvm-symbolizer from PATH, as we do in another sanitizers
llvm-svn: 191954
This commit is contained in:
parent
21bf6ed730
commit
50ec07c196
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue