Re: [PATCH v2 2/3] scripts: generate_rust_target: enable building on RISC-V

From: Miguel Ojeda
Date: Fri Feb 23 2024 - 09:43:10 EST


On Fri, Feb 23, 2024 at 2:38 PM Conor Dooley <conor@xxxxxxxxxx> wrote:
>
> Add the required bits from rust-for-linux to enable generating a RISC-V
> target for rust. The script, written by Miguel, was originally a
> config file contributed by Gary.

Thanks for this Connor!

arm64 is sending these for 6.9:

https://git.kernel.org/arm64/c/f82811e22b48
https://git.kernel.org/arm64/c/724a75ac9542

So it would be nice to see if it may be already possible to enable it
via a builtin target + flags instead of the custom target, e.g. arm64
does:

KBUILD_RUSTFLAGS += --target=aarch64-unknown-none -Ctarget-feature="-neon"

and so on.

If it does not work, it would be good to know what would be needed for
RISC-V and put it into the unstable features / wanted features list
for Rust.

Either way, it is not a blocker (although you will need a rebase after
arm64 lands to use the `target.json` in the right places).

Cheers,
Miguel