This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [[PATCH RFC 2] 02/63] Y2038: add function __difftime64
- From: Albert ARIBAUD <albert dot aribaud at 3adev dot fr>
- To: Paul Eggert <eggert at cs dot ucla dot edu>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 2 May 2018 09:40:45 +0200
- Subject: Re: [[PATCH RFC 2] 02/63] Y2038: add function __difftime64
- References: <20180418201819.15952-1-albert.aribaud@3adev.fr> <20180418201819.15952-2-albert.aribaud@3adev.fr> <20180418201819.15952-3-albert.aribaud@3adev.fr> <0a04fc43-9e92-1bbc-843d-049d1026d971@cs.ucla.edu> <20180419150411.4d7ee629@athena> <34e2461c-5da4-181d-d34b-b63c7f89dbf6@cs.ucla.edu> <20180502092209.540847ad@athena>
On Wed, 2 May 2018 09:22:09 +0200, Albert ARIBAUD
<albert.aribaud@3adev.fr> wrote :
> OK, so let me rephrase this to see if I am getting this :
>
> 1) Keep the original file untouched as the 32-bit-time compilation unit.
> Compiling this file as it is now ensures that the ABI is untouched.
>
> 2) Compile the same original file with -D_TIME_BITS=64 (just like
> application code would be compiled under 64-bit-time), producing a
> second compilation unit which provides new symbols.
more to the point, it would be compiled *as if* under -D_TIME_BITS=64,
because TIME_BITS and __USE_TIME_BITS64 are public API macros which
are not defined at GLIBC build time -- and a git grep shows that no
GLIBC '.c' file ever references a __USE_* or _*_BITS macro defined in
features.h.
> The problem with this approach is that it can be applied to some
> implementations but that for many, the 64-bit version is *not*
> functionally identical with the 32-bit one. At least the
> syscall-dependent ones work differently: the 32-bit impelmentations
> just use the 32-bit syscalls, while the 64-bit implementations have to
> use the 64-bit syscalls *if availaible at run-time*, and be able to
> fallback on the 32-bit syscalls if they have to.
Also, 64-bit time types are not simply 32-bit time types with time_t
promoted to 64-bit signed, so there too, simply compiling the source
code would not always work.
Cordialement,
Albert ARIBAUD
3ADEV