diff options
| author | Huacai Chen <chenhuacai@loongson.cn> | 2024-11-22 15:47:47 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-05 14:02:45 +0100 |
| commit | 7b3a7918f10dbc312e36c7363be0788a596d94d5 (patch) | |
| tree | b26c92cd23d8a76164fd8e72cd0c25e784e29e06 /arch/loongarch | |
| parent | 69d2ceac11acf8579d58d55c9c5b65fb658f916e (diff) | |
| download | linux-7b3a7918f10dbc312e36c7363be0788a596d94d5.tar.gz linux-7b3a7918f10dbc312e36c7363be0788a596d94d5.tar.bz2 linux-7b3a7918f10dbc312e36c7363be0788a596d94d5.zip | |
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: Haiyong Sun <sunhaiyong@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/loongarch')
| -rw-r--r-- | arch/loongarch/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile index ae3f80622f4c..567bd122a9ee 100644 --- a/arch/loongarch/Makefile +++ b/arch/loongarch/Makefile @@ -59,7 +59,7 @@ endif ifdef CONFIG_64BIT ld-emul = $(64bit-emul) -cflags-y += -mabi=lp64s +cflags-y += -mabi=lp64s -mcmodel=normal endif cflags-y += -pipe $(CC_FLAGS_NO_FPU) @@ -104,7 +104,7 @@ ifdef CONFIG_OBJTOOL KBUILD_CFLAGS += -fno-jump-tables 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_MODULE += -Zdirect-access-external-data=no |
