diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2024-09-17 22:23:09 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2024-09-17 22:23:09 +0800 |
commit | a7e0837724562ea8c1d869dd1a5cb1119ef651c3 (patch) | |
tree | 843e62d732c8f0f9ec126dec2f789b14513f117f | |
parent | b8468bd92ae19939d4844899fa05147888732519 (diff) |
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: 120dd4118e58 ("LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
-rw-r--r-- | arch/loongarch/Kconfig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 8dff6ddaf9c5..34531dc8a61f 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -266,7 +266,7 @@ config AS_HAS_FCSR_CLASS def_bool $(as-instr,movfcsr2gr \$t0$(comma)\$fcsr0) config AS_HAS_THIN_ADD_SUB - def_bool $(cc-option,-Wa$(comma)-mthin-add-sub) + def_bool $(cc-option,-Wa$(comma)-mthin-add-sub) || AS_IS_LLVM config AS_HAS_LSX_EXTENSION def_bool $(as-instr,vld \$vr0$(comma)\$a0$(comma)0) |