mbox series

[0/2] A couple of build fixes for x86 when using GCC 15

Message ID 20250121-x86-use-std-consistently-gcc-15-v1-0-8ab0acf645cb@kernel.org
Headers show
Series A couple of build fixes for x86 when using GCC 15 | expand

Message

Nathan Chancellor Jan. 22, 2025, 1:11 a.m. UTC
Hi all,

GCC 15 changed the default C standard version from gnu17 to gnu23, which
reveals a few places in the kernel where a C standard version was not
set, resulting in build failures because bool, true, and false are
reserved keywords in C23 [1][2]. Update these places to use the same C
standard version as the rest of the kernel, gnu11.

[1]: https://lore.kernel.org/4OAhbllK7x4QJGpZjkYjtBYNLd_2whHx9oFiuZcGwtVR4hIzvduultkgfAIRZI3vQpZylu7Gl929HaYFRGeMEalWCpeMzCIIhLxxRhq4U-Y=@protonmail.com/
[2]: https://lore.kernel.org/Z4467umXR2PZ0M1H@tucnak/

---
Nathan Chancellor (2):
      x86/boot: Use '-std=gnu11' to fix build with GCC 15
      efi: libstub: Use '-std=gnu11' to fix build with GCC 15

 arch/x86/boot/compressed/Makefile     | 1 +
 drivers/firmware/efi/libstub/Makefile | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
---
base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
change-id: 20250121-x86-use-std-consistently-gcc-15-f95146e0050f

Best regards,

Comments

Kees Cook Jan. 30, 2025, 4:07 p.m. UTC | #1
On Tue, Jan 21, 2025 at 06:11:32PM -0700, Nathan Chancellor wrote:
> GCC 15 changed the default C standard version from gnu17 to gnu23, which
> reveals a few places in the kernel where a C standard version was not
> set, resulting in build failures because bool, true, and false are
> reserved keywords in C23 [1][2]. Update these places to use the same C
> standard version as the rest of the kernel, gnu11.

Hello x86 maintainers!

I think this would be valuable to get into -rc1 since we're getting very
close to a GCC 15 release. Can someone get this into -tip urgent,
please? If everyone is busy I can take it via the hardening tree, as we
appear to be the ones tripping over it the most currently. :)

-Kees

> [1]: https://lore.kernel.org/4OAhbllK7x4QJGpZjkYjtBYNLd_2whHx9oFiuZcGwtVR4hIzvduultkgfAIRZI3vQpZylu7Gl929HaYFRGeMEalWCpeMzCIIhLxxRhq4U-Y=@protonmail.com/
> [2]: https://lore.kernel.org/Z4467umXR2PZ0M1H@tucnak/
> 
> ---
> Nathan Chancellor (2):
>       x86/boot: Use '-std=gnu11' to fix build with GCC 15
>       efi: libstub: Use '-std=gnu11' to fix build with GCC 15
> 
>  arch/x86/boot/compressed/Makefile     | 1 +
>  drivers/firmware/efi/libstub/Makefile | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> ---
> base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
> change-id: 20250121-x86-use-std-consistently-gcc-15-f95146e0050f
> 
> Best regards,
> -- 
> Nathan Chancellor <nathan@kernel.org>
>
Ard Biesheuvel Jan. 30, 2025, 4:20 p.m. UTC | #2
On Thu, 30 Jan 2025 at 17:07, Kees Cook <kees@kernel.org> wrote:
>
> On Tue, Jan 21, 2025 at 06:11:32PM -0700, Nathan Chancellor wrote:
> > GCC 15 changed the default C standard version from gnu17 to gnu23, which
> > reveals a few places in the kernel where a C standard version was not
> > set, resulting in build failures because bool, true, and false are
> > reserved keywords in C23 [1][2]. Update these places to use the same C
> > standard version as the rest of the kernel, gnu11.
>
> Hello x86 maintainers!
>
> I think this would be valuable to get into -rc1 since we're getting very
> close to a GCC 15 release. Can someone get this into -tip urgent,
> please? If everyone is busy I can take it via the hardening tree, as we
> appear to be the ones tripping over it the most currently. :)
>

+1

Note that I already took the EFI one.
Dave Hansen Jan. 30, 2025, 6:14 p.m. UTC | #3
On 1/30/25 08:07, Kees Cook wrote:
> On Tue, Jan 21, 2025 at 06:11:32PM -0700, Nathan Chancellor wrote:
>> GCC 15 changed the default C standard version from gnu17 to gnu23, which
>> reveals a few places in the kernel where a C standard version was not
>> set, resulting in build failures because bool, true, and false are
>> reserved keywords in C23 [1][2]. Update these places to use the same C
>> standard version as the rest of the kernel, gnu11.
> Hello x86 maintainers!
> 
> I think this would be valuable to get into -rc1 since we're getting very
> close to a GCC 15 release. Can someone get this into -tip urgent,
> please? If everyone is busy I can take it via the hardening tree, as we
> appear to be the ones tripping over it the most currently. 🙂

Thanks for the heads up.  It's in here now:

> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=x86/urgent