aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/Shell/helper/toolchain.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/Shell/helper/toolchain.py')
-rw-r--r--lldb/test/Shell/helper/toolchain.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/lldb/test/Shell/helper/toolchain.py b/lldb/test/Shell/helper/toolchain.py
index 728f634..0c8c39d 100644
--- a/lldb/test/Shell/helper/toolchain.py
+++ b/lldb/test/Shell/helper/toolchain.py
@@ -226,7 +226,7 @@ def use_support_substitutions(config):
except OSError:
res = -1
if res == 0 and out:
- sdk_path = lit.util.to_string(out)
+ sdk_path = out.decode("utf-8")
llvm_config.lit_config.note("using SDKROOT: %r" % sdk_path)
host_flags += ["-isysroot", sdk_path]
elif sys.platform != "win32":
@@ -250,6 +250,15 @@ def use_support_substitutions(config):
"-L{}".format(config.libcxx_libs_dir),
"-lc++",
]
+ # By default, macOS doesn't allow injecting the ASAN runtime into system processes.
+ if platform.system() in ["Darwin"] and config.llvm_use_sanitizer:
+ system_clang = (
+ subprocess.check_output(["xcrun", "-find", "clang"]).strip().decode("utf-8")
+ )
+ system_liblto = os.path.join(
+ os.path.dirname(os.path.dirname(system_clang)), "lib", "libLTO.dylib"
+ )
+ host_flags += ["-Wl,-lto_library", "-Wl," + system_liblto]
host_flags = " ".join(host_flags)
config.substitutions.append(("%clang_host", "%clang " + host_flags))
@@ -268,6 +277,9 @@ def use_support_substitutions(config):
required=True,
use_installed=True,
)
+ if llvm_config.clang_has_bounds_safety():
+ llvm_config.lit_config.note("clang has -fbounds-safety support")
+ config.available_features.add("clang-bounds-safety")
if sys.platform == "win32":
_use_msvc_substitutions(config)