Skip to content

Commit 19baac3

Browse files
committed
LoongArch: Fix build error for LTO with LLVM-18
Commit b152128 ("LoongArch: Make LTO case independent in Makefile") moves "KBUILD_LDFLAGS += -mllvm --loongarch-annotate-tablejump" out of CONFIG_CC_HAS_ANNOTATE_TABLEJUMP, which breaks the build for LLVM-18, as '--loongarch-annotate-tablejump' is unimplemented there: ld.lld: error: -mllvm: ld.lld: Unknown command line argument '--loongarch-annotate-tablejump'. Call ld-option to detect '--loongarch-annotate-tablejump' before use, so as to fix the build error. Fixes: b152128 ("LoongArch: Make LTO case independent in Makefile") Reported-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Nathan Chancellor <nathan@kernel.org> # build Suggested-by: WANG Rui <wangrui@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent abb2a55 commit 19baac3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ ifdef CONFIG_LTO_CLANG
115115
# The annotate-tablejump option can not be passed to LLVM backend when LTO is enabled.
116116
# Ensure it is aware of linker with LTO, '--loongarch-annotate-tablejump' also needs to
117117
# be passed via '-mllvm' to ld.lld.
118-
KBUILD_LDFLAGS += -mllvm --loongarch-annotate-tablejump
118+
KBUILD_LDFLAGS += $(call ld-option,-mllvm --loongarch-annotate-tablejump)
119119
endif
120120
endif
121121

0 commit comments

Comments
 (0)