]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/mipsel_sony_psx.rs
Auto merge of #104679 - dvdhrm:rw/dso, r=petrochenkov
[rust.git] / compiler / rustc_target / src / spec / mipsel_sony_psx.rs
1 use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
2
3 pub fn target() -> Target {
4     Target {
5         llvm_target: "mipsel-sony-psx".into(),
6         pointer_width: 32,
7         data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
8         arch: "mips".into(),
9
10         options: TargetOptions {
11             os: "none".into(),
12             env: "psx".into(),
13             vendor: "sony".into(),
14             linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
15             cpu: "mips1".into(),
16             executables: true,
17             linker: Some("rust-lld".into()),
18             relocation_model: RelocModel::Static,
19             exe_suffix: ".exe".into(),
20
21             // PSX doesn't natively support floats.
22             features: "+soft-float".into(),
23
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
27             // info.
28             max_atomic_width: Some(0),
29
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,
34             ..Default::default()
35         },
36     }
37 }