Patch "LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     loongarch-only-allow-objtool-orc-unwinder-if-toolcha.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit caa9862de683a0591338707ee7f366bd947a8015
Author: Xi Ruoyao <xry111@xxxxxxxxxxx>
Date:   Fri Jun 21 10:18:40 2024 +0800

    LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub
    
    [ Upstream commit 120dd4118e58dbda2ddb1dcf55f3c56cdfe8cee0 ]
    
    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@xxxxxxxxxxxxxxx/
    Closes: https://lore.kernel.org/loongarch/1717478006.038663-1-hengqi@xxxxxxxxxxxxxxxxx/
    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@xxxxxxxxxxx>
    Signed-off-by: Huacai Chen <chenhuacai@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index 54ad04dacdee9..d1b94ce58f793 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -138,7 +138,7 @@ config LOONGARCH
 	select HAVE_LIVEPATCH
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI
-	select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS
+	select HAVE_OBJTOOL if AS_HAS_EXPLICIT_RELOCS && AS_HAS_THIN_ADD_SUB && !CC_IS_CLANG
 	select HAVE_PCI
 	select HAVE_PERF_EVENTS
 	select HAVE_PERF_REGS
@@ -257,6 +257,9 @@ config AS_HAS_EXPLICIT_RELOCS
 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)
+
 config AS_HAS_LSX_EXTENSION
 	def_bool $(as-instr,vld \$vr0$(comma)\$a0$(comma)0)
 
diff --git a/arch/loongarch/Kconfig.debug b/arch/loongarch/Kconfig.debug
index 98d60630c3d4b..8b2ce5b5d43e8 100644
--- a/arch/loongarch/Kconfig.debug
+++ b/arch/loongarch/Kconfig.debug
@@ -28,6 +28,7 @@ config UNWINDER_PROLOGUE
 
 config UNWINDER_ORC
 	bool "ORC unwinder"
+	depends on HAVE_OBJTOOL
 	select OBJTOOL
 	help
 	  This option enables the ORC (Oops Rewind Capability) unwinder for




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux