public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Wookey <wookey@wookware.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: "Sam James" <sam@gentoo.org>,
	"Carlos O'Donell via Libc-alpha" <libc-alpha@sourceware.org>,
	autoconf@gnu.org, c-std-porting@lists.linux.dev,
	"Zack Weinberg" <zack@owlfolio.org>,
	"David Seifert" <soap@gentoo.org>,
	"Gentoo Toolchain" <toolchain@gentoo.org>,
	"Arsen Arsenović" <arsen@aarsen.me>,
	"Paul Eggert" <eggert@cs.ucla.edu>,
	"Frederic Berat" <fberat@redhat.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Helmut Grohne" <helmut@subdivi.de>
Subject: Re: On time64 and Large File Support
Date: Sat, 12 Nov 2022 04:20:52 +0000	[thread overview]
Message-ID: <20221112042052.GL27919@mail.wookware.org> (raw)
In-Reply-To: <87wn81q254.fsf@oldenburg.str.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 5293 bytes --]

On 2022-11-11 10:19 +0100, Florian Weimer wrote:

Hi. I've started looking into the 64-bit time_t transition for 32-bit armhf
in Debian.  We are currently doing a preliminary bootstrap to see what
breaks. We strongly suspect that only a wholesale rebuild for the new
ABI (i.e a new Debian architecture) is practical, but have not yet
entirely ruled out attempting a migration within the existing armhf
arch.

A test of this in 2020 by Arnd Bergman found that too much stuff was broken.
https://lists.debian.org/debian-arm/2020/02/msg00024.html
Things now look much more mature as some others have already fixed various things.
https://lists.debian.org/debian-arm/2022/09/msg00012.html
https://lists.debian.org/debian-arm/2022/10/msg00020.html

I've not got far with bootstrapping but had got as for as noting that
LFS and 64bit timet are tied together in glibc (setting _TIME_BITS=64
requires setting _FILE_OFFSET_BITS=64). So that's two lots of
interacting ABI changes, which doesn't make things any simpler.

> * Sam James
> 
> > In Gentoo, we've been planning out what we should do for time64 on
> > glibc [0] and concluded that we need some support in glibc for a newer
> > option. I'll outline why below.
> >
> > Proposal: glibc gains two new build-time configure options:
> > * --enable-hard-time64
> > * --enable-hard-lfs

I don't quite follow the logic of this. glibc already has build-time macros to set these two things:
_TIME_BITS=64
_FILE_OFFSET_BITS=64

why do we need configure options too?

> We should define new target triplets for this if it's really required.

We have been coming to the conclusion that this is necessary. If it's
not feasible to migrate with the existing armhf (and maybe i386)
architectures, then we need a new triplet to define this ABI and (in
debian, match the dkpg arch name).

> We need to support legacy binaries on i386.  Few libraries are
> explicitly dual-ABI.  Whether it's safe to switch libraries above glibc
> to LFS or time64 needs to be evaluated on a per-library basis.  For most
> distributions, no one is going to do that work, and we have to stick to
> whathever we are building today.

Well Debian has started this work.

> > These would hard-enable the relevant #defines within glibc's headers
> > and ensure that any binaries built with such a glibc have both Large
> > File Support (LFS) and time64 support.
> >
> > I've come to the conclusion it's infeasible to try handle the
> > migration piecemeal. Various mismatches can and will occur (and while
> > it's more likely with time64, it's possible with LFS too) [1].

Right. This is definitely a problem, as both items will be in structs
that are exposed in ABIs in various places. What I've not yet got a
handle on is just how big a problem. Debian has done large ABI
transitions before within an architecture (glibc5->6), (GCC 4.0 C++
ABI), and (long-double transition (from 64 to 128 bits), on a subset of arches), so it is
possible. (That long-double transition is the most like this
transition, because it involves types that can appear in C and C++
ABI). https://lists.debian.org/debian-devel/2007/05/msg01173.html


> > We're now (possibly) on the eve of an autoconf 2.72 release which contains two changes
> > of note [2][3]
> > 1. addition of a new AC_SYS_YEAR2038 macro;
> > 2. making AC_SYS_LARGEFILE change behaviour to imply AC_SYS_YEAR2038.

Which is the opposite way round to glibc, where _TIME_BITS=64 requires
_FILE_OFFSET_BITS=64, but not the other way round
(_FILE_OFFSET_BITS=64, can be set on its own). Am I misunderstanding something here?

It doesn't seem right to me that AC_SYS_LARGEFILE should imply
AC_SYS_YEAR2038. What is the reasoning behind that?

> I really wish the rest of GNU would talk to glibc maintainers before
> overriding glibc maintainer decisions.  If we cannot revert this in
> autoconf (and gnulib), this will very much endanger the Fedora i386
> port.  Debian will probably be impacted in the same way.

I need to read around all this as I have only just become aware that
the LFS thing is entangled with the timet_64 thing. Is there a good
place to read _why_ one implies the other? It definitely complicates
matters.

> > On reflection and after extensive discussion within Gentoo (although
> > I don't seek to speak for everybody there) - with special thanks to
> > David Seifert and Arsen Arsenović for tolerating my bikesheds on this,
> > we don't think it's feasible to handle this in a piecemeal fashion -
> > at the very least not without spending a significant & for some,
> > undesirable amount of time on supporting "obsolete" 32-bit platforms.

Distros need to co-ordinate on this. If there are going to be new
triplets for the 'LFS and 64_bit timet' ABI(s) then we should agree on
them and use them. If distros are happy to migrate to these ABIs
within the existing arm-linux-gnueabihf and i386-linux-gnu (or
i686-linux-gnu) then we should do that.

If half the distros migrate within the existing triplet and the rest use
a new one, that sounds like a recipie for much confusion.

I could write more, but I'll swot up a bit first :-)

Wookey
-- 
Principal hats:  Debian, Wookware, ARM
http://wookware.org/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2022-11-12  4:20 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  8:38 Sam James
2022-11-11  9:16 ` Paul Eggert
2022-11-11  9:19   ` Sam James
2022-11-11 23:48   ` Joseph Myers
2022-11-11  9:19 ` Florian Weimer
2022-11-11  9:27   ` Sam James
2022-11-11 11:38     ` Florian Weimer
2022-11-11 20:12       ` Paul Eggert
2022-11-12  2:20     ` Zack Weinberg
2022-11-12  3:57       ` Sam James
2022-11-12 14:16         ` Zack Weinberg
2022-11-12 17:41           ` Paul Eggert
2022-11-12 18:50             ` Bruno Haible
2022-11-12 19:15               ` Paul Eggert
2022-11-12 20:23                 ` Wookey
2022-11-12 20:54                   ` Russ Allbery
2022-11-12 21:31                   ` Paul Eggert
2022-11-15  5:09                     ` Sam James
2022-11-12 18:19       ` Paul Eggert
2022-11-11  9:40   ` Andreas K. Huettel
2022-11-11 11:30     ` Florian Weimer
2022-11-11 19:01       ` Andreas K. Huettel
2022-11-11 19:28         ` Palmer Dabbelt
2022-11-11  9:46   ` Paul Eggert
2022-11-11 11:22     ` Florian Weimer
2022-11-11 19:56       ` Paul Eggert
2022-11-12  4:20   ` Wookey [this message]
2022-11-12  4:28     ` Sam James
2022-11-12  4:56       ` Wookey
2022-11-12  4:59         ` Sam James
2022-11-12 18:33     ` Paul Eggert
2022-11-14  8:39   ` Adam Sampson
2022-11-14 11:47     ` Florian Weimer
2022-11-14 20:26     ` Arsen Arsenović
2022-11-14 20:52       ` Florian Weimer
2022-11-15  7:39         ` Arsen Arsenović
2022-11-11 10:25 ` Richard Purdie
2023-03-01 22:38 ` Eric Blake
2023-03-02  0:29   ` Demi Marie Obenour
2023-03-02  9:04     ` Daniel P. Berrangé
2023-03-02 10:28       ` Paul Eggert
2023-03-02 10:38         ` Andreas Schwab
2023-03-03  5:46           ` Paul Eggert
2023-03-06  8:58             ` Andreas Schwab
2023-03-06 10:19               ` Florian Weimer
2023-03-02 11:02         ` Richard W.M. Jones
2023-03-02 12:17           ` Bruno Haible
2023-03-02 13:24             ` Daniel P. Berrangé
2023-03-03  3:30               ` Wookey
2023-03-03  5:50                 ` Paul Eggert
2023-03-03 14:01                   ` Wookey
2023-03-03 14:14                     ` Daniel P. Berrangé
2023-03-03 23:21             ` Arsen Arsenović
2023-03-03 11:49           ` Florian Weimer
2023-03-03 12:39             ` Richard W.M. Jones
2023-03-02  8:30   ` Richard W.M. Jones

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=20221112042052.GL27919@mail.wookware.org \
    --to=wookey@wookware.org \
    --cc=arnd@arndb.de \
    --cc=arsen@aarsen.me \
    --cc=autoconf@gnu.org \
    --cc=c-std-porting@lists.linux.dev \
    --cc=eggert@cs.ucla.edu \
    --cc=fberat@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=helmut@subdivi.de \
    --cc=libc-alpha@sourceware.org \
    --cc=sam@gentoo.org \
    --cc=soap@gentoo.org \
    --cc=toolchain@gentoo.org \
    --cc=zack@owlfolio.org \
    /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).