1 use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, RelocModel};
2 use crate::spec::{Target, TargetOptions, TargetResult};
4 // The PSP has custom linker requirements.
5 const LINKER_SCRIPT: &str = include_str!("./mipsel_sony_psp_linker_script.ld");
7 pub fn target() -> TargetResult {
8 let mut pre_link_args = LinkArgs::new();
10 LinkerFlavor::Lld(LldFlavor::Ld),
11 vec!["--eh-frame-hdr".to_string(), "--emit-relocs".to_string()],
15 llvm_target: "mipsel-sony-psp".to_string(),
16 target_endian: "little".to_string(),
17 target_pointer_width: "32".to_string(),
18 target_c_int_width: "32".to_string(),
19 data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
20 arch: "mips".to_string(),
21 target_os: "psp".to_string(),
22 target_env: "".to_string(),
23 target_vendor: "sony".to_string(),
24 linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
26 options: TargetOptions {
27 cpu: "mips2".to_string(),
29 linker: Some("rust-lld".to_owned()),
31 relocation_model: RelocModel::Static,
33 // PSP FPU only supports single precision floats.
34 features: "+single-float".to_string(),
36 // PSP does not support trap-on-condition instructions.
37 llvm_args: vec!["-mno-check-zero-division".to_string()],
39 link_script: Some(LINKER_SCRIPT.to_string()),