[PATCH v2] RISC-V: re-enable gcc + rust builds
Nicolas Schier
nsc at kernel.org
Wed Sep 17 05:13:38 PDT 2025
On Wed, Sep 10, 2025 at 03:27:19PM +0100, Conor Dooley wrote:
> On Tue, Sep 09, 2025 at 06:53:11PM +0200, Asuna Yang wrote:
> > Commit 33549fcf37ec ("RISC-V: disallow gcc + rust builds") disabled GCC
> > + Rust builds for RISC-V due to differences in extension handling
> > compared to LLVM.
> >
> > Add a Kconfig symbol to indicate the version of libclang used by Rust
> > bindgen and add conditions for the availability of libclang to the
> > RISC-V extension Kconfig symbols that depend on the cc-option function.
> >
> > For Zicsr/Zifencei special handling, since LLVM/Clang always enables
> > these two extensions, either don't pass them to -march, or pass them
> > explicitly and Rust bindgen libclang must recognize them.
> >
> > Clang does not support -mno-riscv-attribute flag, filter it out to
> > resolve error: unknown argument: '-mno-riscv-attribute'.
> >
> > Define BINDGEN_TARGET_riscv to pass the target triplet to Rust bindgen
> > libclang for RISC-V to resolve error: unsupported argument 'medany' to
> > option '-mcmodel=' for target 'unknown'. Improve to output a clearer
> > error message if the target triplet is undefined for Rust bindgen
> > libclang.
> >
> > Update the documentation, GCC + Rust builds are now supported.
> >
> > ---
>
> FWIW, this --- breaks git, and anything after this line (including your
> signoff) is lost when the patch is applied.
FTR, there is good documentation about '---' in patch mails:
https://docs.kernel.org/process/submitting-patches.html#commentary
Kind regards,
Nicolas
More information about the linux-riscv
mailing list