diff options
| author | Nathan Chancellor <nathan@kernel.org> | 2026-02-23 12:10:29 -0700 |
|---|---|---|
| committer | Nicolas Schier <nsc@kernel.org> | 2026-03-12 12:52:37 +0100 |
| commit | 0d3fccf68d9873a3c824fb70be0dbb2c4642aa90 (patch) | |
| tree | 160d12c130d3e5b805de6b9e5c4cb46f17661692 /Documentation/controllers/git@git.tavy.me:linux.git | |
| parent | ec4c28276c140a9338700041112f64f8d7ccc3e9 (diff) | |
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 c4781dc3d1cf ("Kbuild:
enable -fms-extensions"). Switch to this more narrow option if it is
available, which would have helped avoid the issue addressed by
commit a6773e6932cb ("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: https://github.com/llvm/llvm-project/commit/c391efe6fb67329d8e2fd231692cc6b0ea902956 [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>
Diffstat (limited to 'Documentation/controllers/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
