gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, feature/m1-pma, created. gawk-4.1.0-4932-ga3652d3a


From: Arnold Robbins
Subject: [SCM] gawk branch, feature/m1-pma, created. gawk-4.1.0-4932-ga3652d3a
Date: Fri, 21 Oct 2022 06:24:57 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, feature/m1-pma has been created
        at  a3652d3a3de4b4a8e2aa2cdc124725d7264189c3 (commit)

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a3652d3a3de4b4a8e2aa2cdc124725d7264189c3

commit a3652d3a3de4b4a8e2aa2cdc124725d7264189c3
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Oct 21 13:24:27 2022 +0300

    Compile gawk as Intel exe on Apple M1.

diff --git a/configure b/configure
index 59241a8e..68208044 100755
--- a/configure
+++ b/configure
@@ -12626,8 +12626,8 @@ fi
                                export LDFLAGS
                                ;;
                        *)
-                               # aarch64-*
-                               use_persistent_malloc=no
+                               # hack! on M1 compile it as x86 executable
+                               CFLAGS="${CFLAGS} -arch x86_64"
                                ;;
                        esac
                        ;;
diff --git a/extension/Makefile.in b/extension/Makefile.in
index d77b7345..7cf10cee 100644
--- a/extension/Makefile.in
+++ b/extension/Makefile.in
@@ -115,6 +115,7 @@ host_triplet = @host@
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../m4/arch.m4 \
+       $(top_srcdir)/../m4/ax_check_compile_flag.m4 \
        $(top_srcdir)/../m4/codeset.m4 $(top_srcdir)/../m4/dirfd.m4 \
        $(top_srcdir)/../m4/gettext.m4 \
        $(top_srcdir)/../m4/host-cpu-c-abi.m4 \
@@ -127,8 +128,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/arch.m4 \
        $(top_srcdir)/../m4/ltsugar.m4 \
        $(top_srcdir)/../m4/ltversion.m4 \
        $(top_srcdir)/../m4/lt~obsolete.m4 $(top_srcdir)/../m4/mpfr.m4 \
-       $(top_srcdir)/../m4/nls.m4 $(top_srcdir)/../m4/po.m4 \
-       $(top_srcdir)/../m4/progtest.m4 \
+       $(top_srcdir)/../m4/nls.m4 $(top_srcdir)/../m4/pma.m4 \
+       $(top_srcdir)/../m4/po.m4 $(top_srcdir)/../m4/progtest.m4 \
        $(top_srcdir)/../m4/triplet-transformation.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
diff --git a/extension/aclocal.m4 b/extension/aclocal.m4
index cad81851..7e4bafd9 100644
--- a/extension/aclocal.m4
+++ b/extension/aclocal.m4
@@ -1209,6 +1209,7 @@ AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
 m4_include([../m4/arch.m4])
+m4_include([../m4/ax_check_compile_flag.m4])
 m4_include([../m4/codeset.m4])
 m4_include([../m4/dirfd.m4])
 m4_include([../m4/gettext.m4])
@@ -1226,6 +1227,7 @@ m4_include([../m4/ltversion.m4])
 m4_include([../m4/lt~obsolete.m4])
 m4_include([../m4/mpfr.m4])
 m4_include([../m4/nls.m4])
+m4_include([../m4/pma.m4])
 m4_include([../m4/po.m4])
 m4_include([../m4/progtest.m4])
 m4_include([../m4/triplet-transformation.m4])
diff --git a/extension/configh.in b/extension/configh.in
index c0e0e2c8..f732c3b2 100644
--- a/extension/configh.in
+++ b/extension/configh.in
@@ -177,11 +177,17 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* The size of `void *', as computed by sizeof. */
+#undef SIZEOF_VOID_P
+
 /* Define to 1 if all of the C90 standard headers exist (not just the ones
    required in a freestanding environment). This macro is provided for
    backward compatibility; new code need not use it. */
 #undef STDC_HEADERS
 
+/* Define to 1 if we can use the pma allocator */
+#undef USE_PERSISTENT_MALLOC
+
 /* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
diff --git a/extension/configure b/extension/configure
index 84a04c27..1f9de569 100755
--- a/extension/configure
+++ b/extension/configure
@@ -684,6 +684,8 @@ LIBTOOL
 OBJDUMP
 DLLTOOL
 AS
+USE_PERSISTENT_MALLOC_FALSE
+USE_PERSISTENT_MALLOC_TRUE
 ac_ct_AR
 AR
 POSUB
@@ -1848,6 +1850,195 @@ printf "%s\n" "$ac_res" >&6; }
 
 } # ac_fn_c_check_member
 
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if test "$cross_compiling" = yes; then
+    # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_hi=$ac_mid; break
+else $as_nop
+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  done
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_lo=$ac_mid; break
+else $as_nop
+  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  done
+else $as_nop
+  ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main (void)
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_hi=$ac_mid
+else $as_nop
+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+static long int longval (void) { return $2; }
+static unsigned long int ulongval (void) { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main (void)
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (($2) < 0)
+    {
+      long int i = longval ();
+      if (i != ($2))
+       return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ($2))
+       return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else $as_nop
+  ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+  fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+
 # ac_fn_c_check_func LINENO FUNC VAR
 # ----------------------------------
 # Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -8493,6 +8684,189 @@ rm -rf conftest*
   fi
 fi
 
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler 
accepts " >&5
+printf %s "checking whether C compiler accepts ... " >&6; }
+if test ${ax_cv_check_cflags__+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS  "
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ax_cv_check_cflags__=yes
+else $as_nop
+  ax_cv_check_cflags__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__" 
>&5
+printf "%s\n" "$ax_cv_check_cflags__" >&6; }
+if test "x$ax_cv_check_cflags__" = xyes
+then :
+  :
+else $as_nop
+  :
+fi
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+printf %s "checking size of void *... " >&6; }
+if test ${ac_cv_sizeof_void_p+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" 
"ac_cv_sizeof_void_p"        "$ac_includes_default"
+then :
+
+else $as_nop
+  if test "$ac_cv_type_void_p" = yes; then
+     { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (void *)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_void_p=0
+   fi
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
+printf "%s\n" "$ac_cv_sizeof_void_p" >&6; }
+
+
+
+printf "%s\n" "#define SIZEOF_VOID_P $ac_cv_sizeof_void_p" >>confdefs.h
+
+
+use_persistent_malloc=no
+if test "$SKIP_PERSIST_MALLOC" = no && test $ac_cv_sizeof_void_p -eq 8
+then
+       ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = xyes
+then :
+
+fi
+
+       ac_fn_c_check_func "$LINENO" "munmap" "ac_cv_func_munmap"
+if test "x$ac_cv_func_munmap" = xyes
+then :
+
+fi
+
+       if test $ac_cv_func_mmap = yes && test $ac_cv_func_munmap = yes
+       then
+               use_persistent_malloc=yes
+               case $host_os in
+               linux-*)
+                       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking 
whether C compiler accepts -no-pie" >&5
+printf %s "checking whether C compiler accepts -no-pie... " >&6; }
+if test ${ax_cv_check_cflags___no_pie+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS  -no-pie"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ax_cv_check_cflags___no_pie=yes
+else $as_nop
+  ax_cv_check_cflags___no_pie=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 
$ax_cv_check_cflags___no_pie" >&5
+printf "%s\n" "$ax_cv_check_cflags___no_pie" >&6; }
+if test "x$ax_cv_check_cflags___no_pie" = xyes
+then :
+  LDFLAGS="${LDFLAGS} -no-pie"
+                               export LDFLAGS
+else $as_nop
+  :
+fi
+
+                       ;;
+               *darwin*)
+                       # 30 September 2022: PMA works on Intel but not
+                       # on M1, disable it, until it gets fixed
+                       case $host in
+                       x86_64-*)
+                               LDFLAGS="${LDFLAGS} -Xlinker -no_pie"
+                               export LDFLAGS
+                               ;;
+                       *)
+                               # hack! on M1 compile it as x86 executable
+                               CFLAGS="${CFLAGS} -arch x86_64"
+                               ;;
+                       esac
+                       ;;
+               *cygwin* | *CYGWIN* | *solaris2.11* | freebsd13.* | openbsd7.* )
+                       true    # nothing do, exes on these systems are not PIE
+                       ;;
+               # Other OS's go here...
+               *)
+                       # For now, play it safe
+                       use_persistent_malloc=no
+
+                       # Allow override for testing on new systems
+                       if test "$REALLY_USE_PERSIST_MALLOC" != ""
+                       then
+                               use_persistent_malloc=yes
+                       fi
+                       ;;
+               esac
+       else
+               use_persistent_malloc=no
+       fi
+fi
+
+ if test "$use_persistent_malloc" = "yes"; then
+  USE_PERSISTENT_MALLOC_TRUE=
+  USE_PERSISTENT_MALLOC_FALSE='#'
+else
+  USE_PERSISTENT_MALLOC_TRUE='#'
+  USE_PERSISTENT_MALLOC_FALSE=
+fi
+
+
+if test "$use_persistent_malloc" = "yes"
+then
+
+printf "%s\n" "#define USE_PERSISTENT_MALLOC 1" >>confdefs.h
+
+fi
+
 case `pwd` in
   *\ * | *\    *)
     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not 
cope well with whitespace in \`pwd\`" >&5
@@ -17554,6 +17928,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z 
"${am__fastdepCC_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${USE_PERSISTENT_MALLOC_TRUE}" && test -z 
"${USE_PERSISTENT_MALLOC_FALSE}"; then
+  as_fn_error $? "conditional \"USE_PERSISTENT_MALLOC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
 : "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
diff --git a/extension/configure.ac b/extension/configure.ac
index b7c04512..7ac7d3b2 100644
--- a/extension/configure.ac
+++ b/extension/configure.ac
@@ -64,6 +64,7 @@ AC_CHECK_MEMBERS([struct stat.st_blksize])
 
 AM_PROG_AR
 AC_SYS_LARGEFILE
+GAWK_USE_PERSISTENT_MALLOC
 LT_INIT([win32-dll disable-static])
 dnl AC_PROG_INSTALL
 
diff --git a/m4/pma.m4 b/m4/pma.m4
index 080713e1..2d3cbcee 100644
--- a/m4/pma.m4
+++ b/m4/pma.m4
@@ -32,8 +32,8 @@ then
                                export LDFLAGS
                                ;;
                        *)
-                               # aarch64-*
-                               use_persistent_malloc=no
+                               # hack! on M1 compile it as x86 executable
+                               CFLAGS="${CFLAGS} -arch x86_64"
                                ;;
                        esac
                        ;;

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=ea6d296a752f447655e954ae51027072cb4e075e

commit ea6d296a752f447655e954ae51027072cb4e075e
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Oct 21 13:19:15 2022 +0300

    Update GNULIB stuff.

diff --git a/ChangeLog b/ChangeLog
index 320ba247..e325d147 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-10-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port to current Gnulib
+       Adjust to current Gnulib, which uses C23 style keywords for bool,
+       true, false and static_assert, and assumes that <config.h>
+       supplies compatibility macros on older systems.
+
+       * awk.h: Do not include stdbool.h.
+       * configure.ac: Use gl_C_BOOL, not AC_HEADER_STDBOOL.
+
 2022-10-20         Arnold D. Robbins     <arnold@skeeve.com>
 
        * NEWS: Updated.
diff --git a/Makefile.in b/Makefile.in
index 7e58cef7..1ed28d30 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -122,16 +122,16 @@ subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
        $(top_srcdir)/m4/ax_check_compile_flag.m4 \
-       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
-       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
-       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
-       $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
-       $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
-       $(top_srcdir)/m4/pma.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
-       $(top_srcdir)/m4/socket.m4 \
+       $(top_srcdir)/m4/c-bool.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \
+       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+       $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libsigsegv.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/pma.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
        $(top_srcdir)/m4/triplet-transformation.m4 \
        $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
diff --git a/aclocal.m4 b/aclocal.m4
index 6de50fec..986c2a5a 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1210,6 +1210,7 @@ AC_SUBST([am__untar])
 
 m4_include([m4/arch.m4])
 m4_include([m4/ax_check_compile_flag.m4])
+m4_include([m4/c-bool.m4])
 m4_include([m4/codeset.m4])
 m4_include([m4/gettext.m4])
 m4_include([m4/host-cpu-c-abi.m4])
diff --git a/awk.h b/awk.h
index 3d70bd11..5cdc53d3 100644
--- a/awk.h
+++ b/awk.h
@@ -71,7 +71,6 @@
 #endif
 
 #include <stdarg.h>
-#include <stdbool.h>
 #include <signal.h>
 #include <time.h>
 #include <errno.h>
diff --git a/awklib/Makefile.in b/awklib/Makefile.in
index 3d4a937c..b66748b5 100644
--- a/awklib/Makefile.in
+++ b/awklib/Makefile.in
@@ -114,16 +114,16 @@ subdir = awklib
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
        $(top_srcdir)/m4/ax_check_compile_flag.m4 \
-       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
-       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
-       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
-       $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
-       $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
-       $(top_srcdir)/m4/pma.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
-       $(top_srcdir)/m4/socket.m4 \
+       $(top_srcdir)/m4/c-bool.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \
+       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+       $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libsigsegv.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/pma.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
        $(top_srcdir)/m4/triplet-transformation.m4 \
        $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
diff --git a/configh.in b/configh.in
index 606fa1a5..e82ae154 100644
--- a/configh.in
+++ b/configh.in
@@ -34,6 +34,9 @@
    the CoreFoundation framework. */
 #undef HAVE_CFPREFERENCESCOPYAPPVALUE
 
+/* Define to 1 if bool, true and false work as per C2023. */
+#undef HAVE_C_BOOL
+
 /* Define to 1 if C supports variable-length arrays. */
 #undef HAVE_C_VARARRAYS
 
@@ -189,7 +192,7 @@
 /* we have sockets on this system */
 #undef HAVE_SOCKETS
 
-/* Define to 1 if stdbool.h conforms to C99. */
+/* Define to 1 if you have the <stdbool.h> header file. */
 #undef HAVE_STDBOOL_H
 
 /* Define to 1 if you have the <stddef.h> header file. */
@@ -344,9 +347,6 @@
 /* systems should define this type here */
 #undef HAVE_WINT_T
 
-/* Define to 1 if the system has the type `_Bool'. */
-#undef HAVE__BOOL
-
 /* Define to 1 if you have the `__etoa_l' function. */
 #undef HAVE___ETOA_L
 
@@ -579,4 +579,21 @@
    do not define. */
 #undef uintmax_t
 
+#ifndef HAVE_C_BOOL
+# if !defined __cplusplus && !defined __bool_true_false_are_defined
+#  if HAVE_STDBOOL_H
+#   include <stdbool.h>
+#  else
+#   if defined __SUNPRO_C
+#    error "<stdbool.h> is not usable with this configuration. To make it 
usable, add -D_STDC_C99= to $CC."
+#   else
+#    error "<stdbool.h> does not exist on this platform. Use gnulib module 
'stdbool-c99' instead of gnulib module 'stdbool'."
+#   endif
+#  endif
+# endif
+# if !true
+#  define true (!false)
+# endif
+#endif
+
 #include "custom.h"
diff --git a/configure b/configure
index d81d3b19..59241a8e 100755
--- a/configure
+++ b/configure
@@ -2818,6 +2818,7 @@ as_fn_append ac_header_c_list " unistd.h unistd_h 
HAVE_UNISTD_H"
 as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H"
 as_fn_append ac_header_c_list " minix/config.h minix_config_h 
HAVE_MINIX_CONFIG_H"
 gt_needs="$gt_needs "
+as_fn_append ac_header_c_list " stdbool.h stdbool_h HAVE_STDBOOL_H"
 as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H"
 as_fn_append ac_func_c_list " alarm HAVE_ALARM"
 
@@ -10369,147 +10370,42 @@ then :
 fi
 
 
-ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = xyes
-then :
-
-printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h
-
 
-fi
 
-   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that 
conforms to C99" >&5
-printf %s "checking for stdbool.h that conforms to C99... " >&6; }
-if test ${ac_cv_header_stdbool_h+y}
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bool, true, 
false" >&5
+printf %s "checking for bool, true, false... " >&6; }
+if test ${gl_cv_c_bool+y}
 then :
   printf %s "(cached) " >&6
 else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdbool.h>
-
-             #ifndef __bool_true_false_are_defined
-               #error "__bool_true_false_are_defined is not defined"
-             #endif
-             char a[__bool_true_false_are_defined == 1 ? 1 : -1];
-
-             /* Regardless of whether this is C++ or "_Bool" is a
-                valid type name, "true" and "false" should be usable
-                in #if expressions and integer constant expressions,
-                and "bool" should be a valid type name.  */
-
-             #if !true
-               #error "'true' is not true"
-             #endif
-             #if true != 1
-               #error "'true' is not equal to 1"
-             #endif
-             char b[true == 1 ? 1 : -1];
-             char c[true];
-
-             #if false
-               #error "'false' is not false"
-             #endif
-             #if false != 0
-               #error "'false' is not equal to 0"
-             #endif
-             char d[false == 0 ? 1 : -1];
-
-             enum { e = false, f = true, g = false * true, h = true * 256 };
-
-             char i[(bool) 0.5 == true ? 1 : -1];
-             char j[(bool) 0.0 == false ? 1 : -1];
-             char k[sizeof (bool) > 0 ? 1 : -1];
-
-             struct sb { bool s: 1; bool t; } s;
-             char l[sizeof s.t > 0 ? 1 : -1];
-
-             /* The following fails for
-                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-             bool m[h];
-             char n[sizeof m == h * sizeof m[0] ? 1 : -1];
-             char o[-1 - (bool) 0 < 0 ? 1 : -1];
-             /* Catch a bug in an HP-UX C compiler.  See
-         https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-         https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-              */
-             bool p = true;
-             bool *pp = &p;
-
-             /* C 1999 specifies that bool, true, and false are to be
-                macros, but C++ 2011 and later overrule this.  */
-             #if __cplusplus < 201103
-              #ifndef bool
-               #error "bool is not defined"
-              #endif
-              #ifndef false
-               #error "false is not defined"
-              #endif
-              #ifndef true
-               #error "true is not defined"
-              #endif
-             #endif
-
-             /* If _Bool is available, repeat with it all the tests
-                above that used bool.  */
-             #ifdef HAVE__BOOL
-               struct sB { _Bool s: 1; _Bool t; } t;
-
-               char q[(_Bool) 0.5 == true ? 1 : -1];
-               char r[(_Bool) 0.0 == false ? 1 : -1];
-               char u[sizeof (_Bool) > 0 ? 1 : -1];
-               char v[sizeof t.t > 0 ? 1 : -1];
-
-               _Bool w[h];
-               char x[sizeof m == h * sizeof m[0] ? 1 : -1];
-               char y[-1 - (_Bool) 0 < 0 ? 1 : -1];
-               _Bool z = true;
-               _Bool *pz = &p;
-             #endif
-
-int
-main (void)
-{
-
-             bool ps = &s;
-             *pp |= p;
-             *pp |= ! p;
 
-             #ifdef HAVE__BOOL
-               _Bool pt = &t;
-               *pz |= z;
-               *pz |= ! z;
-             #endif
-
-             /* Refer to every declared value, so they cannot be
-                discarded as unused.  */
-             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k
-                     + !l + !m + !n + !o + !p + !pp + !ps
-             #ifdef HAVE__BOOL
-                     + !q + !r + !u + !v + !w + !x + !y + !z + !pt
-             #endif
-                    );
-
-  ;
-  return 0;
-}
+          #if true == false
+           #error "true == false"
+          #endif
+          extern bool b;
+          bool b = true == false;
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"
 then :
-  ac_cv_header_stdbool_h=yes
+  gl_cv_c_bool=yes
 else $as_nop
-  ac_cv_header_stdbool_h=no
+  gl_cv_c_bool=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" 
>&5
-printf "%s\n" "$ac_cv_header_stdbool_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_bool" >&5
+printf "%s\n" "$gl_cv_c_bool" >&6; }
+  if test "$gl_cv_c_bool" = yes; then
+
+printf "%s\n" "#define HAVE_C_BOOL 1" >>confdefs.h
+
+  fi
+
 
-if test $ac_cv_header_stdbool_h = yes; then
 
-printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h
 
-fi
 
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is 
POSIX.1 compatible" >&5
 printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
diff --git a/configure.ac b/configure.ac
index d98767fb..2aa3e68f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -184,7 +184,7 @@ AC_CHECK_HEADERS(arpa/inet.h fcntl.h locale.h libintl.h 
mcheck.h \
        sys/ioctl.h sys/param.h sys/select.h sys/socket.h sys/time.h unistd.h \
        termios.h stropts.h wchar.h wctype.h)
 
-AC_HEADER_STDBOOL
+gl_C_BOOL
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS_ONCE([sys/time.h])
 
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 31a03039..605b7bf0 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -116,16 +116,16 @@ subdir = doc
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
        $(top_srcdir)/m4/ax_check_compile_flag.m4 \
-       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
-       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
-       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
-       $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
-       $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
-       $(top_srcdir)/m4/pma.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
-       $(top_srcdir)/m4/socket.m4 \
+       $(top_srcdir)/m4/c-bool.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \
+       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+       $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libsigsegv.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/pma.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
        $(top_srcdir)/m4/triplet-transformation.m4 \
        $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
diff --git a/extras/Makefile.in b/extras/Makefile.in
index 50acff06..9686adce 100644
--- a/extras/Makefile.in
+++ b/extras/Makefile.in
@@ -115,16 +115,16 @@ subdir = extras
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
        $(top_srcdir)/m4/ax_check_compile_flag.m4 \
-       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
-       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
-       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
-       $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
-       $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
-       $(top_srcdir)/m4/pma.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
-       $(top_srcdir)/m4/socket.m4 \
+       $(top_srcdir)/m4/c-bool.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \
+       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+       $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libsigsegv.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/pma.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
        $(top_srcdir)/m4/triplet-transformation.m4 \
        $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
diff --git a/m4/c-bool.m4 b/m4/c-bool.m4
new file mode 100644
index 00000000..bb109b77
--- /dev/null
+++ b/m4/c-bool.m4
@@ -0,0 +1,51 @@
+# Check for bool that conforms to C2023.
+
+dnl Copyright 2022 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_C_BOOL],
+[
+  AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_SOURCE([[
+          #if true == false
+           #error "true == false"
+          #endif
+          extern bool b;
+          bool b = true == false;]])],
+       [gl_cv_c_bool=yes],
+       [gl_cv_c_bool=no])])
+  if test "$gl_cv_c_bool" = yes; then
+    AC_DEFINE([HAVE_C_BOOL], [1],
+      [Define to 1 if bool, true and false work as per C2023.])
+  fi
+
+  AC_CHECK_HEADERS_ONCE([stdbool.h])
+
+  dnl The "zz" puts this toward config.h's end, to avoid potential
+  dnl collisions with other definitions.
+  dnl If 'bool', 'true' and 'false' do not work, arrange for them to work.
+  dnl In C, this means including <stdbool.h> if it is not already included.
+  dnl However, if the preprocessor mistakenly treats 'true' as 0,
+  dnl define it to a bool expression equal to 1; this is needed in
+  dnl Sun C++ 5.11 (Oracle Solaris Studio 12.2, 2010) and older.
+  AH_VERBATIM([zzbool],
+[#ifndef HAVE_C_BOOL
+# if !defined __cplusplus && !defined __bool_true_false_are_defined
+#  if HAVE_STDBOOL_H
+#   include <stdbool.h>
+#  else
+#   if defined __SUNPRO_C
+#    error "<stdbool.h> is not usable with this configuration. To make it 
usable, add -D_STDC_C99= to $CC."
+#   else
+#    error "<stdbool.h> does not exist on this platform. Use gnulib module 
'stdbool-c99' instead of gnulib module 'stdbool'."
+#   endif
+#  endif
+# endif
+# if !true
+#  define true (!false)
+# endif
+#endif])
+])
diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog
index 9268c15c..300dde35 100644
--- a/missing_d/ChangeLog
+++ b/missing_d/ChangeLog
@@ -1,3 +1,12 @@
+2022-10-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port to current Gnulib
+       Adjust to current Gnulib, which uses C23 style keywords for bool,
+       true, false and static_assert, and assumes that <config.h>
+       supplies compatibility macros on older systems.
+
+       * missing_d/mktime.c: Sync from Gnulib.
+
 2022-09-04         Arnold D. Robbins     <arnold@skeeve.com>
 
        * 5.2.0: Release tar ball made.
diff --git a/missing_d/mktime.c b/missing_d/mktime.c
index 3ecab0d1..7dc9d67e 100644
--- a/missing_d/mktime.c
+++ b/missing_d/mktime.c
@@ -1,5 +1,5 @@
 /* Convert a 'struct tm' to a time_t value.
-   Copyright (C) 1993-2018 Free Software Foundation, Inc.
+   Copyright (C) 1993-2022 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Eggert <eggert@twinsun.com>.
 
@@ -17,12 +17,6 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-/* Define this to 1 to have a standalone program to test this implementation of
-   mktime.  */
-#ifndef DEBUG_MKTIME
-# define DEBUG_MKTIME 0
-#endif
-
 /* The following macros influence what gets defined when this file is compiled:
 
    Macro/expression            Which gnulib module    This compilation unit
@@ -34,12 +28,10 @@
    || NEED_MKTIME_WINDOWS
 
    NEED_MKTIME_INTERNAL        mktime-internal        mktime_internal
-
-   DEBUG_MKTIME                (defined manually)     my_mktime, main
  */
 
-#if !defined _LIBC && !DEBUG_MKTIME
-# include <config.h>
+#ifndef _LIBC
+# include <libc-config.h>
 #endif
 
 /* Assume that leap seconds are possible, unless told otherwise.
@@ -51,6 +43,7 @@
 
 #include <time.h>
 
+#include <errno.h>
 #include <limits.h>
 #include <stdbool.h>
 #include <stdlib.h>
@@ -59,13 +52,6 @@
 #include <intprops.h>
 #include <verify.h>
 
-#if DEBUG_MKTIME
-# include <stdio.h>
-/* Make it work even if the system's libc has its own mktime routine.  */
-# undef mktime
-# define mktime my_mktime
-#endif /* DEBUG_MKTIME */
-
 #ifndef NEED_MKTIME_INTERNAL
 # define NEED_MKTIME_INTERNAL 0
 #endif
@@ -73,12 +59,12 @@
 # define NEED_MKTIME_WINDOWS 0
 #endif
 #ifndef NEED_MKTIME_WORKING
-# define NEED_MKTIME_WORKING DEBUG_MKTIME
+# define NEED_MKTIME_WORKING 0
 #endif
 
-# include "mktime-internal.h"
+#include "mktime-internal.h"
 
-#ifndef _LIBC
+#if !defined _LIBC && (NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS)
 static void
 my_tzset (void)
 {
@@ -86,13 +72,13 @@ my_tzset (void)
   /* Rectify the value of the environment variable TZ.
      There are four possible kinds of such values:
        - Traditional US time zone names, e.g. "PST8PDT".  Syntax: see
-         <https://msdn.microsoft.com/en-us/library/90s5c885.aspx>
+         
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset>
        - Time zone names based on geography, that contain one or more
          slashes, e.g. "Europe/Moscow".
        - Time zone names based on geography, without slashes, e.g.
          "Singapore".
        - Time zone names that contain explicit DST rules.  Syntax: see
-         
<http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03>
+         
<https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03>
      The Microsoft CRT understands only the first kind.  It produces incorrect
      results if the value of TZ is of the other kinds.
      But in a Cygwin environment, /etc/profile.d/tzset.sh sets TZ to a value
@@ -108,7 +94,7 @@ my_tzset (void)
   const char *tz = getenv ("TZ");
   if (tz != NULL && strchr (tz, '/') != NULL)
     _putenv ("TZ=");
-# elif HAVE_TZSET
+# else
   tzset ();
 # endif
 }
@@ -119,24 +105,25 @@ my_tzset (void)
 #if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL
 
 /* A signed type that can represent an integer number of years
-   multiplied by three times the number of seconds in a year.  It is
+   multiplied by four times the number of seconds in a year.  It is
    needed when converting a tm_year value times the number of seconds
-   in a year.  The factor of three comes because these products need
+   in a year.  The factor of four comes because these products need
    to be subtracted from each other, and sometimes with an offset
-   added to them, without worrying about overflow.
+   added to them, and then with another timestamp added, without
+   worrying about overflow.
 
-   Much of the code uses long_int to represent time_t values, to
-   lessen the hassle of dealing with platforms where time_t is
+   Much of the code uses long_int to represent __time64_t values, to
+   lessen the hassle of dealing with platforms where __time64_t is
    unsigned, and because long_int should suffice to represent all
-   time_t values that mktime can generate even on platforms where
-   time_t is excessively wide.  */
+   __time64_t values that mktime can generate even on platforms where
+   __time64_t is wider than the int components of struct tm.  */
 
-#if INT_MAX <= LONG_MAX / 3 / 366 / 24 / 60 / 60
+#if INT_MAX <= LONG_MAX / 4 / 366 / 24 / 60 / 60
 typedef long int long_int;
 #else
 typedef long long int long_int;
 #endif
-verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 3 / 366 / 24 / 60 / 60);
+verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 4 / 366 / 24 / 60 / 60);
 
 /* Shift A right by B bits portably, by dividing A by 2**B and
    truncating towards minus infinity.  B should be in the range 0 <= B
@@ -154,19 +141,18 @@ shr (long_int a, int b)
   long_int one = 1;
   return (-one >> 1 == -1
          ? a >> b
-         : a / (one << b) - (a % (one << b) < 0));
+         : (a + (a < 0)) / (one << b) - (a < 0));
 }
 
-/* Bounds for the intersection of time_t and long_int.  */
+/* Bounds for the intersection of __time64_t and long_int.  */
 
 static long_int const mktime_min
-  = ((TYPE_SIGNED (time_t) && TYPE_MINIMUM (time_t) < TYPE_MINIMUM (long_int))
-     ? TYPE_MINIMUM (long_int) : TYPE_MINIMUM (time_t));
+  = ((TYPE_SIGNED (__time64_t)
+      && TYPE_MINIMUM (__time64_t) < TYPE_MINIMUM (long_int))
+     ? TYPE_MINIMUM (long_int) : TYPE_MINIMUM (__time64_t));
 static long_int const mktime_max
-  = (TYPE_MAXIMUM (long_int) < TYPE_MAXIMUM (time_t)
-     ? TYPE_MAXIMUM (long_int) : TYPE_MAXIMUM (time_t));
-
-verify (TYPE_IS_INTEGER (time_t));
+  = (TYPE_MAXIMUM (long_int) < TYPE_MAXIMUM (__time64_t)
+     ? TYPE_MAXIMUM (long_int) : TYPE_MAXIMUM (__time64_t));
 
 #define EPOCH_YEAR 1970
 #define TM_YEAR_BASE 1900
@@ -210,9 +196,10 @@ isdst_differ (int a, int b)
    were not adjusted between the timestamps.
 
    The YEAR values uses the same numbering as TP->tm_year.  Values
-   need not be in the usual range.  However, YEAR1 must not overflow
-   when multiplied by three times the number of seconds in a year, and
-   likewise for YDAY1 and three times the number of seconds in a day.  */
+   need not be in the usual range.  However, YEAR1 - YEAR0 must not
+   overflow even when multiplied by three times the number of seconds
+   in a year, and likewise for YDAY1 - YDAY0 and three times the
+   number of seconds in a day.  */
 
 static long_int
 ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1,
@@ -224,8 +211,8 @@ ydhms_diff (long_int year1, long_int yday1, int hour1, int 
min1, int sec1,
      Take care to avoid integer overflow here.  */
   int a4 = shr (year1, 2) + shr (TM_YEAR_BASE, 2) - ! (year1 & 3);
   int b4 = shr (year0, 2) + shr (TM_YEAR_BASE, 2) - ! (year0 & 3);
-  int a100 = a4 / 25 - (a4 % 25 < 0);
-  int b100 = b4 / 25 - (b4 % 25 < 0);
+  int a100 = (a4 + (a4 < 0)) / 25 - (a4 < 0);
+  int b100 = (b4 + (b4 < 0)) / 25 - (b4 < 0);
   int a400 = shr (a100, 2);
   int b400 = shr (b100, 2);
   int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
@@ -247,110 +234,94 @@ long_int_avg (long_int a, long_int b)
   return shr (a, 1) + shr (b, 1) + ((a | b) & 1);
 }
 
-/* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC),
-   assuming that T corresponds to *TP and that no clock adjustments
-   occurred between *TP and the desired time.
-   Although T and the returned value are of type long_int,
-   they represent time_t values and must be in time_t range.
-   If TP is null, return a value not equal to T; this avoids false matches.
+/* Return a long_int value corresponding to (YEAR-YDAY HOUR:MIN:SEC)
+   minus *TP seconds, assuming no clock adjustments occurred between
+   the two timestamps.
+
    YEAR and YDAY must not be so large that multiplying them by three times the
    number of seconds in a year (or day, respectively) would overflow long_int.
-   If the returned value would be out of range, yield the minimal or
-   maximal in-range value, except do not yield a value equal to T.  */
+   *TP should be in the usual range.  */
 static long_int
-guess_time_tm (long_int year, long_int yday, int hour, int min, int sec,
-              long_int t, const struct tm *tp)
+tm_diff (long_int year, long_int yday, int hour, int min, int sec,
+        struct tm const *tp)
 {
-  if (tp)
-    {
-      long_int result;
-      long_int d = ydhms_diff (year, yday, hour, min, sec,
-                              tp->tm_year, tp->tm_yday,
-                              tp->tm_hour, tp->tm_min, tp->tm_sec);
-      if (! INT_ADD_WRAPV (t, d, &result))
-       return result;
-    }
-
-  /* Overflow occurred one way or another.  Return the nearest result
-     that is actually in range, except don't report a zero difference
-     if the actual difference is nonzero, as that would cause a false
-     match; and don't oscillate between two values, as that would
-     confuse the spring-forward gap detector.  */
-  return (t < long_int_avg (mktime_min, mktime_max)
-         ? (t <= mktime_min + 1 ? t + 1 : mktime_min)
-         : (mktime_max - 1 <= t ? t - 1 : mktime_max));
+  return ydhms_diff (year, yday, hour, min, sec,
+                    tp->tm_year, tp->tm_yday,
+                    tp->tm_hour, tp->tm_min, tp->tm_sec);
 }
 
 /* Use CONVERT to convert T to a struct tm value in *TM.  T must be in
-   range for time_t.  Return TM if successful, NULL if T is out of
-   range for CONVERT.  */
+   range for __time64_t.  Return TM if successful, NULL (setting errno) on
+   failure.  */
 static struct tm *
-convert_time (struct tm *(*convert) (const time_t *, struct tm *),
+convert_time (struct tm *(*convert) (const __time64_t *, struct tm *),
              long_int t, struct tm *tm)
 {
-  time_t x = t;
+  __time64_t x = t;
   return convert (&x, tm);
 }
 
 /* Use CONVERT to convert *T to a broken down time in *TP.
    If *T is out of range for conversion, adjust it so that
    it is the nearest in-range value and then convert that.
-   A value is in range if it fits in both time_t and long_int.  */
+   A value is in range if it fits in both __time64_t and long_int.
+   Return TP on success, NULL (setting errno) on failure.  */
 static struct tm *
-ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
+ranged_convert (struct tm *(*convert) (const __time64_t *, struct tm *),
                long_int *t, struct tm *tp)
 {
-  struct tm *r;
-  if (*t < mktime_min)
-    *t = mktime_min;
-  else if (mktime_max < *t)
-    *t = mktime_max;
-  r = convert_time (convert, *t, tp);
-
-  if (!r && *t)
+  long_int t1 = (*t < mktime_min ? mktime_min
+                : *t <= mktime_max ? *t : mktime_max);
+  struct tm *r = convert_time (convert, t1, tp);
+  if (r)
     {
-      long_int bad = *t;
-      long_int ok = 0;
+      *t = t1;
+      return r;
+    }
+  if (errno != EOVERFLOW)
+    return NULL;
 
-      /* BAD is a known unconvertible value, and OK is a known good one.
-        Use binary search to narrow the range between BAD and OK until
-        they differ by 1.  */
-      while (true)
-       {
-         long_int mid = long_int_avg (ok, bad);
-         if (mid != ok && mid != bad)
-           break;
-         r = convert_time (convert, mid, tp);
-         if (r)
-           ok = mid;
-         else
-           bad = mid;
-       }
+  long_int bad = t1;
+  long_int ok = 0;
+  struct tm oktm; oktm.tm_sec = -1;
 
-      if (!r && ok)
-       {
-         /* The last conversion attempt failed;
-            revert to the most recent successful attempt.  */
-         r = convert_time (convert, ok, tp);
-       }
+  /* BAD is a known out-of-range value, and OK is a known in-range one.
+     Use binary search to narrow the range between BAD and OK until
+     they differ by 1.  */
+  while (true)
+    {
+      long_int mid = long_int_avg (ok, bad);
+      if (mid == ok || mid == bad)
+       break;
+      if (convert_time (convert, mid, tp))
+       ok = mid, oktm = *tp;
+      else if (errno != EOVERFLOW)
+       return NULL;
+      else
+       bad = mid;
     }
 
-  return r;
+  if (oktm.tm_sec < 0)
+    return NULL;
+  *t = ok;
+  *tp = oktm;
+  return tp;
 }
 
 
-/* Convert *TP to a time_t value, inverting
+/* Convert *TP to a __time64_t value, inverting
    the monotonic and mostly-unit-linear conversion function CONVERT.
    Use *OFFSET to keep track of a guess at the offset of the result,
    compared to what the result would be for UTC without leap seconds.
    If *OFFSET's guess is correct, only one CONVERT call is needed.
+   If successful, set *TP to the canonicalized struct tm;
+   otherwise leave *TP alone, return ((time_t) -1) and set errno.
    This function is external because it is used also by timegm.c.  */
-time_t
+__time64_t
 __mktime_internal (struct tm *tp,
-                  struct tm *(*convert) (const time_t *, struct tm *),
+                  struct tm *(*convert) (const __time64_t *, struct tm *),
                   mktime_offset_t *offset)
 {
-  long_int t, gt, t0, t1, t2, dt;
   struct tm tm;
 
   /* The maximum number of probes (calls to CONVERT) should be enough
@@ -370,7 +341,7 @@ __mktime_internal (struct tm *tp,
   int isdst = tp->tm_isdst;
 
   /* 1 if the previous probe was DST.  */
-  int dst2;
+  int dst2 = 0;
 
   /* Ensure that mon is in range, and set year accordingly.  */
   int mon_remainder = mon % 12;
@@ -398,7 +369,7 @@ __mktime_internal (struct tm *tp,
   if (LEAP_SECONDS_POSSIBLE)
     {
       /* Handle out-of-range seconds specially,
-        since ydhms_tm_diff assumes every minute has 60 seconds.  */
+        since ydhms_diff assumes every minute has 60 seconds.  */
       if (sec < 0)
        sec = 0;
       if (59 < sec)
@@ -409,33 +380,46 @@ __mktime_internal (struct tm *tp,
      time.  */
 
   INT_SUBTRACT_WRAPV (0, off, &negative_offset_guess);
-  t0 = ydhms_diff (year, yday, hour, min, sec,
-                  EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, negative_offset_guess);
+  long_int t0 = ydhms_diff (year, yday, hour, min, sec,
+                           EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0,
+                           negative_offset_guess);
+  long_int t = t0, t1 = t0, t2 = t0;
 
   /* Repeatedly use the error to improve the guess.  */
 
-  for (t = t1 = t2 = t0, dst2 = 0;
-       (gt = guess_time_tm (year, yday, hour, min, sec, t,
-                           ranged_convert (convert, &t, &tm)),
-       t != gt);
-       t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0)
-    if (t == t1 && t != t2
-       && (tm.tm_isdst < 0
-           || (isdst < 0
-               ? dst2 <= (tm.tm_isdst != 0)
-               : (isdst != 0) != (tm.tm_isdst != 0))))
-      /* We can't possibly find a match, as we are oscillating
-        between two values.  The requested time probably falls
-        within a spring-forward gap of size GT - T.  Follow the common
-        practice in this case, which is to return a time that is GT - T
-        away from the requested time, preferring a time whose
-        tm_isdst differs from the requested value.  (If no tm_isdst
-        was requested and only one of the two values has a nonzero
-        tm_isdst, prefer that value.)  In practice, this is more
-        useful than returning -1.  */
-      goto offset_found;
-    else if (--remaining_probes == 0)
-      return -1;
+  while (true)
+    {
+      if (! ranged_convert (convert, &t, &tm))
+       return -1;
+      long_int dt = tm_diff (year, yday, hour, min, sec, &tm);
+      if (dt == 0)
+       break;
+
+      if (t == t1 && t != t2
+         && (tm.tm_isdst < 0
+             || (isdst < 0
+                 ? dst2 <= (tm.tm_isdst != 0)
+                 : (isdst != 0) != (tm.tm_isdst != 0))))
+       /* We can't possibly find a match, as we are oscillating
+          between two values.  The requested time probably falls
+          within a spring-forward gap of size DT.  Follow the common
+          practice in this case, which is to return a time that is DT
+          away from the requested time, preferring a time whose
+          tm_isdst differs from the requested value.  (If no tm_isdst
+          was requested and only one of the two values has a nonzero
+          tm_isdst, prefer that value.)  In practice, this is more
+          useful than returning -1.  */
+       goto offset_found;
+
+      remaining_probes--;
+      if (remaining_probes == 0)
+       {
+         __set_errno (EOVERFLOW);
+         return -1;
+       }
+
+      t1 = t2, t2 = t, t += dt, dst2 = tm.tm_isdst != 0;
+    }
 
   /* We have a match.  Check whether tm.tm_isdst has the requested
      value, if any.  */
@@ -445,8 +429,13 @@ __mktime_internal (struct tm *tp,
         time with the right value, and use its UTC offset.
 
         Heuristic: probe the adjacent timestamps in both directions,
-        looking for the desired isdst.  This should work for all real
-        time zone histories in the tz database.  */
+        looking for the desired isdst.  If none is found within a
+        reasonable duration bound, assume a one-hour DST difference.
+        This should work for all real time zone histories in the tz
+        database.  */
+
+      /* +1 if we wanted standard time but got DST, -1 if the reverse.  */
+      int dst_difference = (isdst == 0) - (tm.tm_isdst == 0);
 
       /* Distance between probes when looking for a DST boundary.  In
         tzdata2003a, the shortest period of DST is 601200 seconds
@@ -457,12 +446,14 @@ __mktime_internal (struct tm *tp,
         periods when probing.  */
       int stride = 601200;
 
-      /* The longest period of DST in tzdata2003a is 536454000 seconds
-        (e.g., America/Jujuy starting 1946-10-01 01:00).  The longest
-        period of non-DST is much longer, but it makes no real sense
-        to search for more than a year of non-DST, so use the DST
-        max.  */
-      int duration_max = 536454000;
+      /* In TZDB 2021e, the longest period of DST (or of non-DST), in
+        which the DST (or adjacent DST) difference is not one hour,
+        is 457243209 seconds: e.g., America/Cambridge_Bay with leap
+        seconds, starting 1965-10-31 00:00 in a switch from
+        double-daylight time (-05) to standard time (-07), and
+        continuing to 1980-04-27 02:00 in a switch from standard time
+        (-07) to daylight time (-06).  */
+      int duration_max = 457243209;
 
       /* Search in both directions, so the maximum distance is half
         the duration; add the stride to avoid off-by-1 problems.  */
@@ -477,25 +468,43 @@ __mktime_internal (struct tm *tp,
            if (! INT_ADD_WRAPV (t, delta * direction, &ot))
              {
                struct tm otm;
-               ranged_convert (convert, &ot, &otm);
+               if (! ranged_convert (convert, &ot, &otm))
+                 return -1;
                if (! isdst_differ (isdst, otm.tm_isdst))
                  {
                    /* We found the desired tm_isdst.
                       Extrapolate back to the desired time.  */
-                   t = guess_time_tm (year, yday, hour, min, sec, ot, &otm);
-                   ranged_convert (convert, &t, &tm);
-                   goto offset_found;
+                   long_int gt = ot + tm_diff (year, yday, hour, min, sec,
+                                               &otm);
+                   if (mktime_min <= gt && gt <= mktime_max)
+                     {
+                       if (convert_time (convert, gt, &tm))
+                         {
+                           t = gt;
+                           goto offset_found;
+                         }
+                       if (errno != EOVERFLOW)
+                         return -1;
+                     }
                  }
              }
          }
+
+      /* No unusual DST offset was found nearby.  Assume one-hour DST.  */
+      t += 60 * 60 * dst_difference;
+      if (mktime_min <= t && t <= mktime_max && convert_time (convert, t, &tm))
+       goto offset_found;
+
+      __set_errno (EOVERFLOW);
+      return -1;
     }
 
  offset_found:
   /* Set *OFFSET to the low-order bits of T - T0 - NEGATIVE_OFFSET_GUESS.
      This is just a heuristic to speed up the next mktime call, and
      correctness is unaffected if integer overflow occurs here.  */
-  INT_SUBTRACT_WRAPV (t, t0, &dt);
-  INT_SUBTRACT_WRAPV (dt, negative_offset_guess, offset);
+  INT_SUBTRACT_WRAPV (t, t0, offset);
+  INT_SUBTRACT_WRAPV (*offset, negative_offset_guess, offset);
 
   if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec)
     {
@@ -505,8 +514,12 @@ __mktime_internal (struct tm *tp,
       sec_adjustment -= sec;
       sec_adjustment += sec_requested;
       if (INT_ADD_WRAPV (t, sec_adjustment, &t)
-         || ! (mktime_min <= t && t <= mktime_max)
-         || ! convert_time (convert, t, &tm))
+         || ! (mktime_min <= t && t <= mktime_max))
+       {
+         __set_errno (EOVERFLOW);
+         return -1;
+       }
+      if (! convert_time (convert, t, &tm))
        return -1;
     }
 
@@ -518,9 +531,9 @@ __mktime_internal (struct tm *tp,
 
 #if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS
 
-/* Convert *TP to a time_t value.  */
-time_t
-mktime (struct tm *tp)
+/* Convert *TP to a __time64_t value.  */
+__time64_t
+__mktime64 (struct tm *tp)
 {
   /* POSIX.1 8.1.1 requires that whenever mktime() is called, the
      time zone names contained in the external variable 'tzname' shall
@@ -529,7 +542,7 @@ mktime (struct tm *tp)
 
 # if defined _LIBC || NEED_MKTIME_WORKING
   static mktime_offset_t localtime_offset;
-  return __mktime_internal (tp, __localtime_r, &localtime_offset);
+  return __mktime_internal (tp, __localtime64_r, &localtime_offset);
 # else
 #  undef mktime
   return mktime (tp);
@@ -537,154 +550,29 @@ mktime (struct tm *tp)
 }
 #endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS */
 
-#ifdef weak_alias
-weak_alias (mktime, timelocal)
-#endif
-
-#ifdef _LIBC
-libc_hidden_def (mktime)
-libc_hidden_weak (timelocal)
-#endif
-
-#if DEBUG_MKTIME
-
-static int
-not_equal_tm (const struct tm *a, const struct tm *b)
-{
-  return ((a->tm_sec ^ b->tm_sec)
-         | (a->tm_min ^ b->tm_min)
-         | (a->tm_hour ^ b->tm_hour)
-         | (a->tm_mday ^ b->tm_mday)
-         | (a->tm_mon ^ b->tm_mon)
-         | (a->tm_year ^ b->tm_year)
-         | (a->tm_yday ^ b->tm_yday)
-         | isdst_differ (a->tm_isdst, b->tm_isdst));
-}
+#if defined _LIBC && __TIMESIZE != 64
 
-static void
-print_tm (const struct tm *tp)
-{
-  if (tp)
-    printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d",
-           tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday,
-           tp->tm_hour, tp->tm_min, tp->tm_sec,
-           tp->tm_yday, tp->tm_wday, tp->tm_isdst);
-  else
-    printf ("0");
-}
-
-static int
-check_result (time_t tk, struct tm tmk, time_t tl, const struct tm *lt)
-{
-  if (tk != tl || !lt || not_equal_tm (&tmk, lt))
-    {
-      printf ("mktime (");
-      print_tm (lt);
-      printf (")\nyields (");
-      print_tm (&tmk);
-      printf (") == %ld, should be %ld\n", (long int) tk, (long int) tl);
-      return 1;
-    }
+libc_hidden_def (__mktime64)
 
-  return 0;
-}
-
-int
-main (int argc, char **argv)
+time_t
+mktime (struct tm *tp)
 {
-  int status = 0;
-  struct tm tm, tmk, tml;
-  struct tm *lt;
-  time_t tk, tl, tl1;
-  char trailer;
-
-  /* Sanity check, plus call tzset.  */
-  tl = 0;
-  if (! localtime (&tl))
-    {
-      printf ("localtime (0) fails\n");
-      status = 1;
-    }
-
-  if ((argc == 3 || argc == 4)
-      && (sscanf (argv[1], "%d-%d-%d%c",
-                 &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer)
-         == 3)
-      && (sscanf (argv[2], "%d:%d:%d%c",
-                 &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer)
-         == 3))
+  struct tm tm = *tp;
+  __time64_t t = __mktime64 (&tm);
+  if (in_time_t_range (t))
     {
-      tm.tm_year -= TM_YEAR_BASE;
-      tm.tm_mon--;
-      tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]);
-      tmk = tm;
-      tl = mktime (&tmk);
-      lt = localtime_r (&tl, &tml);
-      printf ("mktime returns %ld == ", (long int) tl);
-      print_tm (&tmk);
-      printf ("\n");
-      status = check_result (tl, tmk, tl, lt);
+      *tp = tm;
+      return t;
     }
-  else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0))
+  else
     {
-      time_t from = atol (argv[1]);
-      time_t by = atol (argv[2]);
-      time_t to = atol (argv[3]);
-
-      if (argc == 4)
-       for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
-         {
-           lt = localtime_r (&tl, &tml);
-           if (lt)
-             {
-               tmk = tml;
-               tk = mktime (&tmk);
-               status |= check_result (tk, tmk, tl, &tml);
-             }
-           else
-             {
-               printf ("localtime_r (%ld) yields 0\n", (long int) tl);
-               status = 1;
-             }
-           tl1 = tl + by;
-           if ((tl1 < tl) != (by < 0))
-             break;
-         }
-      else
-       for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
-         {
-           /* Null benchmark.  */
-           lt = localtime_r (&tl, &tml);
-           if (lt)
-             {
-               tmk = tml;
-               tk = tl;
-               status |= check_result (tk, tmk, tl, &tml);
-             }
-           else
-             {
-               printf ("localtime_r (%ld) yields 0\n", (long int) tl);
-               status = 1;
-             }
-           tl1 = tl + by;
-           if ((tl1 < tl) != (by < 0))
-             break;
-         }
+      __set_errno (EOVERFLOW);
+      return -1;
     }
-  else
-    printf ("Usage:\
-\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\
-\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\
-\t%s FROM BY TO - # Do not test those values (for benchmark).\n",
-           argv[0], argv[0], argv[0]);
-
-  return status;
 }
 
-#endif /* DEBUG_MKTIME */
-
-/*
-Local Variables:
-compile-command: "gcc -DDEBUG_MKTIME -I. -Wall -W -O2 -g mktime.c -o mktime"
-End:
-*/
+#endif
+
+weak_alias (mktime, timelocal)
+libc_hidden_def (mktime)
+libc_hidden_weak (timelocal)
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 18edd9ee..3828cf9d 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2022-10-21         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.tst: Regenerated.
+
 2022-09-25         Arnold D. Robbins     <arnold@skeeve.com>
 
        * Makefile.tst: Regenerated.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 17b03c00..c25dc18e 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -1107,8 +1107,8 @@ readdir_retest:
 
 readall:
        @echo $@
-       @-AWKPATH="$(srcdir)" $(AWK) -lrwarray -f $@1.awk -v 
"ofile=readall.state" > _$@
-       @-AWKPATH="$(srcdir)" $(AWK) -lrwarray -f $@2.awk -v 
"ifile=readall.state" >> _$@
+       @-AWKPATH="$(srcdir)" $(AWK) -lrwarray -f $@1.awk -v 
"ofile=readall.state" > _$@ 2>&1
+       @-AWKPATH="$(srcdir)" $(AWK) -lrwarray -f $@2.awk -v 
"ifile=readall.state" >> _$@ 2>&1
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
        @-$(RM) -f readall.state
 
diff --git a/support/ChangeLog b/support/ChangeLog
index 980f7e2d..1b557d0c 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,13 @@
+2022-10-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port to current Gnulib
+       Adjust to current Gnulib, which uses C23 style keywords for bool,
+       true, false and static_assert, and assumes that <config.h>
+       supplies compatibility macros on older systems.
+
+       * dfa.h, localeinfo.h, malloc/dynarray.h, regex_internal.h:
+       Sync from Gnulib.
+
 2022-10-15         Arnold D. Robbins     <arnold@skeeve.com>
 
        * intprops.h, localeinfo.c, verify.h: Updated from GNULIB.
diff --git a/support/Makefile.in b/support/Makefile.in
index b25e5561..01c3aed0 100644
--- a/support/Makefile.in
+++ b/support/Makefile.in
@@ -117,16 +117,16 @@ subdir = support
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
        $(top_srcdir)/m4/ax_check_compile_flag.m4 \
-       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
-       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
-       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
-       $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
-       $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
-       $(top_srcdir)/m4/pma.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
-       $(top_srcdir)/m4/socket.m4 \
+       $(top_srcdir)/m4/c-bool.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \
+       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+       $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libsigsegv.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/pma.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
        $(top_srcdir)/m4/triplet-transformation.m4 \
        $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
diff --git a/support/dfa.h b/support/dfa.h
index 043f0e97..3e3a938a 100644
--- a/support/dfa.h
+++ b/support/dfa.h
@@ -23,7 +23,6 @@
 
 #include "idx.h"
 #include <regex.h>
-#include <stdbool.h>
 #include <stddef.h>
 #include <stdlib.h>
 
diff --git a/support/localeinfo.h b/support/localeinfo.h
index ac235fcc..f117374a 100644
--- a/support/localeinfo.h
+++ b/support/localeinfo.h
@@ -20,7 +20,6 @@
 /* Written by Paul Eggert.  */
 
 #include <limits.h>
-#include <stdbool.h>
 #include <wchar.h>
 
 struct localeinfo
diff --git a/support/malloc/dynarray.h b/support/malloc/dynarray.h
index f16fd950..df1aa416 100644
--- a/support/malloc/dynarray.h
+++ b/support/malloc/dynarray.h
@@ -94,7 +94,6 @@
 #ifndef _DYNARRAY_H
 #define _DYNARRAY_H
 
-#include <stdbool.h>
 #include <stddef.h>
 #include <string.h>
 
diff --git a/support/regex_internal.h b/support/regex_internal.h
index 57a455b1..784d2d45 100644
--- a/support/regex_internal.h
+++ b/support/regex_internal.h
@@ -29,7 +29,6 @@
 #include <locale.h>
 #include <wchar.h>
 #include <wctype.h>
-#include <stdbool.h>
 #include <stdint.h>
 
 #ifndef _LIBC
diff --git a/test/Makefile.in b/test/Makefile.in
index f6a18605..cdf26e65 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -114,16 +114,16 @@ subdir = test
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
        $(top_srcdir)/m4/ax_check_compile_flag.m4 \
-       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
-       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
-       $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lcmessage.m4 \
-       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
-       $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
-       $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
-       $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
-       $(top_srcdir)/m4/pma.m4 $(top_srcdir)/m4/po.m4 \
-       $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
-       $(top_srcdir)/m4/socket.m4 \
+       $(top_srcdir)/m4/c-bool.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/host-cpu-c-abi.m4 \
+       $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
+       $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/libsigsegv.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/pma.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
        $(top_srcdir)/m4/triplet-transformation.m4 \
        $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -2872,8 +2872,8 @@ readdir_retest:
 
 readall:
        @echo $@
-       @-AWKPATH="$(srcdir)" $(AWK) -lrwarray -f $@1.awk -v 
"ofile=readall.state" > _$@
-       @-AWKPATH="$(srcdir)" $(AWK) -lrwarray -f $@2.awk -v 
"ifile=readall.state" >> _$@
+       @-AWKPATH="$(srcdir)" $(AWK) -lrwarray -f $@1.awk -v 
"ofile=readall.state" > _$@ 2>&1
+       @-AWKPATH="$(srcdir)" $(AWK) -lrwarray -f $@2.awk -v 
"ifile=readall.state" >> _$@ 2>&1
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
        @-$(RM) -f readall.state
 

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=642351414f874a9632d985ef1bd0dde9df9eac9b

commit 642351414f874a9632d985ef1bd0dde9df9eac9b
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Oct 21 13:02:17 2022 +0300

    Update NEWS.

diff --git a/ChangeLog b/ChangeLog
index 73654d8b..320ba247 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2022-10-20         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * NEWS: Updated.
+
 2022-10-14         Andrew J. Schorr      <aschorr@telemetry-investments.com>
 
        * awkgram.y: Use Node_var_new instead of Node_var_array for
diff --git a/NEWS b/NEWS
index 956ae6ef..7936d218 100644
--- a/NEWS
+++ b/NEWS
@@ -7,16 +7,22 @@
 Changes from 5.2.0 to 5.2.1
 ---------------------------
 
-1. More subtle issues with untyped array elements being passed to
+1. Issues related to the sign of NaN and Inf values on RiscV have
+   been fixed; gawk now gives identical results on that platform as
+   it does on others.
+
+2. A few issues with the debugger have been fixed.
+
+3. More subtle issues with untyped array elements being passed to
    functions have been fixed.
 
-2. The rwarray extension's readall() function has had some bugs fixed.
+4. The rwarray extension's readall() function has had some bugs fixed.
 
-3. The PMA allocator is now supported on Linux on s/390, FreeBSD and OpenBSD.
-   It is currently disabled on macos on M1 since there are some unsolved
-   problems in that environment. macos on Intel works without problem.
+5. The PMA allocator is now supported on FreeBSD, OpenBSD and Linux on S/390x.
+   It is currently disabled on macOS on M1 since there are some unsolved
+   problems in that environment. macOS on Intel works without problem.
 
-4. There have been several minor code cleanups and bug fixes. See the
+6. There have been several minor code cleanups and bug fixes. See the
    ChangeLog for details.
 
 Changes from 5.1.x to 5.2.0

-----------------------------------------------------------------------


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]