From: Greg Kroah-Hartman Date: Mon, 10 Feb 2025 15:03:52 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v6.6.77~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2dc724e7eabb1904dc309c6b5d3dfb68beb518e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: x86-boot-use-std-gnu11-to-fix-build-with-gcc-15.patch --- diff --git a/queue-5.10/series b/queue-5.10/series index ff68ddc7c4..de63676272 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -215,3 +215,4 @@ alsa-hda-fix-headset-detection-failure-due-to-unstable-sort.patch scsi-qla2xxx-move-fce-trace-buffer-allocation-to-user-control.patch scsi-storvsc-set-correct-data-length-for-sending-scsi-command-without-payload.patch kbuild-move-wenum-enum-conversion-to-w-2.patch +x86-boot-use-std-gnu11-to-fix-build-with-gcc-15.patch diff --git a/queue-5.10/x86-boot-use-std-gnu11-to-fix-build-with-gcc-15.patch b/queue-5.10/x86-boot-use-std-gnu11-to-fix-build-with-gcc-15.patch new file mode 100644 index 0000000000..d46db5cf2a --- /dev/null +++ b/queue-5.10/x86-boot-use-std-gnu11-to-fix-build-with-gcc-15.patch @@ -0,0 +1,52 @@ +From ee2ab467bddfb2d7f68d996dbab94d7b88f8eaf7 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 21 Jan 2025 18:11:33 -0700 +Subject: x86/boot: Use '-std=gnu11' to fix build with GCC 15 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nathan Chancellor + +commit ee2ab467bddfb2d7f68d996dbab94d7b88f8eaf7 upstream. + +GCC 15 changed the default C standard version to C23, which should not +have impacted the kernel because it requests the gnu11 standard via +'-std=' in the main Makefile. However, the x86 compressed boot Makefile +uses its own set of KBUILD_CFLAGS without a '-std=' value (i.e., using +the default), resulting in errors from the kernel's definitions of bool, +true, and false in stddef.h, which are reserved keywords under C23. + + ./include/linux/stddef.h:11:9: error: expected identifier before ‘false’ + 11 | false = 0, + ./include/linux/types.h:35:33: error: two or more data types in declaration specifiers + 35 | typedef _Bool bool; + +Set '-std=gnu11' in the x86 compressed boot Makefile to resolve the +error and consistently use the same C standard version for the entire +kernel. + +Closes: https://lore.kernel.org/4OAhbllK7x4QJGpZjkYjtBYNLd_2whHx9oFiuZcGwtVR4hIzvduultkgfAIRZI3vQpZylu7Gl929HaYFRGeMEalWCpeMzCIIhLxxRhq4U-Y=@protonmail.com/ +Closes: https://lore.kernel.org/Z4467umXR2PZ0M1H@tucnak/ +Reported-by: Kostadin Shishmanov +Reported-by: Jakub Jelinek +Signed-off-by: Nathan Chancellor +Signed-off-by: Dave Hansen +Reviewed-by: Ard Biesheuvel +Cc:stable@vger.kernel.org +Link: https://lore.kernel.org/all/20250121-x86-use-std-consistently-gcc-15-v1-1-8ab0acf645cb%40kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/boot/compressed/Makefile | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/x86/boot/compressed/Makefile ++++ b/arch/x86/boot/compressed/Makefile +@@ -33,6 +33,7 @@ targets := vmlinux vmlinux.bin vmlinux.b + # avoid errors with '-march=i386', and future flags may depend on the target to + # be valid. + KBUILD_CFLAGS := -m$(BITS) -O2 $(CLANG_FLAGS) ++KBUILD_CFLAGS += -std=gnu11 + KBUILD_CFLAGS += -fno-strict-aliasing -fPIE + KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING + cflags-$(CONFIG_X86_32) := -march=i386