diff mbox series

[2/2] rust: arch/um: use 'large' code model for uml

Message ID 54FC087D02C52990+20240903130606.292935-3-zig@iorw.io
State Changes Requested
Headers show
Series [1/2] rust: arch/um: use 'static' relocation model for uml modules | expand

Commit Message

Zigit Zo Sept. 3, 2024, 1:06 p.m. UTC
The Rust modules compiled against UML should be 'large', without this
the compiler will generate some R_X86_64_32S relocations, but UML is
running at userspace with signed-address larger than zero, therefore
makes '__write_relocate_add' treating the relocation as overflowed.
---
 arch/um/Makefile | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/arch/um/Makefile b/arch/um/Makefile
index b04b1d4d6dfe..c2a9f2102ba7 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -32,6 +32,7 @@  endif
 
 ifdef CONFIG_64BIT
 	KBUILD_CFLAGS += -mcmodel=large
+	KBUILD_RUSTFLAGS += -Ccode-model=large
 endif
 
 HOST_DIR := arch/$(HEADER_ARCH)