Skip to content

Commit cbfd44b

Browse files
heiherchenhuacai
authored andcommitted
LoongArch: Explicitly set -fdirect-access-external-data for vmlinux
After this llvm commit [1], The -fno-pic does not imply direct access external data. Explicitly set -fdirect-access-external-data for vmlinux that can avoids GOT entries. Link: llvm/llvm-project@47eeee2 Suggested-by: Xi Ruoyao <[email protected]> Signed-off-by: WANG Rui <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent d3ec75b commit cbfd44b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/loongarch/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ LDFLAGS_vmlinux += -static -n -nostdlib
6868
ifdef CONFIG_AS_HAS_EXPLICIT_RELOCS
6969
cflags-y += $(call cc-option,-mexplicit-relocs)
7070
KBUILD_CFLAGS_KERNEL += $(call cc-option,-mdirect-extern-access)
71+
KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdirect-access-external-data)
7172
KBUILD_AFLAGS_MODULE += $(call cc-option,-fno-direct-access-external-data)
7273
KBUILD_CFLAGS_MODULE += $(call cc-option,-fno-direct-access-external-data)
7374
KBUILD_AFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax)

0 commit comments

Comments
 (0)