Skip to content

Commit 796d7d2

Browse files
committed
platform-support: add riscv32imac-unknown-xous-elf
Signed-off-by: Sean Cross <[email protected]>
1 parent 9f6e687 commit 796d7d2

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

src/doc/rustc/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md)
2323
- [mips64-openwrt-linux-musl](platform-support/mips64-openwrt-linux-musl.md)
2424
- [nvptx64-nvidia-cuda](platform-support/nvptx64-nvidia-cuda.md)
25+
- [riscv32imac-unknown-xous-elf](platform-support/riscv32imac-unknown-xous-elf.md)
2526
- [*-pc-windows-gnullvm](platform-support/pc-windows-gnullvm.md)
2627
- [*-unknown-openbsd](platform-support/openbsd.md)
2728
- [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md)

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

+1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ target | std | host | notes
275275
`riscv32gc-unknown-linux-gnu` | | | RISC-V Linux (kernel 5.4, glibc 2.33)
276276
`riscv32gc-unknown-linux-musl` | | | RISC-V Linux (kernel 5.4, musl + RISCV32 support patches)
277277
`riscv32im-unknown-none-elf` | * | | Bare RISC-V (RV32IM ISA)
278+
[`riscv32imac-unknown-xous-elf`](platform-support/riscv32imac-unknown-xous-elf.md) | ? | | RISC-V Xous (RV32IMAC ISA)
278279
`riscv32imc-esp-espidf` | ✓ | | RISC-V ESP-IDF
279280
`riscv64gc-unknown-freebsd` | | | RISC-V FreeBSD
280281
`riscv64gc-unknown-linux-musl` | | | RISC-V Linux (kernel 4.20, musl 1.2.0)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# riscv32imac-unknown-xous-elf
2+
3+
**Tier: 3**
4+
5+
Xous microkernel, message-based operating system that powers devices such as Precursor and Betrusted. The operating system is written entirely in Rust, so no additional software is required to compile programs for Xous.
6+
7+
## Target maintainers
8+
9+
- [@xobs](https://github.com/xobs)
10+
11+
## Requirements
12+
13+
14+
Building the target itself requires a RISC-V compiler that is supported by `cc-rs`. For example, you can use the prebuilt [xPack](https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/latest) toolchain.
15+
16+
Cross-compiling programs does not require any additional software beyond the toolchain. Prebuilt versions of the toolchain are available [from Betrusted](https://github.com/betrusted-io/rust/releases).
17+
18+
## Building the target
19+
20+
The target can be built by enabling it for a `rustc` build.
21+
22+
```toml
23+
[build]
24+
target = ["riscv32imac-unknown-xous-elf"]
25+
```
26+
27+
Make sure your C compiler is included in `$PATH`, then add it to the `config.toml`:
28+
29+
```toml
30+
[target.riscv32imac-unknown-xous-elf]
31+
cc = "riscv-none-elf-gcc"
32+
ar = "riscv-none-elf-ar"
33+
```
34+
35+
## Building Rust programs
36+
37+
Rust does not yet ship pre-compiled artifacts for this target. To compile for
38+
this target, you will need to do one of the following:
39+
40+
* Build Rust with the target enabled (see "Building the target" above)
41+
* Build your own copy of `core` by using `build-std` or similar
42+
* Download a prebuilt toolchain [from Betrusted](https://github.com/betrusted-io/rust/releases)
43+
44+
## Cross-compilation
45+
46+
This target can be cross-compiled from any host.
47+
48+
## Testing
49+
50+
Currently there is no support to run the rustc test suite for this target.

0 commit comments

Comments
 (0)