From: Nathan Chancellor <nathan(a)kernel.org>
[ Upstream commit 42d9b379e3e1790eafb87c799c9edfd0b37a37c7 ]
Commit 98cd6f521f10 ("Kconfig: allow explicit opt in to DWARF v5")
prevented CONFIG_DEBUG_INFO_DWARF5 from being selected when
CONFIG_DEBUG_INFO_BTF is enabled because pahole had issues with clang's
DWARF5 info. This was resolved by [1], which is in pahole v1.21.
Allow DEBUG_INFO_DWARF5 to be selected with DEBUG_INFO_BTF when using
pahole v1.21 or newer.
[1]: https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=7d8e829f6…
Change-Id: I9cc90f12abcc8a809bb263e31ec16766d9384e40
Signed-off-by: Nathan Chancellor <nathan(a)kernel.org>
Signed-off-by: Daniel Borkmann <daniel(a)iogearbox.net>
Acked-by: Andrii Nakryiko <andrii(a)kernel.org>
Link: https://lore.kernel.org/bpf/20220201205624.652313-6-nathan@kernel.org
Signed-off-by: Matthias Maennich <maennich(a)google.com>
---
lib/Kconfig.debug | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 944fd2ae756b..dbbd243c865f 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -302,7 +302,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 && AS_HAS_NON_CONST_LEB128)
- depends on !DEBUG_INFO_BTF
+ depends on !DEBUG_INFO_BTF || PAHOLE_VERSION >= 121
help
Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc
5.0+ accepts the -gdwarf-5 flag but only had partial support for some
--
2.39.2.637.g21b0678d19-goog
From: Nathan Chancellor <nathan(a)kernel.org>
[ Upstream commit 613fe169237785a4bb1d06397b52606b2967da53 ]
There are a few different places where pahole's version is turned into a
three digit form with the exact same command. Move this command into
scripts/pahole-version.sh to reduce the amount of duplication across the
tree.
Create CONFIG_PAHOLE_VERSION so the version code can be used in Kconfig
to enable and disable configuration options based on the pahole version,
which is already done in a couple of places.
Change-Id: Id18c1808832cead0d32f6992a52eb35b0ec269bb
Signed-off-by: Nathan Chancellor <nathan(a)kernel.org>
Signed-off-by: Daniel Borkmann <daniel(a)iogearbox.net>
Acked-by: Andrii Nakryiko <andrii(a)kernel.org>
Link: https://lore.kernel.org/bpf/20220201205624.652313-3-nathan@kernel.org
Signed-off-by: Matthias Maennich <maennich(a)google.com>
---
MAINTAINERS | 1 +
init/Kconfig | 4 ++++
scripts/pahole-version.sh | 13 +++++++++++++
3 files changed, 18 insertions(+)
create mode 100755 scripts/pahole-version.sh
diff --git a/MAINTAINERS b/MAINTAINERS
index 4f50a453e18a..826e2ba7b09a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3407,6 +3407,7 @@ F: net/sched/act_bpf.c
F: net/sched/cls_bpf.c
F: samples/bpf/
F: scripts/bpf_doc.py
+F: scripts/pahole-version.sh
F: tools/bpf/
F: tools/lib/bpf/
F: tools/testing/selftests/bpf/
diff --git a/init/Kconfig b/init/Kconfig
index a4144393717b..dafc3ba6fa7a 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -91,6 +91,10 @@ config CC_HAS_ASM_INLINE
config CC_HAS_NO_PROFILE_FN_ATTR
def_bool $(success,echo '__attribute__((no_profile_instrument_function)) int x();' | $(CC) -x c - -c -o /dev/null -Werror)
+config PAHOLE_VERSION
+ int
+ default $(shell,$(srctree)/scripts/pahole-version.sh $(PAHOLE))
+
config CONSTRUCTORS
bool
diff --git a/scripts/pahole-version.sh b/scripts/pahole-version.sh
new file mode 100755
index 000000000000..f8a32ab93ad1
--- /dev/null
+++ b/scripts/pahole-version.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+#
+# Usage: $ ./pahole-version.sh pahole
+#
+# Prints pahole's version in a 3-digit form, such as 119 for v1.19.
+
+if [ ! -x "$(command -v "$@")" ]; then
+ echo 0
+ exit 1
+fi
+
+"$@" --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/'
--
2.39.2.637.g21b0678d19-goog
The null-ptr-deref problem fixed in the following patch is hit on older
branches.
The patch failed to be initially backported into stable branches older
than 5.15 due to the fix-spell-comment commit ab4040df6efb ("mac80211: fix
some spelling mistakes"). Now it can be cleanly applied to the 5.4/5.10
stable branches.
I'm not sure if the comment-fix patch should be backported in these cases,
too (to prevent similar potential future backport fails). Probably not.
So I just adapted the backport patch in-place.
Keep 6.1 in-sync with Build ID fixes.
I've build tested this on {x86_64, arm64, riscv, powerpc, s390, sh}.
Changes for v2:
- include 1/7 2348e6bf4421 ("riscv: remove special treatment for the link order of head.o")
- include 2/7 994b7ac1697b ("arm64: remove special treatment for the link order of head.o")
- rebase 7/7 c1c551bebf92 ("sh: define RUNTIME_DISCARD_EXIT") from upstream
Previous threads:
[1] https://lore.kernel.org/all/cover.1674876902.git.tom.saeger@oracle.com/
[2] https://lore.kernel.org/all/3df32572ec7016e783d37e185f88495831671f5d.167114…
[3] https://lore.kernel.org/all/cover.1670358255.git.tom.saeger@oracle.com/
Signed-off-by: Tom Saeger <tom.saeger(a)oracle.com>
---
Jisheng Zhang (1):
riscv: remove special treatment for the link order of head.o
Masahiro Yamada (3):
arm64: remove special treatment for the link order of head.o
arch: fix broken BuildID for arm64 and riscv
s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36
Michael Ellerman (2):
powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT
powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds
Tom Saeger (1):
sh: define RUNTIME_DISCARD_EXIT
arch/powerpc/kernel/vmlinux.lds.S | 6 +++++-
arch/s390/kernel/vmlinux.lds.S | 2 ++
arch/sh/kernel/vmlinux.lds.S | 1 +
include/asm-generic/vmlinux.lds.h | 5 +++++
scripts/head-object-list.txt | 2 --
5 files changed, 13 insertions(+), 3 deletions(-)
---
base-commit: d60c95efffe84428e3611431bf688f50bfc13f4e
change-id: 20230210-tsaeger-upstream-linux-6-1-y-06c93fbe5bc8
Best regards,
--
Tom Saeger <tom.saeger(a)oracle.com>