Please support the riscv target

Hello Rust Team,

I am using a RISC-V linux board, I plan to use the rust to programming apps, but I find out that rust does not support the arch in target list.

here is arch toolchain provided by chip designer.

nds64le-linux-glibc-v5d rv64imacfdxv5 lp64d nx25 riscv64-elf

please help me, I want to programming with rust

Thank you very much

Riscv is definitively supported. Both bare-metal and for linux:

$ rustc --print target-list | grep riscv
riscv32gc-unknown-linux-gnu
riscv32gc-unknown-linux-musl
riscv32i-unknown-none-elf
riscv32imac-unknown-none-elf
riscv32imc-esp-espidf
riscv32imc-unknown-none-elf
riscv64gc-unknown-linux-gnu
riscv64gc-unknown-linux-musl
riscv64gc-unknown-none-elf
riscv64imac-unknown-none-elf
2 Likes

I think i need riscv64imac-unknow-linux-gnu, right?

Yes

i don't think so rv64gc is just a short for rv64imacfd which is all supported if this line is correct

But there is a target named riscv64imac-unknown-none-elf, there is no target named riscv64imac-unknow-linux-gnu

The F/D extensions are considered mandatory for Linux support, you'd need to create a custom target to achieve that

Edit: And I should clarify, the 'G' extension is shorthand for the 'MAFD' extension set

1 Like

How to create a custom target? why not rust team create it, then everyone can use the target

If I'm reading this thread correctly, the target you want is riscv64gc-unknown-linux-gnu.

1 Like

No, I want to the target riscv64imac-unknow-linux-gnu

imacfd is the same as gc. G is an alias for I with the M, A, F and D extensions. See the actual target spec for riscv64gc-unknown-linux-gnu: rust/riscv64gc_unknown_linux_gnu.rs at d47a6cc3f2dab0ef046c2bb7b76a9ee8d1a0be92 · rust-lang/rust · GitHub

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.