You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#116518 - vita-rust:vita, r=workingjubilee
Updated libc and doc for Vita target
Doc changes:
- Updated Vita target readme. The recommended approach to build artifacts for the platform now is [cargo-vita](https://crates.io/crates/cargo-vita) which wraps all the convoluted steps previously described in a yaml for `cargo-make`
- Updated maintainer list for Vita target. (`@ZetaNumbers` `@pheki` please agree to be added to the list, `@amg98` please let us know if you're still planning on actively maintaining target support)
Code changes:
- ~Updated libc for rust-lang/libc#3284 and rust-lang/libc#3366~ (Already merged in rust-lang#116527)
- In dupfd changed the flag same as for esp target, there is no CLOEXEC on Vita
- Enabled `new_pair` since we've implemented `socketpair` in Vita newlib
[`armv7-sony-vita-newlibeabihf`](platform-support/armv7-sony-vita-newlibeabihf.md) | ? | | ARMv7-A Cortex-A9 Sony PlayStation Vita (requires VITASDK toolchain)
247
+
[`armv7-sony-vita-newlibeabihf`](platform-support/armv7-sony-vita-newlibeabihf.md) | ✓ | | ARMv7-A Cortex-A9 Sony PlayStation Vita (requires VITASDK toolchain)
Copy file name to clipboardexpand all lines: src/doc/rustc/src/platform-support/armv7-sony-vita-newlibeabihf.md
+34-103
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,16 @@
2
2
3
3
**Tier: 3**
4
4
5
-
This tier supports the ARM Cortex A9 processor running on a PlayStation Vita console.`armv7-vita-newlibeabihf` aims to have support for `std` crate using `newlib` as a bridge.
5
+
This tier supports the ARM Cortex A9 processor running on a PlayStation Vita console.
6
6
7
7
Rust support for this target is not affiliated with Sony, and is not derived
To test your developed rust programs on PlayStation Vita, first you must correctly package your elf. These steps can be preformed using tools available in VITASDK, and can be automated using a tool like `cargo-make`.
41
+
The recommended way to build artifacts that can be installed and run on PlayStation Vita is by using the [cargo-vita](https://github.com/vita-rust/cargo-vita) tool. This tool uses `build-std` and VITASDK toolchain to build artifacts runnable on Vita.
42
+
43
+
To install the tool run:
44
+
45
+
```sh
46
+
cargo install cargo-vita
47
+
```
43
48
44
-
First, set up environment variables for `VITASDK`, and it's binaries:
49
+
[VITASDK](https://vitasdk.org/) toolchain must be installed, and the `VITASDK` environment variable must be set to its location, e.g.:
45
50
46
51
```sh
47
52
export VITASDK=/opt/vitasdk
48
-
export PATH=$PATH:$VITASDK/bin
49
53
```
50
54
51
-
Use the example below as a template for your project:
55
+
Add the following section to your project's `Cargo.toml`:
56
+
52
57
53
58
```toml
54
-
[env]
55
-
TITLE = "Rust Hello World"
56
-
TITLEID = "RUST00001"
57
-
58
-
# At least a "sce_sys" folder should be place there for app metadata (title, icons, description...)
59
-
# You can find sample assets for that on $VITASDK/share/gcc-arm-vita-eabi/samples/hello_world/sce_sys/
60
-
STATIC_DIR = "static"# Folder where static assets should be placed (sce_sys folder is at $STATIC_DIR/sce_sys)
# A unique 9 character alphanumeric identifier of the app.
61
+
title_id = "RUSTAPP01"
62
+
# A title that will be used for the app. Optional, name will be used if not defined
63
+
title_name = "My application"
141
64
```
142
65
143
-
After running the above script, you should be able to get a *.vpk file in the same folder your *.elf executable resides. Now you can pick it and install it on your own PlayStation Vita using, or you can use an [Vita3K](https://vita3k.org/) emulator.
66
+
To build a VPK with ELF in the release profile, run:
67
+
68
+
```sh
69
+
cargo vita build vpk --release
70
+
```
71
+
72
+
After building a *.vpk file it can be uploaded to a PlayStation Vita and installed, or used with a [Vita3K](https://vita3k.org/) emulator.
144
73
145
74
## Testing
146
75
147
-
Currently there is no support to run the rustc test suite for this target.
76
+
The default Rust test runner is supported, and tests can be compiled to an elf and packed to a *.vpk file using `cargo-vita` tool. Filtering tests is not currently supported since passing command-line arguments to the executable is not supported on Vita, so the runner will always execute all tests.
77
+
78
+
The Rust test suite for `library/std` is not yet supported.
148
79
149
80
## Cross-compilation
150
81
151
-
This target can be cross-compiled from `x86_64` on either Windows, MacOS or Linux systems. Other hosts are not supported for cross-compilation.
82
+
This target can be cross-compiled from `x86_64` on Windows, MacOS or Linux systems. Other hosts are not supported for cross-compilation.
0 commit comments