1 // Generic x86-64 target for bare-metal code - Floating point disabled
3 // Can be used in conjunction with the `target-feature` and
4 // `target-cpu` compiler flags to opt-in more hardware-specific
8 CodeModel, LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, RelroLevel, StackProbeType,
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()),
25 "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
28 disable_redzone: true,
29 panic_strategy: PanicStrategy::Abort,
30 code_model: Some(CodeModel::Kernel),
34 llvm_target: "x86_64-unknown-none-elf".to_string(),
36 data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
38 arch: "x86_64".to_string(),