[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABVgOSmZEowbLCJepA0bkTHMnt5xhXE5sHoQz2kNhmMo3N9vwg@mail.gmail.com>
Date: Mon, 10 Feb 2025 18:55:42 +0800
From: David Gow <davidgow@...gle.com>
To: Thomas Weißschuh <linux@...ssschuh.net>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
linux-um <linux-um@...ts.infradead.org>
Subject: Re: [PATCH 1/2] rust: pass correct target to bindgen on Usermode Linux
On Sat, 8 Feb 2025 at 21:32, Thomas Weißschuh <linux@...ssschuh.net> wrote:
>
> Usermode Linux uses "um" as primary architecture name and the underlying
> physical architecture is provided in "SUBARCH".
> Resolve the target architecture flags through that underlying architecture.
> This is the same pattern as used by scripts/Makefile.clang from which
> the bindgen flags are derived.
>
> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
> ---
(+cc linux-um, but I assume this will probably go in via the Rust tree, anyway.)
Thanks very much: this is enough to get Rust-for-Linux working with
gcc under 64-bit UML on my system.
However, this is actually a bit of a coincidence -- and there are
still some issues with 32-bit UML -- as the UML Rust flags are
currently conditionally set if CC_IS_CLANG. This is my fault (it was
to work around some bugs with older gcc), and I've sent a patch[1] to
fix it. (Though note that 32-bit UML/Rust still hits issues with
atomics in the block driver, so you'll need to disable that for now.)
Regardless, this is a significant improvement, thanks!
Reviewed-by: David Gow <davidgow@...gl.ecom>
Thanks,
-- David
[1]: https://lore.kernel.org/rust-for-linux/20250210105353.2238769-2-davidgow@google.com/
> rust/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/rust/Makefile b/rust/Makefile
> index 8fcfd60447bc89ba2c66a4f341288db2387b0956..a94fafb91d7d743c6c1b2248479c0d723964e5c4 100644
> --- a/rust/Makefile
> +++ b/rust/Makefile
> @@ -245,6 +245,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
> # Derived from `scripts/Makefile.clang`.
> BINDGEN_TARGET_x86 := x86_64-linux-gnu
> BINDGEN_TARGET_arm64 := aarch64-linux-gnu
> +BINDGEN_TARGET_um := $(BINDGEN_TARGET_$(SUBARCH))
> BINDGEN_TARGET := $(BINDGEN_TARGET_$(SRCARCH))
>
> # All warnings are inhibited since GCC builds are very experimental,
>
> --
> 2.48.1
>
>
Powered by blists - more mailing lists