From 6b2dab17d6fad9d94faae45b46bef307d8560cdf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sat, 8 Feb 2025 14:31:14 +0100 Subject: [PATCH] rust: pass correct target to bindgen on Usermode Linux MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. [ David says: (...) this is enough to get Rust-for-Linux working with gcc under 64-bit UML on my system. - Miguel ] Signed-off-by: Thomas Weißschuh Reviewed-by: David Gow Acked-by: Johannes Berg Link: https://lore.kernel.org/r/20250208-rust-kunit-v1-1-94a026be6d72@weissschuh.net Signed-off-by: Miguel Ojeda --- rust/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/Makefile b/rust/Makefile index e761a8cc3bd5..b9cc810764e9 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -274,6 +274,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.50.1