lib/Kconfig.debug: Set the minimum required pahole version to v1.24
Subsystems (5)
Yonghong Song
reviewerPATCH 1/2 lib/Kconfig.debug: Set the minimum required pahole version to v1.24
Commit 2c1ccd9a1d78 ("docs: changes.rst: restore pahole 1.26 minimum (regressed by sort)") raised the minimal pahole version in the requirements table of Documentation/process/changes.rst to v1.26, since kfuncs with KF_IMPLICIT_ARGS needed the decl_tag_kfuncs feature of pahole v1.26. Commit 692393104909 ("resolve_btfids: Emit bpf_kfunc and bpf_fastcall decl tags") removed that need, as resolve_btfids now emits the kfunc decl tags itself. CONFIG_DEBUG_INFO_BTF, on the other hand, still accepts pahole v1.22.
Set the minimal version to v1.24, so that the kflag of an enum in vmlinux and module BTF is meaningful: 0 for an unsigned enum and 1 for a signed enum. pahole records the signedness of an enum in the kflag since v1.24. With an older pahole, every enum has the kflag 0, signed or not.
--- Documentation/process/changes.rst | 4 ++-- lib/Kconfig.debug | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
Documentation/process/changes.rst +2 -2
@@ -53,7 +53,7 @@ mcelog 0.6 mcelog --version mkimage (optional) 2017.01 mkimage --version nfs-utils 1.0.5 showmount --version openssl & libcrypto 1.0.0 openssl version -pahole 1.26 pahole --version +pahole 1.24 pahole --version pcmciautils 004 pccardctl -V pigz (optional) 2.4 pigz --version PPP 2.4.0 pppd --version
@@ -146,7 +146,7 @@ pahole Since Linux 5.2, if CONFIG_DEBUG_INFO_BTF is selected, the build system generates BTF (BPF Type Format) from DWARF in vmlinux, a bit later from kernel -modules as well. This requires pahole v1.22 or later. +modules as well. This requires pahole v1.24 or later. It is found in the 'dwarves' or 'pahole' distro packages or from https://fedorapeople.org/~acme/dwarves/.
lib/Kconfig.debug +2 -2
@@ -400,12 +400,12 @@ config DEBUG_INFO_BTF depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST depends on BPF_SYSCALL - depends on PAHOLE_VERSION >= 122 + depends on PAHOLE_VERSION >= 124 # pahole uses elfutils, which does not have support for Hexagon relocations depends on !HEXAGON help Generate deduplicated BTF type information from DWARF debug info. - Turning this on requires pahole v1.22 or later, which will convert + Turning this on requires pahole v1.24 or later, which will convert DWARF type info into equivalent deduplicated BTF type info. config PAHOLE_HAS_BTF_TAG
Signature · 1 line
2.53.1-Meta
Yonghong Song
reviewerPATCH 2/2 kbuild, bpf: Remove pahole version checks below v1.24
The previous patch makes CONFIG_DEBUG_INFO_BTF require pahole v1.24, so the Kconfig checks for an older pahole always pass with CONFIG_DEBUG_INFO_BTF.
Remove CONFIG_PAHOLE_HAS_LANG_EXCLUDE (pahole v1.24), which is always set with CONFIG_DEBUG_INFO_BTF. Drop it from the dependency of CONFIG_RUST on !CONFIG_DEBUG_INFO_BTF, and always pass --lang_exclude=rust in scripts/Makefile.btf, which is only included with CONFIG_DEBUG_INFO_BTF.
CONFIG_PAHOLE_HAS_BTF_TAG (pahole v1.23) is still needed, since btf_type_tag is only used with clang, but it no longer needs the pahole version. Every user of it also checks CONFIG_DEBUG_INFO_BTF, so make it depend on CONFIG_CC_IS_CLANG only.
The pahole flags and the resulting config are unchanged, except that CONFIG_PAHOLE_HAS_LANG_EXCLUDE is gone.
--- init/Kconfig | 2 +- lib/Kconfig.debug | 12 +----------- scripts/Makefile.btf | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-)
init/Kconfig +1 -1
@@ -2065,7 +2065,7 @@ config RUST depends on !MODVERSIONS || GENDWARFKSYMS depends on !GCC_PLUGIN_RANDSTRUCT depends on !RANDSTRUCT - depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO) + depends on !DEBUG_INFO_BTF || !LTO depends on !CFI || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC select CFI_ICALL_NORMALIZE_INTEGERS if CFI depends on !KASAN || CC_IS_CLANG
lib/Kconfig.debug +1 -11
@@ -409,22 +409,12 @@ config DEBUG_INFO_BTF DWARF type info into equivalent deduplicated BTF type info. config PAHOLE_HAS_BTF_TAG - def_bool PAHOLE_VERSION >= 123 - depends on CC_IS_CLANG + def_bool CC_IS_CLANG help Decide whether pahole emits btf_tag attributes (btf_type_tag and btf_decl_tag) or not. Currently only clang compiler implements these attributes, so make the config depend on CC_IS_CLANG. -config PAHOLE_HAS_LANG_EXCLUDE - def_bool PAHOLE_VERSION >= 124 - help - Support for the --lang_exclude flag which makes pahole exclude - compilation units from the supplied language. Used in Kbuild to - omit Rust CUs which are not supported in version 1.24 of pahole, - otherwise it would emit malformed kernel and module binaries when - using DEBUG_INFO_BTF_MODULES. - config PAHOLE_HAS_INLINE def_bool PAHOLE_VERSION >= 132 help
scripts/Makefile.btf +1 -1
@@ -20,7 +20,7 @@ pahole-flags-$(call test-ge, $(pahole-ver), 131) += --btf_features=layout endif -pahole-flags-$(CONFIG_PAHOLE_HAS_LANG_EXCLUDE) += --lang_exclude=rust +pahole-flags-y += --lang_exclude=rust btf-inline := $(CONFIG_DEBUG_INFO_BTF_INLINE) ifneq ($(btf-inline),)
Signature · 1 line
2.53.1-Meta
Re: [PATCH bpf-next 2/2] kbuild, bpf: Remove pahole version checks below v1.24
Quoted 15 lines · Yonghong Song
The previous patch makes
CONFIG_DEBUG_INFO_BTFrequire pahole v1.24, so theKconfigchecks for an older pahole always pass withCONFIG_DEBUG_INFO_BTF.Remove
CONFIG_PAHOLE_HAS_LANG_EXCLUDE(pahole v1.24), which is always set withCONFIG_DEBUG_INFO_BTF. Drop it from the dependency ofCONFIG_RUSTon !CONFIG_DEBUG_INFO_BTF, and always pass --lang_exclude=rust inscripts/Makefile.btf, which is only included withCONFIG_DEBUG_INFO_BTF.
CONFIG_PAHOLE_HAS_BTF_TAG(pahole v1.23) is still needed, sincebtf_type_tagis only used with clang, but it no longer needs the pahole version. Every user of it also checksCONFIG_DEBUG_INFO_BTF, so make it depend onCONFIG_CC_IS_CLANGonly.
Quoted 4 lines
The pahole flags and the resulting config are unchanged, except that
CONFIG_PAHOLE_HAS_LANG_EXCLUDEis gone.Signed-off-by Yonghong Song <[email protected]>
one suggestion below, but
Quoted 25 lines
--- init/Kconfig | 2 +- lib/Kconfig.debug | 12 +----------- scripts/Makefile.btf | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-)init/Kconfig +1
-1@@ -2065,7 +2065,7 @@ config RUST depends on !MODVERSIONS || GENDWARFKSYMS depends on !GCC_PLUGIN_RANDSTRUCT depends on !RANDSTRUCT - depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO) + depends on !DEBUG_INFO_BTF || !LTO depends on !CFI || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC select CFI_ICALL_NORMALIZE_INTEGERS if CFI depends on !KASAN || CC_IS_CLANGlib/Kconfig.debug +0
-0@@ -409,22 +409,12 @@ config DEBUG_INFO_BTF DWARF type info into equivalent deduplicated BTF type info.
lib/Kconfig.debug config DEBUG_INFO_BTF · line 417
Quoted 10 lines
lib/Kconfig.debug +1
-2config PAHOLE_HAS_BTF_TAG - def_bool PAHOLE_VERSION >= 123 - depends on CC_IS_CLANG + def_bool CC_IS_CLANG help Decide whether pahole emits btf_tag attributes (btf_type_tag and btf_decl_tag) or not. Currently only clang compiler implements these attributes, so make the config depend on CC_IS_CLANG.
While we're in the area, should we fix this to reflect that gcc has BTF tag support now?
Quoted 25 lines
lib/Kconfig.debug +0
-9-config PAHOLE_HAS_LANG_EXCLUDE - def_bool PAHOLE_VERSION >= 124 - help - Support for the --lang_exclude flag which makes pahole exclude - compilation units from the supplied language. Used in Kbuild to - omit Rust CUs which are not supported in version 1.24 of pahole, - otherwise it would emit malformed kernel and module binaries when - using DEBUG_INFO_BTF_MODULES. - config PAHOLE_HAS_INLINE def_bool PAHOLE_VERSION >= 132 helpscripts/Makefile.btf +1
-1@@ -20,7 +20,7 @@ pahole-flags-$(call test-ge, $(pahole-ver), 131) += --btf_features=layout endif -pahole-flags-$(CONFIG_PAHOLE_HAS_LANG_EXCLUDE) += --lang_exclude=rust +pahole-flags-y += --lang_exclude=rust btf-inline := $(CONFIG_DEBUG_INFO_BTF_INLINE) ifneq ($(btf-inline),)
Yonghong Song
reviewerRe: [PATCH bpf-next 2/2] kbuild, bpf: Remove pahole version checks below v1.24
Quoted 50 lines · Alan Maguire
Quoted 15 lines · Yonghong Song
The previous patch makes
CONFIG_DEBUG_INFO_BTFrequire pahole v1.24, so theKconfigchecks for an older pahole always pass withCONFIG_DEBUG_INFO_BTF.Remove
CONFIG_PAHOLE_HAS_LANG_EXCLUDE(pahole v1.24), which is always set withCONFIG_DEBUG_INFO_BTF. Drop it from the dependency ofCONFIG_RUSTon !CONFIG_DEBUG_INFO_BTF, and always pass --lang_exclude=rust inscripts/Makefile.btf, which is only included withCONFIG_DEBUG_INFO_BTF.
CONFIG_PAHOLE_HAS_BTF_TAG(pahole v1.23) is still needed, sincebtf_type_tagis only used with clang, but it no longer needs the pahole version. Every user of it also checksCONFIG_DEBUG_INFO_BTF, so make it depend onCONFIG_CC_IS_CLANGonly.Quoted 4 lines
The pahole flags and the resulting config are unchanged, except that
CONFIG_PAHOLE_HAS_LANG_EXCLUDEis gone.Signed-off-by Yonghong Song <[email protected]>one suggestion below, but
Acked-by Alan Maguire <[email protected]>Quoted 26 lines
--- init/Kconfig | 2 +- lib/Kconfig.debug | 12 +----------- scripts/Makefile.btf | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-)init/Kconfig +1
-1@@ -2065,7 +2065,7 @@ config RUST depends on !MODVERSIONS || GENDWARFKSYMS depends on !GCC_PLUGIN_RANDSTRUCT depends on !RANDSTRUCT - depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO) + depends on !DEBUG_INFO_BTF || !LTO depends on !CFI || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC select CFI_ICALL_NORMALIZE_INTEGERS if CFI depends on !KASAN || CC_IS_CLANGlib/Kconfig.debug +0
-0@@ -409,22 +409,12 @@ config DEBUG_INFO_BTF DWARF type info into equivalent deduplicated BTF type info.
Quoted 11 lines
lib/Kconfig.debug config DEBUG_INFO_BTF · line 417
Quoted 9 lines
lib/Kconfig.debug +1
-2config PAHOLE_HAS_BTF_TAG - def_bool PAHOLE_VERSION >= 123 - depends on CC_IS_CLANG + def_bool CC_IS_CLANG help Decide whether pahole emits btf_tag attributes (btf_type_tag and btf_decl_tag) or not. Currently only clang compiler implements these attributes, so make the config depend on CC_IS_CLANG.While we're in the area, should we fix this to reflect that gcc has BTF tag support now?
I am not an expert for gcc BTF tag thing. I guess some testing are needed if we want to removing 'depends on CC_IS_CLANG'. This can be a follow-up.
Quoted 25 lines
Quoted 25 lines
lib/Kconfig.debug +0
-9-config PAHOLE_HAS_LANG_EXCLUDE - def_bool PAHOLE_VERSION >= 124 - help - Support for the --lang_exclude flag which makes pahole exclude - compilation units from the supplied language. Used in Kbuild to - omit Rust CUs which are not supported in version 1.24 of pahole, - otherwise it would emit malformed kernel and module binaries when - using DEBUG_INFO_BTF_MODULES. - config PAHOLE_HAS_INLINE def_bool PAHOLE_VERSION >= 132 helpscripts/Makefile.btf +1
-1@@ -20,7 +20,7 @@ pahole-flags-$(call test-ge, $(pahole-ver), 131) += --btf_features=layout endif -pahole-flags-$(CONFIG_PAHOLE_HAS_LANG_EXCLUDE) += --lang_exclude=rust +pahole-flags-y += --lang_exclude=rust btf-inline := $(CONFIG_DEBUG_INFO_BTF_INLINE) ifneq ($(btf-inline),)
[email protected]
AI reviewRe: [PATCH bpf-next 2/2] kbuild, bpf: Remove pahole version checks below v1.24
In reply to Yonghong SongTL;DR: Commit message only: claiming the resulting config is unchanged looks inaccurate, since PAHOLE_HAS_BTF_TAG becomes y for clang builds without BTF, though with no functional effect today.
Quoted 1 line
kbuild, bpf: Remove pahole version checks below v1.24
TL;DR: Commit message only: claiming the resulting config is unchanged looks inaccurate, since PAHOLE_HAS_BTF_TAG becomes y for clang builds without BTF, though with no functional effect today.
Quoted 16 lines
kbuild, bpf: Remove pahole version checks below v1.24
The previous patch makes
CONFIG_DEBUG_INFO_BTFrequire pahole v1.24, so theKconfigchecks for an older pahole always pass withCONFIG_DEBUG_INFO_BTF.
RemoveCONFIG_PAHOLE_HAS_LANG_EXCLUDE(pahole v1.24), which is always set withCONFIG_DEBUG_INFO_BTF. Drop it from the dependency ofCONFIG_RUSTon !CONFIG_DEBUG_INFO_BTF, and always pass --lang_exclude=rust inscripts/Makefile.btf, which is only included withCONFIG_DEBUG_INFO_BTF.CONFIG_PAHOLE_HAS_BTF_TAG(pahole v1.23) is still needed, sincebtf_type_tagis only used with clang, but it no longer needs the pahole version. Every user of it also checksCONFIG_DEBUG_INFO_BTF, so make it depend onCONFIG_CC_IS_CLANGonly.
The pahole flags and the resulting config are unchanged, except thatCONFIG_PAHOLE_HAS_LANG_EXCLUDEis gone.
Is the last sentence of the commit message accurate?
The new definition changes the resulting config for clang builds without BTF:
Before:
config PAHOLE_HAS_BTF_TAG
def_bool PAHOLE_VERSION >= 123
depends on CC_IS_CLANG
After:
config PAHOLE_HAS_BTF_TAG
def_bool CC_IS_CLANG
With LLVM=1 and pahole missing or older than v1.23, PAHOLE_VERSION is below 123, so PAHOLE_HAS_BTF_TAG was n before. Now it is y, and CONFIG_PAHOLE_HAS_BTF_TAG=y is written to .config and the generated autoconf.h and rustc_cfg even though CONFIG_DEBUG_INFO_BTF is n.
This has no functional effect today, since both users (compiler_types.h and trace_event_update_with_eval_map()) also test CONFIG_DEBUG_INFO_BTF.
Would it be better to use "def_bool DEBUG_INFO_BTF && CC_IS_CLANG" so the generated config stays identical, or to reword the commit message to say that CONFIG_PAHOLE_HAS_BTF_TAG is now also set in clang configurations without BTF?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/45289030741
Yonghong Song
reviewerRe: [PATCH bpf-next 2/2] kbuild, bpf: Remove pahole version checks below v1.24
Quoted 40 lines · On 11/23/26 3:41 PM, [email protected] wrote:
Quoted 1 line
kbuild, bpf: Remove pahole version checks below v1.24
TL;DR: Commit message only: claiming the resulting config is unchanged looks inaccurate, since
PAHOLE_HAS_BTF_TAGbecomes y for clang builds without BTF, though with no functional effect today.Quoted 16 lines
kbuild, bpf: Remove pahole version checks below v1.24
The previous patch makes
CONFIG_DEBUG_INFO_BTFrequire pahole v1.24, so theKconfigchecks for an older pahole always pass withCONFIG_DEBUG_INFO_BTF.
RemoveCONFIG_PAHOLE_HAS_LANG_EXCLUDE(pahole v1.24), which is always set withCONFIG_DEBUG_INFO_BTF. Drop it from the dependency ofCONFIG_RUSTon !CONFIG_DEBUG_INFO_BTF, and always pass --lang_exclude=rust inscripts/Makefile.btf, which is only included withCONFIG_DEBUG_INFO_BTF.CONFIG_PAHOLE_HAS_BTF_TAG(pahole v1.23) is still needed, sincebtf_type_tagis only used with clang, but it no longer needs the pahole version. Every user of it also checksCONFIG_DEBUG_INFO_BTF, so make it depend onCONFIG_CC_IS_CLANGonly.
The pahole flags and the resulting config are unchanged, except thatCONFIG_PAHOLE_HAS_LANG_EXCLUDEis gone.Is the last sentence of the commit message accurate?
The new definition changes the resulting config for clang builds without BTF:
Before:
configPAHOLE_HAS_BTF_TAG
def_boolPAHOLE_VERSION>= 123
depends onCC_IS_CLANGAfter:
configPAHOLE_HAS_BTF_TAG
def_boolCC_IS_CLANGWith LLVM=1 and pahole missing or older than v1.23,
PAHOLE_VERSIONis below 123, soPAHOLE_HAS_BTF_TAGwas n before. Now it is y, andCONFIG_PAHOLE_HAS_BTF_TAG=yis written to .config and the generatedautoconf.handrustc_cfgeven thoughCONFIG_DEBUG_INFO_BTFis n.
Quoted 7 lines
This has no functional effect today, since both users (
compiler_types.handtrace_event_update_with_eval_map()) also testCONFIG_DEBUG_INFO_BTF.Would it be better to use "
def_boolDEBUG_INFO_BTF&&CC_IS_CLANG" so the generated config stays identical, or to reword the commit message to say thatCONFIG_PAHOLE_HAS_BTF_TAGis now also set in clang configurations without BTF?
Okay, since CONFIG_DEBUG_INFO_BTF is not involved with PAHOLE_HAS_BTF_TAG, I will leave it as is in the next revision.
Quoted 6 lines
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.mdCI run summary: https://github.com/kernel-patches/bpf/actions/runs/45289030741
Quoted 9 lines · Yonghong Song
Commit
2c1ccd9a1d78("docs:changes.rst: restore pahole 1.26 minimum (regressed by sort)") raised the minimal pahole version in the requirements table ofDocumentation/process/changes.rstto v1.26, since kfuncs withKF_IMPLICIT_ARGSneeded thedecl_tag_kfuncsfeature of pahole v1.26. Commit 692393104909 ("resolve_btfids: Emitbpf_kfuncandbpf_fastcalldecl tags") removed that need, asresolve_btfidsnow emits the kfunc decl tags itself.CONFIG_DEBUG_INFO_BTF, on the other hand, still accepts pahole v1.22.
Quoted 6 lines
Set the minimal version to v1.24, so that the kflag of an enum in vmlinux and module BTF is meaningful: 0 for an unsigned enum and 1 for a signed enum. pahole records the signedness of an enum in the kflag since v1.24. With an older pahole, every enum has the kflag 0, signed or not.
Signed-off-by Yonghong Song <[email protected]>
Quoted 46 lines
--- Documentation/process/changes.rst | 4 ++-- lib/Kconfig.debug | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)Documentation/process/changes.rst +2
-2@@ -53,7 +53,7 @@ mcelog 0.6 mcelog --version mkimage (optional) 2017.01 mkimage --version nfs-utils 1.0.5 showmount --version openssl & libcrypto 1.0.0 openssl version -pahole 1.26 pahole --version +pahole 1.24 pahole --version pcmciautils 004 pccardctl -V pigz (optional) 2.4 pigz --version PPP 2.4.0 pppd --version@@ -146,7 +146,7 @@ pahole Since Linux 5.2, if CONFIG_DEBUG_INFO_BTF is selected, the build system generates BTF (BPF Type Format) from DWARF in vmlinux, a bit later from kernel -modules as well. This requires pahole v1.22 or later. +modules as well. This requires pahole v1.24 or later. It is found in the 'dwarves' or 'pahole' distro packages or from https://fedorapeople.org/~acme/dwarves/.lib/Kconfig.debug +2
-2@@ -400,12 +400,12 @@ config DEBUG_INFO_BTF depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST depends on BPF_SYSCALL - depends on PAHOLE_VERSION >= 122 + depends on PAHOLE_VERSION >= 124 # pahole uses elfutils, which does not have support for Hexagon relocations depends on !HEXAGON help Generate deduplicated BTF type information from DWARF debug info. - Turning this on requires pahole v1.22 or later, which will convert + Turning this on requires pahole v1.24 or later, which will convert DWARF type info into equivalent deduplicated BTF type info. config PAHOLE_HAS_BTF_TAG