From: David Gow Date: Sat, 17 Dec 2022 04:44:34 +0000 (+0800) Subject: rust: arch/um: Use 'pie' relocation mode under UML X-Git-Tag: v6.3-rc1~43^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=905a77077573056d7af508f35373f66ed8b4a39e;p=thirdparty%2Fkernel%2Flinux.git rust: arch/um: Use 'pie' relocation mode under UML UML expects a position independent executable for some reason, so tell rustc to generate pie objects. Otherwise we get a bunch of relocations we can't deal with in libcore. Signed-off-by: David Gow Signed-off-by: Richard Weinberger --- diff --git a/arch/um/Makefile b/arch/um/Makefile index f1d4d67157be0..ae321282dc6f6 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -68,6 +68,8 @@ 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_AFLAGS += $(ARCH_INCLUDE) USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \