Not all options were propageted into tests.
Reviewed By: ychen
Differential Revision: https://reviews.llvm.org/D122869
if 'TEMP' in os.environ:
config.environment['TEMP'] = os.environ['TEMP']
-# Propagate path to symbolizer for ASan/MSan.
-for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
- if symbolizer in os.environ:
- config.environment[symbolizer] = os.environ[symbolizer]
+# Propagate sanitizer options.
+for var in [
+ 'ASAN_SYMBOLIZER_PATH',
+ 'MSAN_SYMBOLIZER_PATH',
+ 'TSAN_SYMBOLIZER_PATH',
+ 'UBSAN_SYMBOLIZER_PATH',
+ 'ASAN_OPTIONS',
+ 'MSAN_OPTIONS',
+ 'TSAN_OPTIONS',
+ 'UBSAN_OPTIONS',
+]:
+ if var in os.environ:
+ config.environment[var] = os.environ[var]
def find_shlibpath_var():
if platform.system() in ['Linux', 'FreeBSD', 'NetBSD', 'SunOS']:
config.substitutions.append(
('%target_triple', config.target_triple))
-# Propagate path to symbolizer for ASan/MSan.
-llvm_config.with_system_environment(
- ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
-
config.substitutions.append(('%PATH%', config.environment['PATH']))
if 'compiler-rt' in config.llvm_enabled_projects:
config.available_features.add('compiler-rt')
-if config.llvm_use_sanitizer:
- # Propagate path to symbolizer for ASan/MSan.
- llvm_config.with_system_environment(
- ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
-
# Check which debuggers are available:
lldb_path = llvm_config.use_llvm_tool('lldb', search_env='LLDB')
if 'HOME' in os.environ:
config.environment['HOME'] = os.environ['HOME']
-# Propagate path to symbolizer for ASan/MSan.
-for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
- if symbolizer in os.environ:
- config.environment[symbolizer] = os.environ[symbolizer]
+# Propagate sanitizer options.
+for var in [
+ 'ASAN_SYMBOLIZER_PATH',
+ 'MSAN_SYMBOLIZER_PATH',
+ 'TSAN_SYMBOLIZER_PATH',
+ 'UBSAN_SYMBOLIZER_PATH',
+ 'ASAN_OPTIONS',
+ 'MSAN_OPTIONS',
+ 'TSAN_OPTIONS',
+ 'UBSAN_OPTIONS',
+]:
+ if var in os.environ:
+ config.environment[var] = os.environ[var]
# Win32 seeks DLLs along %PATH%.
if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
# Propagate some variables from the host environment.
llvm_config.with_system_environment(
- ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP', 'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])
+ ['HOME', 'INCLUDE', 'LIB', 'TMP', 'TEMP'])
# Set up OCAMLPATH to include newly built OCaml libraries.
if not self.use_lit_shell:
features.add('shell')
+ self.with_system_environment([
+ 'ASAN_SYMBOLIZER_PATH',
+ 'MSAN_SYMBOLIZER_PATH',
+ 'TSAN_SYMBOLIZER_PATH',
+ 'UBSAN_SYMBOLIZER_PATH'
+ 'ASAN_OPTIONS',
+ 'MSAN_OPTIONS',
+ 'TSAN_OPTIONS',
+ 'UBSAN_OPTIONS',
+ ])
+
# Running on Darwin OS
if platform.system() == 'Darwin':
# FIXME: lld uses the first, other projects use the second.
if 'HOME' in os.environ:
config.environment['HOME'] = os.environ['HOME']
-# Propagate path to symbolizer for ASan/MSan.
-for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
- if symbolizer in os.environ:
- config.environment[symbolizer] = os.environ[symbolizer]
+# Propagate sanitizer options.
+for var in [
+ 'ASAN_SYMBOLIZER_PATH',
+ 'MSAN_SYMBOLIZER_PATH',
+ 'TSAN_SYMBOLIZER_PATH',
+ 'UBSAN_SYMBOLIZER_PATH',
+ 'ASAN_OPTIONS',
+ 'MSAN_OPTIONS',
+ 'TSAN_OPTIONS',
+ 'UBSAN_OPTIONS',
+]:
+ if var in os.environ:
+ config.environment[var] = os.environ[var]
if 'TEMP' in os.environ:
config.environment['TEMP'] = os.environ['TEMP']
-# Propagate path to symbolizer for ASan/MSan.
-for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
- if symbolizer in os.environ:
- config.environment[symbolizer] = os.environ[symbolizer]
+# Propagate sanitizer options.
+for var in [
+ 'ASAN_SYMBOLIZER_PATH',
+ 'MSAN_SYMBOLIZER_PATH',
+ 'TSAN_SYMBOLIZER_PATH',
+ 'UBSAN_SYMBOLIZER_PATH',
+ 'ASAN_OPTIONS',
+ 'MSAN_OPTIONS',
+ 'TSAN_OPTIONS',
+ 'UBSAN_OPTIONS',
+]:
+ if var in os.environ:
+ config.environment[var] = os.environ[var]
if platform.system() == 'Darwin':
shlibpath_var = 'DYLD_LIBRARY_PATH'