summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs')
-rw-r--r--compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs38
1 files changed, 0 insertions, 38 deletions
diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs
deleted file mode 100644
index 41ba76806..000000000
--- a/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-// This defines the amd64 target for UEFI systems as described in the UEFI specification. See the
-// uefi-base module for generic UEFI options. On x86_64 systems (mostly called "x64" in the spec)
-// UEFI systems always run in long-mode, have the interrupt-controller pre-configured and force a
-// single-CPU execution.
-// The win64 ABI is used. It differs from the sysv64 ABI, so we must use a windows target with
-// LLVM. "x86_64-unknown-windows" is used to get the minimal subset of windows-specific features.
-
-use crate::{abi::call::Conv, spec::Target};
-
-pub fn target() -> Target {
- let mut base = super::uefi_msvc_base::opts();
- base.cpu = "x86-64".into();
- base.plt_by_default = false;
- base.max_atomic_width = Some(64);
- base.entry_abi = Conv::X86_64Win64;
-
- // We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
- // enable these CPU features explicitly before their first use, otherwise their instructions
- // will trigger an exception. Rust does not inject any code that enables AVX/MMX/SSE
- // instruction sets, so this must be done by the firmware. However, existing firmware is known
- // to leave these uninitialized, thus triggering exceptions if we make use of them. Which is
- // why we avoid them and instead use soft-floats. This is also what GRUB and friends did so
- // far.
- //
- // If you initialize FP units yourself, you can override these flags with custom linker
- // arguments, thus giving you access to full MMX/SSE acceleration.
- base.features = "-mmx,-sse,+soft-float".into();
-
- Target {
- llvm_target: "x86_64-unknown-windows".into(),
- pointer_width: 64,
- data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
- .into(),
- arch: "x86_64".into(),
-
- options: base,
- }
-}