Skip to content

Commit b152128

Browse files
seehearfeelchenhuacai
authored andcommitted
LoongArch: Make LTO case independent in Makefile
LTO is not only used for Clang, but maybe also used for Rust, make LTO case out of CONFIG_CC_HAS_ANNOTATE_TABLEJUMP in Makefile. This is preparation for later patch, no function changes. Cc: stable@vger.kernel.org Suggested-by: WANG Rui <wangrui@loongson.cn> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 539d734 commit b152128

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/loongarch/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,16 @@ KBUILD_CFLAGS += $(call cc-option,-mthin-add-sub) $(call cc-option,-Wa$(comma)
102102

103103
ifdef CONFIG_OBJTOOL
104104
ifdef CONFIG_CC_HAS_ANNOTATE_TABLEJUMP
105+
KBUILD_CFLAGS += -mannotate-tablejump
106+
else
107+
KBUILD_CFLAGS += -fno-jump-tables # keep compatibility with older compilers
108+
endif
109+
ifdef CONFIG_LTO_CLANG
105110
# The annotate-tablejump option can not be passed to LLVM backend when LTO is enabled.
106111
# Ensure it is aware of linker with LTO, '--loongarch-annotate-tablejump' also needs to
107112
# be passed via '-mllvm' to ld.lld.
108-
KBUILD_CFLAGS += -mannotate-tablejump
109-
ifdef CONFIG_LTO_CLANG
110113
KBUILD_LDFLAGS += -mllvm --loongarch-annotate-tablejump
111114
endif
112-
else
113-
KBUILD_CFLAGS += -fno-jump-tables # keep compatibility with older compilers
114-
endif
115115
endif
116116

117117
KBUILD_RUSTFLAGS += --target=loongarch64-unknown-none-softfloat -Ccode-model=small

0 commit comments

Comments
 (0)