mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: lfs64 api removal
Date: Tue, 29 Oct 2019 11:20:35 -0400	[thread overview]
Message-ID: <20191029152035.GD16318@brightrain.aerifal.cx> (raw)

One roadmap item I had down for this release cycle, whose practicality
at this point I need to assess, is removal of the lfs64 stuff at the
API level. The intent is that all the macros defining "64"-suffixed
alternate names for interfaces and types involving off_t would be
removed, but the symbols would still be present for linking only
(possibly dynamic linking only). These macros tend to break C++ stuff
since GCC's default _GNU_SOURCE in C++ mode exposes them all, and
unlike glibc's definitions, musl's are at the preprocessor level where
they can't be namespaced or shadowed. And they're just ugly, useless,
and possibly misleading.

Ideally we could just remove all of this from the public headers, but
at least at one point in the past, lots of software used broken
configure tests which were link-only to infer their existence, then
without the corresponding declarations or macros in the public
headers, produced implicit function definitions using them with
horribly wrong behavior as a result. As I recall it, this was the
motivation for adding them to begin with.

If that's still an issue, removing the API while keeping the ABI
requires some mechanism to make them unavailable at ld-time but
available at ldso time. The easiest way seems to be replacing

weak_alias(foo,foo64);

with something like:

__asm__(".symver foo,foo64@");

which produces a non-default empty-versioned symbol. This seems to
also require -Wl,--default-symver to work. ("Seems", because nothing
connected to symbol versioning hell is actually documented.) It also
depends on ldso ignoring non-default symbol versions and only
resolving to the default version, which probably isn't done right now
because we don't use versions for libc/ldso itself at all. So while
the source-level change is simple, there's some real ugliness here
that might interact badly with other things in the future.

The other simple way is also a hack: have ldso recheck failed lookups
just in libc, with any 64 removed, before committing to failure.

Further alternatives are making a fake virtual dso to hook
glibc-linked (DT_NEEDED:libc.so.6) apps/libs up to and providing the
lfs64 symbols from there, or dropping them entirely from musl, moving
them to gcompat, and instead adding a feature for auto-loading gcompat
for glibc apps/libs. (These approaches involve more detail I haven't
gone into here.)

Ideally, I'd be really happy to find out that just removing the cruft
from the headers suffices, so that we can consider getting rid of the
linkable symbols as s completely separate matter later if desired
rather than having to do them together.

Rich


             reply	other threads:[~2019-10-29 15:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 15:20 Rich Felker [this message]
2019-10-29 15:43 ` A. Wilcox
2019-10-29 16:47   ` 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=20191029152035.GD16318@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).