GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libgfortran

libgfortran: Enable 64-bit time_t on 32-bit glibc targets

Libgfortran now supports 64-bit time_t on 32-bit glibc to avoid Y2038 issues.

Libgfortran now correctly enables 64-bit time_t support on 32-bit glibc systems that can accommodate it, addressing the Year 2038 problem for file timestamp handling. Previously, builds could break due to stat() failures on 32-bit time_t past January 19, 2038. A new configure check, LIBGFOR_CHECK_TIME_BITS64, determines if _TIME_BITS=64 can be defined, ensuring internal time-related functions remain robust past the Y2038 boundary.

In Details

Libgfortran's build system has been updated to conditionally enable 64-bit time_t by defining _TIME_BITS=64 on 32-bit glibc targets. This is managed by a new LIBGFOR_CHECK_TIME_BITS64 check in acinclude.m4, which runs after AC_SYS_LARGEFILE. It verifies if time_t can be widened to 64 bits, necessary to avoid stat() overflows and related build failures (PR114895). The change doesn't affect the ABI as no exported interfaces use time_t directly.

For Context
time_t
A fundamental C type (usually an integer) that represents calendar time, typically as the number of seconds elapsed since the Epoch (January 1, 1970). Its size determines the range of dates that can be represented.
Year 2038 problem (Y2038)
A problem similar to the Year 2000 problem, but specific to 32-bit signed integer representations of time. On January 19, 2038, a 32-bit time_t will overflow, causing systems to incorrectly interpret the date as being in 1901.
stat()
A system call that retrieves status information about a file or file system, such as size, modification times, and permissions. It typically returns a struct stat containing this information.
libgfortran
The runtime library for the GNU Fortran compiler (gfortran). It provides support for Fortran language features, including I/O operations and intrinsic functions.
ABI
Application Binary Interface. Defines how binary code (compiled programs) interacts with the operating system and other libraries. Changes to the ABI can break compatibility between different versions of software.
Filed Under: libgfortrangccglibcY2038build