From 9e78a57ae30ec897241ea3200ca767b622539f2b Mon Sep 17 00:00:00 2001 From: Paul Eggert
Date: Mon, 6 Nov 2017 23:20:23 -0800 Subject: [PATCH] year2038: be more insistent about 64-bit time_t Applications requiring access to arbitrary files should not be built with 32-bit time_t on hosts that have 64-bit timestamps, as this can lead to real trouble at runtime. * m4/year2038.m4 (gl_YEAR2038): Do not require AC_CANONICAL_HOST. Check on all systems, not just MinGW. Use a heuristic involving TIME_T_32_BIT_OK, cross_compiling, and the touch command to output a failure or just a warning, to make it more likely that builders will select 64-bit time_t. --- ChangeLog | 12 ++++++++++++ m4/year2038.m4 | 36 ++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9dc192dd..cad5ed70d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2017-11-06 Paul Eggert + + year2038: be more insistent about 64-bit time_t + Applications requiring access to arbitrary files should not be + built with 32-bit time_t on hosts that have 64-bit timestamps, + as this can lead to real trouble at runtime. + * m4/year2038.m4 (gl_YEAR2038): Do not require AC_CANONICAL_HOST. + Check on all systems, not just MinGW. Use a heuristic involving + TIME_T_32_BIT_OK, cross_compiling, and the touch command to + output a failure or just a warning, to make it more likely that + builders will select 64-bit time_t. + 2017-11-05 Paul Eggert havelib: fix typo in previous change diff --git a/m4/year2038.m4 b/m4/year2038.m4 index b9adc99bd..ccc905c91 100644 --- a/m4/year2038.m4 +++ b/m4/year2038.m4 @@ -1,4 +1,4 @@ -# year2038.m4 serial 2 +# year2038.m4 serial 3 dnl Copyright (C) 2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -20,9 +20,12 @@ AC_DEFUN([gl_YEAR2038_EARLY], AC_DEFUN([gl_YEAR2038], [ - AC_REQUIRE([AC_CANONICAL_HOST]) - case "$host_os" in - mingw*) + dnl On many systems, time_t is already a 64-bit type. + dnl On those systems where time_t is still 32-bit, it requires kernel + dnl and libc support to make it 64-bit. For glibc on Linux/x86, this + dnl is work in progress; see + dnl