Re: [PATCH] bpf: Hoise pahole version checks into Kconfig

From: Sedat Dilek
Date: Thu Feb 04 2021 - 02:23:11 EST


On Thu, Jan 14, 2021 at 12:07 AM Nathan Chancellor
<natechancellor@xxxxxxxxx> wrote:
>
> On Wed, Jan 13, 2021 at 02:38:27PM -0800, Andrii Nakryiko wrote:
> > Hm.. Just saw Linus proposing using $(error-if) in Kconfig for an
> > unrelated issue ([0]). If we can make this work, then it would catch
> > such issue early on, yet won't have any downsides of hiding
> > CONFIG_DEBUG_INFO_BTF if pahole is too old. WDYT?
> >
> > [0] https://lore.kernel.org/lkml/CAHk-=wh-+TMHPTFo1qs-MYyK7tZh-OQovA=pP3=e06aCVp6_kA@xxxxxxxxxxxxxx/
>
> Yes, I think that would be exactly what we want because DEBUG_INFO_BTF
> could cause the build to error if PAHOLE_VERSION is not >= 116. I will
> try to keep an eye on that thread to see how it goes then respin this
> based on anything that comes from it.
>

For BPF/pahole testing (see [1]) with CONFIG_DEBUG_INFO_DWARF5=y I did:

$ git diff
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index b0840d192e95..f15b37143165 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -272,7 +272,7 @@ config DEBUG_INFO_DWARF5
bool "Generate DWARF Version 5 debuginfo"
depends on GCC_VERSION >= 50000 || CC_IS_CLANG
depends on CC_IS_GCC ||
$(success,$(srctree)/scripts/test_dwarf5_support.sh $(CC)
$(CLANG_FLAGS))
- depends on !DEBUG_INFO_BTF
+ depends on !DEBUG_INFO_BTF || (DEBUG_INFO_BTF && PAHOLE_VERSION >= 120)
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

Thanks again for that patch.

- Sedat -

[1] https://git.kernel.org/pub/scm/devel/pahole/pahole.git/log/?h=tmp.1.20