[PATCH v1] RISC-V: disallow gcc + rust builds

Alexandre Ghiti alex at ghiti.fr
Wed Oct 9 00:46:42 PDT 2024


Hi Conor,

On 01/10/2024 13:28, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley at microchip.com>
>
> During the discussion before supporting rust on riscv, it was decided
> not to support gcc yet, due to differences in extension handling
> compared to llvm (only the version of libclang matching the c compiler
> is supported). Recently Jason Montleon reported [1] that building with
> gcc caused build issues, due to unsupported arguments being passed to
> libclang. After some discussion between myself and Miguel


I have just added "[2]" here as it seemed to be missing.

Thanks,

Alex


> , it is better
> to disable gcc + rust builds to match the original intent, and
> subsequently support it when an appropriate set of extensions can be
> deduced from the version of libclang.
>
> Closes: https://lore.kernel.org/all/20240917000848.720765-2-jmontleo@redhat.com/ [1]
> Link: https://lore.kernel.org/all/20240926-battering-revolt-6c6a7827413e@spud/ [2]
> Fixes: 70a57b247251a ("RISC-V: enable building 64-bit kernels with rust support")
> Reported-by: Jason Montleon <jmontleo at redhat.com>
> Signed-off-by: Conor Dooley <conor.dooley at microchip.com>
> ---
>
> Palmer, this is yours to take.
>
> CC: jmontleo at redhat.com
> CC: ojeda at kernel.org
> CC: alex.gaynor at gmail.com
> CC: boqun.feng at gmail.com
> CC: gary at garyguo.net
> CC: bjorn3_gh at protonmail.com
> CC: benno.lossin at proton.me
> CC: a.hindborg at kernel.org
> CC: aliceryhl at google.com
> CC: paul.walmsley at sifive.com
> CC: palmer at dabbelt.com
> CC: nathan at kernel.org
> CC: ndesaulniers at google.com
> CC: morbo at google.com
> CC: justinstitt at google.com
> CC: rust-for-linux at vger.kernel.org
> CC: linux-riscv at lists.infradead.org
> CC: llvm at lists.linux.dev
> ---
>   Documentation/rust/arch-support.rst | 2 +-
>   arch/riscv/Kconfig                  | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/rust/arch-support.rst b/Documentation/rust/arch-support.rst
> index 750ff371570a0..54be7ddf3e57a 100644
> --- a/Documentation/rust/arch-support.rst
> +++ b/Documentation/rust/arch-support.rst
> @@ -17,7 +17,7 @@ Architecture   Level of support  Constraints
>   =============  ================  ==============================================
>   ``arm64``      Maintained        Little Endian only.
>   ``loongarch``  Maintained        \-
> -``riscv``      Maintained        ``riscv64`` only.
> +``riscv``      Maintained        ``riscv64`` and LLVM/Clang only.
>   ``um``         Maintained        \-
>   ``x86``        Maintained        ``x86_64`` only.
>   =============  ================  ==============================================
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 22dc5ea4196ce..76843584960c2 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -177,7 +177,7 @@ config RISCV
>   	select HAVE_REGS_AND_STACK_ACCESS_API
>   	select HAVE_RETHOOK if !XIP_KERNEL
>   	select HAVE_RSEQ
> -	select HAVE_RUST if RUSTC_SUPPORTS_RISCV
> +	select HAVE_RUST if RUSTC_SUPPORTS_RISCV && CC_IS_CLANG
>   	select HAVE_SAMPLE_FTRACE_DIRECT
>   	select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
>   	select HAVE_STACKPROTECTOR



More information about the linux-riscv mailing list