linux/init
Nathan Chancellor 0d3fccf68d
kbuild: Use '-fms-anonymous-structs' if it is available
Clang recently added '-fms-anonymous-structs' [1] to specifically enable
the Microsoft tagged anonymous structure / union extension, for which
the kernel added '-fms-extensions' in commit c4781dc3d1 ("Kbuild:
enable -fms-extensions"). Switch to this more narrow option if it is
available, which would have helped avoid the issue addressed by
commit a6773e6932 ("jfs: Rename _inline to avoid conflict with clang's
'-fms-extensions'"). GCC has talked about adding a similar flag [2] as
well but potentially naming it differently.

Move the selection of the flag to Kconfig to make it easier to use
cc-option (as CC_FLAGS_DIALECT may be used in arch Makefiles, which may
be too early for cc-option in Kbuild) and customize based on compiler
flag names.

Link: c391efe6fb [1]
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123623 [2]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Helge Deller <deller@gmx.de>  # parisc
Link: https://patch.msgid.link/20260223-fms-anonymous-structs-v1-2-8ee406d3c36c@kernel.org
Signed-off-by: Nicolas Schier <nsc@kernel.org>
2026-03-12 12:52:37 +01:00
..
.gitignore
.kunitconfig initramfs_test: kunit tests for initramfs unpacking 2025-03-08 12:13:04 +01:00
Kconfig kbuild: Use '-fms-anonymous-structs' if it is available 2026-03-12 12:52:37 +01:00
Makefile initramfs_test: kunit tests for initramfs unpacking 2025-03-08 12:13:04 +01:00
calibrate.c calibrate: update header inclusion 2025-11-27 14:24:45 -08:00
do_mounts.c vfs-7.0-rc1.nullfs 2026-02-09 13:41:34 -08:00
do_mounts.h fs: use nullfs unconditionally as the real rootfs 2026-01-14 11:23:39 +01:00
do_mounts_initrd.c init: remove /proc/sys/kernel/real-root-dev 2026-01-12 17:22:27 +01:00
do_mounts_rd.c initrd: remove deprecated code path (linuxrc) 2026-01-12 17:22:22 +01:00
init_task.c Scheduler changes for v7.0: 2026-02-10 12:50:10 -08:00
initramfs.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
initramfs_internal.h init: add initramfs_internal.h 2025-03-04 09:52:36 +01:00
initramfs_test.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
main.c mm.git review status for linus..mm-nonmm-stable 2026-02-12 12:13:01 -08:00
noinitramfs.c
version-timestamp.c ns: drop custom reference count initialization for initial namespaces 2025-11-11 10:01:32 +01:00
version.c