mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Adjustments to roadmap
Date: Fri, 28 Aug 2015 13:18:18 -0400	[thread overview]
Message-ID: <20150828171818.GC7833@brightrain.aerifal.cx> (raw)
In-Reply-To: <20150828183932.0f03a8d5@r2lynx>

On Fri, Aug 28, 2015 at 06:39:32PM +0700, Рысь wrote:
> On Fri, 28 Aug 2015 09:24:22 +0200
> u-wsnj@aetey.se wrote:
> 
> > > I don't think the status quo is a reasonable option. We should
> > > either teach GCC that musl targets don't support symbol versioning,
> > > and make sure apps/libs' build systems detect this, or we should
> > > make them work. My leaning is towards the latter.
> > 
> > I'd rather prefer the former. Otherwise supporting an approach chosen
> > for unrelated reasons somewhere else imposes a certain complexity
> > cost on musl and on any packager/integrator who does not need
> > versioning.
> > 
> > Rune
> > 
> 
> I agree with this too. What are the real reasons raised to reconsider
> support for symbol versioning? How other not glibc build environments
> currently handle them?

The real reasons are what I said:

- Internal use by some software of versioned symbols, e.g. in libgcc.
  I would not call this as packaging/integration issue because it's
  not solved by using matching library versions at runtime. It
  requires internal changes that are not formulatic but require
  individual consideration for any software affected to develop and
  alternate solution.

- Presumed (I haven't tested this) breakage using C++ programs built
  with different GCC versions (and maybe even just different -std
  options?) with the latest libstdc++. Symbol versioning actually
  can't make this work when there are multiple C++ shared libraries in
  the same program built with different libstdc++ versions, but people
  generally know C++ is ABI-hell and static link most of all of the
  C++ code, only using dynamic linking for C libraries, and in that
  case symbol versioning _should_ be sufficient to make it work
  safely. Unlike the first issue, this issue _could_ be addressed at
  he packaging/integration level by making different SONAMEs for
  different libstdc++ versions/ABIs, or different library paths for
  different apps, and I'm aware that Rune is doing something like
  this, but I don't think it's reasonable to tell users they have to
  deviate heavily from upstream GCC intent to make this work.

- Silent breakage in various libraries that use symbol versioning and
  break their ABIs. As I've said before, symbol versioning does NOT
  solve this problem correctly or safely, but the chance of nasty,
  dangerous blow-up is much higher when apps/libs _think_ they have
  symbol versioning at their disposal but it doesn't actually work.
  This issue (unlike the above 2) could probably be fixed by teaching
  the toolchain that musl does not support versioned symbols, but I
  have no real-world information on how many libs would fallback to
  some other solution (SONAMEs?) vs simply refusing to build.

As I've said I'm confident in my existing conclusion that symbol
versioning was a misfeature and that it's not something musl should
use. But however dubious it is, it's a dynamic-linking behavior that a
fair amount of software expects should work. The only potential cost
of supporting it is some impact on dynamic linking time, which I'll of
course work to minimize if we support it. Code size impact is
negligible IMO.

BTW there is also one use for symbol versioning that's semi-legitimate
and not related to mixing ABIS; I believe glibc makes use of this. If
you have a family of related shared libraries and want to provide some
symbols for private interfaces between them, you can use a non-default
version. This prevents the symbol from being linkable by ld without
specifying a specific version (e.g. so configure scripts won't detect
the presence of the symbol). I would rather this feature have never
existed, but it does exist, and software that uses it is not doing
anything sketchy with mixing of incompatible ABIs via versioning; it's
just using the mechanism to achieve a different result.

Rich


  reply	other threads:[~2015-08-28 17:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-28  2:43 Rich Felker
2015-08-28  3:38 ` Khem Raj
2015-08-28  4:21   ` Rich Felker
2015-08-28  6:57     ` Вася Бойцов
2015-08-28 12:47       ` Rich Felker
2015-08-28 12:16     ` Justin Cormack
2015-08-28  7:24 ` u-wsnj
2015-08-28 11:39   ` Рысь
2015-08-28 17:18     ` Rich Felker [this message]
2015-08-30  4:21       ` Рысь
2015-08-30  4:46         ` Rich Felker
2015-08-30  5:13           ` Рысь
2015-08-30  5:30             ` Rich Felker
2015-08-30  9:00               ` Szabolcs Nagy
2015-08-30 17:09                 ` Rich Felker
2015-08-30 17:45                   ` u-wsnj
2015-08-30 17:13               ` Рысь
2015-08-30 17:38                 ` Rich Felker
2015-08-30  5:18 ` Рысь
2015-08-30  5:31   ` Rich Felker
2015-08-30 17:21     ` Рысь
2015-08-30 19:29       ` Message localization [Was: Re: [musl] Adjustments to roadmap] Rich Felker
2015-09-01  4:26         ` Рысь
2015-09-01  4:47           ` Rich Felker
2015-09-02  2:26             ` Рысь
2015-09-02  2:28               ` Rich Felker
2015-09-07 13:51                 ` Рысь
2015-09-08 15:18                   ` Rich Felker
2015-08-31  7:09 ` Adjustments to roadmap 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=20150828171818.GC7833@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).