https://github.com/koute/rustc-rv32e
Rust toolchain for RV32E
https://github.com/koute/rustc-rv32e
Last synced: 7 months ago
JSON representation
Rust toolchain for RV32E
- Host: GitHub
- URL: https://github.com/koute/rustc-rv32e
- Owner: koute
- License: apache-2.0
- Archived: true
- Created: 2023-08-15T14:39:49.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-09T11:07:01.000Z (over 2 years ago)
- Last Synced: 2025-02-10T21:37:04.428Z (over 1 year ago)
- Language: Shell
- Size: 45.9 KB
- Stars: 10
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
## Rust toolchain for RV32E
This repository contains scripts to build a Rust toolchain targetting RISC-V RV32E.
The target triplet is: riscv32em-unknown-none-elf
**Warning**: This was only tested on Linux! Patches welcome if it doesn't work on your OS.
Note: This might require up to ~35GB of disk space to build.
## Building rustc
1. Run `./01-clone.sh`. This will download the necessary sources.
2. Run `./02-patch.sh`. This will patch the sources for RV32E.
3. Run `./03-rustc-build.sh`. This will build the compiler.
Now you have two options:
a) Link the toolchain you've built with `rustup` using the `04a-link-rustup.sh` script.
b) Build (potentially redistributable) dist artifacts with `05-build-dist.sh` and install them with `06-install-dist.sh`.
In case of (a) you'll have to keep this repository in-place as `rustup` will link to this directory
to access the toolchain. In case of (b) the toolchain will be permanently installed, after which
you can delete this repository.
## Using rustc
After installing prefix your `cargo` invocations with `rustup run rv32e-nightly-2023-04-05-x86_64-unknown-linux-gnu`
and add `--target=riscv32em-unknown-none-elf`. For example this should work:
```
rustup run rv32e-nightly-2023-04-05-x86_64-unknown-linux-gnu cargo build --target=riscv32em-unknown-none-elf
```
Only `no_std` is supported!
## Building clang (optional)
You can also build clang if you want. After cloning and patching the sources run `03-clang-build-and-install.sh`
to build and install it. The clang binary will be installed to `/opt/clang-rv32e/bin/clang`.
## License
MIT or Apache-2