Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

compiler/gcc: Raise minimum GCC version for kernel builds to 4.8

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>

+10 -13
+1 -1
Documentation/process/changes.rst
··· 29 29 ====================== =============== ======================================== 30 30 Program Minimal version Command to check the version 31 31 ====================== =============== ======================================== 32 - GNU C 4.6 gcc --version 32 + GNU C 4.8 gcc --version 33 33 GNU make 3.81 make --version 34 34 binutils 2.23 ld -v 35 35 flex 2.5.35 flex --version
+6 -6
arch/arm/crypto/Kconfig
··· 30 30 31 31 config CRYPTO_SHA1_ARM_CE 32 32 tristate "SHA1 digest algorithm (ARM v8 Crypto Extensions)" 33 - depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800) 33 + depends on KERNEL_MODE_NEON 34 34 select CRYPTO_SHA1_ARM 35 35 select CRYPTO_HASH 36 36 help ··· 39 39 40 40 config CRYPTO_SHA2_ARM_CE 41 41 tristate "SHA-224/256 digest algorithm (ARM v8 Crypto Extensions)" 42 - depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800) 42 + depends on KERNEL_MODE_NEON 43 43 select CRYPTO_SHA256_ARM 44 44 select CRYPTO_HASH 45 45 help ··· 96 96 97 97 config CRYPTO_AES_ARM_CE 98 98 tristate "Accelerated AES using ARMv8 Crypto Extensions" 99 - depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800) 99 + depends on KERNEL_MODE_NEON 100 100 select CRYPTO_SKCIPHER 101 101 select CRYPTO_LIB_AES 102 102 select CRYPTO_SIMD ··· 106 106 107 107 config CRYPTO_GHASH_ARM_CE 108 108 tristate "PMULL-accelerated GHASH using NEON/ARMv8 Crypto Extensions" 109 - depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800) 109 + depends on KERNEL_MODE_NEON 110 110 select CRYPTO_HASH 111 111 select CRYPTO_CRYPTD 112 112 select CRYPTO_GF128MUL ··· 118 118 119 119 config CRYPTO_CRCT10DIF_ARM_CE 120 120 tristate "CRCT10DIF digest algorithm using PMULL instructions" 121 - depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800) 121 + depends on KERNEL_MODE_NEON 122 122 depends on CRC_T10DIF 123 123 select CRYPTO_HASH 124 124 125 125 config CRYPTO_CRC32_ARM_CE 126 126 tristate "CRC32(C) digest algorithm using CRC and/or PMULL instructions" 127 - depends on KERNEL_MODE_NEON && (CC_IS_CLANG || GCC_VERSION >= 40800) 127 + depends on KERNEL_MODE_NEON 128 128 depends on CRC32 129 129 select CRYPTO_HASH 130 130
-1
crypto/Kconfig
··· 316 316 config CRYPTO_AEGIS128_SIMD 317 317 bool "Support SIMD acceleration for AEGIS-128" 318 318 depends on CRYPTO_AEGIS128 && ((ARM || ARM64) && KERNEL_MODE_NEON) 319 - depends on !ARM || CC_IS_CLANG || GCC_VERSION >= 40800 320 319 default y 321 320 322 321 config CRYPTO_AEGIS128_AESNI_SSE2
+2 -3
include/linux/compiler-gcc.h
··· 10 10 + __GNUC_MINOR__ * 100 \ 11 11 + __GNUC_PATCHLEVEL__) 12 12 13 - #if GCC_VERSION < 40600 13 + /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 */ 14 + #if GCC_VERSION < 40800 14 15 # error Sorry, your compiler is too old - please upgrade it. 15 16 #endif 16 17 ··· 127 126 #if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__) 128 127 #define __HAVE_BUILTIN_BSWAP32__ 129 128 #define __HAVE_BUILTIN_BSWAP64__ 130 - #if GCC_VERSION >= 40800 131 129 #define __HAVE_BUILTIN_BSWAP16__ 132 - #endif 133 130 #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */ 134 131 135 132 #if GCC_VERSION >= 70000
-1
init/Kconfig
··· 1285 1285 bool "Dead code and data elimination (EXPERIMENTAL)" 1286 1286 depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION 1287 1287 depends on EXPERT 1288 - depends on !(FUNCTION_TRACER && CC_IS_GCC && GCC_VERSION < 40800) 1289 1288 depends on $(cc-option,-ffunction-sections -fdata-sections) 1290 1289 depends on $(ld-option,--gc-sections) 1291 1290 help
+1 -1
scripts/gcc-plugins/Kconfig
··· 8 8 menuconfig GCC_PLUGINS 9 9 bool "GCC plugins" 10 10 depends on HAVE_GCC_PLUGINS 11 - depends on CC_IS_GCC && GCC_VERSION >= 40800 11 + depends on CC_IS_GCC 12 12 depends on $(success,$(srctree)/scripts/gcc-plugin.sh $(CC)) 13 13 default y 14 14 help