mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: musl@lists.openwall.com
Subject: Re: [musl] friendly errors for ABI mismatch
Date: Tue, 28 Jul 2020 21:16:07 -0400	[thread overview]
Message-ID: <20200729011606.GR6949@brightrain.aerifal.cx> (raw)
In-Reply-To: <871rkwuj5o.fsf@mid.deneb.enyo.de>

On Tue, Jul 28, 2020 at 10:40:35AM +0200, Florian Weimer wrote:
> * Rich Felker:
> 
> > Symbol versioning, if used, changes this somewhat by binding to a
> > particular version string (which by convention usually contains a
> > library name too) *if* the library used to resolve it at runtime has
> > versioning, but for very good reasons we have not used and do not want
> > to use symbol versioning. (In short, like here it's an "approximate
> > solution" for most things people want to use it for, doesn't actually
> > achieve those things precisely, messes other things up in the process,
> > and has really really bad tooling support.)
> 
> I think you should look at this from a different angle.  You could use
> it just to produce an error message in case there is an ABI change,
> but not for backwards compatibility with old binaries or enabling
> otherwise ABI-incompatible changes without rebuilding the world.

The only ABI change here is in the ABI defined between libc consumers
using the time_t-derived libc types. From the standpoint of musl's ABI
surface, the change here was similar to any other instance of adding
new interfaces for new functionality except that the new symbols get
used implicitly via redirection rather than only when directly
referenced by the application.

> With this approach, all symbols would have a single, default version.
> New releases do not add new symbol version strings in general, except
> when there is something like time64_t, in which the default (and only
> version) for those symbols changes.  Over time, you will end up with a
> few symbol versions, but at a much slower pace than what glibc does.

I didn't want to get into a detailed discussion of how symbol
versioning is broken, but it is broken, and using it in place of
symbol redirection for time64 would not have meet the needs here. In
particular, without hacking on nonstandard semantics for version
resolution, the following would not work:

- Mixing old object files (static libraries) in code built with new
  musl and time64, or vice versa.

- Supporting call-intercepting interposition libraries like fakeroot
  in a way that's safe for both time32 and time64 binaries.

I suspect there are others that I'm not recalling right off. At least
dlsym would have needed to be handled differently but I suspect it
would still be possible to make it work.

Rich

  reply	other threads:[~2020-07-29  1:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 15:27 Ariadne Conill
2020-07-27 16:03 ` Rich Felker
2020-07-27 20:54   ` A. Wilcox
2020-07-27 20:57   ` Ariadne Conill
2020-07-27 21:50     ` Rich Felker
2020-07-28  8:40       ` Florian Weimer
2020-07-29  1:16         ` Rich Felker [this message]
2020-07-27 21:16 ` 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=20200729011606.GR6949@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=fw@deneb.enyo.de \
    --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).