about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-05-26 23:44:21 +0000
committerbors <bors@rust-lang.org>2025-05-26 23:44:21 +0000
commitd76fe154029e03aeb64af721beafdcef856d576a (patch)
tree0ca5fca09d584ec838a934f299144ad3293912db /compiler
parent2805e1dc4c18ed4c84d161502c48da870c56f68a (diff)
parent45ed022d636ec72dfbb22269196007b0e71a9c7d (diff)
downloadrust-d76fe154029e03aeb64af721beafdcef856d576a.tar.gz
rust-d76fe154029e03aeb64af721beafdcef856d576a.zip
Auto merge of #140790 - quininer:mac-xray, r=wesleywiser,jieyouxu
Enable xray support for Mac

https://github.com/rust-lang/rust/issues/102921

Upstream has supported Mac for a while, let's enable it.

I've tested it on M4 and it generates nop sled correctly.

* https://maskray.me/blog/2023-06-18-port-llvm-xray-to-apple-systems
* https://github.com/llvm/llvm-project/blob/llvmorg-20.1.4/clang/lib/Driver/XRayArgs.cpp#L31

try-job: x86_64-apple-1
try-job: aarch64-apple
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_target/src/spec/targets/aarch64_apple_darwin.rs1
-rw-r--r--compiler/rustc_target/src/spec/targets/x86_64_apple_darwin.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_apple_darwin.rs b/compiler/rustc_target/src/spec/targets/aarch64_apple_darwin.rs
index d3e0a32c8b8..6587abb2ba7 100644
--- a/compiler/rustc_target/src/spec/targets/aarch64_apple_darwin.rs
+++ b/compiler/rustc_target/src/spec/targets/aarch64_apple_darwin.rs
@@ -22,6 +22,7 @@ pub(crate) fn target() -> Target {
             max_atomic_width: Some(128),
             // FIXME: The leak sanitizer currently fails the tests, see #88132.
             supported_sanitizers: SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::THREAD,
+            supports_xray: true,
             ..opts
         },
     }
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_apple_darwin.rs b/compiler/rustc_target/src/spec/targets/x86_64_apple_darwin.rs
index 2f868e38f1a..64c17054780 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_apple_darwin.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_apple_darwin.rs
@@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
                 | SanitizerSet::CFI
                 | SanitizerSet::LEAK
                 | SanitizerSet::THREAD,
+            supports_xray: true,
             ..opts
         },
     }