Re: fms extension (Was: [PATCH] fs/pipe: stop duplicating union pipe_index declaration)

Ard Biesheuvel
2025-10-30T13:39:03Z

On Thu, 30 Oct 2025 at 14:23, Christian Brauner <brauner@kernel.org> wrote:
>
> On Wed, Oct 29, 2025 at 04:30:57PM -0700, Nathan Chancellor wrote:
> > On Thu, Oct 30, 2025 at 12:13:11AM +0100, Christian Brauner wrote:
> > > I'm fine either way. @Nathan, if you just want to give Linus the patch
> > > if it's small enough or just want to give me a stable branch I can pull
> > > I'll be content. Thanks!
> >
> > I do not care either way but I created a shared branch/tag since it was
> > easy enough to do. If Linus wants to take these directly for -rc4, I am
> > fine with that as well.
> >
> > Cheers,
> > Nathan
> >
> > The following changes since commit 3a8660878839faadb4f1a6dd72c3179c1df56787:
> >
> > Linux 6.18-rc1 (2025-10-12 13:42:36 -0700)
> >
> > are available in the Git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git tags/kbuild-ms-extensions-6.19
>
> Thanks, I pulled this and placed it into a branch that I can base other
> branches on.
>
> _But_, I'm already running into problems. :)
>
...
>
> Because struct cgroup_namespace embeddds struct ns_common and it
> proliferates via mm stuff into the efi code.
>
> So the EFI cod has it's own KBUILD_CFLAGS. It does:
>
> # non-x86 reuses KBUILD_CFLAGS, x86 does not
> cflags-y := $(KBUILD_CFLAGS)
>
> <snip>
>
> KBUILD_CFLAGS := $(subst $(CC_FLAGS_FTRACE),,$(cflags-y)) \
> -Os -DDISABLE_BRANCH_PROFILING \
> -include $(srctree)/include/linux/hidden.h \
> -D__NO_FORTIFY \
> -ffreestanding \
> -fno-stack-protector \
> $(call cc-option,-fno-addrsig) \
> -D__DISABLE_EXPORTS
>
> which means x86 doesn't get -fms-extension breaking the build. If I
> manually insert:
>
> diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
> index 94b05e4451dd..4ad2f8f42134 100644
> --- a/drivers/firmware/efi/libstub/Makefile
> +++ b/drivers/firmware/efi/libstub/Makefile
> @@ -42,6 +42,8 @@ KBUILD_CFLAGS := $(subst $(CC_FLAGS_FTRACE),,$(cflags-y)) \
> -ffreestanding \
> -fno-stack-protector \
> $(call cc-option,-fno-addrsig) \
> + -fms-extensions \
> + -Wno-microsoft-anon-tag \
> -D__DISABLE_EXPORTS
>
> The build works...
>
> I think we need to decide how to fix this now because as soon as someone
> makes use of the extension that is indirectly included by that libstub
> thing we're fscked.

Unless anyone is feeling brave and wants to untangle the x86 command
line delta between the stub and core kernel, I suggest we just add
these flags just like you proposed (assuming all supported compilers
tolerate their presence)