Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Thu, 1 Aug 2019 00:45:35 -0400
From: Rich Felker <>
Subject: remaining time64 blocker: lfs64 abi-compat mess

As I've mentioned on #musl and twitter, I have an i386 time64
that runs both existing binaries with 32-bit time_t and allows linking
new binaries with 64-bit time_t. The glue to put it together needs
some work still, but that's minor; the major remaining blocker is the
glibc "largefile64 support" ABI compat symbols. Most of them are
defined as weak_alias(foo,foo64), for some function "foo", and if
"foo" happens to be a function whose interface involves time_t, this
will end up making foo64 an alias for the new-ABI function taking
64-bit time_t, which is NOT ABI-compatible with the glibc function
it's trying to provide.

The obvious direct minimal fix is to condition the weak_alias for lfs
versions of time functions on them not beind redirected, something

#if !_REDIR_TIME64
weak_alias(aio_suspend, aio_suspend64)

and then putting in the corresponding compat shim file something like:

weak_alias(__aio_suspend_time32, aio_suspend64);

This seems ugly, but the reason I had to stretch and grab such a niche
function as aio_suspend is that there are very few functions affected
by both off_t and time_t. There are only 4 more I can find, fstat,
fstatat, lstat, and stat, and these aren't actually glibc symbols
because of the glibc libc_nonshared.a __xstat hack.

Of course the __xstat stuff is a mess too -- they're not weak aliases
for the functions that will now be time64, but rather calling them. I
think they would need to be made conditional on !_REDIR_TIME64 too,
and replacements that call the time32 shims added.

I very well might end up just doing something like the above for now,
since the volume of ugliness is highly bounded, but it's indicative to
me that we should be thinking about extricating musl from the
glibc-ABI-compat stuff.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.