summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gow <davidgow@google.com>2022-12-17 12:44:34 +0800
committerRichard Weinberger <richard@nod.at>2023-02-10 21:27:32 +0100
commit905a77077573056d7af508f35373f66ed8b4a39e (patch)
treea2c95f825caf8f081b429e37d88b94770a726972
parentd5dbcfe7ee31ccea85a8cbf7ff84a2808d6c8f76 (diff)
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 <davidgow@google.com> Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--arch/um/Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile
index f1d4d67157be..ae321282dc6f 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))) \