lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <173826111721.31546.13704348787528502062.tip-bot2@tip-bot2>
Date: Thu, 30 Jan 2025 18:18:36 -0000
From: "tip-bot2 for Nathan Chancellor" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Kostadin Shishmanov <kostadinshishmanov@...tonmail.com>,
 Jakub Jelinek <jakub@...hat.com>, Nathan Chancellor <nathan@...nel.org>,
 Dave Hansen <dave.hansen@...ux.intel.com>, Ard Biesheuvel <ardb@...nel.org>,
 stable@...r.kernel.org, x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: x86/urgent] x86/boot: Use '-std=gnu11' to fix build with GCC 15

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     ee2ab467bddfb2d7f68d996dbab94d7b88f8eaf7
Gitweb:        https://git.kernel.org/tip/ee2ab467bddfb2d7f68d996dbab94d7b88f8eaf7
Author:        Nathan Chancellor <nathan@...nel.org>
AuthorDate:    Tue, 21 Jan 2025 18:11:33 -07:00
Committer:     Dave Hansen <dave.hansen@...ux.intel.com>
CommitterDate: Thu, 30 Jan 2025 09:59:24 -08:00

x86/boot: Use '-std=gnu11' to fix build with GCC 15

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 <kostadinshishmanov@...tonmail.com>
Reported-by: Jakub Jelinek <jakub@...hat.com>
Signed-off-by: Nathan Chancellor <nathan@...nel.org>
Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
Reviewed-by: Ard Biesheuvel <ardb@...nel.org>
Cc:stable@...r.kernel.org
Link: https://lore.kernel.org/all/20250121-x86-use-std-consistently-gcc-15-v1-1-8ab0acf645cb%40kernel.org
---
 arch/x86/boot/compressed/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index f205164..606c74f 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -25,6 +25,7 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
 # 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 += -Wundef
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ