From nobody Fri Oct 31 23:15:43 2025 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 D58F12E4254; Fri, 17 Oct 2025 17:34:01 +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=1760722441; cv=none; b=uH1FNyzt/yqlXOTB9SMsejrSucnRb6yHKXHrI+P8vV63Z8yXFVYTZVSZGRxp1znOww7s9nYaJDxDM4noPivgvCVcgfok+MtyTlbV1pD5Ea0ibdy6EcmLcn8s89M2oE3eZwOzeq2DyGwfykONBa6JJQIi4txfx/sVN7nQGUp+ViU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760722441; c=relaxed/simple; bh=Q0QoUkpt2xUYIfX09AQuImr55777CNwie12QlXnh3ak=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FyHj5bXD2EN4AlNP8Nk9LBg4BJe660H9Mt17exei24c9ghWYTYd75Z8tnbE4tojwMujwFuqA7aGMG9AFczXeHppCdK0xm2ddnXU8yYdL4rzrb2DzghYVI2yQHxQDyavYGbElu5zHjZghdPO22aaaYoelOP0kg9KeZBbtABSfyiE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZWbsHMG2; 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="ZWbsHMG2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0F7DC4CEE7; Fri, 17 Oct 2025 17:33:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760722441; bh=Q0QoUkpt2xUYIfX09AQuImr55777CNwie12QlXnh3ak=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZWbsHMG2rL7Uob9SpbYui0ijtJ9eOsLfe+z0ap6YaqT8Qm5CsaU/bebVqrpaSpXyb Yc42GV4zFwYzJuF5EAJN8x7CkiymcUzNi0zqrdZqNy8zdZBtlr6qY7/s0r0OTMFP/g RclpvQiXIyRxzrTfa/NWMgxbBRgwqfx2bQuWr0tXX4YGzpcWTqG4G9OfLD0dCc/CE2 zIYa8ImRPm4zcPRXDzLLQfxebl+7Ey8FqXXvshks7stpvtS6uX2KPYTsIGpHj2TWkU rq7fYebhk2os8g118aX2jtFlhkpnb/JczTJFT9Gtru7MWC0GA45XdDHv5lA1UtP9d1 wBjB4edMq5ZwA== From: "Matthieu Baerts (NGI0)" Date: Fri, 17 Oct 2025 19:33:41 +0200 Subject: [PATCH 5.4.y 4/5] arch: back to -std=gnu89 in < v5.18 Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251017-v5-4-gcc-15-v1-4-6d6367ee50a1@kernel.org> References: <20251017-v5-4-gcc-15-v1-0-6d6367ee50a1@kernel.org> In-Reply-To: <20251017-v5-4-gcc-15-v1-0-6d6367ee50a1@kernel.org> To: stable@vger.kernel.org, Greg Kroah-Hartman , Sasha Levin Cc: MPTCP Upstream , "Matthieu Baerts (NGI0)" , Nathan Chancellor , Ard Biesheuvel , Alexey Dobriyan , Arnd Bergmann X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5445; i=matttbe@kernel.org; h=from:subject:message-id; bh=Q0QoUkpt2xUYIfX09AQuImr55777CNwie12QlXnh3ak=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDI+1f55rxp/vDRgTX+B45Kp/3497Dzuybv8zyX7A96Mt d2F3/XjOkpZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTACbC2c/IsFj/MEvWbY+0mcc0 LAxv6k2ep7XEKrt3QngPn16T3S4DLkaG1/EWog2XmJRXnpN9VikmtSlkWsPmWt+iR6ILtvnyLjn EAgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Recent fixes have been backported to < v5.18 to fix build issues with GCC 5.15. They all force -std=3Dgnu11 in the CFLAGS, "because [the kernel] requests the gnu11 standard via '-std=3D' in the main Makefile". This is true for >=3D 5.18 versions, but not before. This switch to -std=3Dgnu11 has been done in commit e8c07082a810 ("Kbuild: move to -std=3Dgnu11"). For a question of uniformity, force -std=3Dgnu89, similar to what is done in the main Makefile. Note: the fixes tags below refers to upstream commits, but this fix is only for kernels not having commit e8c07082a810 ("Kbuild: move to -std=3Dgnu11"). Fixes: 7cbb015e2d3d ("parisc: fix building with gcc-15") Fixes: 3b8b80e99376 ("s390: Add '-std=3Dgnu11' to decompressor and purgator= y CFLAGS") Fixes: b3bee1e7c3f2 ("x86/boot: Compile boot code with -std=3Dgnu11 too") Fixes: ee2ab467bddf ("x86/boot: Use '-std=3Dgnu11' to fix build with GCC 15= ") Fixes: 8ba14d9f490a ("efi: libstub: Use '-std=3Dgnu11' to fix build with GC= C 15") Signed-off-by: Matthieu Baerts (NGI0) --- Note: An alternative is to backport commit e8c07082a810 ("Kbuild: move to -std=3Dgnu11"), but I guess we might not want to do that for stable, as it might introduce new warnings. Cc: Nathan Chancellor Cc: Ard Biesheuvel Cc: Alexey Dobriyan Cc: Arnd Bergmann --- arch/parisc/boot/compressed/Makefile | 2 +- arch/s390/Makefile | 2 +- arch/s390/purgatory/Makefile | 2 +- arch/x86/Makefile | 2 +- arch/x86/boot/compressed/Makefile | 2 +- drivers/firmware/efi/libstub/Makefile | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/parisc/boot/compressed/Makefile b/arch/parisc/boot/compre= ssed/Makefile index 98d69488e5c2..92cab904f1ba 100644 --- a/arch/parisc/boot/compressed/Makefile +++ b/arch/parisc/boot/compressed/Makefile @@ -21,7 +21,7 @@ KBUILD_CFLAGS +=3D -fno-PIE -mno-space-regs -mdisable-fpr= egs -Os ifndef CONFIG_64BIT KBUILD_CFLAGS +=3D -mfast-indirect-calls endif -KBUILD_CFLAGS +=3D -std=3Dgnu11 +KBUILD_CFLAGS +=3D -std=3Dgnu89 =20 OBJECTS +=3D $(obj)/head.o $(obj)/real2.o $(obj)/firmware.o $(obj)/misc.o = $(obj)/piggy.o =20 diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 22dc393b5a83..287b853a7f09 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -23,7 +23,7 @@ endif aflags_dwarf :=3D -Wa,-gdwarf-2 KBUILD_AFLAGS_DECOMPRESSOR :=3D $(CLANG_FLAGS) -m64 -D__ASSEMBLY__ KBUILD_AFLAGS_DECOMPRESSOR +=3D $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf)) -KBUILD_CFLAGS_DECOMPRESSOR :=3D $(CLANG_FLAGS) -m64 -O2 -std=3Dgnu11 +KBUILD_CFLAGS_DECOMPRESSOR :=3D $(CLANG_FLAGS) -m64 -O2 -std=3Dgnu89 KBUILD_CFLAGS_DECOMPRESSOR +=3D -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY KBUILD_CFLAGS_DECOMPRESSOR +=3D -fno-delete-null-pointer-checks -msoft-flo= at KBUILD_CFLAGS_DECOMPRESSOR +=3D -fno-asynchronous-unwind-tables diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile index 2f4d8422bdfb..facd0b3db637 100644 --- a/arch/s390/purgatory/Makefile +++ b/arch/s390/purgatory/Makefile @@ -20,7 +20,7 @@ GCOV_PROFILE :=3D n UBSAN_SANITIZE :=3D n KASAN_SANITIZE :=3D n =20 -KBUILD_CFLAGS :=3D -std=3Dgnu11 -fno-strict-aliasing -Wall -Wstrict-protot= ypes +KBUILD_CFLAGS :=3D -std=3Dgnu89 -fno-strict-aliasing -Wall -Wstrict-protot= ypes KBUILD_CFLAGS +=3D -Wno-pointer-sign -Wno-sign-compare KBUILD_CFLAGS +=3D -fno-zero-initialized-in-bss -fno-builtin -ffreestanding KBUILD_CFLAGS +=3D -c -MD -Os -m64 -msoft-float -fno-common diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 69930ed5574b..424ee0e1f23d 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -31,7 +31,7 @@ endif CODE16GCC_CFLAGS :=3D -m32 -Wa,$(srctree)/arch/x86/boot/code16gcc.h M16_CFLAGS :=3D $(call cc-option, -m16, $(CODE16GCC_CFLAGS)) =20 -REALMODE_CFLAGS :=3D -std=3Dgnu11 $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PR= OFILING \ +REALMODE_CFLAGS :=3D -std=3Dgnu89 $(M16_CFLAGS) -g -Os -DDISABLE_BRANCH_PR= OFILING \ -Wall -Wstrict-prototypes -march=3Di386 -mregparm=3D3 \ -fno-strict-aliasing -fomit-frame-pointer -fno-pic \ -mno-mmx -mno-sse $(call cc-option,-fcf-protection=3Dnone) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/M= akefile index e436819859d9..5771d5b43bb8 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -27,7 +27,7 @@ targets :=3D vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.b= in.bz2 vmlinux.bin.lzma \ vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4 =20 KBUILD_CFLAGS :=3D -m$(BITS) -O2 -KBUILD_CFLAGS +=3D -std=3Dgnu11 +KBUILD_CFLAGS +=3D -std=3Dgnu89 KBUILD_CFLAGS +=3D -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC) KBUILD_CFLAGS +=3D -DDISABLE_BRANCH_PROFILING cflags-$(CONFIG_X86_32) :=3D -march=3Di386 diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/l= ibstub/Makefile index 0dc80564bbd2..00622027a49f 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -7,7 +7,7 @@ # cflags-$(CONFIG_X86_32) :=3D -march=3Di386 cflags-$(CONFIG_X86_64) :=3D -mcmodel=3Dsmall -cflags-$(CONFIG_X86) +=3D -m$(BITS) -D__KERNEL__ -O2 -std=3Dgnu11 \ +cflags-$(CONFIG_X86) +=3D -m$(BITS) -D__KERNEL__ -O2 -std=3Dgnu89 \ -fPIC -fno-strict-aliasing -mno-red-zone \ -mno-mmx -mno-sse -fshort-wchar \ -Wno-pointer-sign \ --=20 2.51.0