[Buildroot] [PATCH v1 0/1] pahole for kconfig

thilo zirnstein <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
Hi all, 

I recently noticed that I could not enable the CONFIG_DEBUG_INFO_BTF option, 
even if I enable the BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE option. 

The pahole was built prior to linux but not recognized when running make linux-menuconfig. 
I dug a bit and the problem seems to be: 

The environment for building the configuration editor is quite limited. 
Refer $(2)_CONFIGURATOR_MAKE_ENV
It explicitly clears the PATH variable.
The same environment is used to run the configuration editor. 

In this environment the pahole version cannot be determined (It does not exist)
The PAHOLE_VERSION is set to 0. 
The pahole is a dependence of some configurations (CONFIG_DEBUG_INFO_BTF), which cannot be enabled :/ 

Now the fun part :) 
If you read back the .config file after running menuconfig the pahole version is resolved. 
This is due to the fact that the pkg-kconfig.mk does some magic after calling $$($(2)_DIR)/.kconfig_editor_%. 
It runs a bunch of fixups, defined as $$($(2)_FIXUP_DOT_CONFIG), these fixups will run kconfig-package-regen-dot-config, 
which creates a oldconfig with a different environment. 
Now the path to host/bin/pahole is set and the pahole version is resolved.

Nevertheless, it is an issue that the pahole version is not correct when running menuconfig.
A user never can enable the CONFIG_DEBUG_INFO_BTF option, even if he enabled the BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE option.

My fix: 

I resolved the issue by adding the pahole path explicitly to the linux make flags.

Thank you for maintaining buildroot and best regards,

thilo zirnstein (1):
  linux: add host-pahole to linux make flags

 linux/linux.mk | 1 +
 1 file changed, 1 insertion(+)

-- 
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.