[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240917143234.4b213175@eugeo>
Date: Tue, 17 Sep 2024 14:32:34 +0100
From: Gary Guo <gary@...yguo.net>
To: Jason Montleon <jmontleo@...hat.com>
Cc: ojeda@...nel.org, alex.gaynor@...il.com, boqun.feng@...il.com,
bjorn3_gh@...tonmail.com, benno.lossin@...ton.me, a.hindborg@...nel.org,
aliceryhl@...gle.com, paul.walmsley@...ive.com, palmer@...belt.com,
aou@...s.berkeley.edu, nathan@...nel.org, ndesaulniers@...gle.com,
morbo@...gle.com, justinstitt@...gle.com, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
llvm@...ts.linux.dev, stable@...r.kernel.org
Subject: Re: [PATCH] RISC-V: Fix building rust when using GCC toolchain
On Mon, 16 Sep 2024 20:08:48 -0400
Jason Montleon <jmontleo@...hat.com> wrote:
> Clang does not support '-mno-riscv-attribute' resulting in the error
> error: unknown argument: '-mno-riscv-attribute'
>
> Not setting BINDGEN_TARGET_riscv results in the in the error
> error: unsupported argument 'medany' to option '-mcmodel=' for target \
> 'unknown'
> error: unknown target triple 'unknown'
>
> Signed-off-by: Jason Montleon <jmontleo@...hat.com>
> Cc: stable@...r.kernel.org
I also carry a similar patch locally (haven't get around to submit it
yet), so I can confirm
Tested-by: Gary Guo <garyguo.net>
As Conor points out, the commit message could be improved. Perhaps add
a bit of context about the flag filtering.
Best,
Gary
> ---
> rust/Makefile | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/rust/Makefile b/rust/Makefile
> index f168d2c98a15..73eceaaae61e 100644
> --- a/rust/Makefile
> +++ b/rust/Makefile
> @@ -228,11 +228,12 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
> -fzero-call-used-regs=% -fno-stack-clash-protection \
> -fno-inline-functions-called-once -fsanitize=bounds-strict \
> -fstrict-flex-arrays=% -fmin-function-alignment=% \
> - --param=% --param asan-%
> + --param=% --param asan-% -mno-riscv-attribute
>
> # Derived from `scripts/Makefile.clang`.
> BINDGEN_TARGET_x86 := x86_64-linux-gnu
> BINDGEN_TARGET_arm64 := aarch64-linux-gnu
> +BINDGEN_TARGET_riscv := riscv64-linux-gnu
> BINDGEN_TARGET := $(BINDGEN_TARGET_$(SRCARCH))
>
> # All warnings are inhibited since GCC builds are very experimental,
>
> base-commit: ad060dbbcfcfcba624ef1a75e1d71365a98b86d8
Powered by blists - more mailing lists