compiler/gcc: Raise minimum GCC version for kernel builds to 4.8
authorWill Deacon <will@kernel.org>
Wed, 22 Jan 2020 19:38:21 +0000 (19:38 +0000)
committerWill Deacon <will@kernel.org>
Wed, 15 Apr 2020 20:36:20 +0000 (21:36 +0100)
It is very rare to see versions of GCC prior to 4.8 being used to build
the mainline kernel. These old compilers are also know to have codegen
issues which can lead to silent miscompilation:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145

Raise the minimum GCC version for kernel build to 4.8 and remove some
tautological Kconfig dependencies as a consequence.

Cc: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Documentation/process/changes.rst
arch/arm/crypto/Kconfig
crypto/Kconfig
include/linux/compiler-gcc.h
init/Kconfig
scripts/gcc-plugins/Kconfig

index 91c5ff8e161e365450186f1f5864ba13df0a2a97..5cfb54c2aaa6e639e771d65a7682cef85c53c868 100644 (file)
@@ -29,7 +29,7 @@ you probably needn't concern yourself with pcmciautils.
 ====================== ===============  ========================================
         Program        Minimal version       Command to check the version
 ====================== ===============  ========================================
-GNU C                  4.6              gcc --version
+GNU C                  4.8              gcc --version
 GNU make               3.81             make --version
 binutils               2.23             ld -v
 flex                   2.5.35           flex --version
index 2674de6ada1fa4a8d76879af07dc8294b05c675a..c9bf2df85cb904d735bac933817041af206b8479 100644 (file)
@@ -30,7 +30,7 @@ config CRYPTO_SHA1_ARM_NEON
 
 config CRYPTO_SHA1_ARM_CE
        tristate "SHA1 digest algorithm (ARM v8 Crypto Extensions)"
-       depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
+       depends on KERNEL_MODE_NEON
        select CRYPTO_SHA1_ARM
        select CRYPTO_HASH
        help
@@ -39,7 +39,7 @@ config CRYPTO_SHA1_ARM_CE
 
 config CRYPTO_SHA2_ARM_CE
        tristate "SHA-224/256 digest algorithm (ARM v8 Crypto Extensions)"
-       depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
+       depends on KERNEL_MODE_NEON
        select CRYPTO_SHA256_ARM
        select CRYPTO_HASH
        help
@@ -96,7 +96,7 @@ config CRYPTO_AES_ARM_BS
 
 config CRYPTO_AES_ARM_CE
        tristate "Accelerated AES using ARMv8 Crypto Extensions"
-       depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
+       depends on KERNEL_MODE_NEON
        select CRYPTO_SKCIPHER
        select CRYPTO_LIB_AES
        select CRYPTO_SIMD
@@ -106,7 +106,7 @@ config CRYPTO_AES_ARM_CE
 
 config CRYPTO_GHASH_ARM_CE
        tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions"
-       depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
+       depends on KERNEL_MODE_NEON
        select CRYPTO_HASH
        select CRYPTO_CRYPTD
        select CRYPTO_GF128MUL
@@ -118,13 +118,13 @@ config CRYPTO_GHASH_ARM_CE
 
 config CRYPTO_CRCT10DIF_ARM_CE
        tristate "CRCT10DIF digest algorithm using PMULL instructions"
-       depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
+       depends on KERNEL_MODE_NEON
        depends on CRC_T10DIF
        select CRYPTO_HASH
 
 config CRYPTO_CRC32_ARM_CE
        tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions"
-       depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800)
+       depends on KERNEL_MODE_NEON
        depends on CRC32
        select CRYPTO_HASH
 
index c24a47406f8f57b7550a98a20654fde836d212d0..34a8c5bfd0620642f954f86cf8248068890cf9a0 100644 (file)
@@ -316,7 +316,6 @@ config CRYPTO_AEGIS128
 config CRYPTO_AEGIS128_SIMD
        bool "Support SIMD acceleration for AEGIS-128"
        depends on CRYPTO_AEGIS128 && ((ARM || ARM64) && KERNEL_MODE_NEON)
-       depends on !ARM || CC_IS_CLANG || GCC_VERSION >= 40800
        default y
 
 config CRYPTO_AEGIS128_AESNI_SSE2
index d7ee4c6bad482a39898725ec64566cb04714b5d5..e2f72527326172fa3b1a2d1b8b12048ab3bd8c7d 100644 (file)
@@ -10,7 +10,8 @@
                     + __GNUC_MINOR__ * 100     \
                     + __GNUC_PATCHLEVEL__)
 
-#if GCC_VERSION < 40600
+/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 */
+#if GCC_VERSION < 40800
 # error Sorry, your compiler is too old - please upgrade it.
 #endif
 
 #if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__)
 #define __HAVE_BUILTIN_BSWAP32__
 #define __HAVE_BUILTIN_BSWAP64__
-#if GCC_VERSION >= 40800
 #define __HAVE_BUILTIN_BSWAP16__
-#endif
 #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */
 
 #if GCC_VERSION >= 70000
index 9e22ee8fbd75e2dbe2d80fa0952e0393e4ee01dd..035d38a4f9addcd264d43ea432707e2a56d13d59 100644 (file)
@@ -1285,7 +1285,6 @@ config LD_DEAD_CODE_DATA_ELIMINATION
        bool "Dead code and data elimination (EXPERIMENTAL)"
        depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION
        depends on EXPERT
-       depends on !(FUNCTION_TRACER && CC_IS_GCC && GCC_VERSION < 40800)
        depends on $(cc-option,-ffunction-sections -fdata-sections)
        depends on $(ld-option,--gc-sections)
        help
index 013ba3a576691da34eec80e168c7f0490610ab2f..ce0b99fb5847110a410f84efba711c85ef23d138 100644 (file)
@@ -8,7 +8,7 @@ config HAVE_GCC_PLUGINS
 menuconfig GCC_PLUGINS
        bool "GCC plugins"
        depends on HAVE_GCC_PLUGINS
-       depends on CC_IS_GCC && GCC_VERSION >= 40800
+       depends on CC_IS_GCC
        depends on $(success,$(srctree)/scripts/gcc-plugin.sh $(CC))
        default y
        help