Skip to content

Commit 094fd6b

Browse files
author
AMG
committed
feat: added support for psvita platform
1 parent 7734cb8 commit 094fd6b

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
2+
use crate::abi::Endian;
3+
4+
/// A base target for PlayStation Vita devices using the VITASDK toolchain.
5+
///
6+
/// Requires the VITASDK toolchain on the host system.
7+
8+
pub fn target() -> Target {
9+
let mut pre_link_args = LinkArgs::new();
10+
pre_link_args.insert(
11+
LinkerFlavor::Gcc,
12+
vec![
13+
"-Wl,-q".to_string(),
14+
],
15+
);
16+
17+
Target {
18+
llvm_target: "armv7a-vita-eabihf".to_string(),
19+
pointer_width: 32,
20+
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
21+
arch: "arm".to_string(),
22+
23+
options: TargetOptions {
24+
os: "vita".to_string(),
25+
endian: Endian::Little,
26+
c_int_width: "32".to_string(),
27+
dynamic_linking: false,
28+
env: "newlib".to_string(),
29+
vendor: "sony".to_string(),
30+
abi: "eabihf".to_string(),
31+
linker_flavor: LinkerFlavor::Gcc,
32+
linker_is_gnu: true,
33+
no_default_libraries: false,
34+
cpu: "cortex-a9".to_string(),
35+
executables: true,
36+
families: vec!["unix".to_string()],
37+
linker: Some("arm-vita-eabi-gcc".to_string()),
38+
relocation_model: RelocModel::Static,
39+
features: "+v7,+neon".to_string(),
40+
pre_link_args,
41+
exe_suffix: ".elf".to_string(),
42+
panic_strategy: PanicStrategy::Abort,
43+
max_atomic_width: Some(32),
44+
..Default::default()
45+
},
46+
}
47+
}

compiler/rustc_target/src/spec/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,8 @@ supported_targets! {
956956

957957
("armv6k-nintendo-3ds", armv6k_nintendo_3ds),
958958

959+
("armv7-sony-vita-eabihf", armv7_sony_vita_eabihf),
960+
959961
("armv7-unknown-linux-uclibceabihf", armv7_unknown_linux_uclibceabihf),
960962

961963
("x86_64-unknown-none", x86_64_unknown_none),

0 commit comments

Comments
 (0)