Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Sam James <sam@gentoo.org>,
	Kostadin Shishmanov <kostadinshishmanov@protonmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-kbuild@vger.kernel.org
Subject: Re: Build failure with GCC 15 (-std=gnu23)
Date: Tue, 19 Nov 2024 07:18:09 -0700	[thread overview]
Message-ID: <20241119141809.GA2196859@thelio-3990X> (raw)
In-Reply-To: <10db3077-9409-446d-8e50-1a2a803db767@app.fastmail.com>

On Tue, Nov 19, 2024 at 07:53:37AM +0100, Arnd Bergmann wrote:
> On Tue, Nov 19, 2024, at 05:15, Nathan Chancellor wrote:
> > On Tue, Nov 19, 2024 at 02:57:28AM +0000, Sam James wrote:
> >> 
> >> -std=gnu11 certainly isn't there.
> >
> > Ugh, this is because drivers/firmware/efi/libstub does not use
> > KBUILD_CFLAGS from the rest of the kernel when targeting x86:
> >
> > $ sed -n '9,21p' drivers/firmware/efi/libstub/Makefile
> > # non-x86 reuses KBUILD_CFLAGS, x86 does not
> > cflags-y                        := $(KBUILD_CFLAGS)
> >
> > cflags-$(CONFIG_X86_32)         := -march=i386
> > cflags-$(CONFIG_X86_64)         := -mcmodel=small
> > cflags-$(CONFIG_X86)            += -m$(BITS) -D__KERNEL__ \
> >                                    -fPIC -fno-strict-aliasing 
> > -mno-red-zone \
> >                                    -mno-mmx -mno-sse -fshort-wchar \
> >                                    -Wno-pointer-sign \
> >                                    $(call cc-disable-warning, 
> > address-of-packed-member) \
> >                                    $(call cc-disable-warning, gnu) \
> >                                    -fno-asynchronous-unwind-tables \
> >                                    $(CLANG_FLAGS)
> >
> > This isn't the first time this peculiarity has bitten us :/ sticking
> > '-std=gnu11' in there should resolve that issue.
> 
> Could we revisit the decision to make x86 special here and
> change it to use a modified KBUILD_CFLAGS like the other ones?

I am sure that we could have a discussion with Ard and the x86 folks
about it to see what flags need to be filtered and such but we will
still need something like I suggested in other areas of the kernel,
since this is not the only place where KBUILD_CFLAGS gets blown away.

> > arch/x86/boot/compressed/Makefile might need the same treatment. It
> > might make sense to introduce something like 'CSTD_FLAG := -std=gnu11'
> > then use that in the various places within the kernel that need it so it
> > can be consistently updated in the future whenever needed. I see that
> > flag in Makefile, arch/arm64/kernel/vdso32/Makefile, and
> > arch/x86/Makefile.
> 
> I actually have a patch to make the entire kernel use -std=gnu2x,
> but I never sent that because that requires gcc-9 or higher, and
> has no real upsides: the main difference is the handling of 'bool'
> types, and the std=gnu1x variant is simpler here because it avoids
> using the compiler-provided "stdbool.h".

Ah, that's what I thought the conclusion was but I could not remember
exactly.

Cheers,
Nathan

      reply	other threads:[~2024-11-19 14:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4OAhbllK7x4QJGpZjkYjtBYNLd_2whHx9oFiuZcGwtVR4hIzvduultkgfAIRZI3vQpZylu7Gl929HaYFRGeMEalWCpeMzCIIhLxxRhq4U-Y=@protonmail.com>
2024-11-18 20:56 ` Build failure with GCC 15 (-std=gnu23) Nathan Chancellor
2024-11-19  2:57   ` Sam James
2024-11-19  4:15     ` Nathan Chancellor
2024-11-19  4:24       ` Sam James
2024-11-19  4:47         ` Nathan Chancellor
2024-11-19 18:28           ` Masahiro Yamada
2025-01-21  0:16             ` Kees Cook
2025-01-21 21:53               ` Nathan Chancellor
2025-01-21 22:11                 ` Sam James
2025-01-21 22:51                   ` Nathan Chancellor
2024-11-19  6:53       ` Arnd Bergmann
2024-11-19 14:18         ` Nathan Chancellor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241119141809.GA2196859@thelio-3990X \
    --to=nathan@kernel.org \
    --cc=arnd@arndb.de \
    --cc=kostadinshishmanov@protonmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox