public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/2] kbuild: Switch from '-fms-extensions' to '-fms-anonymous-structs' when available
@ 2026-02-23 19:10 Nathan Chancellor
  2026-02-23 19:10 ` [PATCH 1/2] kbuild: Consolidate C dialect options Nathan Chancellor
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Nathan Chancellor @ 2026-02-23 19:10 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier
  Cc: Linus Torvalds, Catalin Marinas, Will Deacon, Huacai Chen,
	WANG Xuerui, James E.J. Bottomley, Helge Deller,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Ard Biesheuvel, Ilias Apalodimas,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Kees Cook,
	linux-kbuild, linux-kernel, linux-arm-kernel, loongarch,
	linux-parisc, linuxppc-dev, linux-s390, linux-efi, llvm

Hi all,

The kernel enabled '-fms-extensions' in commit c4781dc3d1cf ("Kbuild:
enable -fms-extensions") in 6.19 to gain access to a Microsoft
(originally Plan 9) extension around including a tagged structure/union
anonymously in an other structure/union. Since then, Clang 23.0.0
(current main) has added a flag to enable only that extension, rather
than all Microsoft extensions, '-fms-anonymous-structs' [1]. Using this
narrower compiler option would have avoided the build error fixed by
commit a6773e6932cb ("jfs: Rename _inline to avoid conflict with clang's
'-fms-extensions'"). While these errors are not expected to be common,
using the narrower option when available has no drawbacks because the
kernel only cares about this extension in '-fms-extensions', no others.
While this could result in build errors for folks using
'-fms-anonymous-structs' if a developer uses another extension in
'-fms-extensions' (either intentionally or unintentionally), flagging
these uses for further scrutiny seems worthwhile.

This series converts the build system to use that flag when it is
available. The first patch consolidates all of the C dialect flags into
a single variable to make future updates to the dialect flags less
painful, as updating the logic in every place that uses their custom
built C flags is getting cumbersome (and C23 is looming). The second
patch makes the actual switch.

I would like Nicolas to carry this in the Kbuild tree for 7.1, please
provide Acks as necessary.

[1]: https://github.com/llvm/llvm-project/commit/c391efe6fb67329d8e2fd231692cc6b0ea902956

---
Nathan Chancellor (2):
      kbuild: Consolidate C dialect options
      kbuild: Use '-fms-anonymous-structs' if it is available

 Makefile                              | 16 ++++++++++++----
 arch/arm64/kernel/vdso32/Makefile     |  3 +--
 arch/loongarch/vdso/Makefile          |  2 +-
 arch/parisc/boot/compressed/Makefile  |  2 +-
 arch/powerpc/boot/Makefile            |  3 +--
 arch/s390/Makefile                    |  3 +--
 arch/s390/purgatory/Makefile          |  3 +--
 arch/x86/Makefile                     |  6 +-----
 arch/x86/boot/compressed/Makefile     |  6 +-----
 drivers/firmware/efi/libstub/Makefile |  3 +--
 init/Kconfig                          |  5 +++++
 scripts/Makefile.warn                 |  5 -----
 12 files changed, 26 insertions(+), 31 deletions(-)
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260223-fms-anonymous-structs-f6ade6c8b5a6

Best regards,
--  
Nathan Chancellor <nathan@kernel.org>



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-03-12 12:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23 19:10 [PATCH 0/2] kbuild: Switch from '-fms-extensions' to '-fms-anonymous-structs' when available Nathan Chancellor
2026-02-23 19:10 ` [PATCH 1/2] kbuild: Consolidate C dialect options Nathan Chancellor
2026-02-27 16:36   ` Nicolas Schier
2026-02-23 19:10 ` [PATCH 2/2] kbuild: Use '-fms-anonymous-structs' if it is available Nathan Chancellor
2026-02-23 22:33   ` Kees Cook
2026-02-23 22:53     ` Nathan Chancellor
2026-02-23 23:02       ` Kees Cook
2026-02-24 20:55         ` Nathan Chancellor
2026-03-05 10:25   ` Nicolas Schier
2026-02-23 19:38 ` [PATCH 0/2] kbuild: Switch from '-fms-extensions' to '-fms-anonymous-structs' when available Ard Biesheuvel
2026-02-23 21:13   ` Helge Deller
2026-03-05 23:43 ` H. Peter Anvin
2026-03-06 23:17   ` Nathan Chancellor
2026-03-06 23:31     ` H. Peter Anvin
2026-03-09  6:49 ` Nicolas Schier
2026-03-12 12:08 ` Nicolas Schier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox