Skip to content

Commit 3c67b0d

Browse files
committed
Add new target: x86_64-unknown-none-elf
1 parent 08a0307 commit 3c67b0d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,8 @@ supported_targets! {
943943
("bpfel-unknown-none", bpfel_unknown_none),
944944

945945
("armv6k-nintendo-3ds", armv6k_nintendo_3ds),
946+
947+
("x86_64-unknown-none-elf", x86_64_unknown_none_elf),
946948
}
947949

948950
/// Warnings encountered when parsing the target `json`.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Generic AArch64 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+
// For example, `-C target-cpu=cortex-a53`.
8+
9+
use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
10+
11+
pub fn target() -> Target {
12+
let opts = TargetOptions {
13+
abi: "softfloat".to_string(),
14+
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
15+
linker: Some("rust-lld".to_owned()),
16+
features: "-mmx,-sse,+soft-float".to_string(),
17+
executables: true,
18+
disable_redzone: true,
19+
panic_strategy: PanicStrategy::Abort,
20+
..Default::default()
21+
};
22+
Target {
23+
llvm_target: "x86_64-unknown-none-elf".to_string(),
24+
pointer_width: 64,
25+
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128".to_string(),
26+
arch: "x86_64".to_string(),
27+
options: opts,
28+
}
29+
}

0 commit comments

Comments
 (0)