]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/x86_64_unknown_none.rs
Auto merge of #97800 - pnkfelix:issue-97463-fix-aarch64-call-abi-does-not-zeroext...
[rust.git] / compiler / rustc_target / src / spec / x86_64_unknown_none.rs
1 // Generic x86-64 target for bare-metal code - Floating point disabled
2 //
3 // Can be used in conjunction with the `target-feature` and
4 // `target-cpu` compiler flags to opt-in more hardware-specific
5 // features.
6
7 use super::{CodeModel, LinkerFlavor, LldFlavor, PanicStrategy};
8 use super::{RelroLevel, StackProbeType, Target, TargetOptions};
9
10 pub fn target() -> Target {
11     let opts = TargetOptions {
12         cpu: "x86-64".into(),
13         max_atomic_width: Some(64),
14         // don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
15         stack_probes: StackProbeType::Call,
16         position_independent_executables: true,
17         static_position_independent_executables: true,
18         relro_level: RelroLevel::Full,
19         linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
20         linker: Some("rust-lld".into()),
21         features:
22             "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
23                 .into(),
24         disable_redzone: true,
25         panic_strategy: PanicStrategy::Abort,
26         code_model: Some(CodeModel::Kernel),
27         ..Default::default()
28     };
29     Target {
30         llvm_target: "x86_64-unknown-none-elf".into(),
31         pointer_width: 64,
32         data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
33             .into(),
34         arch: "x86_64".into(),
35         options: opts,
36     }
37 }