From e0df83dd11320d5fcbd78bddc29e8015f0b72e9c Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Tue, 6 Feb 2024 23:39:28 +0100 Subject: [PATCH] Default to being year 2038 safe on 32-bit machines --- erts/configure.ac | 64 ++++++------------- .../internal/ethread_header_config.h.in | 13 ++++ lib/common_test/test_server/configure.ac | 5 +- lib/crypto/c_src/Makefile.in | 2 +- lib/crypto/configure.ac | 2 +- lib/erl_interface/configure.ac | 8 +-- lib/erl_interface/src/Makefile.in | 2 +- lib/erl_interface/test/Makefile.src | 2 +- .../test/all_SUITE_data/Makefile.src | 2 +- .../test/ei_accept_SUITE_data/Makefile.src | 2 +- .../test/ei_connect_SUITE_data/Makefile.src | 2 +- .../test/ei_decode_SUITE_data/Makefile.src | 2 +- .../ei_decode_encode_SUITE_data/Makefile.src | 2 +- .../test/ei_encode_SUITE_data/Makefile.src | 2 +- .../test/ei_format_SUITE_data/Makefile.src | 2 +- .../test/ei_global_SUITE_data/Makefile.src | 2 +- .../test/ei_print_SUITE_data/Makefile.src | 2 +- .../test/ei_tmo_SUITE_data/Makefile.src | 2 +- lib/megaco/configure.ac | 2 +- lib/megaco/src/flex/Makefile.in | 2 +- make/autoconf/otp.m4 | 6 +- make/configure.ac | 2 +- make/otp_ded.mk.in | 4 +- 23 files changed, 64 insertions(+), 70 deletions(-) diff --git a/erts/configure.ac b/erts/configure.ac index c5c4ff93b239..f3ea3c754726 100644 --- a/erts/configure.ac +++ b/erts/configure.ac @@ -23,7 +23,7 @@ dnl autoconf convention that should be cleaned up. AC_INIT AC_CONFIG_SRCDIR([emulator/beam/erl_process.c]) -AC_PREREQ([2.71]) +AC_PREREQ([2.72]) m4_include([otp.m4]) @@ -423,6 +423,10 @@ AC_DEFINE_UNQUOTED(ERTS_NO_RETPOLINE, $i_noretpoline_attr, *only* defined when --with-spectre-mitigation=incomplete and has no effects otherwise]) +# Remove old configuration information. +# Next line should be before first output to CONF_INFO. +rm -f "$ERL_TOP/erts/CONF_INFO" + dnl ---------------------------------------------------------------------- dnl Checks for programs. dnl ---------------------------------------------------------------------- @@ -548,45 +552,24 @@ extra_flags="$ERTS_CONFIG_H_IDIR $OTP_EXTRA_FLAGS" CFLAGS="$CFLAGS $extra_flags" DEBUG_FLAGS=-g +# Large file support and 8-byte time_t by default +AC_SYS_YEAR2038 -lfs_conf=ok -lfs_source=none -AS_IF([test "${LFS_CFLAGS+set}" = "set" || test "${LFS_LDFLAGS+set}" = "set" || test "${LFS_LIBS+set}" = "set"], - [ - lfs_source=user - ], - [ - LM_CHECK_GETCONF - test "$GETCONF" = "false" || lfs_source=getconf - ]) +AC_CHECK_SIZEOF(time_t) -if test "$lfs_source" = "none"; then - AC_MSG_WARN([Do not know how to check for large file support flags; no getconf is available]) -else - for var in CFLAGS LDFLAGS LIBS; do - AC_MSG_CHECKING([for large file support $var]) - if test $lfs_source = user; then - eval "lfs_val=\"\$LFS_$var\"" - else - eval "lfs_var=LFS_$var" - lfs_val=`$GETCONF $lfs_var 2>/dev/null` || lfs_conf=failed - if test $lfs_conf = failed; then - AC_MSG_RESULT([failed]) - break - fi - eval "$lfs_var=\"$lfs_val\"" - fi - test "$lfs_val" != "" || lfs_val=none - AC_MSG_RESULT([$lfs_val]) - done - if test $lfs_conf = failed; then - AC_MSG_WARN([Check for large file support flags failed; $GETCONF failed]) - else - CFLAGS="$CFLAGS $LFS_CFLAGS" - LDFLAGS="$LDFLAGS $LFS_LDFLAGS" - LIBS="$LIBS $LFS_LIBS" - fi -fi +AS_IF([test "$ac_cv_sizeof_time_t" != "8"], + [ + test -f "$ERL_TOP/erts/CONF_INFO" || echo "" > "$ERL_TOP/erts/CONF_INFO" + cat >> $ERL_TOP/erts/CONF_INFO <