This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Alistair Francis <alistair23 at gmail dot com>
- Cc: Vineet Gupta <vineetg76 at gmail dot com>, Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Arnd Bergmann <arnd at arndb dot de>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Palmer Dabbelt <palmerdabbelt at google dot com>, "Maciej W. Rozycki" <macro at wdc dot com>, Zong Li <zongbox at gmail dot com>, arcml <linux-snps-arc at lists dot infradead dot org>
- Date: Wed, 12 Feb 2020 01:30:46 +0000
- Subject: Re: [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
- Ironport-sdr: SLgKIqBeq35yAFWgtr2Jvrl+ls0GzXLfbYZbkWbiwLsNzWacicTHrqmuzb6npl15tBHglNW8sk eFKF9Mp40k0wKw+1SA7bS2HbgewvQggDFSUVTh/txmjU1JUubr4w9qc4CwT9KUJsf1OUEeLn9A DT31zN0FM7tPBq1puKSvbeqrT7u/2sdFYl3rsd8yH3M0ep3Fx51E6+VWvkM3nOMJK7UjA5At2v ZfWjNdCIBnRyxi6hpjME7pvg99V3E4EBfjAbZ+QiNUmbeWZaMQguRtWNW1ii27begY1M4ucMXB nug=
- Ironport-sdr: old77eI9xHSg2mAv4TnadrF7BJ9t8k2EXfL/eorW6ZFyGDbqV1WxO1VUWAyz+AsmDB65X1ZnO+ B7htnpC3BvDf4QAHsGGSTBc9OIuXIh6Bbc4506BUtNV5XNFxscMfUI7BSgIeGFNkJaRP0t+T81 eN5fL6wb9eN18Qqa2aygE3Mlj8JwIkMXe3Fip1rFUPf/0Cjydak1E0a2bCGVTwBIN0c059B6mx 1B3VCQOXzEWXhtu0/wg9gt9vLGN9+/+YkXY4GTOHEYBM8SnkrdztzjG/TvZzLK+OLkusknE2ET 6Gg=
- References: <cover.1578824547.git.alistair.francis@wdc.com> <4e95f95966d8d7c6a8339160dc62d81c1f6a1bfb.1578824547.git.alistair.francis@wdc.com> <00574bfb-981a-3a1c-cbdf-b2fee4eddc32@gmail.com> <CAKmqyKMyf2psPp+-EHoidvbPbSXv0=dP26GjVQnT5BUriLc1gA@mail.gmail.com>
On Tue, 11 Feb 2020, Alistair Francis wrote:
> > > diff --git a/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h b/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
> > > new file mode 100644
> > > index 0000000000..0da3bdeb5d
> > > --- /dev/null
> > > +++ b/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
> >
> > I was hoping newer arches could simply use the asm-generic one ?
>
> We need to specify that RV32 uses a 64-bit time_t. The generic ones
> don't do that for 32-bit arches.
Since it seems we'd like future 32-bit ports of glibc to use 64-bit time
and offsets, we should make that as easy as possible.
That is, you need an RISC-V-specific bits/timesize.h. But you shouldn't
need an RISC-V-specific bits/typesizes.h - rather, make the linux/generic
one do the right thing for __TIME_T_TYPE based on bits/timesize.h. And
have some other header that 32-bit linux/generic ports can use to say
whether they use the 64-bit offset/stat/statfs interface, that
bits/typesizes.h can use together with its existing __LP64__ check, and
make the definitions of __OFF_T_TYPE etc. check that as well, and then you
shouldn't need an RISC-V-specific bits/typesizes.h - the RISC-V-specific
headers should be strictly minimal. (No architecture-specific
bits/time64.h headers should be needed in any case.)
At some point (or indeed now) we might flip the default for linux/generic
so the architectures needing an architecture-specific header are only the
older 32-bit linux/generic architectures that have support for 32-bit
times and offsets, and the newer ones with no such support don't need such
a header.
--
Joseph S. Myers
joseph@codesourcery.com