aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/Shell/helper/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/Shell/helper/build.py')
-rwxr-xr-xlldb/test/Shell/helper/build.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py
index a5a7e99..1fa8aab 100755
--- a/lldb/test/Shell/helper/build.py
+++ b/lldb/test/Shell/helper/build.py
@@ -804,7 +804,19 @@ class GccBuilder(Builder):
args.extend(self._obj_file_names())
if sys.platform == "darwin":
+ # By default, macOS doesn't allow injecting the ASAN
+ # runtime into system processes.
+ 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"
+ )
args.extend(["-isysroot", self.apple_sdk])
+ args.extend(["-Wl,-lto_library", "-Wl," + system_liblto])
+
elif self.objc_gnustep_lib:
args.extend(["-L", self.objc_gnustep_lib, "-lobjc"])
if sys.platform == "linux":