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,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue