bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Cc: Florian Weimer <fweimer@redhat.com>, Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: [PATCH] year2038: support glibc 2.34 _TIME_BITS=64
Date: Sat, 03 Jul 2021 00:29:52 +0200	[thread overview]
Message-ID: <4302797.ikRTjI96fm@omega> (raw)
In-Reply-To: <878s2ozq70.fsf@oldenburg.str.redhat.com>

Hi Florian,

> > In glibc 2.34 on Linux kernels where time_t is traditionally 32-bit,
> > defining _FILE_OFFSET_BITS=64 and _TIME_BITS=64 makes time_t 64-bit.
> > Apps must define both macros.  Gnulib applications that use either
> > the largefile or the year2038 modules will want this behavior;
> > largefile because it deals with the off_t and ino_t components of
> > struct stat already, and so should also deal with time_t.
> 
> Won't this be a very disruptive change to distributions, whose system
> libraries have not switched to 64-bit time_t on 32-bit?
> 
> gnulib should not try to force a different distribution default.  I'm
> worried that this will lead to distributions abandoning 32-bit i386
> support altogether because the support cost is too high—and you can't
> even run legacy binaries anymore.

I don't understand your points regarding "very disruptive change",
"distribution default", and "can't even run legacy binaries". Probably
you have something in mind that differs from my understanding.

In my understanding, a change like this one propagates to the tarballs
that make use of Gnulib. For example, GNU tar will, starting with the
next version, contain logic that has the effect of adding
  #define _TIME_BITS 64
to the config.h of that package. Thus, GNU tar and GNU mt will, on
glibc ≥ 2.34 systems, be internally using a different time_t type than
programs that don't use Gnulib (e.g. util-linux) and programs that use
older versions of Gnulib (e.g. GNU clisp).

From the perspective of the distributions, this is a no-op, IMO.

The only problem that I see is with *libraries* that have an API that
references the time_t type. It is well-known that when a library
  - references off_t or 'struct stat' in its API, and
  - was built with AC_SYS_LARGEFILE in effect,
the packages that use this library also have to be built with
AC_SYS_LARGEFILE. This has caused problems in the past, when
_FILE_OFFSET_BITS=64 was introduced (ca. 2000-2005).

Now, Paul's change has the effect that when a library
  - references time_t in its API, and
  - either it was built with Gnulib module 'largefile',
    or it was built without -D_TIME_BITS=64 but the package that uses it
    is built with  Gnulib module 'largefile' or -D_TIME_BITS=64,
there will be similar problems.

Are there many such libraries? Not many, but come important ones.
A quick look in my /usr/include lists
  libcurl
  glib, gtk
  gdbm
  gnutls, openssl
  libpng
  wxWidgets
  X11/Xos_r.h

Also, there might be problems with socket/pipe protocols which
transfer time_t values within a stream of data. Which such protocols
exist?

I don't see big problems with distribution vendors, since 56%
of the distributions have already abandoned i386 ports by now [1],
and more will follow suit. The rest of the distros can easily
add -D_TIME_BITS=64 to their common compilation flags.

However, I do see some bug reports coming from people who still use
such old i386 distros and try to build packages that rely on libraries
that use time_t in their APIs.

What is the best approach?
  - A package-by-package approach that allows each package maintainer
    to choose their preference? That would mean, to keep 'largefile'
    and 'year2038' as independent modules.
  - Or a global approach, like Paul's patch does?

From the times _FILE_OFFSET_BITS was introduced, I remember that
the package-by-package approach led to major trouble, and that the
global approach — use -D_FILE_OFFSET_BITS=64 in all compilations —
was ultimately the simplest way forward.

Bruno

[1] https://distrowatch.com/search.php#advanced



  reply	other threads:[~2021-07-02 22:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02  2:33 [PATCH] year2038: support glibc 2.34 _TIME_BITS=64 Paul Eggert
2021-07-02 15:32 ` Florian Weimer
2021-07-02 22:29   ` Bruno Haible [this message]
2021-07-03  2:40     ` Paul Eggert
2021-07-05 14:32     ` Florian Weimer
2021-07-05 20:14       ` Paul Eggert
2021-07-06  1:34         ` Bruno Haible
2021-07-06 22:29           ` Paul Eggert
2021-07-06  2:11       ` Bruno Haible
2021-07-07  8:45         ` Florian Weimer
2021-07-07 21:58           ` Paul Eggert
2021-07-08  5:36             ` Florian Weimer
2021-07-17  3:39               ` Paul Eggert

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4302797.ikRTjI96fm@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=fweimer@redhat.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).