]> git.dujemihanovic.xyz Git - linux.git/commit
LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub
authorXi Ruoyao <xry111@xry111.site>
Fri, 21 Jun 2024 02:18:40 +0000 (10:18 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 21 Jun 2024 02:18:40 +0000 (10:18 +0800)
commit120dd4118e58dbda2ddb1dcf55f3c56cdfe8cee0
tree4d6b57b79e9d5dd0a1a2b0d67859b6d709496da4
parent6ba59ff4227927d3a8530fc2973b80e94b54d58f
LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub

GAS <= 2.41 does not support generating R_LARCH_{32,64}_PCREL for
"label - ." and it generates R_LARCH_{ADD,SUB}{32,64} pairs instead.
Objtool cannot handle R_LARCH_{ADD,SUB}{32,64} pair in __jump_table
(static key implementation) and etc. so it will produce some warnings.
This is causing the kernel CI systems to complain everywhere.

For GAS we can check if -mthin-add-sub option is available to know if
R_LARCH_{32,64}_PCREL are supported.

For Clang, we require Clang >= 18 and Clang >= 17 already supports
R_LARCH_{32,64}_PCREL. But unfortunately Clang has some other issues,
so we disable objtool for Clang at present.

Note that __jump_table here is not generated by the compiler, so
-fno-jump-table is completely irrelevant for this issue.

Fixes: cb8a2ef0848c ("LoongArch: Add ORC stack unwinder support")
Closes: https://lore.kernel.org/loongarch/Zl5m1ZlVmGKitAof@yujie-X299/
Closes: https://lore.kernel.org/loongarch/ZlY1gDDPi_mNrwJ1@slm.duckdns.org/
Closes: https://lore.kernel.org/loongarch/1717478006.038663-1-hengqi@linux.alibaba.com/
Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=816029e06768
Link: https://github.com/llvm/llvm-project/commit/42cb3c6346fc
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/Kconfig
arch/loongarch/Kconfig.debug