1 use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, RelocModel};
2 use crate::spec::{Target, TargetOptions};
4 // The PSP has custom linker requirements.
5 const LINKER_SCRIPT: &str = include_str!("./mipsel_sony_psp_linker_script.ld");
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()]);
12 llvm_target: "mipsel-sony-psp".to_string(),
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(),
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(),
23 linker: Some("rust-lld".to_owned()),
24 relocation_model: RelocModel::Static,
26 // PSP FPU only supports single precision floats.
27 features: "+single-float".to_string(),
29 // PSP does not support trap-on-condition instructions.
30 llvm_args: vec!["-mno-check-zero-division".to_string()],
32 link_script: Some(LINKER_SCRIPT.to_string()),