[PATCH 1/2] rust: arch/um: use 'static' relocation model for uml modules
Zigit Zo
zig at iorw.io
Tue Sep 3 06:06:05 PDT 2024
In the x86_64 UML, kernel modules compiled with Rust will currently
generate some R_X86_64_GOTPCREL relocations, which will then be rejected
by the kernel.
And because of the kernel modules of UML are only got handled by the UML
itself, relocation model 'static' can work as expected other than 'pie'.
---
arch/um/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/um/Makefile b/arch/um/Makefile
index 00b63bac5eff..b04b1d4d6dfe 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -63,7 +63,7 @@ KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \
-Din6addr_loopback=kernel_in6addr_loopback \
-Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr
-KBUILD_RUSTFLAGS += -Crelocation-model=pie
+KBUILD_RUSTFLAGS_KERNEL += -Crelocation-model=pie
KBUILD_AFLAGS += $(ARCH_INCLUDE)
--
2.46.0
More information about the linux-um
mailing list