mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: pthread object sizes for new archs
Date: Tue, 10 Mar 2015 14:24:41 -0400	[thread overview]
Message-ID: <20150310182441.GC23507@brightrain.aerifal.cx> (raw)
In-Reply-To: <1425976244.2199.1.camel@inria.fr>

On Tue, Mar 10, 2015 at 09:30:44AM +0100, Jens Gustedt wrote:
> Hello,
> 
> Am Montag, den 09.03.2015, 21:07 -0400 schrieb Rich Felker:
> > How does this affect "glibc ABI compatibility"? Very little. As long
> > as the sizes of the musl types are no larger than the sizes of the
> > glibc types on the same arch, compatibility with glibc binary code
> > (apps or libs) is not affected. All that is affected if the ABI of
> > third-party libraries that use pthread types as members of public
> > structs, and it only matters if you're calling such libraries using
> > the glibc-derived ABI from code compiled against musl and using the
> > affected structures. This is a very unusual usage case, not something
> > we've ever prioritized supporting (it's broken in several other ways
> > anyway, or at least it was historically), and IMO it's not worth
> > severely bloating new archs that people actually want to use.
> 
> So to rephrase your arguments for that
> 
>  - For the case I compile my code with the glibc ABI and link it with
>    musl: any struct that has pthread (or C11 thread) components in it
>    will potentially only use a smaller part of that pthread (C11)
>    component. In particular in that case when compiling with the glibc
>    ABI the compiler always generates a consistent offset for the
>    pthread components. Sounds ok.

Yes.

>    But this only works because the glibc ABI doesn't export any
>    interface that has a visible combination of different pthread
>    components. Are we sure about that?

Yes. There are no public structs containing these, and it's unlikely
there ever would be. If so they could contain their own internal
padding to match.

>  - For the case that I compile code with the musl ABI and link it with
>    glibc, this may (and probably will) cause out-of-bounds errors on
>    execution. I would very much prefer that big warnings are already
>    issued when doing such a link, or even better if such a link would
>    fail systematically.

This does not work now anyway, and it's not intended to work.

- On glibc certain symbols like strerror_r map to nonstandard
  functions with different signatures and the standard function has
  some alternate name.

- On 32-bit archs the 32-bit-off_t functions would get used and
  horribly misinterpret their argument lists.

There may be other reasons I'm not thinking of right now too.

>    I hope that there is nobody out there, who would be currently using
>    this model, perhaps unknowingly.

If so it's already broken, so breaking quicker and more spectacularly
would be nice. :-)

Rich


      reply	other threads:[~2015-03-10 18:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10  1:07 Rich Felker
2015-03-10  1:19 ` Rich Felker
2015-03-10  8:30 ` Jens Gustedt
2015-03-10 18:24   ` Rich Felker [this message]

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=20150310182441.GC23507@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).