Skip to contentSkip to conversation

gcc-plugins: make it possible to disable CONFIG_GCC_PLUGINS again

PATCH Applied Arnd Bergmann 4 participants 7 messages Dec 11, 2019 – Dec 30, 2019 Gcc plugins

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc-plugins: make it possible to disable CONFIG_GCC_PLUGINS again

I noticed that randconfig builds with gcc no longer produce a lot of ccache hits, unlike with clang, and traced this back to plugins now being enabled unconditionally if they are supported.

I am now working around this by adding

export CCACHE_COMPILERCHECK=/usr/bin/size -A %compiler%

to my top-level Makefile. This changes the heuristic that ccache uses to determine whether the plugins are the same after a 'make clean'.

However, it also seems that being able to just turn off the plugins is generally useful, at least for build testing it adds noticeable overhead but does not find a lot of bugs additional bugs, and may be easier for ccache users than my workaround.

Fixes 9f671e58159a ("security: Create "kernel hardening" config area")
---
 scripts/gcc-plugins/Kconfig | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
scripts/gcc-plugins/Kconfig +4 -5
index d33de0b9f4f5..e3569543bdac 100644
@@ -14,8 +14,8 @@ config HAVE_GCC_PLUGINS
 	  An arch should select this symbol if it supports building with
 	  GCC plugins.
 
-config GCC_PLUGINS
-	bool
+menuconfig GCC_PLUGINS
+	bool "GCC plugins"
 	depends on HAVE_GCC_PLUGINS
 	depends on PLUGIN_HOSTCC != ""
 	default y
@@ -25,8 +25,7 @@ config GCC_PLUGINS
 
 	  See Documentation/core-api/gcc-plugins.rst for details.
 
-menu "GCC plugins"
-	depends on GCC_PLUGINS
+if GCC_PLUGINS
 
 config GCC_PLUGIN_CYC_COMPLEXITY
 	bool "Compute the cyclomatic complexity of a function" if EXPERT
@@ -113,4 +112,4 @@ config GCC_PLUGIN_ARM_SSP_PER_TASK
 	bool
 	depends on GCC_PLUGINS && ARM
 
-endmenu
+endif
Signature · 1 line
2.20.0
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Arnd Bergmann

I noticed that randconfig builds with gcc no longer produce a lot of ccache hits, unlike with clang, and traced this back to plugins now being enabled unconditionally if they are supported.

I am now working around this by adding

export CCACHE_COMPILERCHECK=/usr/bin/size -A %compiler%

to my top-level Makefile. This changes the heuristic that ccache uses to determine whether the plugins are the same after a 'make clean'.

Quoted 7 lines

However, it also seems that being able to just turn off the plugins is generally useful, at least for build testing it adds noticeable overhead but does not find a lot of bugs additional bugs, and may be easier for ccache users than my workaround.

Fixes 9f671e58159a ("security: Create "kernel hardening" config area")
Quoted 38 lines
---
 scripts/gcc-plugins/Kconfig | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
scripts/gcc-plugins/Kconfig +4 -6
index d33de0b9f4f5..e3569543bdac 100644
@@ -14,8 +14,8 @@ config HAVE_GCC_PLUGINS
          An arch should select this symbol if it supports building with
          GCC plugins.
 
-config GCC_PLUGINS
-       bool
+menuconfig GCC_PLUGINS
+       bool "GCC plugins"
        depends on HAVE_GCC_PLUGINS
        depends on PLUGIN_HOSTCC != ""
        default y
@@ -25,8 +25,7 @@ config GCC_PLUGINS
 
          See Documentation/core-api/gcc-plugins.rst for details.
 
-menu "GCC plugins"
-       depends on GCC_PLUGINS
+if GCC_PLUGINS
 
 config GCC_PLUGIN_CYC_COMPLEXITY
        bool "Compute the cyclomatic complexity of a function" if EXPERT
@@ -113,4 +112,4 @@ config GCC_PLUGIN_ARM_SSP_PER_TASK
        bool
        depends on GCC_PLUGINS && ARM
 
-endmenu
+endif
--

2.20.0

Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 12 lines · Arnd Bergmann

I noticed that randconfig builds with gcc no longer produce a lot of ccache hits, unlike with clang, and traced this back to plugins now being enabled unconditionally if they are supported.

I am now working around this by adding

export CCACHE_COMPILERCHECK=/usr/bin/size -A %compiler%

to my top-level Makefile. This changes the heuristic that ccache uses to determine whether the plugins are the same after a 'make clean'.

Quoted 8 lines

However, it also seems that being able to just turn off the plugins is generally useful, at least for build testing it adds noticeable overhead but does not find a lot of bugs additional bugs, and may be easier for ccache users than my workaround.

Fixes 9f671e58159a ("security: Create "kernel hardening" config area")

---

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw
Quoted 23 lines · Masahiro Yamada
Quoted 12 lines · Arnd Bergmann

I noticed that randconfig builds with gcc no longer produce a lot of ccache hits, unlike with clang, and traced this back to plugins now being enabled unconditionally if they are supported.

I am now working around this by adding

export CCACHE_COMPILERCHECK=/usr/bin/size -A %compiler%

to my top-level Makefile. This changes the heuristic that ccache uses to determine whether the plugins are the same after a 'make clean'.

Quoted 7 lines

However, it also seems that being able to just turn off the plugins is generally useful, at least for build testing it adds noticeable overhead but does not find a lot of bugs additional bugs, and may be easier for ccache users than my workaround.

Fixes 9f671e58159a ("security: Create "kernel hardening" config area")
Quoted 1 line · Ard Biesheuvel

Thanks! Who would be the best person to pick up the patch? Should I send it to Andrew?

Arnd

Acked-by
#4 lore raw
Quoted 23 lines · Arnd Bergmann
Quoted 22 lines · Masahiro Yamada
Quoted 19 lines · Arnd Bergmann

I noticed that randconfig builds with gcc no longer produce a lot of ccache hits, unlike with clang, and traced this back to plugins now being enabled unconditionally if they are supported.

I am now working around this by adding

export CCACHE_COMPILERCHECK=/usr/bin/size -A %compiler%

to my top-level Makefile. This changes the heuristic that ccache uses to determine whether the plugins are the same after a 'make clean'.

However, it also seems that being able to just turn off the plugins is generally useful, at least for build testing it adds noticeable overhead but does not find a lot of bugs additional bugs, and may be easier for ccache users than my workaround.

Fixes 9f671e58159a ("security: Create "kernel hardening" config area")
Quoted 8 lines
Quoted 1 line
Quoted 1 line · Ard Biesheuvel

Thanks! Who would be the best person to pick up the patch? Should I send it to Andrew?

I can take it in my tree, or I'm happy to have Masahiro take it.

Signature · 1 line
Kees Cook
#5 lore raw
Quoted 34 lines · Kees Cook
Quoted 23 lines · Arnd Bergmann
Quoted 22 lines · Masahiro Yamada
Quoted 19 lines · Arnd Bergmann

I noticed that randconfig builds with gcc no longer produce a lot of ccache hits, unlike with clang, and traced this back to plugins now being enabled unconditionally if they are supported.

I am now working around this by adding

export CCACHE_COMPILERCHECK=/usr/bin/size -A %compiler%

to my top-level Makefile. This changes the heuristic that ccache uses to determine whether the plugins are the same after a 'make clean'.

However, it also seems that being able to just turn off the plugins is generally useful, at least for build testing it adds noticeable overhead but does not find a lot of bugs additional bugs, and may be easier for ccache users than my workaround.

Fixes 9f671e58159a ("security: Create "kernel hardening" config area")
Quoted 8 lines
Quoted 1 line
Quoted 1 line · Ard Biesheuvel

Thanks! Who would be the best person to pick up the patch? Should I send it to Andrew?

Quoted 6 lines

I can take it in my tree, or I'm happy to have Masahiro take it.

--
Kees Cook

Kees,
Please apply it to your tree.

Thanks.

Signature · 2 lines
Best Regards
Masahiro Yamada
Applied
#6 lore raw
Quoted 37 lines · Masahiro Yamada
Quoted 36 lines · Kees Cook
Quoted 23 lines · Arnd Bergmann
Quoted 22 lines · Masahiro Yamada
Quoted 19 lines · Arnd Bergmann

I noticed that randconfig builds with gcc no longer produce a lot of ccache hits, unlike with clang, and traced this back to plugins now being enabled unconditionally if they are supported.

I am now working around this by adding

export CCACHE_COMPILERCHECK=/usr/bin/size -A %compiler%

to my top-level Makefile. This changes the heuristic that ccache uses to determine whether the plugins are the same after a 'make clean'.

However, it also seems that being able to just turn off the plugins is generally useful, at least for build testing it adds noticeable overhead but does not find a lot of bugs additional bugs, and may be easier for ccache users than my workaround.

Fixes 9f671e58159a ("security: Create "kernel hardening" config area")
Quoted 8 lines
Quoted 1 line
Quoted 1 line · Ard Biesheuvel

Thanks! Who would be the best person to pick up the patch? Should I send it to Andrew?

Quoted 7 lines
Quoted 4 lines

I can take it in my tree, or I'm happy to have Masahiro take it.

--
Kees Cook

Kees,
Please apply it to your tree.

Thanks, applied!

Signature · 1 line
Kees Cook