Add a sparc-unknown-none-elf target.

Tested with the Gaisler bcc2 toolchain (both gcc and clang) and the Leon3 simulator.
上级 d8899c57
......@@ -1433,6 +1433,8 @@ fn $module() {
("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),
......
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 @@
"s390x-unknown-linux-gnu",
"sparc64-unknown-linux-gnu",
"sparcv9-sun-solaris",
"sparc-unknown-none-elf",
"thumbv6m-none-eabi",
"thumbv7em-none-eabi",
"thumbv7em-none-eabihf",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册