Skip to main content

rustc_target/spec/targets/
aarch64_unknown_uefi.rs

1// This defines the aarch64 target for UEFI systems as described in the UEFI specification. See the
2// uefi-base module for generic UEFI options.
3// The "aarch64-unknown-uefi" LLVM target is used with LLVM 24 and later, and the
4// "aarch64-unknown-windows" target with LLVM 23 and earlier.
5
6use crate::spec::{Arch, LinkerFlavor, Lld, Target, TargetMetadata, base};
7
8pub(crate) fn target() -> Target {
9    let mut base = base::uefi_msvc::opts();
10
11    base.max_atomic_width = Some(128);
12    base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]);
13    base.features = "+v8a".into();
14
15    Target {
16        llvm_target: "aarch64-unknown-uefi".into(),
17        metadata: TargetMetadata {
18            description: Some("ARM64 UEFI".into()),
19            tier: Some(2),
20            host_tools: Some(false),
21            std: None, // ?
22        },
23        pointer_width: 64,
24        data_layout:
25            "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32"
26                .into(),
27        arch: Arch::AArch64,
28        options: base,
29    }
30}