public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rust: arch:um: Fix building 32-bit UML with GCC
@ 2026-04-25  3:41 David Gow
  2026-04-30 20:44 ` Miguel Ojeda
  0 siblings, 1 reply; 2+ messages in thread
From: David Gow @ 2026-04-25  3:41 UTC (permalink / raw)
  To: Miguel Ojeda, Johannes Berg, Richard Weinberger, Anton Ivanov
  Cc: David Gow, Thomas Weißschuh, rust-for-linux, linux-um,
	linux-kernel

32-bit UML builds can be configured either by setting CONFIG_64BIT=n or
with SUBARCH=i386. Both work with Rust-for-Linux when clang is the
compiler, but when SUBARCH=i386, we don't set a bindgen target correctly if
gcc is the compiler.

Add the appropriate bindgen target configuration for i386, as is done in
Makefile.clang.

Fixes: ab0f4cedc355 ("arch: um: rust: Add i386 support for Rust")
Signed-off-by: David Gow <david@davidgow.net>
---

This could go in via either the rust or um trees. I suspect rust is less
likely to trigger conflicts, though.

Cheers,
-- David

---
 rust/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rust/Makefile b/rust/Makefile
index b361bfedfdf0..b9e9f512cec3 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -403,6 +403,8 @@ BINDGEN_TARGET_x86	:= x86_64-linux-gnu
 BINDGEN_TARGET_arm64	:= aarch64-linux-gnu
 BINDGEN_TARGET_arm	:= arm-linux-gnueabi
 BINDGEN_TARGET_loongarch	:= loongarch64-linux-gnusf
+# This is only for i386 UM builds, which need the 32-bit target not -m32
+BINDGEN_TARGET_i386	:= i386-linux-gnu
 BINDGEN_TARGET_um	:= $(BINDGEN_TARGET_$(SUBARCH))
 BINDGEN_TARGET		:= $(BINDGEN_TARGET_$(SRCARCH))
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rust: arch:um: Fix building 32-bit UML with GCC
  2026-04-25  3:41 [PATCH] rust: arch:um: Fix building 32-bit UML with GCC David Gow
@ 2026-04-30 20:44 ` Miguel Ojeda
  0 siblings, 0 replies; 2+ messages in thread
From: Miguel Ojeda @ 2026-04-30 20:44 UTC (permalink / raw)
  To: David Gow
  Cc: Miguel Ojeda, Johannes Berg, Richard Weinberger, Anton Ivanov,
	Thomas Weißschuh, rust-for-linux, linux-um, linux-kernel

On Sat, Apr 25, 2026 at 5:42 AM David Gow <david@davidgow.net> wrote:
>
> 32-bit UML builds can be configured either by setting CONFIG_64BIT=n or
> with SUBARCH=i386. Both work with Rust-for-Linux when clang is the
> compiler, but when SUBARCH=i386, we don't set a bindgen target correctly if
> gcc is the compiler.
>
> Add the appropriate bindgen target configuration for i386, as is done in
> Makefile.clang.
>
> Fixes: ab0f4cedc355 ("arch: um: rust: Add i386 support for Rust")
> Signed-off-by: David Gow <david@davidgow.net>

Applied to `rust-fixes` -- thanks!

    [ For reference, the errors look like:

            BINDGEN rust/bindings/bindings_generated.rs
          error: unsupported option '-mno-sse' for target ''
          ...
          error: unknown target triple 'unknown'
          panicked at .../bindgen-0.72.1/ir/context.rs:562:15:
          libclang error; possible causes include:
          ...

        - Miguel ]

    [ Added space in title. - Miguel ]

(I left the comment as-is to keep the match from `Makefile.clang`).

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-30 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-25  3:41 [PATCH] rust: arch:um: Fix building 32-bit UML with GCC David Gow
2026-04-30 20:44 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox