[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANXV_XwgZMCGXijfoUyZ9+KyM6Rgeqiq-sCfubyj_16d-2CN=A@mail.gmail.com>
Date: Sun, 14 Aug 2022 22:17:39 +0300
From: Dmitrii Bundin <dmitrii.bundin.a@...il.com>
To: Fangrui Song <maskray@...gle.com>, masahiroy@...nel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nathan Chancellor <nathan@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Kees Cook <keescook@...omium.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Isabella Basso <isabbasso@...eup.net>,
Eric Dumazet <edumazet@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>
Subject: Re: [PATCH v2] kbuild: add configurable debug info level
> We already have CONFIG_DEBUG_INFO_NONE to
> disable the debug info.
Thanks for pointing this out. Indeed providing another way of
disabling debug info does not look reasonable to me.
So only it makes sense to set only 1, 2 or 3 debug levels.
> Using 'int' does not look sensible to me.
Could you please give a hint why?
My intention to choose int was to provide a boundary with range on the
DEBUG_INFO_LEVEL option to choose only acceptable ones.
On Sun, Aug 14, 2022 at 8:31 AM Fangrui Song <maskray@...gle.com> wrote:
> In Clang, -g = -g2 = -g3. To generate macro information,
> specify -fdebug-macro.
Thanks.
I would propose to add another config option like
DEBUG_MACRO_DEFINITIONS to turn on macro information for GCC/Clang.
For GCC it would be -g3, for Clang -fdebug-macro.
> Before GCC 11 and Clang 12, -gsplit-dwarf implied -g2 (older
> -gsplit-dwarf is like today's `-gsplit-dwarf -g2`).
>
> GCC 11 and Clang 12 (https://reviews.llvm.org/D80391) have changed
> -gsplit-dwarf to not imply -g2.
>
> For a group of -g0 -g1 -g2, the last option wins. Therefore,
>
> -g0 -gsplit-dwarf => debug info in GCC<11 and Clang<12
> -g0 -gsplit-dwarf => no debug info in GCC>=11 and Clang>=12
I would add a note that when selecting -gdwarf-<level> gcc also
implicitly sets -g2 (at least in older versions).
It seems reasonable to me to put the DEBUG_LEVEL_INFO setting at the
very bottom to prevent it from overriding implicitly.
What do you think?
Powered by blists - more mailing lists