From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9DBDF513E9 for ; Thu, 5 Mar 2026 23:44:34 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fRmNJ4lX6z3c95; Fri, 06 Mar 2026 10:44:32 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2607:7c80:54:3::136" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772754272; cv=none; b=FCmRvFgh22NkjxxysoQdCFMjEsklyslXfy4E4W0LRAgTOF5V4LSqqS9GjlvMSoGNfMCisahFuXKaFMCeJ8wsf9ORlmPD71e7Tnx4cUzSPfM3vcm/B5WUpW7dJ3oegmAZ+VZ94wZYoW+C4U7E2yvXTMvRIsgjQyKYA1mhEHBB6WnOObFRk5YiEMe8q9fsry4cvygm3SyEZct1YGVKSMxVaTIHYQly+/krBkGwy4bv7rwSUOpJRhCU6vM+hNKfBXABLTuwueVMej5K0u9iioDjdbWgJJ3yygg/6fkqKgCi+mmmifb2Ec702l4ho2dRXsX9MQrdDMRe4i7vWxZSD4Kmtw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772754272; c=relaxed/relaxed; bh=W+08PYjDQhAaObzzVmi0H3Jb7j0xETdylBL3/4YZEk8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bFG81wOs/tJdwtff8TDboiQmCoGAShmFZBUnV1peLeK0LfQghq+3+wh6xpNjyN+wnr6S10i3TU19/RN+c2WnB9kotrdob7VHVPNqhVyJhZIbstqpLID4Hc5MgHgdlDaU+4mtjyUXFuybcfafSyps1HrfV+oCbCtRaN7SCWlyiUkeqgmyHwml9M3nA+CY1ZhrbEcm16ftVcamJZPvyVSINMa/oB5LUsvJ9nJUAgv5DQFHSXmLTnfkcg/gWAnO4tVe92q2/Znv6r8ToE7hNZF06lp0KCOFyxST9QNsck35c/B0QOr3BMbPhosTyrcQVmz/fNEWY1ai7EDTYZuFItXh2A== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=zytor.com; dkim=pass (2048-bit key; unprotected) header.d=zytor.com header.i=@zytor.com header.a=rsa-sha256 header.s=2026022301 header.b=NiuHMNof; dkim-atps=neutral; spf=pass (client-ip=2607:7c80:54:3::136; helo=mail.zytor.com; envelope-from=hpa@zytor.com; receiver=lists.ozlabs.org) smtp.mailfrom=zytor.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=zytor.com header.i=@zytor.com header.a=rsa-sha256 header.s=2026022301 header.b=NiuHMNof; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=zytor.com (client-ip=2607:7c80:54:3::136; helo=mail.zytor.com; envelope-from=hpa@zytor.com; receiver=lists.ozlabs.org) Received: from mail.zytor.com (terminus.zytor.com [IPv6:2607:7c80:54:3::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fRmNC5QcVz3c8x for ; Fri, 06 Mar 2026 10:44:26 +1100 (AEDT) Received: from [172.27.2.41] (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 625NhY3o4127751 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 5 Mar 2026 15:43:35 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 625NhY3o4127751 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026022301; t=1772754218; bh=W+08PYjDQhAaObzzVmi0H3Jb7j0xETdylBL3/4YZEk8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=NiuHMNofaKp4X3OTkTE4sx+ETMmwUFwgJjU83eBnK2/BqKkOamVxH8/VjJ6FOT+rj cX8EORzUxiaeuPL/1KqpN374d4Fv+bjiIc9qbH2fAFX6suJ7cqLLdsFwbLkHnOb4e/ 4rbho2As0pJPemgWwc3J3VEGg1b0DHzc5RkY8zixe6iRpSUQIEDHsEBxGqiEhzlUvB SdoTrvFmB+3vG9ZsjdkJ/n76P3jMN/BwJ0h8M1f7ogLYnkjnS0DdO4PbTJCc0rLtsz xxrlilrcBpzg9J0XWBj/4aaFK7REjIiRGJ0ywiqx438ZCLfQPfIZNO74P6Ue7O7SPu 4MLF4w7uvkNjQ== Message-ID: <01433066-eb9b-4a96-8d7f-794af941d365@zytor.com> Date: Thu, 5 Mar 2026 15:43:29 -0800 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] kbuild: Switch from '-fms-extensions' to '-fms-anonymous-structs' when available 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@kernel.org, Ard Biesheuvel , Ilias Apalodimas , Nick Desaulniers , Bill Wendling , Justin Stitt , Kees Cook , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-efi@vger.kernel.org, llvm@lists.linux.dev References: <20260223-fms-anonymous-structs-v1-0-8ee406d3c36c@kernel.org> Content-Language: en-US, sv-SE From: "H. Peter Anvin" In-Reply-To: <20260223-fms-anonymous-structs-v1-0-8ee406d3c36c@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2026-02-23 11:10, Nathan Chancellor wrote: > 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 > Question: does clang allow this with __extension__, or only if the option is on the command line? It would be desirable in the long run if both clang and gcc would allow this with __extension__, as that would be required to use it in uapi headers (at least without some doable-but-nontrivial preprocessing, which might be worthwhile to do anyway...) -hpa