summaryrefslogtreecommitdiffstats
path: root/arch/loongarch/Makefile
diff options
context:
space:
mode:
authorWANG Rui <wangrui@loongson.cn>2024-01-17 12:43:00 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2024-01-17 12:43:00 +0800
commit90868ff9cadecd46fa2a4f5501c66bfea8ade9b7 (patch)
tree7557db8f2a52fbdbe29073b101340e23a44c7025 /arch/loongarch/Makefile
parentf58b0abae839f06be9d791d16196922a4b281777 (diff)
downloadlinux-stable-90868ff9cadecd46fa2a4f5501c66bfea8ade9b7.tar.gz
linux-stable-90868ff9cadecd46fa2a4f5501c66bfea8ade9b7.tar.bz2
linux-stable-90868ff9cadecd46fa2a4f5501c66bfea8ade9b7.zip
LoongArch: Enable initial Rust support
Enable initial Rust support for LoongArch. Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: WANG Rui <wangrui@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/Makefile')
-rw-r--r--arch/loongarch/Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index 4ba8d67ddb09..ba45cb7b621c 100644
--- a/arch/loongarch/Makefile
+++ b/arch/loongarch/Makefile
@@ -81,8 +81,11 @@ KBUILD_AFLAGS_MODULE += -Wa,-mla-global-with-abs
KBUILD_CFLAGS_MODULE += -fplt -Wa,-mla-global-with-abs,-mla-local-with-abs
endif
+KBUILD_RUSTFLAGS_MODULE += -Crelocation-model=pic
+
ifeq ($(CONFIG_RELOCATABLE),y)
KBUILD_CFLAGS_KERNEL += -fPIE
+KBUILD_RUSTFLAGS_KERNEL += -Crelocation-model=pie
LDFLAGS_vmlinux += -static -pie --no-dynamic-linker -z notext $(call ld-option, --apply-dynamic-relocs)
endif