Add a sparc-unknown-none-elf target.
Tested with the Gaisler bcc2 toolchain (both gcc and clang) and the Leon3 simulator.
This commit is contained in:
parent
d8899c577b
commit
d30294e33c
4 changed files with 31 additions and 0 deletions
|
@ -1433,6 +1433,8 @@ supported_targets! {
|
|||
("riscv64gc-unknown-linux-gnu", riscv64gc_unknown_linux_gnu),
|
||||
("riscv64gc-unknown-linux-musl", riscv64gc_unknown_linux_musl),
|
||||
|
||||
("sparc-unknown-none-elf", sparc_unknown_none_elf),
|
||||
|
||||
("loongarch64-unknown-none", loongarch64_unknown_none),
|
||||
("loongarch64-unknown-none-softfloat", loongarch64_unknown_none_softfloat),
|
||||
|
||||
|
|
27
compiler/rustc_target/src/spec/sparc_unknown_none_elf.rs
Normal file
27
compiler/rustc_target/src/spec/sparc_unknown_none_elf.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
use crate::abi::Endian;
|
||||
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
|
||||
|
||||
pub fn target() -> Target {
|
||||
let options = TargetOptions {
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
|
||||
linker: Some("sparc-elf-gcc".into()),
|
||||
endian: Endian::Big,
|
||||
cpu: "v7".into(),
|
||||
abi: "elf".into(),
|
||||
max_atomic_width: Some(32),
|
||||
atomic_cas: true,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
relocation_model: RelocModel::Static,
|
||||
no_default_libraries: false,
|
||||
emit_debug_gdb_scripts: false,
|
||||
eh_frame_header: false,
|
||||
..Default::default()
|
||||
};
|
||||
Target {
|
||||
data_layout: "E-m:e-p:32:32-i64:64-f128:64-n32-S64".into(),
|
||||
llvm_target: "sparc-unknown-none-elf".into(),
|
||||
pointer_width: 32,
|
||||
arch: "sparc".into(),
|
||||
options,
|
||||
}
|
||||
}
|
|
@ -176,6 +176,7 @@ target | std | notes
|
|||
`thumbv8m.base-none-eabi` | * | Bare ARMv8-M Baseline
|
||||
`thumbv8m.main-none-eabi` | * | Bare ARMv8-M Mainline
|
||||
`thumbv8m.main-none-eabihf` | * | Bare ARMv8-M Mainline, hardfloat
|
||||
`sparc-unknown-none-elf` | * | Bare 32-bit SPARC V7+
|
||||
`wasm32-unknown-emscripten` | ✓ | WebAssembly via Emscripten
|
||||
`wasm32-unknown-unknown` | ✓ | WebAssembly
|
||||
`wasm32-wasi` | ✓ | WebAssembly with WASI
|
||||
|
|
|
@ -127,6 +127,7 @@ static TARGETS: &[&str] = &[
|
|||
"s390x-unknown-linux-gnu",
|
||||
"sparc64-unknown-linux-gnu",
|
||||
"sparcv9-sun-solaris",
|
||||
"sparc-unknown-none-elf",
|
||||
"thumbv6m-none-eabi",
|
||||
"thumbv7em-none-eabi",
|
||||
"thumbv7em-none-eabihf",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue