Skip to content

Commit a7e0837

Browse files
seehearfeelchenhuacai
authored andcommitted
LoongArch: Set AS_HAS_THIN_ADD_SUB as y if AS_IS_LLVM
When building kernel with "make CC=clang defconfig", LLVM Assembler is used due to LLVM_IAS=0 is not specified, then AS_HAS_THIN_ADD_SUB is not set, thus objtool can not be built after enable it for Clang. config AS_HAS_THIN_ADD_SUB is to check whether -mthin-add-sub option is available to know R_LARCH_{32,64}_PCREL are supported for GNU Assembler, there is no such an option for LLVM Assembler. The minimal version of Clang is 18 for building LoongArch kernel, and Clang >= 17 has already supported R_LARCH_{32,64}_PCREL, that is to say, there is no need to depend on AS_HAS_THIN_ADD_SUB for Clang, so just set AS_HAS_THIN_ADD_SUB as y if AS_IS_LLVM. Fixes: 120dd41 ("LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub") Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent b8468bd commit a7e0837

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ config AS_HAS_FCSR_CLASS
266266
def_bool $(as-instr,movfcsr2gr \$t0$(comma)\$fcsr0)
267267

268268
config AS_HAS_THIN_ADD_SUB
269-
def_bool $(cc-option,-Wa$(comma)-mthin-add-sub)
269+
def_bool $(cc-option,-Wa$(comma)-mthin-add-sub) || AS_IS_LLVM
270270

271271
config AS_HAS_LSX_EXTENSION
272272
def_bool $(as-instr,vld \$vr0$(comma)\$a0$(comma)0)

0 commit comments

Comments
 (0)