GNU C Library Lands Year 2038 Handling For Legacy ABIs
The GNU C Library (Glibc) saw another batch of Year 2038 "Y2038" preparations on Tuesday for the Unix timestamp for when the time since 1 January 1970 can no longer be stored in a signed 32-bit integer.
There were several Y2038 patches to be merged to Glibc in the past day but ultimately the main highlight is support for 64-bit time with the legacy ABIs.
As explained by Linaro's Adhemerval Zanella, "A new build flag, _TIME_BITS, enables the usage of the newer 64-bit
time symbols for legacy ABI (where 32-bit time_t is default). The 64 bit time support is only enabled if LFS (_FILE_OFFSET_BITS=64) is also used. Different than LFS support, the y2038 symbols are added only for the required ABIs (armhf, csky, hppa, i386, m68k, microblaze, mips32, mips64-n32, nios2, powerpc32, sparc32, s390-32, and sh). The ABIs with 64-bit time support are unchanged, both for symbol and types redirection. On Linux the full 64-bit time support requires a minimum of kernel version v5.1. Otherwise, the 32-bit fallbacks are used and might results in error with overflow return code (EOVERFLOW)."
The redirections for handling 64-bit time are added for fstat, gettimeofday, mktime, nanosleep, select, stat, time, utime, and many other libc calls as well as for librt and libanl.
With recent versions of the Linux kernel and other key user-space software components, the Year 2038 handling is in relatively good shape and now this Glibc work for proper handling with the legacy ABIs now more thoroughly handles it. There is still seventeen years to go until the "Epochalypse" but particularly on the embedded front it remains to be seen how many systems/hardware will be updated by the vendor to the mitigate the issue.
There were several Y2038 patches to be merged to Glibc in the past day but ultimately the main highlight is support for 64-bit time with the legacy ABIs.
As explained by Linaro's Adhemerval Zanella, "A new build flag, _TIME_BITS, enables the usage of the newer 64-bit
time symbols for legacy ABI (where 32-bit time_t is default). The 64 bit time support is only enabled if LFS (_FILE_OFFSET_BITS=64) is also used. Different than LFS support, the y2038 symbols are added only for the required ABIs (armhf, csky, hppa, i386, m68k, microblaze, mips32, mips64-n32, nios2, powerpc32, sparc32, s390-32, and sh). The ABIs with 64-bit time support are unchanged, both for symbol and types redirection. On Linux the full 64-bit time support requires a minimum of kernel version v5.1. Otherwise, the 32-bit fallbacks are used and might results in error with overflow return code (EOVERFLOW)."
The redirections for handling 64-bit time are added for fstat, gettimeofday, mktime, nanosleep, select, stat, time, utime, and many other libc calls as well as for librt and libanl.
With recent versions of the Linux kernel and other key user-space software components, the Year 2038 handling is in relatively good shape and now this Glibc work for proper handling with the legacy ABIs now more thoroughly handles it. There is still seventeen years to go until the "Epochalypse" but particularly on the embedded front it remains to be seen how many systems/hardware will be updated by the vendor to the mitigate the issue.
24 Comments