]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Oct 2022 06:48:02 +0000 (08:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Oct 2022 06:48:02 +0000 (08:48 +0200)
added patches:
kconfig.debug-add-toolchain-checks-for-debug_info_dwarf_toolchain_default.patch
kconfig.debug-simplify-the-dependency-of-debug_info_dwarf4-5.patch
lib-kconfig.debug-add-check-for-non-constant-.-s-u-leb128-support-to-dwarf5.patch

queue-5.15/kconfig.debug-add-toolchain-checks-for-debug_info_dwarf_toolchain_default.patch [new file with mode: 0644]
queue-5.15/kconfig.debug-simplify-the-dependency-of-debug_info_dwarf4-5.patch [new file with mode: 0644]
queue-5.15/lib-kconfig.debug-add-check-for-non-constant-.-s-u-leb128-support-to-dwarf5.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/kconfig.debug-add-toolchain-checks-for-debug_info_dwarf_toolchain_default.patch b/queue-5.15/kconfig.debug-add-toolchain-checks-for-debug_info_dwarf_toolchain_default.patch
new file mode 100644 (file)
index 0000000..ca8e170
--- /dev/null
@@ -0,0 +1,52 @@
+From foo@baz Tue Oct 18 08:47:40 AM CEST 2022
+From: Masahiro Yamada <masahiroy@kernel.org>
+Date: Wed, 5 Oct 2022 01:29:04 +0900
+Subject: Kconfig.debug: add toolchain checks for DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+commit bb1435f3f575b5213eaf27434efa3971f51c01de upstream.
+
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT does not give explicit
+-gdwarf-* flag. The actual DWARF version is up to the toolchain.
+
+The combination of GCC and GAS works fine, and Clang with the integrated
+assembler is good too.
+
+The combination of Clang and GAS is tricky, but at least, the -g flag
+works for Clang <=13, which defaults to DWARF v4.
+
+Clang 14 switched its default to DWARF v5.
+
+Now, CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT has the same issue as
+addressed by commit 98cd6f521f10 ("Kconfig: allow explicit opt in to
+DWARF v5").
+
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y for Clang >= 14 and
+GAS < 2.35 produces a ton of errors like follows:
+
+  /tmp/main-c2741c.s: Assembler messages:
+  /tmp/main-c2741c.s:109: Error: junk at end of line, first unrecognized character is `"'
+  /tmp/main-c2741c.s:109: Error: file number less than one
+
+Add 'depends on' to check toolchains.
+
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Reviewed-by: Nathan Chancellor <nathan@kernel.org>
+[nathan: Fix conflict due to lack of f9b3cd24578401e]
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ lib/Kconfig.debug |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/lib/Kconfig.debug
++++ b/lib/Kconfig.debug
+@@ -274,6 +274,7 @@ choice
+ config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
+       bool "Rely on the toolchain's implicit default DWARF version"
++      depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502)
+       help
+         The implicit default version of DWARF debug info produced by a
+         toolchain changes over time.
diff --git a/queue-5.15/kconfig.debug-simplify-the-dependency-of-debug_info_dwarf4-5.patch b/queue-5.15/kconfig.debug-simplify-the-dependency-of-debug_info_dwarf4-5.patch
new file mode 100644 (file)
index 0000000..0016004
--- /dev/null
@@ -0,0 +1,34 @@
+From foo@baz Tue Oct 18 08:47:40 AM CEST 2022
+From: Masahiro Yamada <masahiroy@kernel.org>
+Date: Wed, 5 Oct 2022 01:29:03 +0900
+Subject: Kconfig.debug: simplify the dependency of DEBUG_INFO_DWARF4/5
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+commit 4f001a21080ff2e2f0e1c3692f5e119aedbb3bc1 upstream.
+
+Commit c0a5c81ca9be ("Kconfig.debug: drop GCC 5+ version check for
+DWARF5") could have cleaned up the code a bit more.
+
+"CC_IS_CLANG &&" is unneeded. No functional change is intended.
+
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Reviewed-by: Nathan Chancellor <nathan@kernel.org>
+[nathan: Only apply to DWARF5, as 5.15 does not have 32ef9e5054ec032]
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ lib/Kconfig.debug |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/Kconfig.debug
++++ b/lib/Kconfig.debug
+@@ -295,7 +295,7 @@ config DEBUG_INFO_DWARF4
+ config DEBUG_INFO_DWARF5
+       bool "Generate DWARF Version 5 debuginfo"
+-      depends on !CC_IS_CLANG || (CC_IS_CLANG && (AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502)))
++      depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502)
+       depends on !DEBUG_INFO_BTF
+       help
+         Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc
diff --git a/queue-5.15/lib-kconfig.debug-add-check-for-non-constant-.-s-u-leb128-support-to-dwarf5.patch b/queue-5.15/lib-kconfig.debug-add-check-for-non-constant-.-s-u-leb128-support-to-dwarf5.patch
new file mode 100644 (file)
index 0000000..76099ea
--- /dev/null
@@ -0,0 +1,88 @@
+From foo@baz Tue Oct 18 08:47:40 AM CEST 2022
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Fri, 14 Oct 2022 13:42:11 -0700
+Subject: lib/Kconfig.debug: Add check for non-constant .{s,u}leb128 support to DWARF5
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit 0a6de78cff600cb991f2a1b7ed376935871796a0 upstream.
+
+When building with a RISC-V kernel with DWARF5 debug info using clang
+and the GNU assembler, several instances of the following error appear:
+
+  /tmp/vgettimeofday-48aa35.s:2963: Error: non-constant .uleb128 is not supported
+
+Dumping the .s file reveals these .uleb128 directives come from
+.debug_loc and .debug_ranges:
+
+  .Ldebug_loc0:
+          .byte   4                               # DW_LLE_offset_pair
+          .uleb128 .Lfunc_begin0-.Lfunc_begin0    #   starting offset
+          .uleb128 .Ltmp1-.Lfunc_begin0           #   ending offset
+          .byte   1                               # Loc expr size
+          .byte   90                              # DW_OP_reg10
+          .byte   0                               # DW_LLE_end_of_list
+
+  .Ldebug_ranges0:
+          .byte   4                               # DW_RLE_offset_pair
+          .uleb128 .Ltmp6-.Lfunc_begin0           #   starting offset
+          .uleb128 .Ltmp27-.Lfunc_begin0          #   ending offset
+          .byte   4                               # DW_RLE_offset_pair
+          .uleb128 .Ltmp28-.Lfunc_begin0          #   starting offset
+          .uleb128 .Ltmp30-.Lfunc_begin0          #   ending offset
+          .byte   0                               # DW_RLE_end_of_list
+
+There is an outstanding binutils issue to support a non-constant operand
+to .sleb128 and .uleb128 in GAS for RISC-V but there does not appear to
+be any movement on it, due to concerns over how it would work with
+linker relaxation.
+
+To avoid these build errors, prevent DWARF5 from being selected when
+using clang and an assembler that does not have support for these symbol
+deltas, which can be easily checked in Kconfig with as-instr plus the
+small test program from the dwz test suite from the binutils issue.
+
+Link: https://sourceware.org/bugzilla/show_bug.cgi?id=27215
+Link: https://github.com/ClangBuiltLinux/linux/issues/1719
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+[nathan: Fix conflicts due to lack of f9b3cd24578401e]
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ lib/Kconfig.debug |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/lib/Kconfig.debug
++++ b/lib/Kconfig.debug
+@@ -208,6 +208,11 @@ config DEBUG_BUGVERBOSE
+ endmenu # "printk and dmesg options"
++# Clang is known to generate .{s,u}leb128 with symbol deltas with DWARF5, which
++# some targets may not support: https://sourceware.org/bugzilla/show_bug.cgi?id=27215
++config AS_HAS_NON_CONST_LEB128
++      def_bool $(as-instr,.uleb128 .Lexpr_end4 - .Lexpr_start3\n.Lexpr_start3:\n.Lexpr_end4:)
++
+ menu "Compile-time checks and compiler options"
+ config DEBUG_INFO
+@@ -274,7 +279,7 @@ choice
+ config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
+       bool "Rely on the toolchain's implicit default DWARF version"
+-      depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502)
++      depends on !CC_IS_CLANG || AS_IS_LLVM || CLANG_VERSION < 140000 || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128)
+       help
+         The implicit default version of DWARF debug info produced by a
+         toolchain changes over time.
+@@ -296,7 +301,7 @@ config DEBUG_INFO_DWARF4
+ config DEBUG_INFO_DWARF5
+       bool "Generate DWARF Version 5 debuginfo"
+-      depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502)
++      depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_LEB128)
+       depends on !DEBUG_INFO_BTF
+       help
+         Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc
index bc3c6b0920a69b9be01e44a8e6f4697d4fde9ef5..f2d98bcbce6cea4f5425976fa264452db2c3c64d 100644 (file)
@@ -621,3 +621,6 @@ drm-amd-display-fix-build-breakage-with-config_debug_fs-n.patch
 phy-qcom-qmp-fix-msm8996-pcie-phy-support.patch
 clk-fix-pointer-casting-to-prevent-oops-in-devm_clk_release.patch
 net-wwan-t7xx-use-gfp_atomic-under-spin-lock-in-t7xx_cldma_gpd_set_next_ptr.patch
+kconfig.debug-simplify-the-dependency-of-debug_info_dwarf4-5.patch
+kconfig.debug-add-toolchain-checks-for-debug_info_dwarf_toolchain_default.patch
+lib-kconfig.debug-add-check-for-non-constant-.-s-u-leb128-support-to-dwarf5.patch