about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-19 01:47:23 +0000
committerbors <bors@rust-lang.org>2023-09-19 01:47:23 +0000
commit19dd9535408db0f1ff3d16613619076aef524d19 (patch)
treee60e97985c242bd3df4af7b278d0ba521ac92a2f /src/bootstrap
parentf3984ce5bbd5b6ab99279617ad1b84dec7a3dd20 (diff)
parentb7e98e13cdbd6319fab38b6edc233e3d2925d567 (diff)
Auto merge of #115644 - danakj:catalyst-asan, r=cjgillot,thomcc
Enable ASAN/LSAN/TSAN for *-apple-ios-macabi

The -macabi targets are iOS running on MacOS, and they use the runtime libraries for MacOS, thus they have the same sanitizers available as the *-apple-darwin targets.

This is based on the work of https://github.com/rust-lang/rust/commit/aacf3213b142f074999429eab767ef7b53c3a1a5.

Closes #113935.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/compile.rs3
-rw-r--r--src/bootstrap/llvm.rs2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 2686a8c1752..4f19ffa83db 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -570,6 +570,9 @@ fn copy_sanitizers(
         let dst = libdir.join(&runtime.name);
         builder.copy(&runtime.path, &dst);
 
+        // The `aarch64-apple-ios-macabi` and `x86_64-apple-ios-macabi` are also supported for
+        // sanitizers, but they share a sanitizer runtime with `${arch}-apple-darwin`, so we do
+        // not list them here to rename and sign the runtime library.
         if target == "x86_64-apple-darwin"
             || target == "aarch64-apple-darwin"
             || target == "aarch64-apple-ios"
diff --git a/src/bootstrap/llvm.rs b/src/bootstrap/llvm.rs
index 07288a1863a..7e5ade50ca7 100644
--- a/src/bootstrap/llvm.rs
+++ b/src/bootstrap/llvm.rs
@@ -1063,6 +1063,7 @@ fn supported_sanitizers(
         "aarch64-apple-darwin" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
         "aarch64-apple-ios" => darwin_libs("ios", &["asan", "tsan"]),
         "aarch64-apple-ios-sim" => darwin_libs("iossim", &["asan", "tsan"]),
+        "aarch64-apple-ios-macabi" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
         "aarch64-unknown-fuchsia" => common_libs("fuchsia", "aarch64", &["asan"]),
         "aarch64-unknown-linux-gnu" => {
             common_libs("linux", "aarch64", &["asan", "lsan", "msan", "tsan", "hwasan"])
@@ -1073,6 +1074,7 @@ fn supported_sanitizers(
         "x86_64-apple-darwin" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
         "x86_64-unknown-fuchsia" => common_libs("fuchsia", "x86_64", &["asan"]),
         "x86_64-apple-ios" => darwin_libs("iossim", &["asan", "tsan"]),
+        "x86_64-apple-ios-macabi" => darwin_libs("osx", &["asan", "lsan", "tsan"]),
         "x86_64-unknown-freebsd" => common_libs("freebsd", "x86_64", &["asan", "msan", "tsan"]),
         "x86_64-unknown-netbsd" => {
             common_libs("netbsd", "x86_64", &["asan", "lsan", "msan", "tsan"])