Skip to content
Snippets Groups Projects
Commit 7b3a7918 authored by Huacai Chen's avatar Huacai Chen Committed by Greg Kroah-Hartman
Browse files

LoongArch: Explicitly specify code model in Makefile


commit e67e0eb6a98b261caf45048f9eb95fd7609289c0 upstream.

LoongArch's toolchain may change the default code model from normal to
medium. This is unnecessary for kernel, and generates some relocations
which cannot be handled by the module loader. So explicitly specify the
code model to normal in Makefile (for Rust 'normal' is 'small').

Cc: stable@vger.kernel.org
Tested-by: default avatarHaiyong Sun <sunhaiyong@loongson.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 69d2ceac
No related branches found
No related tags found
1 merge request!176🤖 Sync Bot: Update v6.12-ktn to Latest Stable Kernel (v6.12.4)
...@@ -59,7 +59,7 @@ endif ...@@ -59,7 +59,7 @@ endif
ifdef CONFIG_64BIT ifdef CONFIG_64BIT
ld-emul = $(64bit-emul) ld-emul = $(64bit-emul)
cflags-y += -mabi=lp64s cflags-y += -mabi=lp64s -mcmodel=normal
endif endif
cflags-y += -pipe $(CC_FLAGS_NO_FPU) cflags-y += -pipe $(CC_FLAGS_NO_FPU)
...@@ -104,7 +104,7 @@ ifdef CONFIG_OBJTOOL ...@@ -104,7 +104,7 @@ ifdef CONFIG_OBJTOOL
KBUILD_CFLAGS += -fno-jump-tables KBUILD_CFLAGS += -fno-jump-tables
endif endif
KBUILD_RUSTFLAGS += --target=loongarch64-unknown-none-softfloat KBUILD_RUSTFLAGS += --target=loongarch64-unknown-none-softfloat -Ccode-model=small
KBUILD_RUSTFLAGS_KERNEL += -Zdirect-access-external-data=yes KBUILD_RUSTFLAGS_KERNEL += -Zdirect-access-external-data=yes
KBUILD_RUSTFLAGS_MODULE += -Zdirect-access-external-data=no KBUILD_RUSTFLAGS_MODULE += -Zdirect-access-external-data=no
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment