glibc/sysdeps
Lukasz Majewski 75c4044b9a y2038: linux: Provide __time64 implementation
In the glibc the time function can use vDSO (on power and x86 the
USE_IFUNC_TIME is defined), time syscall or 'default' time() from
./time/time.c (as a fallback).

In this patch the last function (time) has been refactored and moved
to ./sysdeps/unix/sysv/linux/time.c to be Linux specific.

The new __time64 explicit 64 bit function for providing 64 bit value of
seconds after epoch (by internally calling __clock_gettime64) has been
introduced.

Moreover, a 32 bit version - __time has been refactored to internally
use __time64.

The __time is now supposed to be used on systems still supporting 32 bit
time (__TIMESIZE != 64) - hence the necessary check for time_t potential
overflow.

The iFUNC vDSO direct call optimization has been removed from both i686 and
powerpc32 (USE_IFUNC_TIME is not defined for those architectures
anymore). The Linux kernel does not provide a y2038 safe implementation of
time neither it plans to provide it in the future, __clock_gettime64
should be used instead. Keeping support for this optimization would require
to handle another build permutation (!__ASSUME_TIME64_SYSCALLS &&
USE_IFUNC_TIME which adds more complexity and has limited use (since the
idea is to eventually have a y2038 safe glibc build).

Build tests:
./src/scripts/build-many-glibcs.py glibcs

Run-time tests:
- Run specific tests on ARM/x86 32bit systems (qemu):
https://github.com/lmajewski/meta-y2038 and run tests:
https://github.com/lmajewski/y2038-tests/commits/master

Above tests were performed with Y2038 redirection applied as well as
without to test proper usage of both __time64 and __time.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-10-19 16:01:37 +02:00
..
aarch64 AArch64: Use __memcpy_simd on Neoverse N2/V1 2020-10-14 14:27:50 +01:00
alpha Update alpha libm-test-ulps 2020-10-08 10:29:15 -03:00
arc aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
arm aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
csky C-SKY:Fix dynamic linker's name when mfloat-abi=softfp. 2020-10-19 12:48:37 +08:00
generic linux: Add {f}stat{at} y2038 support 2020-10-09 17:02:07 -03:00
gnu string: Fix strerrorname_np return value [BZ #26555] 2020-09-29 13:56:06 -03:00
hppa aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
htl htl: Move cleanup handling to non-private libc-lock 2020-06-28 00:13:57 +00:00
hurd hurd: Fix build-many-glibcs.py 2020-07-13 14:25:03 -03:00
i386 x86: Initialize CPU info via IFUNC relocation [BZ 26203] 2020-10-16 16:17:53 -07:00
ia64 aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
ieee754 math: Fix inaccuracy of j0f for x >= 2^127 when sin(x)+cos(x) is tiny 2020-08-07 16:33:13 -03:00
m68k aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
mach hurd: support clock_gettime(CLOCK_PROCESS/THREAD_CPUTIME_ID) 2020-10-11 14:00:41 +00:00
microblaze aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
mips Update mips64 libm-test-ulps 2020-10-08 10:29:15 -03:00
nios2 aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
nptl y2038: nptl: Convert pthread_mutex_{clock|timed}lock to support 64 bit 2020-10-15 09:35:43 +02:00
posix linux: Move posix dir implementations to Linux 2020-10-16 14:19:23 -03:00
powerpc aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
pthread C11 threads: Fix inaccuracies in testsuite 2020-09-07 11:42:52 +02:00
riscv aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
s390 aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
sh aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
sparc aarch64: enforce >=64K guard size [BZ #26691] 2020-10-02 09:57:44 +01:00
unix y2038: linux: Provide __time64 implementation 2020-10-19 16:01:37 +02:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
x86 x86: Initialize CPU info via IFUNC relocation [BZ 26203] 2020-10-16 16:17:53 -07:00
x86_64 x86: Initialize CPU info via IFUNC relocation [BZ 26203] 2020-10-16 16:17:53 -07:00