From 8e49c847400b0ec47d501a72e3c0ad95f81b5fe9 Mon Sep 17 00:00:00 2001 From: Oleksii Lozovskyi Date: Sun, 2 Oct 2022 10:45:54 +0900 Subject: XRay support flag in TargetOptions Specify where XRay is supported. I only test ARM64 and x86_64, but hey those others should work too, right? LLVM documentation says that MIPS and PPC are also supported, but I don't have the hardware, so I won't pretend. Naturally, more targets can be added later with more testing. --- compiler/rustc_target/src/spec/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/rustc_target/src/spec/mod.rs') diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index a094c2c5452..bc1920e3424 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1718,6 +1718,9 @@ pub struct TargetOptions { /// The ABI of entry function. /// Default value is `Conv::C`, i.e. C call convention pub entry_abi: Conv, + + /// Whether the target supports XRay instrumentation. + pub supports_xray: bool, } /// Add arguments for the given flavor and also for its "twin" flavors @@ -1937,6 +1940,7 @@ impl Default for TargetOptions { supports_stack_protector: true, entry_name: "main".into(), entry_abi: Conv::C, + supports_xray: false, } } } @@ -2592,6 +2596,7 @@ impl Target { key!(supports_stack_protector, bool); key!(entry_name); key!(entry_abi, Conv)?; + key!(supports_xray, bool); if base.is_builtin { // This can cause unfortunate ICEs later down the line. @@ -2845,6 +2850,7 @@ impl ToJson for Target { target_option_val!(supports_stack_protector); target_option_val!(entry_name); target_option_val!(entry_abi); + target_option_val!(supports_xray); if let Some(abi) = self.default_adjusted_cabi { d.insert("default-adjusted-cabi".into(), Abi::name(abi).to_json()); -- cgit 1.4.1-3-g733a5