[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNATeW+c5+Kxnj9M4N+yNSv+7ot7bLTHzO3Z0Xb_XEW_6Nw@mail.gmail.com>
Date: Fri, 30 Sep 2022 06:06:46 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Dmitrii Bundin <dmitrii.bundin.a@...il.com>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Eric Dumazet <edumazet@...gle.com>,
Isabella Basso <isabbasso@...eup.net>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Kees Cook <keescook@...omium.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Fangrui Song <maskray@...gle.com>,
Michal Marek <michal.lkml@...kovi.net>,
Nathan Chancellor <nathan@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH v3] kbuild: add debug level and macro defs options
On Tue, Aug 23, 2022 at 7:42 AM Dmitrii Bundin
<dmitrii.bundin.a@...il.com> wrote:
>
> On Tue, Aug 23, 2022 at 12:36 AM Nick Desaulniers
> <ndesaulniers@...gle.com> wrote:
> >
> > or perhaps that simply needs to be `-g -gsplit-dwarf`? In which case,
> > that if/else could just be re-arranged.
>
> How about simply assigning DEBUG_CFLAGS := -g at the very beginning
> without any conditions? This would provide the default with the
> possibility of overriding later and -gsplit-dwarf does not necessarily
> come with -g implicitly.
This was fixed by commit 32ef9e5054ec0321b9336058c58ec749e9c6b0fe,
which is now in the mainline.
> > Honestly, I really don't think we need to be wrapping every compiler
> > command line flag under the sun in a kconfig option.
>
> This indeed sounds reasonable to me. So the key point here is to not
> bloat the kconfig with options related to every compiler flag. But I
> think it still might be useful to provide some option that would
> include sort of full debug information compilers may produce. With
> this approach there would be, in fact 3 different levels of debug
> information supported by Kconfig: reduced, default and full. The full
> level would increase everything like -g3, and -fdebug-macro for Clang,
> and probably others.
I think that would be much saner than this patch.
CONFIG_DEBUG_INFO_LEVEL is a direct way to specify the debug level.
CONFIG_DEBUG_MACRO_DEFINITIONS is feature-driven.
Do not mix two different ways.
CONFIG_DEBUG_INFO_LEVEL is here just because Andrew Morton suggested that.
The debug level is compiler-specific. There is no guarantee
that there is a common range.
The debug level range of GCC is 0-3.
Clang accepts 3, but -g3 has no effect.
The debug level range of Rustc is 0-2.
See how badly scripts/Makefile.debug looks in linux-next.
How should Rustc behave for CONFIG_DEBUG_INFO_LEVEL=3 ?
-Cdebuginfo=3 is a compile error.
RUSTC L rust/core.o
error: debug info level needs to be between 0-2 (instead was `3`)
You cannot directly specify the debug level number given that
we support multiple compilers with different policy for
debug level options.
> > Or add -g1 to CONFIG_DEBUG_INFO_REDUCED.
>
> I ran some tests and there was indeed some decrease in size. That
> combination probably might be useful.
>
> Any thoughts?
>
> Regards
> Dmitrii
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists