[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNAS6po1Zj0QnFkaKZbDw8P3YD7Z2-20zsp_HBrUfmeEaWw@mail.gmail.com>
Date: Wed, 22 Dec 2021 08:22:39 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Kees Cook <keescook@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Peter Zijlstra <peterz@...radead.org>,
Nathan Chancellor <nathan@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] Kconfig.debug: Make DEBUG_INFO selectable from a choice
On Fri, Dec 10, 2021 at 6:40 PM Arnd Bergmann <arnd@...db.de> wrote:
>
> On Fri, Dec 10, 2021 at 1:09 AM Kees Cook <keescook@...omium.org> wrote:
> >
> > Currently it's not possible to enable DEBUG_INFO for an all*config
> > build, since it is marked as "depends on !COMPILE_TEST". This generally
> > makes sense because a debug build of an all*config target ends up taking
> > much longer and the output is much larger. Having this be "default off"
> > makes sense. However, there are cases where enabling DEBUG_INFO for such
> > builds is useful for doing treewide A/B comparisons of build options,
> > etc.
> >
> > Make DEBUG_INFO selectable from any of the DWARF version choice options,
> > with DEBUG_INFO_NONE being the default for COMPILE_TEST. The mutually
> > exclusive relationship between DWARF5 and BTF must be inverted, but the
> > result remains the same. Additionally moves DEBUG_KERNEL and DEBUG_MISC
> > up to the top of the menu because was enabling features _above_ it,
> > making it weird to navigate menuconfig.
> >
> > Suggested-by: Arnd Bergmann <arnd@...db.de>
> > Signed-off-by: Kees Cook <keescook@...omium.org>
>
> Looks good to me,
>
> Reviewed-by: Arnd Bergmann <arnd@...db.de>
>
> One detail:
>
> > +choice
> > + prompt "Debug information"
> > + depends on DEBUG_KERNEL
> > + default DEBUG_INFO_NONE if COMPILE_TEST
> > + default DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT if DEBUG_KERNEL
>
> I think this line should be simplified to
>
> default DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
Indeed.
It can be simplified into:
default DEBUG_INFO_NONE if COMPILE_TEST
default DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
The first entry of the choice is the default.
So, it can be further simplified to:
default DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT if !COMPILE_TEST
Another way is to move DEBUG_INFO_NONE to the last entry of the choice,
then
default DEBUG_INFO_NONE if COMPILE_TEST
> since DEBUG_KERNEL is always enabled at this point. You can also consider
> turning the 'menu' into 'menuconfig DEBUG_KERNEL' and dropping the 'depends
> on DEBUG_KERNEL' in favor of the implied dependency.
>
> Arnd
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists