linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: Carlos O'Donell <carlos@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	linux-api@vger.kernel.org, musl@lists.openwall.com,
	Rich Felker <dalias@aerifal.cx>
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	[thread overview]
Message-ID: <20170309001435.GJ2082@port70.net> (raw)
In-Reply-To: <a360ec42-33ca-5e89-3d70-3b1c9a011c7f@redhat.com>

* Carlos O'Donell <carlos@redhat.com> [2017-03-08 10:53:00 -0500]:
> On 11/11/2016 07:08 AM, Felix Janda wrote:
> > fixes the following compiler errors when <linux/in6.h> is included
> > after musl <netinet/in.h>:
> > 
> > ./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)

  parent reply	other threads:[~2017-03-09  0:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 12:08 [PATCH resent] uapi libc compat: allow non-glibc to opt out of uapi definitions Felix Janda
2017-03-08 12:46 ` David Woodhouse
2017-03-08 16:39   ` Carlos O'Donell
     [not found]     ` <459a8faf-4585-5063-3d94-3a1fecfa8289-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-25  6:45       ` [musl] " Hauke Mehrtens
2017-04-25 12:29         ` Carlos O'Donell
2017-04-25 17:00           ` Rich Felker
     [not found]           ` <9f591383-6e4c-c231-1e5b-68e4b8c16d94-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-06-02  7:07             ` [musl] " Florian Weimer
     [not found]   ` <1488977188.4347.134.camel-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-04-25  6:37     ` Hauke Mehrtens
     [not found]       ` <9373f78c-ff15-fbb5-724a-27152d6f994b-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2017-04-25 12:13         ` Carlos O'Donell
2017-07-08 20:27           ` Felix Janda
2017-03-08 15:53 ` Carlos O'Donell
2017-03-08 16:25   ` Rich Felker
2017-03-08 17:29     ` Carlos O'Donell
2017-03-09  0:14   ` Szabolcs Nagy [this message]
2017-03-09  0:51     ` Carlos O'Donell
2017-03-09  2:01       ` Rich Felker
     [not found]     ` <20170309001435.GJ2082-4P1ElwuDYu6sTnJN9+BGXg@public.gmane.org>
2017-04-25 13:22       ` Florian Weimer

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=20170309001435.GJ2082@port70.net \
    --to=nsz@port70.net \
    --cc=carlos@redhat.com \
    --cc=dalias@aerifal.cx \
    --cc=davem@davemloft.net \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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.
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).