From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9451 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: iproute2 & other software Date: Thu, 3 Mar 2016 11:00:54 -0500 Message-ID: <20160303160054.GV9349@brightrain.aerifal.cx> References: <20160302204941.GH29662@port70.net> <20160302233050.GQ9349@brightrain.aerifal.cx> <20160303101005.GJ29662@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457020890 4946 80.91.229.3 (3 Mar 2016 16:01:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Mar 2016 16:01:30 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9464-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 03 17:01:13 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1abVgc-0003nf-J3 for gllmg-musl@m.gmane.org; Thu, 03 Mar 2016 17:01:10 +0100 Original-Received: (qmail 15992 invoked by uid 550); 3 Mar 2016 16:01:07 -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 15973 invoked from network); 3 Mar 2016 16:01:06 -0000 Content-Disposition: inline In-Reply-To: <20160303101005.GJ29662@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9451 Archived-At: On Thu, Mar 03, 2016 at 11:10:06AM +0100, Szabolcs Nagy wrote: > * Rich Felker [2016-03-02 18:30:50 -0500]: > > On Wed, Mar 02, 2016 at 09:49:41PM +0100, Szabolcs Nagy wrote: > > > * Loganaden Velvindron [2016-03-02 19:19:13 +0000]: > > > > " > > > > Sorry, I have to reject this. > > > > All include files in include/linux come from headers automatically > > > > generated from upstream > > > > Linux source. This is the only way to ensure long term ABI/API consistency > > > > with kernel. > > > > > > > > Either fix musl or submit patches to upstream kernel and get them merged. > > > > " > > > > > > > > Can we look into providing somekind of compatibility layer for header files > > > > so that it's easier to get upstream projects like iproute2 to support musl ? > > > > > > > > > > in theory the correct solution is to fix the kernel headers > > > so they don't collide with posix types in libc headers. > > > > > > in practice old kernel headers should work too and it's unlikely > > > that a complete uapi fix would be accepted into linux any time > > > soon so applications should avoid including both libc and kernel > > > headers into the same tu. > > > > > > unfortunately glibc added workarounds into libc and uapi headers > > > that make it seem as if mixing linux and libc headers work, so > > > now application programmers don't have the incentive to fix this. > > > > > > musl cannot use the same workarounds because they use ifdef __GLIBC__ > > > (which is a major bug for linux uapi headers to depend on): > > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/libc-compat.h > > > > Would it help for us to define the __UAPI_DEF_* macros? If so I'd be > > no, because they are defined unconditionally in libc-compat.h, > however we could define _UAPI_LIBC_COMPAT_H to make the conflicting > type definitions disappear. > > but that is still fragile: any libc header would disable all > typedefs, while in glibc the checks are more fine grained. That sounds viable (we never want _any_ kernel definitions that conflict with standard ones) but I don't like the mechanism (poking at their multiple-inclusion-guard macro). Likewise I don't like how they're peeking at libc's private multiple-inclusion-guard macros. > we could also submit a linux patch to make the non-__GLIBC__ > case more reasonable (e.g. check for existing definition of > the macros). I think that sounds more reasonable. What would be ideal would be a macro we could define from features.h or even stdc-predef.h that says "libc defines all the standard types; we don't want kernel headers trying to define them", which the kernel headers would honor via: #ifdef _LIBC_DEFINES_STD_TYPES #include #else /* their own definitions */ #endif but I suspect that would be controversial on the kernel side. Rich