1 use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
3 pub fn target() -> Target {
5 llvm_target: "mipsel-sony-psx".into(),
7 data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
10 options: TargetOptions {
13 vendor: "sony".into(),
14 linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
17 linker: Some("rust-lld".into()),
18 relocation_model: RelocModel::Static,
19 exe_suffix: ".exe".into(),
21 // PSX doesn't natively support floats.
22 features: "+soft-float".into(),
24 // This should be 16 bits, but LLVM incorrectly tries emitting MIPS-II SYNC instructions
25 // for atomic loads and stores. This crashes rustc so we have to disable the Atomic* API
26 // until this is fixed upstream. See https://reviews.llvm.org/D122427#3420144 for more
28 max_atomic_width: Some(0),
30 // PSX does not support trap-on-condition instructions.
31 llvm_args: cvs!["-mno-check-zero-division"],
32 llvm_abiname: "o32".into(),
33 panic_strategy: PanicStrategy::Abort,