0003-SConscript-Do-not-force-_TIME_BITS-on-a-32-bit-syste.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From a1f36cf216861ac6499654b4e6e4d54107142cfc Mon Sep 17 00:00:00 2001
  2. Message-Id: <a1f36cf216861ac6499654b4e6e4d54107142cfc.1749533625.git.yann.morin@orange.com>
  3. In-Reply-To: <f18e52dad4eeba2434a988bc899f6c7fe973f4ba.1749533625.git.yann.morin@orange.com>
  4. References: <f18e52dad4eeba2434a988bc899f6c7fe973f4ba.1749533625.git.yann.morin@orange.com>
  5. From: "Gary E. Miller" <gem@rellim.com>
  6. Date: Thu, 5 Jun 2025 18:14:55 -0700
  7. Subject: [PATCH] SConscript: Do not force _TIME_BITS on a 32 bit system.
  8. The build assumed that if _TIME_BITS existed on a system then it was OK
  9. to set it. Turns out that is a bad assumption.
  10. Leave it to the builds to decide when _TIME_BITS should be used.
  11. Upstream: https://gitlab.com/gpsd/gpsd/-/commit/95814d22276c34abe72a35b89065b1190d34f9bf
  12. Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
  13. ---
  14. SConscript | 16 +++-------------
  15. 1 file changed, 3 insertions(+), 13 deletions(-)
  16. diff --git a/SConscript b/SConscript
  17. index 28105fa7b..357c53f2b 100644
  18. --- a/SConscript
  19. +++ b/SConscript
  20. @@ -1335,19 +1335,9 @@ if not cleaning and not helping:
  21. # check for 64 bit time_t. Needed for 2038.
  22. sizeof_time_t = config.CheckTypeSize("time_t", "#include <time.h>",
  23. expect=8)
  24. - if 0 == sizeof_time_t:
  25. - # see if we can force time64_t
  26. - # this needs glibc 2.34 or later, and a compatible kernel
  27. - sizeof_time_t = config.CheckTypeSize("time_t",
  28. - "#define _TIME_BITS 64\n"
  29. - "#define _FILE_OFFSET_BITS 64\n"
  30. - "#include <time.h>",
  31. - expect=8)
  32. - if 0 != sizeof_time_t:
  33. - # force time64_t
  34. - confdefs.append("// Forcing 64-bit time_t\n"
  35. - "#define _TIME_BITS 64\n"
  36. - "#define _FILE_OFFSET_BITS 64\n")
  37. + # do not try to force time64_t, that is a distro decision.
  38. + # it needs glibc 2.34 or later, and a compatible kernel
  39. + # CFLAGS += "-D_TIME_BITS 64 -D_FILE_OFFSET_BITS 64"
  40. if 0 == sizeof_time_t:
  41. announce("WARNING: time_t is too small. It will fail in 2038")
  42. --
  43. 2.34.1