From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11125 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general,gmane.linux.kernel,gmane.linux.kernel.api Subject: Re: [PATCH resent] uapi libc compat: allow non-glibc to opt out of uapi definitions Date: Thu, 9 Mar 2017 01:14:35 +0100 Message-ID: <20170309001435.GJ2082@port70.net> References: <20161111120820.GA435@nyan> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1489018497 16733 195.159.176.226 (9 Mar 2017 00:14:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Mar 2017 00:14:57 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) Cc: linux-kernel@vger.kernel.org, "David S. Miller" , linux-api@vger.kernel.org, musl@lists.openwall.com, Rich Felker To: Carlos O'Donell Original-X-From: musl-return-11140-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 09 01:14:51 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1clljD-0003JD-1C for gllmg-musl@m.gmane.org; Thu, 09 Mar 2017 01:14:47 +0100 Original-Received: (qmail 25616 invoked by uid 550); 9 Mar 2017 00:14:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 24565 invoked from network); 9 Mar 2017 00:14:47 -0000 Mail-Followup-To: Carlos O'Donell , linux-kernel@vger.kernel.org, "David S. Miller" , linux-api@vger.kernel.org, musl@lists.openwall.com, Rich Felker Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:11125 gmane.linux.kernel:2426750 gmane.linux.kernel.api:22435 Archived-At: * Carlos O'Donell [2017-03-08 10:53:00 -0500]: > On 11/11/2016 07:08 AM, Felix Janda wrote: > > fixes the following compiler errors when is included > > after musl : > > > > ./linux/in6.h:32:8: error: redefinition of 'struct in6_addr' > > ./linux/in6.h:49:8: error: redefinition of 'struct sockaddr_in6' > > ./linux/in6.h:59:8: error: redefinition of 'struct ipv6_mreq' > > Do you have plans for fixing the error when the inclusion order is the other way? the other way (linux header included first) is problematic because linux headers don't follow all the standards the libc follows, they violate namespace rules in their struct definitions, so the libc definitions are necessarily incompatible with them and thus different translation units can end up refering to the same object through incompatible types which is undefined. (even if the abi matches and thus works across the syscall interface, a sufficiently smart toolchain can break such code at link time, and since the libc itself uses its own definitons that's what user code should use too). there should be a way to include standard conform libc headers and linux headers into the same tu, at least the case when all conflicting definitions come from the libc should work and i think that should be the scope of these libc-compat.h changes. (of course if glibc tries to support arbitrary interleavings then the changes should not break that)