[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNASdfvJsqq8ubpBZJ5yWPMimt=pF_GFBLTJbFytbtw8jxg@mail.gmail.com>
Date: Tue, 23 Feb 2021 00:45:24 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Heiko Carstens <hca@...ux.ibm.com>,
Kees Cook <keescook@...omium.org>,
linux-hardening@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Arnd Bergmann <arnd@...nel.org>
Subject: Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
On Tue, Feb 23, 2021 at 12:18 AM Guenter Roeck <linux@...ck-us.net> wrote:
>
> On 2/22/21 4:05 AM, Heiko Carstens wrote:
> > On Sun, Feb 21, 2021 at 02:56:50PM -0800, Guenter Roeck wrote:
> >> Commit 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") disabled
> >> COMPILE_TEST for s390. At the same time, "make allmodconfig/allyesconfig" for
> >> s390 is still supported. However, it generates thousands of compiler
> >> messages such as the following, making it highly impractical to run.
> >>
> >> Cyclomatic Complexity 1 scripts/mod/devicetable-offsets.c:main
> >> Cyclomatic Complexity 1 scripts/mod/devicetable-offsets.c:_GLOBAL__sub_I_00100_0_main
> >>
> >> Since GCC_PLUGIN_CYC_COMPLEXITY is primarily used for testing, disable it
> >> when building s390 images.
> >>
> >> Cc: Arnd Bergmann <arnd@...nel.org>
> >> Cc: Heiko Carstens <hca@...ux.ibm.com>
> >> Fixes: 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390")
> >> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
> >> ---
> >> scripts/gcc-plugins/Kconfig | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/scripts/gcc-plugins/Kconfig b/scripts/gcc-plugins/Kconfig
> >> index ab9eb4cbe33a..5e9bb500f443 100644
> >> --- a/scripts/gcc-plugins/Kconfig
> >> +++ b/scripts/gcc-plugins/Kconfig
> >> @@ -21,7 +21,7 @@ if GCC_PLUGINS
> >>
> >> config GCC_PLUGIN_CYC_COMPLEXITY
> >> bool "Compute the cyclomatic complexity of a function" if EXPERT
> >> - depends on !COMPILE_TEST # too noisy
> >> + depends on !COMPILE_TEST && !S390 # too noisy
> >
> > I don't see a reason to disable this in general for s390. COMPILE_TEST
> > was only disabled for s390 because a lot of irrelevant configs didn't
> > compile and it would cause a lot of unnecessary work to fix that.
> >
> > However the !COMPILE_TEST dependency here looks more like it was
> > misused in lack of a possibility to detect if the config was generated
> > with allyesconfig/allmodconfig. Maybe that could be added somehow to
> > Kconfig?
> >
>
> That is what COMPILE_TEST used to be for. Not setting it for s390 doesn't
> just cause this config to be disabled. Lots of other compile tests
> for s390 are now disabled as well, and code which should be disabled
> is now enabled. Looking at it, I'd be a bit surprised if allmodconfig/
> allyesconfig with COMPILE_TEST=y still builds for s390.
>
> I agree that COMPILE_TEST it is being misused. However, I think what
> you'd be looking for is something like COMPILE_TEST_RANDCONFIG.
> FWIW, in my opinion, randconfig should not enable COMPILE_TEST
> to start with. But that is a different discussion.
>
> Anyway, I can disable GCC_PLUGIN_CYC_COMPLEXITY manually in my own
> build tests, so this isn't that much of a problem for me, so feel
> free to drop this patch.
>
> Guenter
Maybe, we can add something like CONFIG_SUPPRESS_NOISY_TESTS,
which is set to y by all{yes,mod}config.
This is self-documenting, so we do not need the '# too noisy' comment.
config SUPPRESS_NOISY_TESTS
bool "suppress noisy test"
config GCC_PLUGIN_CYC_COMPLEXITY
bool "Compute the cyclomatic complexity of a function" if EXPERT
depends on !SUPPRESS_NOISY_TESTS
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists