Re: [PATCH] configs/debug: set CONFIG_DEBUG_INFO=y properly

From: Daniel Thompson
Date: Tue Mar 08 2022 - 09:30:37 EST


On Tue, Mar 08, 2022 at 08:56:00AM -0500, Qian Cai wrote:
> On Tue, Mar 08, 2022 at 10:42:15AM +0000, Daniel Thompson wrote:
> > On Tue, Mar 01, 2022 at 03:29:20PM -0500, Qian Cai wrote:
> > > CONFIG_DEBUG_INFO can't be set by user directly,
> >
> > What do you mean by "can't be set by user directly"? DEBUG_INFO
> > is fully controlable via menuconfig.
>
> On linux-next, we no longer able to select DEBUG_INFO directly due to this
> patch:
>
> https://lore.kernel.org/all/20220125075126.891825-1-keescook@xxxxxxxxxxxx/
>
> Thus, this patch will work on both the mainline and linux-next.

So your patch sounds like it works for linux-next but, as shown in the
example I shared, it does not work on mainline and should not be
included in v5.17-rc7 .


> > Does this change actually work in the kernels it has merged into?
> >
> > DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT existence is predicated on DEBUG_INFO
> > being set. It makes no sense at all to set the former without the later.
>
> It works fine here.
>
> $ git reset --hard v5.17-rc7
> $ rm .config
> $ make ARCH=arm64 defconfig debug.config
> $ grep -i debug_info .config
> CONFIG_DEBUG_INFO=y

That is *not* an example of debug.config working correctly. It is an
example that only works by accident because the arm64 defconfig already
included CONFIG_DEBUG_INFO=y (that's why I explicitly disabled it in my
example demonstrating the problem before I applied debug.config).

However debug.config is not specific to arm64 and, for v5.17-rc7 it is
also not working with the defconfigs for (at least) arm, powerpc, riscv and
x86 (both i386 and x86_64).

I'm still of the view that any change that removes CONFIG_DEBUG_INFO=y
cannot be sensibly applied to kernels that do not include Kees' patch.


Daniel.