Skip to content

Commit 118c40b

Browse files
committed
kbuild: require gcc-8 and binutils-2.30
Commit a3e8fe8 ("x86/build: Raise the minimum GCC version to 8.1") raised the minimum compiler version as enforced by Kbuild to gcc-8.1 and clang-15 for x86. This is actually the same gcc version that has been discussed as the minimum for all architectures several times in the past, with little objection. A previous concern was the kernel for SLE15-SP7 needing to be built with gcc-7. As this ended up still using linux-6.4 and there is no plan for an SP8, this is no longer a problem. Change it for all architectures and adjust the documentation accordingly. A few version checks can be removed in the process. The binutils version 2.30 is the lowest version used in combination with gcc-8 on common distros, so use that as the corresponding minimum. Link: https://lore.kernel.org/lkml/[email protected]/ Link: https://lore.kernel.org/lkml/[email protected]/ Acked-by: Mark Rutland <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent b443265 commit 118c40b

File tree

12 files changed

+14
-72
lines changed

12 files changed

+14
-72
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: 2 additions & 2 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

Documentation/translations/it_IT/process/changes.rst

Lines changed: 2 additions & 2 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

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/um/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ archprepare:
118118
$(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h
119119

120120
LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
121-
ifdef CONFIG_LD_SCRIPT_DYN
122-
LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie
123-
endif
121+
LINK-$(CONFIG_LD_SCRIPT_DYN) += -no-pie
124122
LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib
125123

126124
CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \

include/linux/unroll.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111

1212
#ifdef CONFIG_CC_IS_CLANG
1313
#define __pick_unrolled(x, y) _Pragma(#x)
14-
#elif CONFIG_GCC_VERSION >= 80000
15-
#define __pick_unrolled(x, y) _Pragma(#y)
1614
#else
17-
#define __pick_unrolled(x, y) /* not supported */
15+
#define __pick_unrolled(x, y) _Pragma(#y)
1816
#endif
1917

2018
/**

kernel/gcov/gcc_4_7.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
#define GCOV_COUNTERS 9
2323
#elif (__GNUC__ >= 10)
2424
#define GCOV_COUNTERS 8
25-
#elif (__GNUC__ >= 7)
26-
#define GCOV_COUNTERS 9
27-
#elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1)
28-
#define GCOV_COUNTERS 10
2925
#else
3026
#define GCOV_COUNTERS 9
3127
#endif

lib/test_fortify/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ quiet_cmd_gen_fortify_log = CAT $@
1818
$(obj)/test_fortify.log: $(addprefix $(obj)/, $(logs)) FORCE
1919
$(call if_changed,gen_fortify_log)
2020

21-
# GCC<=7 does not always produce *.d files.
22-
# Run the tests only for GCC>=8 or Clang.
23-
always-$(call gcc-min-version, 80000) += test_fortify.log
24-
always-$(CONFIG_CC_IS_CLANG) += test_fortify.log
21+
always-y += test_fortify.log
2522

2623
# Some architectures define __NO_FORTIFY if __SANITIZE_ADDRESS__ is undefined.
2724
# Pass CFLAGS_KASAN to avoid warnings.

scripts/Makefile.compiler

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ cc-option-yn = $(if $(call cc-option,$1),y,n)
6060
cc-disable-warning = $(if $(call cc-option,-W$(strip $1)),-Wno-$(strip $1))
6161

6262
# gcc-min-version
63-
# Usage: cflags-$(call gcc-min-version, 70100) += -foo
63+
# Usage: cflags-$(call gcc-min-version, 110100) += -foo
6464
gcc-min-version = $(call test-ge, $(CONFIG_GCC_VERSION), $1)
6565

6666
# clang-min-version

0 commit comments

Comments
 (0)