[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNASWmV2W4MG8UUMQ=BqsK72coqwXsWRZ7TQMKRrtQqP=qA@mail.gmail.com>
Date: Sat, 14 Aug 2021 10:33:01 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Michal Marek <michal.lkml@...kovi.net>,
Andrew Morton <akpm@...ux-foundation.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Miguel Ojeda <ojeda@...nel.org>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Vitor Massaru Iha <vitor@...saru.org>,
Sedat Dilek <sedat.dilek@...il.com>,
Daniel Latypov <dlatypov@...gle.com>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] Makefile: remove stale cc-option checks
On Wed, Aug 11, 2021 at 8:01 AM Nathan Chancellor <nathan@...nel.org> wrote:
>
> On Tue, Aug 10, 2021 at 01:42:37PM -0700, Nick Desaulniers wrote:
> > cc-option, cc-option-yn, and cc-disable-warning all invoke the compiler
> > during build time, and can slow down the build when these checks become
> > stale for our supported compilers, whose minimally supported versions
> > increases over time. See Documentation/process/changes.rst for the
> > current supported minimal versions (GCC 4.9+, clang 10.0.1+). Compiler
> > version support for these flags may be verified on godbolt.org.
> >
> > The following flags are GCC only and supported since at least GCC 4.9.
> > Remove cc-option and cc-disable-warning tests.
> > * -fno-tree-loop-im
> > * -Wno-maybe-uninitialized
> > * -fno-reorder-blocks
> > * -fno-ipa-cp-clone
> > * -fno-partial-inlining
> > * -femit-struct-debug-baseonly
> > * -fno-inline-functions-called-once
> > * -fconserve-stack
> >
> > The following flags are supported by all supported versions of GCC and
> > Clang. Remove their cc-option, cc-option-yn, and cc-disable-warning tests.
> > * -fno-delete-null-pointer-checks
> > * -fno-var-tracking
> > * -mfentry
> > * -Wno-array-bounds
> >
> > The following configs are made dependent on GCC, since they use GCC
> > specific flags.
> > * READABLE_ASM
> > * DEBUG_SECTION_MISMATCH
> >
> > --param=allow-store-data-races=0 was renamed to --allow-store-data-races
> > in the GCC 10 release.
> >
> > Also, base RETPOLINE_CFLAGS and RETPOLINE_VDSO_CFLAGS on CONFIC_CC_IS_*
> > then remove cc-option tests for Clang.
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/1436
> > Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
>
> Fewer pointless calls to the compiler is always a good thing :)
>
> Reviewed-by: Nathan Chancellor <nathan@...nel.org>
>
> Small comments inline.
>
> > ---
> > Note: It may be preferred to move the test for
> > -fno-inline-functions-called-once for DEBUG_SECTION_MISMATCH into
> > Kconfig. That one does seem relatively more reasonable to implement in
> > Clang.
> >
> > Makefile | 55 ++++++++++++++++++++++++++---------------------
> > lib/Kconfig.debug | 2 ++
> > 2 files changed, 33 insertions(+), 24 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 027fdf2a14fe..3e3fb4affba1 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -730,9 +730,10 @@ endif # KBUILD_EXTMOD
> > # Defaults to vmlinux, but the arch makefile usually adds further targets
> > all: vmlinux
> >
> > -CFLAGS_GCOV := -fprofile-arcs -ftest-coverage \
> > - $(call cc-option,-fno-tree-loop-im) \
> > - $(call cc-disable-warning,maybe-uninitialized,)
> > +CFLAGS_GCOV := -fprofile-arcs -ftest-coverage
> > +ifdef CONFIG_CC_IS_GCC
> > +CFLAGS_GCOV += -fno-tree-loop-im
> > +endif
>
> Eliminating -Wno-maybe-uninitialized might warrant a comment in the
> commit message as I was initially confused then I realized that it is
> unconditionally added later.
Indeed.
Commit 78a5255ffb6a1af189a83e493d916ba1c54d8c75
could have removed -Wno-maybe-initialized
from CFLAGS_GCOV as well, but somehow it has been
left over here...
Comments in the commit log, or perhaps
splitting this as 1/2 will be less confusing.
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists