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 --- We may use new toolchain to build 6.1/6.6 LTS, backport it to avoid problems.
arch/loongarch/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile index a74bbcb05ee1..f2966745b058 100644 --- a/arch/loongarch/Makefile +++ b/arch/loongarch/Makefile @@ -55,7 +55,7 @@ endif
ifdef CONFIG_64BIT ld-emul = $(64bit-emul) -cflags-y += -mabi=lp64s +cflags-y += -mabi=lp64s -mcmodel=normal endif
cflags-y += -pipe -msoft-float