mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
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 <[email protected]> Acked-by: Kees Cook <[email protected]>
This commit is contained in:
parent
8034c2fb12
commit
59f53855ba
4 changed files with 36 additions and 57 deletions
10
arch/Kconfig
10
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue