summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-28 11:22:06 +0200
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-06-11 02:16:22 +0200
commit59f53855babf757ac7be19995670ab884aaf9b71 (patch)
tree482e47560c10f6d2a180cbf55d8cc196f7f6922b /arch
parentgcc-plugins: move GCC version check for PowerPC to Kconfig (diff)
downloadlinux-59f53855babf757ac7be19995670ab884aaf9b71.tar.xz
linux-59f53855babf757ac7be19995670ab884aaf9b71.zip
gcc-plugins: test plugin support in Kconfig and clean up Makefile
Run scripts/gcc-plugin.sh from Kconfig so that users can enable GCC_PLUGINS only when the compiler supports building plugins. Kconfig defines a new symbol, PLUGIN_HOSTCC. This will contain the compiler (g++ or gcc) used for building plugins, or empty if the plugin can not be supported at all. This allows us to remove all ugly testing in Makefile.gcc-plugins. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 2c7c3cf8adfc..e4a47d640a87 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -398,6 +398,15 @@ config SECCOMP_FILTER
See Documentation/prctl/seccomp_filter.txt for details.
+preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX),$(HOSTCC))
+
+config PLUGIN_HOSTCC
+ string
+ default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")"
+ help
+ Host compiler used to build GCC plugins. This can be $(HOSTCXX),
+ $(HOSTCC), or a null string if GCC plugin is unsupported.
+
config HAVE_GCC_PLUGINS
bool
help
@@ -407,6 +416,7 @@ config HAVE_GCC_PLUGINS
menuconfig GCC_PLUGINS
bool "GCC plugins"
depends on HAVE_GCC_PLUGINS
+ depends on PLUGIN_HOSTCC != ""
depends on !COMPILE_TEST
help
GCC plugins are loadable modules that provide extra features to the