[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] year2038: support glibc 2.34 _TIME_BITS=64

From: Florian Weimer
Subject: Re: [PATCH] year2038: support glibc 2.34 _TIME_BITS=64
Date: Wed, 07 Jul 2021 10:45:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

* Bruno Haible:

> Florian Weimer wrote:
>> 64-bit file offsets enabled real use cases.
> Year 2038 is also a real use-case. It is not so rare that machines are
> being used for 15 years. (I still occasionally use a 14-years old
> computer, and had a washing machine that lasted 25 years.)
> Year 2038 is less than 17 years away. So, it is time to do something for
> year 2038 now, not in five years.

Y2038 support requires recompilation.  If you are able to do that, why
not recompile for a 64-bit architecture?

>> I assume GNU clisp (at least in a full build) need to link to some
>> system libraries which are not dual ABI (and probably never will be).
>> If gnulib forces the use of time64 mode, then it creates a push towards
>> time64 mode in those libraries, too.  At that point, these libraries
>> will no longer be usable for running older binaries (in at least some
>> cases; in others, the time_t symbols are not actually used).
>> ...
>> gnulib is pushing things in one particular direction, a
>> direction ...
> Let me try to summarize your arguments, the way I understand them.
>   1) The ability to run older binaries is essential for nearly all
>      distros.
>   2) On i386, 32-bit time_t and 64-bit time_t are not binary compatible,
>      when used in the public API of a shared library. Assume an existing
>      old binary relies on /usr/lib/libfoo.so.5 and uses its API with
>      32-bit time_t assumption. Then this library must stay in place with
>      the same API.
>   3) The distribution can provide a libfoo.so compiled with 64-bit
>      time_t, but it MUST reside in a different file.

I think there is also the possibility of a dual ABI, see below.

> Pieces that are missing, AFAICS, are:
>  A) Possibly some glibc "magic" with shared library versioning would
>     make this situation simpler? Or is the combination of ldconfig and
>     LD_LIBRARY_PATH etc. sufficient?

This probably needs per-package/component work to enable dual ABI,
similar to what glibc did for its time_t interfaces.  There is no linker
magic involved, it's either symbol redirects (using a GCC extension) or
a preprocessor macro.  A dual ABI avoids the need for new soname and the
introduction of symbol versioning (so that the object can be loaded
twice into the same process with different ABIs).

I don't expect many upstreams to support this effort.

>  B) A writeup for distributors, what is the recommended way to handle
>     the situation.
>     There are several _possible_ ways to handle it. But Linux distros
>     aim at being compatible at the binary level, and that requires
>     a _common_ approch among distros. IMO, the Linux Standard Base (LSB)
>     is the forum where such things should be standardized.
>     Have the LSB people already been involved in the discussion?

LSB is quite dead, and it never covered the interesting packages anyway.

I can see distributions building 32-bit Arm and a *new*, separate
variant of i386 for 64-bit time_t, and the original i386 port remains at
32-bit.  The new i386 port would have a glibc that defaults to 64-bit
time_t.  Two separate i386 ports seem to require the least human
resources to maintain.  If that's the chosen approach, gnulib should
just use whatever the default time_t size is, and not attempt to
override it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]