Skip to content

Commit dee264c

Browse files
committed
Merge tag 'gcc-minimum-version-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
Pull compiler version requirement update from Arnd Bergmann: "Require gcc-8 and binutils-2.30 x86 already uses gcc-8 as the minimum version, this changes all other architectures to the same version. gcc-8 is used is Debian 10 and Red Hat Enterprise Linux 8, both of which are still supported, and binutils 2.30 is the oldest corresponding version on those. Ubuntu Pro 18.04 and SUSE Linux Enterprise Server 15 both use gcc-7 as the system compiler but additionally include toolchains that remain supported. With the new minimum toolchain versions, a number of workarounds for older versions can be dropped, in particular on x86_64 and arm64. Importantly, the updated compiler version allows removing two of the five remaining gcc plugins, as support for sancov and structeak features is already included in modern compiler versions. I tried collecting the known changes that are possible based on the new toolchain version, but expect that more cleanups will be possible. Since this touches multiple architectures, I merged the patches through the asm-generic tree." * tag 'gcc-minimum-version-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: Makefile.kcov: apply needed compiler option unconditionally in CFLAGS_KCOV Documentation: update binutils-2.30 version reference gcc-plugins: remove SANCOV gcc plugin Kbuild: remove structleak gcc plugin arm64: drop binutils version checks raid6: skip avx512 checks kbuild: require gcc-8 and binutils-2.30
2 parents 3184898 + 582847f commit dee264c

File tree

31 files changed

+25
-677
lines changed

31 files changed

+25
-677
lines changed

Documentation/admin-guide/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ Configuring the kernel
259259
Compiling the kernel
260260
--------------------
261261

262-
- Make sure you have at least gcc 5.1 available.
262+
- Make sure you have at least gcc 8.1 available.
263263
For more information, refer to :ref:`Documentation/process/changes.rst <changes>`.
264264

265265
- Do a ``make`` to create a compressed kernel image. It is also possible to do

Documentation/kbuild/makefiles.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,10 @@ gcc-min-version
625625

626626
Example::
627627

628-
cflags-$(call gcc-min-version, 70100) := -foo
628+
cflags-$(call gcc-min-version, 110100) := -foo
629629

630630
In this example, cflags-y will be assigned the value -foo if $(CC) is gcc and
631-
$(CONFIG_GCC_VERSION) is >= 7.1.
631+
$(CONFIG_GCC_VERSION) is >= 11.1.
632632

633633
clang-min-version
634634
clang-min-version tests if the value of $(CONFIG_CLANG_VERSION) is greater

Documentation/process/changes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ you probably needn't concern yourself with pcmciautils.
2929
====================== =============== ========================================
3030
Program Minimal version Command to check the version
3131
====================== =============== ========================================
32-
GNU C 5.1 gcc --version
32+
GNU C 8.1 gcc --version
3333
Clang/LLVM (optional) 13.0.1 clang --version
3434
Rust (optional) 1.78.0 rustc --version
3535
bindgen (optional) 0.65.1 bindgen --version
3636
GNU make 4.0 make --version
3737
bash 4.2 bash --version
38-
binutils 2.25 ld -v
38+
binutils 2.30 ld -v
3939
flex 2.5.35 flex --version
4040
bison 2.0 bison --version
4141
pahole 1.16 pahole --version
@@ -116,7 +116,7 @@ Bash 4.2 or newer is needed.
116116
Binutils
117117
--------
118118

119-
Binutils 2.25 or newer is needed to build the kernel.
119+
Binutils 2.30 or newer is needed to build the kernel.
120120

121121
pkg-config
122122
----------

Documentation/translations/it_IT/process/changes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ PC Card, per esempio, probabilmente non dovreste preoccuparvi di pcmciautils.
3232
====================== ================= ========================================
3333
Programma Versione minima Comando per verificare la versione
3434
====================== ================= ========================================
35-
GNU C 5.1 gcc --version
35+
GNU C 8.1 gcc --version
3636
Clang/LLVM (optional) 13.0.0 clang --version
3737
Rust (opzionale) 1.78.0 rustc --version
3838
bindgen (opzionale) 0.65.1 bindgen --version
3939
GNU make 4.0 make --version
4040
bash 4.2 bash --version
41-
binutils 2.25 ld -v
41+
binutils 2.30 ld -v
4242
flex 2.5.35 flex --version
4343
bison 2.0 bison --version
4444
pahole 1.16 pahole --version
@@ -118,7 +118,7 @@ Questo richiede bash 4.2 o successivo.
118118
Binutils
119119
--------
120120

121-
Per generare il kernel è necessario avere Binutils 2.25 o superiore.
121+
Per generare il kernel è necessario avere Binutils 2.30 o superiore.
122122

123123
pkg-config
124124
----------

Documentation/translations/zh_CN/admin-guide/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Linux内核6.x版本 <http://kernel.org/>
224224
编译内核
225225
---------
226226

227-
- 确保您至少有gcc 5.1可用。
227+
- 确保您至少有gcc 8.1可用。
228228
有关更多信息,请参阅 :ref:`Documentation/process/changes.rst <changes>` 。
229229

230230
- 执行 ``make`` 来创建压缩内核映像。如果您安装了lilo以适配内核makefile,

arch/arm64/Kconfig

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,6 @@ config ARM64_ERRATUM_843419
659659

660660
If unsure, say Y.
661661

662-
config ARM64_LD_HAS_FIX_ERRATUM_843419
663-
def_bool $(ld-option,--fix-cortex-a53-843419)
664-
665662
config ARM64_ERRATUM_1024718
666663
bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
667664
default y
@@ -1907,13 +1904,9 @@ config ARM64_PAN
19071904
The feature is detected at runtime, and will remain as a 'nop'
19081905
instruction if the cpu does not implement the feature.
19091906

1910-
config AS_HAS_LSE_ATOMICS
1911-
def_bool $(as-instr,.arch_extension lse)
1912-
19131907
config ARM64_LSE_ATOMICS
19141908
bool
19151909
default ARM64_USE_LSE_ATOMICS
1916-
depends on AS_HAS_LSE_ATOMICS
19171910

19181911
config ARM64_USE_LSE_ATOMICS
19191912
bool "Atomic instructions"
@@ -1925,20 +1918,12 @@ config ARM64_USE_LSE_ATOMICS
19251918

19261919
Say Y here to make use of these instructions for the in-kernel
19271920
atomic routines. This incurs a small overhead on CPUs that do
1928-
not support these instructions and requires the kernel to be
1929-
built with binutils >= 2.25 in order for the new instructions
1930-
to be used.
1921+
not support these instructions.
19311922

19321923
endmenu # "ARMv8.1 architectural features"
19331924

19341925
menu "ARMv8.2 architectural features"
19351926

1936-
config AS_HAS_ARMV8_2
1937-
def_bool $(cc-option,-Wa$(comma)-march=armv8.2-a)
1938-
1939-
config AS_HAS_SHA3
1940-
def_bool $(as-instr,.arch armv8.2-a+sha3)
1941-
19421927
config ARM64_PMEM
19431928
bool "Enable support for persistent memory"
19441929
select ARCH_HAS_PMEM_API
@@ -2012,7 +1997,6 @@ config ARM64_PTR_AUTH_KERNEL
20121997
bool "Use pointer authentication for kernel"
20131998
default y
20141999
depends on ARM64_PTR_AUTH
2015-
depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_ARMV8_3
20162000
# Modern compilers insert a .note.gnu.property section note for PAC
20172001
# which is only understood by binutils starting with version 2.33.1.
20182002
depends on LD_IS_LLD || LD_VERSION >= 23301 || (CC_IS_GCC && GCC_VERSION < 90100)
@@ -2033,19 +2017,10 @@ config CC_HAS_BRANCH_PROT_PAC_RET
20332017
# GCC 9 or later, clang 8 or later
20342018
def_bool $(cc-option,-mbranch-protection=pac-ret+leaf)
20352019

2036-
config CC_HAS_SIGN_RETURN_ADDRESS
2037-
# GCC 7, 8
2038-
def_bool $(cc-option,-msign-return-address=all)
2039-
2040-
config AS_HAS_ARMV8_3
2041-
def_bool $(cc-option,-Wa$(comma)-march=armv8.3-a)
2042-
20432020
config AS_HAS_CFI_NEGATE_RA_STATE
2021+
# binutils 2.34+
20442022
def_bool $(as-instr,.cfi_startproc\n.cfi_negate_ra_state\n.cfi_endproc\n)
20452023

2046-
config AS_HAS_LDAPR
2047-
def_bool $(as-instr,.arch_extension rcpc)
2048-
20492024
endmenu # "ARMv8.3 architectural features"
20502025

20512026
menu "ARMv8.4 architectural features"
@@ -2073,20 +2048,13 @@ config ARM64_AMU_EXTN
20732048
correctly reflect reality. Most commonly, the value read will be 0,
20742049
indicating that the counter is not enabled.
20752050

2076-
config AS_HAS_ARMV8_4
2077-
def_bool $(cc-option,-Wa$(comma)-march=armv8.4-a)
2078-
20792051
config ARM64_TLB_RANGE
20802052
bool "Enable support for tlbi range feature"
20812053
default y
2082-
depends on AS_HAS_ARMV8_4
20832054
help
20842055
ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a
20852056
range of input addresses.
20862057

2087-
The feature introduces new assembly instructions, and they were
2088-
support when binutils >= 2.30.
2089-
20902058
endmenu # "ARMv8.4 architectural features"
20912059

20922060
menu "ARMv8.5 architectural features"
@@ -2162,7 +2130,6 @@ config ARM64_MTE
21622130
default y
21632131
depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI
21642132
depends on AS_HAS_ARMV8_5
2165-
depends on AS_HAS_LSE_ATOMICS
21662133
# Required for tag checking in the uaccess routines
21672134
select ARM64_PAN
21682135
select ARCH_HAS_SUBPAGE_FAULTS

arch/arm64/Makefile

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ ifeq ($(CONFIG_RELOCATABLE), y)
1616
# Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour
1717
# for relative relocs, since this leads to better Image compression
1818
# with the relocation offsets always being zero.
19-
LDFLAGS_vmlinux += -shared -Bsymbolic -z notext \
20-
$(call ld-option, --no-apply-dynamic-relocs)
19+
LDFLAGS_vmlinux += -shared -Bsymbolic -z notext --no-apply-dynamic-relocs
2120
endif
2221

2322
ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
24-
ifeq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
2523
LDFLAGS_vmlinux += --fix-cortex-a53-843419
26-
endif
2724
endif
2825

2926
cc_has_k_constraint := $(call try-run,echo \
@@ -105,12 +102,8 @@ endif
105102
# hardware.
106103
ifeq ($(CONFIG_AS_HAS_ARMV8_5), y)
107104
asm-arch := armv8.5-a
108-
else ifeq ($(CONFIG_AS_HAS_ARMV8_4), y)
105+
else
109106
asm-arch := armv8.4-a
110-
else ifeq ($(CONFIG_AS_HAS_ARMV8_3), y)
111-
asm-arch := armv8.3-a
112-
else ifeq ($(CONFIG_AS_HAS_ARMV8_2), y)
113-
asm-arch := armv8.2-a
114107
endif
115108

116109
ifdef asm-arch
@@ -201,16 +194,6 @@ install zinstall:
201194

202195
archprepare:
203196
$(Q)$(MAKE) $(build)=arch/arm64/tools kapi
204-
ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
205-
ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
206-
@echo "warning: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum" >&2
207-
endif
208-
endif
209-
ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS),y)
210-
ifneq ($(CONFIG_ARM64_LSE_ATOMICS),y)
211-
@echo "warning: LSE atomics not supported by binutils" >&2
212-
endif
213-
endif
214197

215198
ifeq ($(KBUILD_EXTMOD),)
216199
# We need to generate vdso-offsets.h before compiling certain files in kernel/.

arch/arm64/include/asm/rwonce.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,12 @@
1212

1313
#ifndef BUILD_VDSO
1414

15-
#ifdef CONFIG_AS_HAS_LDAPR
1615
#define __LOAD_RCPC(sfx, regs...) \
1716
ALTERNATIVE( \
1817
"ldar" #sfx "\t" #regs, \
1918
".arch_extension rcpc\n" \
2019
"ldapr" #sfx "\t" #regs, \
2120
ARM64_HAS_LDAPR)
22-
#else
23-
#define __LOAD_RCPC(sfx, regs...) "ldar" #sfx "\t" #regs
24-
#endif /* CONFIG_AS_HAS_LDAPR */
2521

2622
/*
2723
* When building with LTO, there is an increased risk of the compiler

arch/arm64/kvm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ if VIRTUALIZATION
1919

2020
menuconfig KVM
2121
bool "Kernel-based Virtual Machine (KVM) support"
22-
depends on AS_HAS_ARMV8_4
2322
select KVM_COMMON
2423
select KVM_GENERIC_HARDWARE_ENABLING
2524
select KVM_GENERIC_MMU_NOTIFIER

arch/arm64/lib/xor-neon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static void xor_arm64_eor3_5(unsigned long bytes,
319319

320320
static int __init xor_neon_init(void)
321321
{
322-
if (IS_ENABLED(CONFIG_AS_HAS_SHA3) && cpu_have_named_feature(SHA3)) {
322+
if (cpu_have_named_feature(SHA3)) {
323323
xor_block_inner_neon.do_3 = xor_arm64_eor3_3;
324324
xor_block_inner_neon.do_4 = xor_arm64_eor3_4;
325325
xor_block_inner_neon.do_5 = xor_arm64_eor3_5;

0 commit comments

Comments
 (0)