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

[docs] Update armv6k-nintendo-3ds platform docs for outdated info #120937

Merged
Merged
Changes from all commits
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
26 changes: 12 additions & 14 deletions src/doc/rustc/src/platform-support/armv6k-nintendo-3ds.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ from nor used with any official Nintendo SDK.

## Target maintainers

This target is maintained by members of the [@rust3ds](https://github.com/rust3ds)
organization:

- [@Meziu](https://github.com/Meziu)
- [@AzureMarker](https://github.com/AzureMarker)
- [@ian-h-chamberlain](https://github.com/ian-h-chamberlain)
Expand All @@ -35,8 +38,8 @@ Additionally, some helper crates provide implementations of some `libc` function
use by `std` that may otherwise be missing. These, or an alternate implementation
of the relevant functions, are required to use `std`:

- [`pthread-3ds`](https://github.com/Meziu/pthread-3ds) provides pthread APIs for `std::thread`.
- [`linker-fix-3ds`](https://github.com/Meziu/rust-linker-fix-3ds) fulfills some other missing libc APIs.
- [`pthread-3ds`](https://github.com/rust3ds/pthread-3ds) provides pthread APIs for `std::thread`.
- [`shim-3ds`](https://github.com/rust3ds/shim-3ds) fulfills some other missing libc APIs (e.g. `getrandom`).

Binaries built for this target should be compatible with all variants of the
3DS (and 2DS) hardware and firmware, but testing is limited and some versions may
Expand Down Expand Up @@ -74,32 +77,27 @@ export CFLAGS_armv6k_nintendo_3ds="-mfloat-abi=hard -mtune=mpcore -mtp=soft -mar
Rust does not yet ship pre-compiled artifacts for this target.

The recommended way to build binaries is by using the
[cargo-3ds](https://github.com/Meziu/cargo-3ds) tool, which uses `build-std`
[cargo-3ds](https://github.com/rust3ds/cargo-3ds) tool, which uses `build-std`
and provides commands that work like the usual `cargo run`, `cargo build`, etc.
The `cargo 3ds new` will automatically set up a new project with the dependencies
needed to build a simple binary.

You can also build Rust with the target enabled (see
[Building the target](#building-the-target) above).

As mentioned in [Requirements](#requirements), programs that use `std` must link
against both the devkitARM toolchain and libraries providing the `libc` APIs used
in `std`. There is a general-purpose utility crate for working with nonstandard
APIs provided by the OS: [`ctru-rs`](https://github.com/Meziu/ctru-rs).
APIs provided by the OS: [`ctru-rs`](https://github.com/rust3ds/ctru-rs).
Add it to Cargo.toml to use it in your program:

```toml
[dependencies]
ctru-rs = { git = "https://github.com/Meziu/ctru-rs.git" }
ctru-rs = { git = "https://github.com/rust3ds/ctru-rs.git" }
```

Using this library's `init()` function ensures the symbols needed to link
against `std` are present (as mentioned in [Requirements](#requirements)
above), as well as providing a runtime suitable for `std`:

```rust,ignore (requires-3rd-party-library)
fn main() {
ctru::init();
}
```
Depending on `ctru-rs` ensures that all the necessary symbols are available at
link time.

## Testing

Expand Down
Loading