diff options
| author | quininer <quininer@live.com> | 2025-05-08 17:56:09 +0800 |
|---|---|---|
| committer | quininer <quininer@live.com> | 2025-05-24 15:06:53 +0800 |
| commit | 1758f07cb832e9a854f34af437878a10f22dae82 (patch) | |
| tree | d9c6be2e76d2db0200ba3a180fa0739e74f28518 | |
| parent | 105354db48223b7bf799b05d4dd3a412aca7bd05 (diff) | |
| download | rust-1758f07cb832e9a854f34af437878a10f22dae82.tar.gz rust-1758f07cb832e9a854f34af437878a10f22dae82.zip | |
Enable xray support for Mac
* 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
3 files changed, 3 insertions, 1 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 }, } diff --git a/tests/ui/instrument-xray/target-not-supported.rs b/tests/ui/instrument-xray/target-not-supported.rs index 2045913b186..697db6bd4b7 100644 --- a/tests/ui/instrument-xray/target-not-supported.rs +++ b/tests/ui/instrument-xray/target-not-supported.rs @@ -1,7 +1,7 @@ // Verifies that `-Z instrument-xray` cannot be used with unsupported targets, // //@ needs-llvm-components: x86 -//@ compile-flags: -Z instrument-xray --target x86_64-apple-darwin +//@ compile-flags: -Z instrument-xray --target x86_64-pc-windows-msvc #![feature(no_core)] #![no_core] |
