From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from magnesium.8pit.net (magnesium.8pit.net [45.76.88.171]) by sourceware.org (Postfix) with ESMTP id 9DB793858428 for ; Fri, 3 Dec 2021 06:24:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9DB793858428 Received: from localhost (p200300f5ff094b007ccd85aa78228f25.dip0.t-ipconnect.de [2003:f5:ff09:4b00:7ccd:85aa:7822:8f25]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 97b0445b (TLSv1.3:AEAD-AES256-GCM-SHA384:256:YES); Fri, 3 Dec 2021 07:24:51 +0100 (CET) Date: Fri, 03 Dec 2021 07:24:46 +0100 To: Jeff Law Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] stddef.h: add support for musl typedef macro guards From: =?UTF-8?Q?S=C3=B6ren?= Tempel References: <20211126165717.9729-1-soeren@soeren-tempel.net> <7da617fe-bf76-fd57-b32b-0688ac8795ac@gmail.com> In-Reply-To: <7da617fe-bf76-fd57-b32b-0688ac8795ac@gmail.com> Message-Id: <3LNI9X4XOTA5O.3JKS4FGJD3ULO@8pit.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2021 06:24:55 -0000 Hi, Jeff Law wrote: > So what doesn't make sense here is how both stddef.h files get=20 > included.=C2=A0 That's the core problem I think you need to resolve. The libgo/sysinfo.c file includes stddef.h (for which the GCC version in ginclude is used on my system) and stdlib.h which, on musl, causes an include of /usr/include/bits/alltypes.h [1] which then defines size_t and other types, which were already defined by GCC's stddef.h, again [2]. As such, both stddef.h files are actually not included, i.e. only the GCC one is used. The alternative here would be to have libgo/sysinfo.c include the stddef.h provide by the systemc libc but not sure if that is intended here. I am personally not very familiar with the GCC codebase. I can send you a pre-processed version of sysinfo.c if you want to reproduce this yourself. Greetings, S=C3=B6ren [1]: https://git.musl-libc.org/cgit/musl/tree/include/stdlib.h?id=3Db76f37f= d5625d038141b52184956fb4b7838e9a5#n19 [2]: https://git.musl-libc.org/cgit/musl/tree/include/alltypes.h.in?id=3Db7= 6f37fd5625d038141b52184956fb4b7838e9a5#n5