Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlayStation Vita support #105606

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: added support for psvita platform
  • Loading branch information
amgdev9 committed Nov 4, 2021
commit 094fd6beaf54f7458a21399a846911893246f8a6
47 changes: 47 additions & 0 deletions compiler/rustc_target/src/spec/armv7_sony_vita_eabihf.rs
Original file line number Diff line number Diff line change
@@ -0,0 1,47 @@
use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
use crate::abi::Endian;

/// A base target for PlayStation Vita devices using the VITASDK toolchain.
///
/// Requires the VITASDK toolchain on the host system.

pub fn target() -> Target {
let mut pre_link_args = LinkArgs::new();
pre_link_args.insert(
LinkerFlavor::Gcc,
vec![
"-Wl,-q".to_string(),
],
);

Target {
llvm_target: "armv7a-vita-eabihf".to_string(),
pointer_width: 32,
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".to_string(),
arch: "arm".to_string(),

options: TargetOptions {
os: "vita".to_string(),
endian: Endian::Little,
c_int_width: "32".to_string(),
dynamic_linking: false,
env: "newlib".to_string(),
vendor: "sony".to_string(),
abi: "eabihf".to_string(),
linker_flavor: LinkerFlavor::Gcc,
linker_is_gnu: true,
no_default_libraries: false,
cpu: "cortex-a9".to_string(),
executables: true,
families: vec!["unix".to_string()],
linker: Some("arm-vita-eabi-gcc".to_string()),
relocation_model: RelocModel::Static,
features: " v7, neon".to_string(),
pre_link_args,
exe_suffix: ".elf".to_string(),
panic_strategy: PanicStrategy::Abort,
max_atomic_width: Some(32),
..Default::default()
},
}
}
2 changes: 2 additions & 0 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 956,8 @@ supported_targets! {

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

("armv7-sony-vita-eabihf", armv7_sony_vita_eabihf),

("armv7-unknown-linux-uclibceabihf", armv7_unknown_linux_uclibceabihf),

("x86_64-unknown-none", x86_64_unknown_none),
Expand Down