Skip to content

Commit 6ef4dbe

Browse files
committed
rust: 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 <[email protected]>
1 parent bd12347 commit 6ef4dbe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/um/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \
7070

7171
KBUILD_AFLAGS += $(ARCH_INCLUDE)
7272

73+
KBUILD_RUSTFLAGS += -Crelocation-model=pie
74+
7375
USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
7476
$(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \
7577
-D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \

0 commit comments

Comments
 (0)