Skip to content

Commit 34c248d

Browse files
committed
compiletest: load supports-xray from target spec
1 parent 64e27cb commit 34c248d

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

src/tools/compiletest/src/common.rs

+2
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@ pub struct TargetCfg {
578578
pub(crate) dynamic_linking: bool,
579579
#[serde(rename = "supported-sanitizers", default)]
580580
pub(crate) sanitizers: Vec<Sanitizer>,
581+
#[serde(rename = "supports-xray", default)]
582+
pub(crate) xray: bool,
581583
}
582584

583585
impl TargetCfg {

src/tools/compiletest/src/header/needs.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::common::{Config, Debugger, Sanitizer};
22
use crate::header::IgnoreDecision;
3-
use crate::util;
43

54
pub(super) fn handle_needs(
65
cache: &CachedNeedsConditions,
@@ -235,7 +234,7 @@ impl CachedNeedsConditions {
235234
sanitizer_shadow_call_stack: sanitizers.contains(&Sanitizer::ShadowCallStack),
236235
sanitizer_safestack: sanitizers.contains(&Sanitizer::Safestack),
237236
profiler_support: std::env::var_os("RUSTC_PROFILER_SUPPORT").is_some(),
238-
xray: util::XRAY_SUPPORTED_TARGETS.contains(target),
237+
xray: config.target_cfg().xray,
239238

240239
// For tests using the `needs-rust-lld` directive (e.g. for `-Zgcc-ld=lld`), we need to find
241240
// whether `rust-lld` is present in the compiler under test.

src/tools/compiletest/src/util.rs

-13
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,6 @@ use tracing::*;
99
#[cfg(test)]
1010
mod tests;
1111

12-
pub const XRAY_SUPPORTED_TARGETS: &[&str] = &[
13-
"aarch64-linux-android",
14-
"aarch64-unknown-linux-gnu",
15-
"aarch64-unknown-linux-musl",
16-
"x86_64-linux-android",
17-
"x86_64-unknown-freebsd",
18-
"x86_64-unknown-linux-gnu",
19-
"x86_64-unknown-linux-musl",
20-
"x86_64-unknown-netbsd",
21-
"x86_64-unknown-none-linuxkernel",
22-
"x86_64-unknown-openbsd",
23-
];
24-
2512
pub fn make_new_path(path: &str) -> String {
2613
assert!(cfg!(windows));
2714
// Windows just uses PATH as the library search path, so we have to

0 commit comments

Comments
 (0)