diff mbox series

[RFC,v1,3/4] package/xz: enable year2038 option

Message ID 20240307165218.10027-3-ps.report@gmx.net
State Rejected
Headers show
Series [v1,1/4] package/xz: bump version to 5.6.0 | expand

Commit Message

Peter Seiderer March 7, 2024, 4:52 p.m. UTC
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Notes:

- From autoconf-2.72 release notes ([1]):
  *** Support for ensuring time_t is Y2038-safe
  configure can now ensure that time_t can represent moments in time
  after 18 January 2038, i.e. 2**31 - 1 seconds after the Unix epoch.
  On most 64-bit systems this is true by default; the new feature
  is detection of systems where time_t is a 32-bit signed integer by
  default, *and* there is an alternative mode in which it is larger,
  in which case that mode will be enabled.

  In this release, all configure scripts that use AC_SYS_LARGEFILE
  gain a new command line option --enable-year2038.  When this option
  is used, the configure script will check for and enable support for
  a large time_t.

  This release also adds two new macros, AC_SYS_YEAR2038 and
  AC_SYS_YEAR2038_RECOMMENDED.  Both have all the effects of
  AC_SYS_LARGEFILE.  (This is because it is not possible to enlarge
  time_t without also enlarging off_t, on any system we are aware of.)

  AC_SYS_YEAR2038 additionally flips the default for --enable-year2038;
  a configure script that uses this macro will check for and enable
  support for a large time_t by default, but this can be turned off by
  using --disable-year2038.  AC_SYS_YEAR2038_RECOMMENDED goes even
  further, and makes the configure script fail on systems that do not
  seem to support timestamps after 18 January 2038 at all.  This
  failure can be suppressed by using --disable-year2038.

  Changing the size of time_t can change a library`s ABI.  Therefore,
  application and library builders should take care that all packages
  are configured with consistent use of --enable-year2038 or
  --disable-year2038, to ensure binary compatibility.  This is similar
  to longstanding consistency requirements with --enable-largefile and
  --disable-largefile.

  In this release, these macros only know how to enlarge time_t on two
  classes of systems: 32-bit MinGW, and any system where time_t can be
  enlarged by defining the preprocessor macro _TIME_BITS with the
  value 64.  At the time this NEWS entry was written, only GNU libc
  (version 2.34 and later) supported the latter macro.  Authors of
  other C libraries with a 32-bit time_t are encouraged to adopt
  _TIME_BITS, rather than inventing a different way to enlarge time_t.

- In buildroot there is already the BR2_TIME_BITS_64 config option
  ('Build Y2038-ready code'), which enables a system wide
  '-D_TIME_BITS=64' compile flag (and maybe should additional set
  '--enable-year2039' configure option for the autotools-packages?).
---
 package/xz/xz.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/package/xz/xz.mk b/package/xz/xz.mk
index a9e33bd3df..64dbec8b2e 100644
--- a/package/xz/xz.mk
+++ b/package/xz/xz.mk
@@ -40,7 +40,7 @@  XZ_CONF_OPTS = \
 	--enable-unaligned-access=auto \
 	--disable-unsafe-type-punning \
 	--disable-werror \
-	--disable-year2038
+	--enable-year2038
 
 HOST_XZ_CONF_OPTS = \
 	$(XZ_CONF_OPTS) \