]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/x86_64_unknown_none.rs
Auto merge of #87869 - thomcc:skinny-io-error, r=yaahc
[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::{
8     CodeModel, LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, RelroLevel, StackProbeType,
9     Target, TargetOptions,
10 };
11
12 pub fn target() -> Target {
13     let opts = TargetOptions {
14         cpu: "x86-64".to_string(),
15         max_atomic_width: Some(64),
16         // don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved
17         stack_probes: StackProbeType::Call,
18         position_independent_executables: true,
19         static_position_independent_executables: true,
20         relro_level: RelroLevel::Full,
21         relocation_model: RelocModel::Pic,
22         linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
23         linker: Some("rust-lld".to_owned()),
24         features:
25             "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
26                 .to_string(),
27         executables: true,
28         disable_redzone: true,
29         panic_strategy: PanicStrategy::Abort,
30         code_model: Some(CodeModel::Kernel),
31         ..Default::default()
32     };
33     Target {
34         llvm_target: "x86_64-unknown-none-elf".to_string(),
35         pointer_width: 64,
36         data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
37             .to_string(),
38         arch: "x86_64".to_string(),
39         options: opts,
40     }
41 }