summary refs log tree commit diff
path: root/compiler/rustc_target/src
diff options
context:
space:
mode:
authorNicholas Bishop <nbishop@nbishop.net>2022-11-05 14:26:54 -0400
committerNicholas Bishop <nbishop@nbishop.net>2022-11-06 17:04:42 -0500
commit16edaa56bafca405f4bae43d3f18480af13dfc90 (patch)
tree56014447de8ef380dac8330e01e0b500415d5c15 /compiler/rustc_target/src
parent7eef946fc0e0eff40e588eab77b09b287accbec3 (diff)
downloadrust-16edaa56bafca405f4bae43d3f18480af13dfc90.tar.gz
rust-16edaa56bafca405f4bae43d3f18480af13dfc90.zip
Limit efiapi calling convention to supported arches
Supported architectures in UEFI are described here:
https://uefi.org/specs/UEFI/2.10/02_Overview.html#calling-conventions

Changes to tests modeled on 8240e7aa101815e2009c7d03b33dd2566d843e73.

https://github.com/rust-lang/rust/issues/65815
Diffstat (limited to 'compiler/rustc_target/src')
-rw-r--r--compiler/rustc_target/src/spec/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 72b088d663b..0fe600bd058 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -1941,8 +1941,10 @@ impl Target {
             | PlatformIntrinsic
             | Unadjusted
             | Cdecl { .. }
-            | EfiApi
             | RustCold => true,
+            EfiApi => {
+                ["arm", "aarch64", "riscv32", "riscv64", "x86", "x86_64"].contains(&&self.arch[..])
+            }
             X86Interrupt => ["x86", "x86_64"].contains(&&self.arch[..]),
             Aapcs { .. } => "arm" == self.arch,
             CCmseNonSecureCall => ["arm", "aarch64"].contains(&&self.arch[..]),