config.environment[symbolizer] = os.environ[symbolizer]
# Propagate options for sanitizers.
-for options in ['ASAN_OPTIONS']:
+for options in ['ASAN_OPTIONS', 'UBSAN_OPTIONS']:
if options in os.environ:
config.environment[options] = os.environ[options]
if (config.llvm_use_sanitizer == "Memory" or
config.llvm_use_sanitizer == "MemoryWithOrigins"):
config.available_features.add("msan")
+if config.llvm_use_sanitizer == "Undefined":
+ config.available_features.add("ubsan")
+else:
+ config.available_features.add("not_ubsan")
# Direct object generation
if not 'hexagon' in config.target_triple:
try:
llvm_config_cmd = subprocess.Popen(
[os.path.join(llvm_tools_dir, 'llvm-config'), '--assertion-mode'],
- stdout = subprocess.PIPE)
+ stdout = subprocess.PIPE,
+ env=config.environment)
except OSError:
print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)