From nobody Sun Feb 8 05:26:55 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C405B14A82; Mon, 7 Apr 2025 09:41:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744018892; cv=none; b=mpwzzg6qrXOdRJE6NE1TaHiw+YuRthdxuJ/i48pr1RUTtl7aH2GHSTKRSibZQzBYgKPiek2DwXTM18S+deOKqFyubKgYOxrNzAtQCbiIqnP8YiZ+ixbNfuJTuQY6eXCiDvchKpzUySNfHvhs1ryN7ekOTHTYGnXastA1sTKdnyM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744018892; c=relaxed/simple; bh=LADWl+fVBw+ZhNd73tyJyeOs41U/nX6r/rG0GxLjseE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=oCd5lWxP/kZ1FOGiPXfdJOaUh/1lIu4+PKnbxn7TFc6WELgzqxRtpMn4iF7SV63V0foJJv6YocWfK9sxVkezxjgUXv/0ffR32XlOXDs5uaHAtCuM8/HT/1ukACOqybGvMa4SR0TBewNzbu686QHc1NxQvkhN1cdX1R1wjJvX26c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XHsw47fa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XHsw47fa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83C23C4CEDD; Mon, 7 Apr 2025 09:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744018892; bh=LADWl+fVBw+ZhNd73tyJyeOs41U/nX6r/rG0GxLjseE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XHsw47fa1vykt54xSk2kKBeoNqvHMWT4hSYd+mem0KHkTAtdDPRPviOIjH7TmXyIn cGitmtAXfD1pge+FopBslumR8GbdAy0390VqmZNyN2zCjT22l0M2lSPgofYkvpaH5m sQaZ5V9UHeTmZxGI9F+uB7zCE96/uwsd34Cr1oJj7WWPUUup49+nNeShQIAvbcFR5P J2zAJ8sSYmVLIcqTe3Og+D5lEhYXiFMrsyLge5oyYIRaT+/dr77QL5vaNTzY4Aw0bE GrA0fRws1IGUPIbtS3GyRIIwkxMQGB6qp1vyyxMJWa4AboI3lT1RQ91UIJQ+TRbCHA yIy7kbl+9ZXlw== From: Arnd Bergmann To: linux-kbuild@vger.kernel.org Cc: Arnd Bergmann , "H. Peter Anvin" , Ard Biesheuvel , Borislav Petkov , Brian Gerst , Catalin Marinas , Dave Hansen , Herbert Xu , Ingo Molnar , Jonathan Corbet , Marc Zyngier , Mark Rutland , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Takashi Iwai , Thomas Gleixner , Uros Bizjak , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, x86@kernel.org Subject: [PATCH 1/4] kbuild: require gcc-8 and binutils-2.30 Date: Mon, 7 Apr 2025 11:41:13 +0200 Message-Id: <20250407094116.1339199-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250407094116.1339199-1-arnd@kernel.org> References: <20250407094116.1339199-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Arnd Bergmann Commit a3e8fe814ad1 ("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/20240925150059.3955569-32-ardb+git@googl= e.com/ Link: https://lore.kernel.org/lkml/871q7yxrgv.wl-tiwai@suse.de/ Signed-off-by: Arnd Bergmann --- Documentation/admin-guide/README.rst | 2 +- Documentation/kbuild/makefiles.rst | 4 +- Documentation/process/changes.rst | 4 +- .../translations/it_IT/process/changes.rst | 4 +- .../translations/zh_CN/admin-guide/README.rst | 2 +- arch/um/Makefile | 4 +- include/linux/unroll.h | 4 +- kernel/gcov/gcc_4_7.c | 4 -- lib/test_fortify/Makefile | 5 +-- scripts/Makefile.compiler | 2 +- scripts/gcc-plugins/gcc-common.h | 45 ------------------- scripts/min-tool-version.sh | 6 +-- 12 files changed, 14 insertions(+), 72 deletions(-) diff --git a/Documentation/admin-guide/README.rst b/Documentation/admin-gui= de/README.rst index 70b02f30013a..05301f03b717 100644 --- a/Documentation/admin-guide/README.rst +++ b/Documentation/admin-guide/README.rst @@ -259,7 +259,7 @@ Configuring the kernel Compiling the kernel -------------------- =20 - - Make sure you have at least gcc 5.1 available. + - Make sure you have at least gcc 8.1 available. For more information, refer to :ref:`Documentation/process/changes.rst = `. =20 - Do a ``make`` to create a compressed kernel image. It is also possible = to do diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/make= files.rst index 3b9a8bc671e2..38cc656fac20 100644 --- a/Documentation/kbuild/makefiles.rst +++ b/Documentation/kbuild/makefiles.rst @@ -625,10 +625,10 @@ gcc-min-version =20 Example:: =20 - cflags-$(call gcc-min-version, 70100) :=3D -foo + cflags-$(call gcc-min-version, 110100) :=3D -foo =20 In this example, cflags-y will be assigned the value -foo if $(CC) is gc= c and - $(CONFIG_GCC_VERSION) is >=3D 7.1. + $(CONFIG_GCC_VERSION) is >=3D 11.1. =20 clang-min-version clang-min-version tests if the value of $(CONFIG_CLANG_VERSION) is great= er diff --git a/Documentation/process/changes.rst b/Documentation/process/chan= ges.rst index d564362773b5..41b1431f5a6b 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -29,13 +29,13 @@ you probably needn't concern yourself with pcmciautils. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D Program Minimal version Command to check the version =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D -GNU C 5.1 gcc --version +GNU C 8.1 gcc --version Clang/LLVM (optional) 13.0.1 clang --version Rust (optional) 1.78.0 rustc --version bindgen (optional) 0.65.1 bindgen --version GNU make 4.0 make --version bash 4.2 bash --version -binutils 2.25 ld -v +binutils 2.30 ld -v flex 2.5.35 flex --version bison 2.0 bison --version pahole 1.16 pahole --version diff --git a/Documentation/translations/it_IT/process/changes.rst b/Documen= tation/translations/it_IT/process/changes.rst index c7d05e2fff15..2e203fbd1785 100644 --- a/Documentation/translations/it_IT/process/changes.rst +++ b/Documentation/translations/it_IT/process/changes.rst @@ -32,13 +32,13 @@ PC Card, per esempio, probabilmente non dovreste preocc= uparvi di pcmciautils. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D Programma Versione minima Comando per verificare la ve= rsione =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -GNU C 5.1 gcc --version +GNU C 8.1 gcc --version Clang/LLVM (optional) 13.0.0 clang --version Rust (opzionale) 1.78.0 rustc --version bindgen (opzionale) 0.65.1 bindgen --version GNU make 4.0 make --version bash 4.2 bash --version -binutils 2.25 ld -v +binutils 2.30 ld -v flex 2.5.35 flex --version bison 2.0 bison --version pahole 1.16 pahole --version diff --git a/Documentation/translations/zh_CN/admin-guide/README.rst b/Docu= mentation/translations/zh_CN/admin-guide/README.rst index 1bdafdc4c8e2..82e628b77efd 100644 --- a/Documentation/translations/zh_CN/admin-guide/README.rst +++ b/Documentation/translations/zh_CN/admin-guide/README.rst @@ -224,7 +224,7 @@ Linux=E5=86=85=E6=A0=B86.x=E7=89=88=E6=9C=AC =E7=BC=96=E8=AF=91=E5=86=85=E6=A0=B8 --------- =20 - - =E7=A1=AE=E4=BF=9D=E6=82=A8=E8=87=B3=E5=B0=91=E6=9C=89gcc 5.1=E5=8F=AF= =E7=94=A8=E3=80=82 + - =E7=A1=AE=E4=BF=9D=E6=82=A8=E8=87=B3=E5=B0=91=E6=9C=89gcc 8.1=E5=8F=AF= =E7=94=A8=E3=80=82 =E6=9C=89=E5=85=B3=E6=9B=B4=E5=A4=9A=E4=BF=A1=E6=81=AF=EF=BC=8C=E8=AF= =B7=E5=8F=82=E9=98=85 :ref:`Documentation/process/changes.rst ` = =E3=80=82 =20 - =E6=89=A7=E8=A1=8C ``make`` =E6=9D=A5=E5=88=9B=E5=BB=BA=E5=8E=8B=E7=BC= =A9=E5=86=85=E6=A0=B8=E6=98=A0=E5=83=8F=E3=80=82=E5=A6=82=E6=9E=9C=E6=82=A8= =E5=AE=89=E8=A3=85=E4=BA=86lilo=E4=BB=A5=E9=80=82=E9=85=8D=E5=86=85=E6=A0= =B8makefile=EF=BC=8C diff --git a/arch/um/Makefile b/arch/um/Makefile index 1d36a613aad8..599c167890ff 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -118,9 +118,7 @@ archprepare: $(Q)$(MAKE) $(build)=3D$(HOST_DIR)/um include/generated/user_constants.h =20 LINK-$(CONFIG_LD_SCRIPT_STATIC) +=3D -static -ifdef CONFIG_LD_SCRIPT_DYN -LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) +=3D -no-pie -endif +LINK-$(CONFIG_LD_SCRIPT_DYN) +=3D -no-pie LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) +=3D -Wl,-rpath,/lib =20 CFLAGS_NO_HARDENING :=3D $(call cc-option, -fno-PIC,) $(call cc-option, -f= no-pic,) \ diff --git a/include/linux/unroll.h b/include/linux/unroll.h index 863fb69f6a7e..186b71de740f 100644 --- a/include/linux/unroll.h +++ b/include/linux/unroll.h @@ -11,10 +11,8 @@ =20 #ifdef CONFIG_CC_IS_CLANG #define __pick_unrolled(x, y) _Pragma(#x) -#elif CONFIG_GCC_VERSION >=3D 80000 -#define __pick_unrolled(x, y) _Pragma(#y) #else -#define __pick_unrolled(x, y) /* not supported */ +#define __pick_unrolled(x, y) _Pragma(#y) #endif =20 /** diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c index fd75b4a484d7..a08cc076f332 100644 --- a/kernel/gcov/gcc_4_7.c +++ b/kernel/gcov/gcc_4_7.c @@ -22,10 +22,6 @@ #define GCOV_COUNTERS 9 #elif (__GNUC__ >=3D 10) #define GCOV_COUNTERS 8 -#elif (__GNUC__ >=3D 7) -#define GCOV_COUNTERS 9 -#elif (__GNUC__ > 5) || (__GNUC__ =3D=3D 5 && __GNUC_MINOR__ >=3D 1) -#define GCOV_COUNTERS 10 #else #define GCOV_COUNTERS 9 #endif diff --git a/lib/test_fortify/Makefile b/lib/test_fortify/Makefile index 1c3f82ad8bb2..399cae880e1d 100644 --- a/lib/test_fortify/Makefile +++ b/lib/test_fortify/Makefile @@ -18,10 +18,7 @@ quiet_cmd_gen_fortify_log =3D CAT $@ $(obj)/test_fortify.log: $(addprefix $(obj)/, $(logs)) FORCE $(call if_changed,gen_fortify_log) =20 -# GCC<=3D7 does not always produce *.d files. -# Run the tests only for GCC>=3D8 or Clang. -always-$(call gcc-min-version, 80000) +=3D test_fortify.log -always-$(CONFIG_CC_IS_CLANG) +=3D test_fortify.log +always-y +=3D test_fortify.log =20 # Some architectures define __NO_FORTIFY if __SANITIZE_ADDRESS__ is undefi= ned. # Pass CFLAGS_KASAN to avoid warnings. diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index 8956587b8547..d74fad494b5b 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -60,7 +60,7 @@ cc-option-yn =3D $(if $(call cc-option,$1),y,n) cc-disable-warning =3D $(if $(call cc-option,-W$(strip $1)),-Wno-$(strip $= 1)) =20 # gcc-min-version -# Usage: cflags-$(call gcc-min-version, 70100) +=3D -foo +# Usage: cflags-$(call gcc-min-version, 110100) +=3D -foo gcc-min-version =3D $(call test-ge, $(CONFIG_GCC_VERSION), $1) =20 # clang-min-version diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-com= mon.h index 3222c1070444..3fdaf1c4b258 100644 --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h @@ -3,11 +3,7 @@ #define GCC_COMMON_H_INCLUDED =20 #include "bversion.h" -#if BUILDING_GCC_VERSION >=3D 6000 #include "gcc-plugin.h" -#else -#include "plugin.h" -#endif #include "plugin-version.h" #include "config.h" #include "system.h" @@ -39,9 +35,7 @@ =20 #include "hash-map.h" =20 -#if BUILDING_GCC_VERSION >=3D 7000 #include "memmodel.h" -#endif #include "emit-rtl.h" #include "debug.h" #include "target.h" @@ -74,9 +68,7 @@ #include "context.h" #include "tree-ssa-alias.h" #include "tree-ssa.h" -#if BUILDING_GCC_VERSION >=3D 7000 #include "tree-vrp.h" -#endif #include "tree-ssanames.h" #include "print-tree.h" #include "tree-eh.h" @@ -149,16 +141,6 @@ static inline opt_pass *get_pass_for_id(int id) return g->get_passes()->get_pass_for_id(id); } =20 -#if BUILDING_GCC_VERSION < 6000 -/* gimple related */ -template <> -template <> -inline bool is_a_helper::test(const_gimple gs) -{ - return gs->code =3D=3D GIMPLE_ASSIGN; -} -#endif - #define TODO_verify_ssa TODO_verify_il #define TODO_verify_flow TODO_verify_il #define TODO_verify_stmts TODO_verify_il @@ -181,7 +163,6 @@ static inline const char *get_decl_section_name(const_t= ree decl) #define varpool_get_node(decl) varpool_node::get(decl) #define dump_varpool_node(file, node) (node)->dump(file) =20 -#if BUILDING_GCC_VERSION >=3D 8000 #define cgraph_create_edge(caller, callee, call_stmt, count, freq) \ (caller)->create_edge((callee), (call_stmt), (count)) =20 @@ -189,15 +170,6 @@ static inline const char *get_decl_section_name(const_= tree decl) old_call_stmt, call_stmt, count, freq, reason) \ (caller)->create_edge_including_clones((callee), \ (old_call_stmt), (call_stmt), (count), (reason)) -#else -#define cgraph_create_edge(caller, callee, call_stmt, count, freq) \ - (caller)->create_edge((callee), (call_stmt), (count), (freq)) - -#define cgraph_create_edge_including_clones(caller, callee, \ - old_call_stmt, call_stmt, count, freq, reason) \ - (caller)->create_edge_including_clones((callee), \ - (old_call_stmt), (call_stmt), (count), (freq), (reason)) -#endif =20 typedef struct cgraph_node *cgraph_node_ptr; typedef struct cgraph_edge *cgraph_edge_p; @@ -293,14 +265,12 @@ static inline void cgraph_call_edge_duplication_hooks= (cgraph_edge *cs1, cgraph_e symtab->call_edge_duplication_hooks(cs1, cs2); } =20 -#if BUILDING_GCC_VERSION >=3D 6000 typedef gimple *gimple_ptr; typedef const gimple *const_gimple_ptr; #define gimple gimple_ptr #define const_gimple const_gimple_ptr #undef CONST_CAST_GIMPLE #define CONST_CAST_GIMPLE(X) CONST_CAST(gimple, (X)) -#endif =20 /* gimple related */ static inline gimple gimple_build_assign_with_ops(enum tree_code subcode, = tree lhs, tree op1, tree op2 MEM_STAT_DECL) @@ -400,15 +370,7 @@ static inline void ipa_remove_stmt_references(symtab_n= ode *referring_node, gimpl referring_node->remove_stmt_references(stmt); } =20 -#if BUILDING_GCC_VERSION < 6000 -#define get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsig= nedp, preversep, pvolatilep, keep_aligning) \ - get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, p= volatilep, keep_aligning) -#define gen_rtx_set(ARG0, ARG1) gen_rtx_SET(VOIDmode, (ARG0), (ARG1)) -#endif - -#if BUILDING_GCC_VERSION >=3D 6000 #define gen_rtx_set(ARG0, ARG1) gen_rtx_SET((ARG0), (ARG1)) -#endif =20 #ifdef __cplusplus static inline void debug_tree(const_tree t) @@ -425,15 +387,8 @@ static inline void debug_gimple_stmt(const_gimple s) #define debug_gimple_stmt(s) debug_gimple_stmt(CONST_CAST_GIMPLE(s)) #endif =20 -#if BUILDING_GCC_VERSION >=3D 7000 #define get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsig= nedp, preversep, pvolatilep, keep_aligning) \ get_inner_reference(exp, pbitsize, pbitpos, poffset, pmode, punsignedp, p= reversep, pvolatilep) -#endif - -#if BUILDING_GCC_VERSION < 7000 -#define SET_DECL_ALIGN(decl, align) DECL_ALIGN(decl) =3D (align) -#define SET_DECL_MODE(decl, mode) DECL_MODE(decl) =3D (mode) -#endif =20 #if BUILDING_GCC_VERSION >=3D 14000 #define last_stmt(x) last_nondebug_stmt(x) diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh index 787868183b84..0d223b4a9445 100755 --- a/scripts/min-tool-version.sh +++ b/scripts/min-tool-version.sh @@ -14,15 +14,13 @@ fi =20 case "$1" in binutils) - echo 2.25.0 + echo 2.30.0 ;; gcc) if [ "$ARCH" =3D parisc64 ]; then echo 12.0.0 - elif [ "$SRCARCH" =3D x86 ]; then - echo 8.1.0 else - echo 5.1.0 + echo 8.1.0 fi ;; llvm) --=20 2.39.5