]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/spec/mipsel_sony_psp.rs
Rollup merge of #82497 - jyn514:json, r=CraftSpider
[rust.git] / compiler / rustc_target / src / spec / mipsel_sony_psp.rs
1 use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, RelocModel};
2 use crate::spec::{Target, TargetOptions};
3
4 // The PSP has custom linker requirements.
5 const LINKER_SCRIPT: &str = include_str!("./mipsel_sony_psp_linker_script.ld");
6
7 pub fn target() -> Target {
8     let mut pre_link_args = LinkArgs::new();
9     pre_link_args.insert(LinkerFlavor::Lld(LldFlavor::Ld), vec!["--emit-relocs".to_string()]);
10
11     Target {
12         llvm_target: "mipsel-sony-psp".to_string(),
13         pointer_width: 32,
14         data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
15         arch: "mips".to_string(),
16
17         options: TargetOptions {
18             os: "psp".to_string(),
19             vendor: "sony".to_string(),
20             linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
21             cpu: "mips2".to_string(),
22             executables: true,
23             linker: Some("rust-lld".to_owned()),
24             linker_is_gnu: true,
25             relocation_model: RelocModel::Static,
26
27             // PSP FPU only supports single precision floats.
28             features: "+single-float".to_string(),
29
30             // PSP does not support trap-on-condition instructions.
31             llvm_args: vec!["-mno-check-zero-division".to_string()],
32             pre_link_args,
33             link_script: Some(LINKER_SCRIPT.to_string()),
34             ..Default::default()
35         },
36     }
37 }