Skip to content

Commit e67e0eb

Browse files
committed
LoongArch: Explicitly specify code model in Makefile
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: Haiyong Sun <sunhaiyong@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 1b9bc42 commit e67e0eb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/loongarch/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ endif
5959

6060
ifdef CONFIG_64BIT
6161
ld-emul = $(64bit-emul)
62-
cflags-y += -mabi=lp64s
62+
cflags-y += -mabi=lp64s -mcmodel=normal
6363
endif
6464

6565
cflags-y += -pipe $(CC_FLAGS_NO_FPU)
@@ -104,7 +104,7 @@ ifdef CONFIG_OBJTOOL
104104
KBUILD_CFLAGS += -fno-jump-tables
105105
endif
106106

107-
KBUILD_RUSTFLAGS += --target=loongarch64-unknown-none-softfloat
107+
KBUILD_RUSTFLAGS += --target=loongarch64-unknown-none-softfloat -Ccode-model=small
108108
KBUILD_RUSTFLAGS_KERNEL += -Zdirect-access-external-data=yes
109109
KBUILD_RUSTFLAGS_MODULE += -Zdirect-access-external-data=no
110110

0 commit comments

Comments
 (0)