0004-Undef-_TIME_BITS-along-with-_FILE_OFFSET_BITS-on-Lin.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 88b73eedcfa0fc58aee2555377e6f7d4de153282 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Fri, 3 Feb 2023 11:48:35 -0800
  4. Subject: [PATCH] Undef _TIME_BITS along with _FILE_OFFSET_BITS on Linux
  5. On 32-bit glibc>=2.34 systems using 64bit time_t build fails because
  6. _FILE_OFFSET_BITS is undefined here but _TIME_BITS is still set to 64
  7. Fixes
  8. ```
  9. /usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed
  10. only with _FILE_OFFSET_BITS=64"
  11. | # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
  12. | ^
  13. | 1 error generated.
  14. ```
  15. Reviewed By: thesamesam, MaskRay
  16. Differential Revision: https://reviews.llvm.org/D140812
  17. Upstream: https://github.com/llvm/llvm-project/commit/26800a2c7e7996dc773b4e990dd5cca41c45e1a9
  18. Upstream: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d53b3d94aaf211ffb2159614f5aaaf03ceb861cc
  19. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  20. ---
  21. .../sanitizer_common/sanitizer_platform_limits_posix.cpp | 1 +
  22. 1 file changed, 1 insertion(+)
  23. diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
  24. index bcbd143d19d..1b23898b374 100644
  25. --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
  26. +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
  27. @@ -18,6 +18,7 @@
  28. // depends on _FILE_OFFSET_BITS setting.
  29. // To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.
  30. #undef _FILE_OFFSET_BITS
  31. +#undef _TIME_BITS
  32. #endif
  33. // Must go after undef _FILE_OFFSET_BITS.
  34. --
  35. 2.45.2