gcc-plugins: require GCC
PATCH 1/1 gcc-plugins: require GCC
Unsurprisingly GCC plugins require GCC as a compiler. This avoids GCC plugins being selectable when using clang.
--- arch/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/Kconfig +1 -1
@@ -422,7 +422,7 @@ config HAVE_GCC_PLUGINS menuconfig GCC_PLUGINS bool "GCC plugins" - depends on HAVE_GCC_PLUGINS + depends on HAVE_GCC_PLUGINS && CC_IS_GCC depends on PLUGIN_HOSTCC != "" help GCC plugins are loadable modules that provide extra features to the
Signature · 1 line
2.18.0
2018-08-11 18:48 GMT+09:00 Stefan Agner <[email protected]>:
Quoted 22 lines
Unsurprisingly GCC plugins require GCC as a compiler. This avoids GCC plugins being selectable when using clang.
Signed-off-by Stefan Agner <[email protected]>--- arch/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/Kconfig +1
-2@@ -422,7 +422,7 @@ config HAVE_GCC_PLUGINS menuconfig GCC_PLUGINS bool "GCC plugins" - depends on HAVE_GCC_PLUGINS + depends on HAVE_GCC_PLUGINS && CC_IS_GCC depends on PLUGIN_HOSTCC != "" help GCC plugins are loadable modules that provide extra features to the --
Quoted 2 lines
2.18.0
I guess the more correct way is to fixscripts/gcc-plugin.sh
This shell script should exit 0
only when GCC plugin is supported.
Kees?
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 29 lines · Masahiro Yamada
2018-08-11 18:48 GMT+09:00 Stefan Agner <[email protected]>:
Quoted 22 lines
Unsurprisingly GCC plugins require GCC as a compiler. This avoids GCC plugins being selectable when using clang.
Signed-off-by Stefan Agner <[email protected]>--- arch/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/Kconfig +1
-2@@ -422,7 +422,7 @@ config HAVE_GCC_PLUGINS menuconfig GCC_PLUGINS bool "GCC plugins" - depends on HAVE_GCC_PLUGINS + depends on HAVE_GCC_PLUGINS && CC_IS_GCC depends on PLUGIN_HOSTCC != "" help GCC plugins are loadable modules that provide extra features to the --Quoted 2 lines
2.18.0
I guess the more correct way is to fix
scripts/gcc-plugin.sh
Quoted 2 lines
This shell script should exit 0
only when GCC plugin is supported.
I'm of two minds: we already have the gcc test in Kconfig so we might want to avoid redundant checks, but maybe the script should be a "complete" test. I guess the latter. I will send a patch.
-Kees
Signature · 2 lines
Kees Cook Pixel Security
Quoted 31 lines · Kees Cook
Quoted 29 lines · Masahiro Yamada
2018-08-11 18:48 GMT+09:00 Stefan Agner <[email protected]>:
Quoted 22 lines
Unsurprisingly GCC plugins require GCC as a compiler. This avoids GCC plugins being selectable when using clang.
Signed-off-by Stefan Agner <[email protected]>--- arch/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/Kconfig +1
-2@@ -422,7 +422,7 @@ config HAVE_GCC_PLUGINS menuconfig GCC_PLUGINS bool "GCC plugins" - depends on HAVE_GCC_PLUGINS + depends on HAVE_GCC_PLUGINS && CC_IS_GCC depends on PLUGIN_HOSTCC != "" help GCC plugins are loadable modules that provide extra features to the --Quoted 2 lines
2.18.0
I guess the more correct way is to fix
scripts/gcc-plugin.sh
Quoted 6 lines
Quoted 2 lines
This shell script should exit 0
only when GCC plugin is supported.I'm of two minds: we already have the gcc test in
Kconfigso we might want to avoid redundant checks, but maybe the script should be a "complete" test. I guess the latter. I will send a patch.
Actually, how about we do the test in Kconfig, but ahead of the script? That will reduce redundancy:
arch/Kconfig +0 -0
@@ -409,7 +409,7 @@ preferred-plugin-hostcc := $(if-success,[
$(gcc-version) -ge 40800 ],$(HOSTCXX),
config PLUGIN_HOSTCC
string
- default "$(shell,$(srctree)/scripts/gcc-plugin.sh
"$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")"
+ default "$(shell,$(srctree)/scripts/gcc-plugin.sh
"$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" if CC_IS_GCC
help
Host compiler used to build GCC plugins. This can be $(HOSTCXX),
$(HOSTCC), or a null string if GCC plugin is unsupported.-Kees
Signature · 2 lines
Kees Cook Pixel Security
Quoted 55 lines · Kees Cook
Quoted 31 lines · Kees Cook
Quoted 29 lines · Masahiro Yamada
2018-08-11 18:48 GMT+09:00 Stefan Agner <[email protected]>:
Quoted 22 lines
Unsurprisingly GCC plugins require GCC as a compiler. This avoids GCC plugins being selectable when using clang.
Signed-off-by Stefan Agner <[email protected]>--- arch/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/Kconfig +1
-2@@ -422,7 +422,7 @@ config HAVE_GCC_PLUGINS menuconfig GCC_PLUGINS bool "GCC plugins" - depends on HAVE_GCC_PLUGINS + depends on HAVE_GCC_PLUGINS && CC_IS_GCC depends on PLUGIN_HOSTCC != "" help GCC plugins are loadable modules that provide extra features to the --Quoted 2 lines
2.18.0
I guess the more correct way is to fix
scripts/gcc-plugin.shQuoted 6 lines
Quoted 2 lines
This shell script should exit 0
only when GCC plugin is supported.I'm of two minds: we already have the gcc test in
Kconfigso we might want to avoid redundant checks, but maybe the script should be a "complete" test. I guess the latter. I will send a patch.Actually, how about we do the test in
Kconfig, but ahead of the script? That will reduce redundancy:arch/Kconfig +0
-1@@ -409,7 +409,7 @@ preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX), config PLUGIN_HOSTCC string - default "$(shell,$(srctree)/scripts/gcc-plugin.sh"$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")"
+ default "$(shell,$(srctree)/scripts/gcc-plugin.sh
"$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" ifCC_IS_GCC
Quoted 3 lines
help
Host compiler used to build GCC plugins. This can be $(HOSTCXX),
$(HOSTCC), or a null string if GCC plugin is unsupported.I like this better. A script which is called gcc-plugin.sh should only be called if gcc is used...
--
Stefan
Quoted 3 lines
-Kees
Masahiro Yamada
Reviewed-by2018-08-14 6:29 GMT+09:00 Stefan Agner <[email protected]>:
Quoted 50 lines · Kees Cook
Quoted 49 lines · Kees Cook
Quoted 31 lines
Quoted 29 lines · Masahiro Yamada
2018-08-11 18:48 GMT+09:00 Stefan Agner <[email protected]>:
Quoted 22 lines
Unsurprisingly GCC plugins require GCC as a compiler. This avoids GCC plugins being selectable when using clang.
Signed-off-by Stefan Agner <[email protected]>--- arch/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/Kconfig +1
-2@@ -422,7 +422,7 @@ config HAVE_GCC_PLUGINS menuconfig GCC_PLUGINS bool "GCC plugins" - depends on HAVE_GCC_PLUGINS + depends on HAVE_GCC_PLUGINS && CC_IS_GCC depends on PLUGIN_HOSTCC != "" help GCC plugins are loadable modules that provide extra features to the --Quoted 2 lines
2.18.0
I guess the more correct way is to fix
scripts/gcc-plugin.shQuoted 6 lines
Quoted 2 lines
This shell script should exit 0
only when GCC plugin is supported.I'm of two minds: we already have the gcc test in
Kconfigso we might want to avoid redundant checks, but maybe the script should be a "complete" test. I guess the latter. I will send a patch.Actually, how about we do the test in
Kconfig, but ahead of the script? That will reduce redundancy:arch/Kconfig +0
-0@@ -409,7 +409,7 @@ preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX),
Quoted 13 lines
Quoted 9 lines
arch/Kconfig +0
-1config PLUGIN_HOSTCC string - default "$(shell,$(srctree)/scripts/gcc-plugin.sh"$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")"
+ default "$(shell,$(srctree)/scripts/gcc-plugin.sh
"$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" ifCC_IS_GCChelp Host compiler used to build GCC plugins. This can be $(HOSTCXX), $(HOSTCC), or a null string if GCC plugin is unsupported.I like this better. A script which is called
gcc-plugin.shshould only be called if gcc is used...
This does not work like that.
$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")
is expanded in the parse stage regardless of CC_IS_GCC.
If nobody comes up with a better way, I am fine with this.
Quoted 6 lines
--
StefanQuoted 3 lines
-Kees
Signature · 2 lines
Best Regards Masahiro Yamada