Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
On Wed, Feb 24, 2021 at 10:46 AM Guenter Roeck wrote: > > On Tue, Feb 23, 2021 at 07:03:47PM +0100, Heiko Carstens wrote: > > On Tue, Feb 23, 2021 at 09:41:40AM -0800, Guenter Roeck wrote: > > > > I tried to explain why we don't want to set COMPILE_TEST for s390 > > > > anymore. It overrides architecture dependencies in Kconfig, and lots > > > > of drivers do not set dependencies for HAS_IOMEM, HAS_DMA, and friends > > > > correctly. > > > > This generates constantly fallout which is irrelevant for s390 and > > > > also for other architectures. It generates just work with close to > > > > zero benefit. For drivers which matter for s390 we still see those > > > > errors. > > > > > > > > > On the other side, if that flag would be set explicitly by > > > > > all{yes,mod}config, it would really beg for being misused. We > > > > > might then as well add a new flag that is explicitly associated > > > > > with all{yes,mod}config, but not with randconfig. > > > > > > > > I think that makes most sense, probably also have a flag that is set > > > > for randconfig. > > > > > > Not sure what value such an option would have, and how it would be used. > > > I would argue that randconfig should not set COMPILE_TEST to start with, > > > since its purpose should be to test random valid configurations and not > > > to compile test arbitrary (and in that case random) code. But that is > > > a different question, and just my personal opinion. > > > > > > Overall, the question is what kind of additional option you would find > > > useful for s390. You make it clear that you don't want COMPILE_TEST. > > > At the same time, you still want all{mod,yes}config, but presumably > > > excluding options currently restricted by !COMPILE_TEST (such as > > > DEBUG_INFO, BPF_PRELOAD, UBSAN_TRAP, GCC_PLUGIN_CYC_COMPLEXITY, > > > and a few others). SUPPRESS_NOISY_TESTS would not cover that, but > > > neither would RANDCONFIG (or whatever it would be called). > > > > Well, if we would have e.g. RANDCONFIG, then we could probably revert > > 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") and > > instead let COMPILE_TEST depend on !RANDCONFIG. > > I think this _could_ solve all common problems we currently see. > > > > And it would also do what you suggested. > > Sounds good. > > Question is how one would set such a flag. The code in scripts/kconfig/conf.c > doesn't really set COMPILE_TEST in conjunction with randconfig; that is > just as random as all other configuration flags. Would something like > the patch below be acceptable ? NACK. Such a stupid option is what I really do not want to merge. Even allnoconfig_y is also a horrible mistake, and I have a plan to kill it. Only the sensible one is 'option modules'. The others are really bad hacks. > Thanks, > Guenter > > --- > From 301dc1746b259afce02c104ebbf3f0c37189ae4a Mon Sep 17 00:00:00 2001 > From: Guenter Roeck > Date: Tue, 23 Feb 2021 17:21:51 -0800 > Subject: [PATCH] kconfig: Introduce RANDCONFIG > > "make randconfig" is intended to be used to generate random valid > configurations. It is supposed to verify if configuration dependencies > are valid and compile. It is not supposed to be used as replacement > for all{mod,yes}config. This is just your opinion. Each sentence should start with "I think". > > However, that is not currently the case. "make randconfig" treats all > configurations randomly. Yes, this is what randconfig should do. > This means that "COMPILE_TEST" will be enabled > randomly. This defeats the purpose of "make randconfig" If you want to set particular CONFIG option(s) to a fixed value, KCONFIG_ALLCONFIG is supported. See Documentation/kbuild/kconfig.rst > > To solve the problem, introduce a RANDCONFIG configuration option > and set it for all "randconfig" configurations. Disable COMPILE_TEST > whenever RANDCONFIG is enabled. > > Signed-off-by: Guenter Roeck > --- > init/Kconfig | 12 > scripts/kconfig/confdata.c | 15 --- > scripts/kconfig/expr.h | 1 + > scripts/kconfig/lexer.l| 1 + > scripts/kconfig/lkc.h | 1 + > scripts/kconfig/menu.c | 5 + > scripts/kconfig/parser.y | 6 ++ > 7 files changed, 38 insertions(+), 3 deletions(-) > > diff --git a/init/Kconfig b/init/Kconfig > index ba8bd5256980..a85099c5e383 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -111,9 +111,21 @@ config INIT_ENV_ARG_LIMIT > Maximum of each of the number of arguments and environment > variables passed to init from the kernel command line. > > +config RANDCONFIG > + bool "Compile random configurations" > + option randconfig_y > + help > + This option indicates that the configuration is random and used to > + test if configuration dependencies are valid and complete. > + Resulting images are not expected to be bootable on real hardware. > + > + If you are a developer and want to build test random
Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
On Tue, Feb 23, 2021 at 07:03:47PM +0100, Heiko Carstens wrote: > On Tue, Feb 23, 2021 at 09:41:40AM -0800, Guenter Roeck wrote: > > > I tried to explain why we don't want to set COMPILE_TEST for s390 > > > anymore. It overrides architecture dependencies in Kconfig, and lots > > > of drivers do not set dependencies for HAS_IOMEM, HAS_DMA, and friends > > > correctly. > > > This generates constantly fallout which is irrelevant for s390 and > > > also for other architectures. It generates just work with close to > > > zero benefit. For drivers which matter for s390 we still see those > > > errors. > > > > > > > On the other side, if that flag would be set explicitly by > > > > all{yes,mod}config, it would really beg for being misused. We > > > > might then as well add a new flag that is explicitly associated > > > > with all{yes,mod}config, but not with randconfig. > > > > > > I think that makes most sense, probably also have a flag that is set > > > for randconfig. > > > > Not sure what value such an option would have, and how it would be used. > > I would argue that randconfig should not set COMPILE_TEST to start with, > > since its purpose should be to test random valid configurations and not > > to compile test arbitrary (and in that case random) code. But that is > > a different question, and just my personal opinion. > > > > Overall, the question is what kind of additional option you would find > > useful for s390. You make it clear that you don't want COMPILE_TEST. > > At the same time, you still want all{mod,yes}config, but presumably > > excluding options currently restricted by !COMPILE_TEST (such as > > DEBUG_INFO, BPF_PRELOAD, UBSAN_TRAP, GCC_PLUGIN_CYC_COMPLEXITY, > > and a few others). SUPPRESS_NOISY_TESTS would not cover that, but > > neither would RANDCONFIG (or whatever it would be called). > > Well, if we would have e.g. RANDCONFIG, then we could probably revert > 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") and > instead let COMPILE_TEST depend on !RANDCONFIG. > I think this _could_ solve all common problems we currently see. > > And it would also do what you suggested. Sounds good. Question is how one would set such a flag. The code in scripts/kconfig/conf.c doesn't really set COMPILE_TEST in conjunction with randconfig; that is just as random as all other configuration flags. Would something like the patch below be acceptable ? Thanks, Guenter --- >From 301dc1746b259afce02c104ebbf3f0c37189ae4a Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Tue, 23 Feb 2021 17:21:51 -0800 Subject: [PATCH] kconfig: Introduce RANDCONFIG "make randconfig" is intended to be used to generate random valid configurations. It is supposed to verify if configuration dependencies are valid and compile. It is not supposed to be used as replacement for all{mod,yes}config. However, that is not currently the case. "make randconfig" treats all configurations randomly. This means that "COMPILE_TEST" will be enabled randomly. This defeats the purpose of "make randconfig" To solve the problem, introduce a RANDCONFIG configuration option and set it for all "randconfig" configurations. Disable COMPILE_TEST whenever RANDCONFIG is enabled. Signed-off-by: Guenter Roeck --- init/Kconfig | 12 scripts/kconfig/confdata.c | 15 --- scripts/kconfig/expr.h | 1 + scripts/kconfig/lexer.l| 1 + scripts/kconfig/lkc.h | 1 + scripts/kconfig/menu.c | 5 + scripts/kconfig/parser.y | 6 ++ 7 files changed, 38 insertions(+), 3 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index ba8bd5256980..a85099c5e383 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -111,9 +111,21 @@ config INIT_ENV_ARG_LIMIT Maximum of each of the number of arguments and environment variables passed to init from the kernel command line. +config RANDCONFIG + bool "Compile random configurations" + option randconfig_y + help + This option indicates that the configuration is random and used to + test if configuration dependencies are valid and complete. + Resulting images are not expected to be bootable on real hardware. + + If you are a developer and want to build test random configurations, + say Y here. If you are a user/distributor, say N. + config COMPILE_TEST bool "Compile also drivers which will not load" depends on !UML && !S390 + depends on !RANDCONFIG default n help Some drivers can be compiled on a different platform than they are diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 2568dbe16ed6..0b36cc2f702b 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -1254,10 +1254,16 @@ bool conf_set_all_new_symbols(enum conf_def_mode mode) has_changed = true; switch (mode) { case def_yes: -
Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
On Tue, Feb 23, 2021 at 07:03:47PM +0100, Heiko Carstens wrote: > Well, if we would have e.g. RANDCONFIG, then we could probably revert > 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") and > instead let COMPILE_TEST depend on !RANDCONFIG. > I think this _could_ solve all common problems we currently see. > > And it would also do what you suggested. I've wanted similar (e.g. for some UBSAN options that would go weird under RANDCONFIG). :) -- Kees Cook
Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
On Tue, Feb 23, 2021 at 09:41:40AM -0800, Guenter Roeck wrote: > > I tried to explain why we don't want to set COMPILE_TEST for s390 > > anymore. It overrides architecture dependencies in Kconfig, and lots > > of drivers do not set dependencies for HAS_IOMEM, HAS_DMA, and friends > > correctly. > > This generates constantly fallout which is irrelevant for s390 and > > also for other architectures. It generates just work with close to > > zero benefit. For drivers which matter for s390 we still see those > > errors. > > > > > On the other side, if that flag would be set explicitly by > > > all{yes,mod}config, it would really beg for being misused. We > > > might then as well add a new flag that is explicitly associated > > > with all{yes,mod}config, but not with randconfig. > > > > I think that makes most sense, probably also have a flag that is set > > for randconfig. > > Not sure what value such an option would have, and how it would be used. > I would argue that randconfig should not set COMPILE_TEST to start with, > since its purpose should be to test random valid configurations and not > to compile test arbitrary (and in that case random) code. But that is > a different question, and just my personal opinion. > > Overall, the question is what kind of additional option you would find > useful for s390. You make it clear that you don't want COMPILE_TEST. > At the same time, you still want all{mod,yes}config, but presumably > excluding options currently restricted by !COMPILE_TEST (such as > DEBUG_INFO, BPF_PRELOAD, UBSAN_TRAP, GCC_PLUGIN_CYC_COMPLEXITY, > and a few others). SUPPRESS_NOISY_TESTS would not cover that, but > neither would RANDCONFIG (or whatever it would be called). Well, if we would have e.g. RANDCONFIG, then we could probably revert 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") and instead let COMPILE_TEST depend on !RANDCONFIG. I think this _could_ solve all common problems we currently see. And it would also do what you suggested.
Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
On Tue, Feb 23, 2021 at 12:54:10PM +0100, Heiko Carstens wrote: > On Mon, Feb 22, 2021 at 08:03:31AM -0800, Guenter Roeck wrote: > > > 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 > > > > > > > Good idea. Downside would be that it won't solve the real problem > > for s390 (which is lack of allmodconfig/allyesconfig compile test > > coverage because COMPILE_TEST isn't set anymore), but that is a > > different problem anyway, and my original patch doesn't solve > > that either. > > I tried to explain why we don't want to set COMPILE_TEST for s390 > anymore. It overrides architecture dependencies in Kconfig, and lots > of drivers do not set dependencies for HAS_IOMEM, HAS_DMA, and friends > correctly. > This generates constantly fallout which is irrelevant for s390 and > also for other architectures. It generates just work with close to > zero benefit. For drivers which matter for s390 we still see those > errors. > > > On the other side, if that flag would be set explicitly by > > all{yes,mod}config, it would really beg for being misused. We > > might then as well add a new flag that is explicitly associated > > with all{yes,mod}config, but not with randconfig. > > I think that makes most sense, probably also have a flag that is set > for randconfig. Not sure what value such an option would have, and how it would be used. I would argue that randconfig should not set COMPILE_TEST to start with, since its purpose should be to test random valid configurations and not to compile test arbitrary (and in that case random) code. But that is a different question, and just my personal opinion. Overall, the question is what kind of additional option you would find useful for s390. You make it clear that you don't want COMPILE_TEST. At the same time, you still want all{mod,yes}config, but presumably excluding options currently restricted by !COMPILE_TEST (such as DEBUG_INFO, BPF_PRELOAD, UBSAN_TRAP, GCC_PLUGIN_CYC_COMPLEXITY, and a few others). SUPPRESS_NOISY_TESTS would not cover that, but neither would RANDCONFIG (or whatever it would be called). Guenter
Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
On Mon, Feb 22, 2021 at 08:03:31AM -0800, Guenter Roeck wrote: > > 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 > > > > Good idea. Downside would be that it won't solve the real problem > for s390 (which is lack of allmodconfig/allyesconfig compile test > coverage because COMPILE_TEST isn't set anymore), but that is a > different problem anyway, and my original patch doesn't solve > that either. I tried to explain why we don't want to set COMPILE_TEST for s390 anymore. It overrides architecture dependencies in Kconfig, and lots of drivers do not set dependencies for HAS_IOMEM, HAS_DMA, and friends correctly. This generates constantly fallout which is irrelevant for s390 and also for other architectures. It generates just work with close to zero benefit. For drivers which matter for s390 we still see those errors. > On the other side, if that flag would be set explicitly by > all{yes,mod}config, it would really beg for being misused. We > might then as well add a new flag that is explicitly associated > with all{yes,mod}config, but not with randconfig. I think that makes most sense, probably also have a flag that is set for randconfig.
Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
On 2/22/21 7:45 AM, Masahiro Yamada wrote: > On Tue, Feb 23, 2021 at 12:18 AM Guenter Roeck 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 Cc: Heiko Carstens Fixes: 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") Signed-off-by: Guenter Roeck --- 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 > Good idea. Downside would be that it won't solve the real problem for s390 (which is lack of allmodconfig/allyesconfig compile test coverage because COMPILE_TEST isn't set anymore), but that is a different problem anyway, and my original patch doesn't solve that either. On the other side, if that flag would be set explicitly by all{yes,mod}config, it would really beg for being misused. We might then as well add a new flag that is explicitly associated with all{yes,mod}config, but not with randconfig. Thanks, Guenter
Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
On Tue, Feb 23, 2021 at 12:18 AM Guenter Roeck 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 > >> Cc: Heiko Carstens > >> Fixes: 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") > >> Signed-off-by: Guenter Roeck > >> --- > >> 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
Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
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 >> Cc: Heiko Carstens >> Fixes: 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") >> Signed-off-by: Guenter Roeck >> --- >> 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
Re: [PATCH] gcc-plugins: Disable GCC_PLUGIN_CYC_COMPLEXITY for s390
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 > Cc: Heiko Carstens > Fixes: 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") > Signed-off-by: Guenter Roeck > --- > 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?