From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: Removing glibc from the musl .2 ABI
Date: Wed, 24 Jul 2019 17:17:35 +0200 [thread overview]
Message-ID: <20190724151735.GS21055@port70.net> (raw)
In-Reply-To: <20190722155259.GA7445@brightrain.aerifal.cx>
* Rich Felker <dalias@libc.org> [2019-07-22 11:52:59 -0400]:
> So, what I'd (tentatively; for discussion) like to do:
>
> When ldso loads an application or shared library and detects that it's
> glibc-linked (DT_NEEDED for libc.so.6), it both loads a gcompat
> library instead *and* flags the dso as needing ABI-compat. The gcompat
> library would be permanently RTLD_LOCAL, unable to be used for
> resolving global symbols, since it would have to define symbols
> conflicting with libc symbols names and with future directions of the
> musl ABI.
>
> Symbol lookups when relocating such a flagged dso would take place by
> first processing gcompat (logically, adding it to the head of the dso
> search list), then the normal symbol search order. The gcompat library
> could also provide a replacement dlsym function, so that dlsym calls
> from the glibc-linked DSO also follow this order, and a replacement
> dlopen, so that dlopen of libc from the glibc-linked DSO would get the
> gcompat module.
>
> I'm not sure what mechanism gcompat would then use to make its own
> references to the underlying real libc functions. This is something
> we'd need to think about.
i'm not sure how gcompat would implement dlsym, if it's
on top of the musl dlsym, then that needs to be accessible
already (e.g. by exposing a __musl_dlsym alias) and can be
used to do lookups in libc.so.
>
> Before we decide to do it, please be aware that this would be a bit of
> a burden on gcompat to do more than it's doing now. But it would also
> make lots of cases work that fundamentally *can't* work now -- compat
> with 32-bit code using the legacy 32-bit off_t functions, compat with
> 64-bit code using regexec, etc. -- anywhere the musl ABI currently
> conflicts with the glibc ABI. Of course much of this is optional. The
> new things that would be mandatory would mainly be moving over
> existing glibc compat shims (like the __ctype and __xstat stuff) and
> implementing converting wrappers where musl's use of reserved space
> creates unsafety/incompatibility with the existing glibc code.
>
> Rich
next prev parent reply other threads:[~2019-07-24 15:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 23:58 A. Wilcox
2019-07-12 0:51 ` Khem Raj
2019-07-12 1:45 ` Rich Felker
2019-07-12 1:47 ` Rich Felker
2019-07-17 3:37 ` Rich Felker
2019-07-17 13:13 ` A. Wilcox
2019-07-17 15:11 ` Rich Felker
2019-07-17 18:10 ` A. Wilcox
2019-07-17 18:16 ` Rich Felker
2019-07-22 15:52 ` Rich Felker
2019-07-24 15:17 ` Szabolcs Nagy [this message]
2019-07-24 16:02 ` Rich Felker
2019-07-24 16:33 ` James Y Knight
2019-07-24 17:36 ` Szabolcs Nagy
2019-07-24 21:31 ` Rich Felker
2019-07-24 21:29 ` Rich Felker
2019-07-25 16:42 ` James Y Knight
2019-07-25 20:03 ` 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=20190724151735.GS21055@port70.net \
--to=nsz@port70.net \
--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).