From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: iproute2 & other software
Date: Thu, 3 Mar 2016 11:00:54 -0500 [thread overview]
Message-ID: <20160303160054.GV9349@brightrain.aerifal.cx> (raw)
In-Reply-To: <20160303101005.GJ29662@port70.net>
On Thu, Mar 03, 2016 at 11:10:06AM +0100, Szabolcs Nagy wrote:
> * Rich Felker <dalias@libc.org> [2016-03-02 18:30:50 -0500]:
> > On Wed, Mar 02, 2016 at 09:49:41PM +0100, Szabolcs Nagy wrote:
> > > * Loganaden Velvindron <loganaden@gmail.com> [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 <netinet/in.h>
#else
/* their own definitions */
#endif
but I suspect that would be controversial on the kernel side.
Rich
next prev parent reply other threads:[~2016-03-03 16:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 19:19 Loganaden Velvindron
2016-03-02 20:37 ` Khem Raj
2016-03-02 20:39 ` Loganaden Velvindron
2016-03-02 20:44 ` Khem Raj
2016-03-02 23:18 ` Rich Felker
2016-03-02 20:49 ` Szabolcs Nagy
2016-03-02 23:30 ` Rich Felker
2016-03-03 10:10 ` Szabolcs Nagy
2016-03-03 16:00 ` Rich Felker [this message]
2016-03-03 16:12 Kylie McClain
2016-03-03 17:01 ` Szabolcs Nagy
2016-03-03 19:05 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160303160054.GV9349@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).