Skip to content

Commit 7478987

Browse files
committed
Add platform support document for riscv64gc-unknown-linux-musl
1 parent 25e24a0 commit 7478987

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

src/doc/rustc/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
- [riscv32im-risc0-zkvm-elf](platform-support/riscv32im-risc0-zkvm-elf.md)
6666
- [riscv32imac-unknown-xous-elf](platform-support/riscv32imac-unknown-xous-elf.md)
6767
- [riscv32*-unknown-none-elf](platform-support/riscv32-unknown-none-elf.md)
68+
- [riscv64gc-unknown-linux-musl](platform-support/riscv64gc-unknown-linux-musl.md)
6869
- [sparc-unknown-none-elf](./platform-support/sparc-unknown-none-elf.md)
6970
- [*-pc-windows-gnullvm](platform-support/pc-windows-gnullvm.md)
7071
- [\*-nto-qnx-\*](platform-support/nto-qnx.md)

src/doc/rustc/src/platform-support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ target | notes
9797
`powerpc64-unknown-linux-gnu` | PPC64 Linux (kernel 3.2, glibc 2.17)
9898
`powerpc64le-unknown-linux-gnu` | PPC64LE Linux (kernel 3.10, glibc 2.17)
9999
`riscv64gc-unknown-linux-gnu` | RISC-V Linux (kernel 4.20, glibc 2.29)
100+
`riscv64gc-unknown-linux-musl` | RISC-V Linux (kernel 4.20, musl 1.2.3)
100101
`s390x-unknown-linux-gnu` | S390x Linux (kernel 3.2, glibc 2.17)
101102
`x86_64-unknown-freebsd` | 64-bit FreeBSD
102103
`x86_64-unknown-illumos` | illumos
@@ -352,7 +353,6 @@ target | std | host | notes
352353
[`riscv64gc-unknown-hermit`](platform-support/hermit.md) | ✓ | | RISC-V Hermit
353354
`riscv64gc-unknown-freebsd` | | | RISC-V FreeBSD
354355
`riscv64gc-unknown-fuchsia` | | | RISC-V Fuchsia
355-
`riscv64gc-unknown-linux-musl` | | | RISC-V Linux (kernel 4.20, musl 1.2.3)
356356
[`riscv64gc-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | RISC-V NetBSD
357357
[`riscv64gc-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/riscv64
358358
[`riscv64-linux-android`](platform-support/android.md) | | | RISC-V 64-bit Android
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# riscv64gc-unknown-linux-musl
2+
3+
**Tier: 2**
4+
5+
Target for RISC-V Linux programs using musl libc.
6+
7+
## Target maintainers
8+
9+
- [@Amanieu](https://github.com/Amanieu)
10+
- [@kraj](https://github.com/kraj)
11+
12+
## Requirements
13+
14+
Building the target itself requires a RISC-V compiler that is supported by `cc-rs`.
15+
16+
## Building the target
17+
18+
The target can be built by enabling it for a `rustc` build.
19+
20+
```toml
21+
[build]
22+
target = ["riscv64gc-unknown-linux-musl"]
23+
```
24+
25+
Make sure your C compiler is included in `$PATH`, then add it to the `config.toml`:
26+
27+
```toml
28+
[target.riscv64gc-unknown-linux-musl]
29+
cc = "riscv64-linux-gnu-gcc"
30+
cxx = "riscv64-linux-gnu-g++"
31+
ar = "riscv64-linux-gnu-ar"
32+
linker = "riscv64-linux-gnu-gcc"
33+
```
34+
35+
## Building Rust programs
36+
37+
This target are distributed through `rustup`, and otherwise require no
38+
special configuration.
39+
40+
## Cross-compilation
41+
42+
This target can be cross-compiled from any host.
43+
44+
## Testing
45+
46+
This target can be tested as normal with `x.py` on a RISC-V host or via QEMU
47+
emulation.

0 commit comments

Comments
 (0)