summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-28 11:22:01 +0200
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-06-08 11:56:01 +0200
commita4353898980cc46b28c03fc401d4d916d82c6f4f (patch)
tree4dd1672d9992cd8d4cfc85b6e7889f2dbad6a1e6 /init
parentstack-protector: test compiler capability in Kconfig and drop AUTO mode (diff)
downloadlinux-a4353898980cc46b28c03fc401d4d916d82c6f4f.tar.xz
linux-a4353898980cc46b28c03fc401d4d916d82c6f4f.zip
kconfig: add CC_IS_GCC and GCC_VERSION
This will be useful to specify the required compiler version, like this: config FOO bool "Use Foo" depends on GCC_VERSION >= 40800 help This feature requires GCC 4.8 or newer. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig8
1 files changed, 8 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 22ca30f6a6bd..66c8fd1f1d8e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -8,6 +8,14 @@ config DEFCONFIG_LIST
default ARCH_DEFCONFIG
default "arch/$(ARCH)/defconfig"
+config CC_IS_GCC
+ def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
+
+config GCC_VERSION
+ int
+ default $(shell,$(srctree)/scripts/gcc-version.sh -p $(CC) | sed 's/^0*//') if CC_IS_GCC
+ default 0
+
config CONSTRUCTORS
bool
depends on !UML