How to get the rust toolchain for riscv32imac core?

I am trying to set up the dev environment in linux with rust for risc-v. I am new to both.
Came across this link. GitHub - riscv-rust/riscv-rust-quickstart: A template for building Rust applications for HiFive1 boards
Where it says rustup target add riscv32imac-unknown-none-elf.

Following is what I see when I did this:
iscv@riscvc:~$ rustup target add riscv32imac-unknown-none-elf
info: downloading component 'rust-std' for 'riscv32imac-unknown-none-elf'
info: installing component 'rust-std' for 'riscv32imac-unknown-none-elf'
info: using up to 500.0 MiB of RAM to unpack components

When I searched for riscv32imac-unknown-none-elf, I could n't find any. Will this command install the toolchain (rust compiler for that particular target)? If so where does it install?

This command installed the libraries needed for cross-compiling using your current toolchain. You can now pass a --target argument to cargo or rustc to select this target. For example:

cargo build --target riscv32imac-unknown-none-elf

This will compile your program for RISC-V and place the compiled artifacts in the ./target/riscv32imac-unknown-none-elf directory.

You can use rustup target list to see which targets your current toolchain supports, and which ones are currently installed.

1 Like