0034-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 3c7ebde16bea113e119b2ef7134b10cd8d7e3b1c Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Sat, 31 Dec 2022 15:03:24 -0800
  4. Subject: [PATCH] compiler-rt: Undef _TIME_BITS along with _FILE_OFFSET_BITS on
  5. linux
  6. On 32bit systems using 64bit time_t build fails because
  7. _FILE_OFFSET_BITS is undefined here but _TIME_BITS is still set to 64
  8. Fixes
  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. Also avoid LFS64 functions on musl
  15. Upstream-Status: Pending
  16. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  17. ---
  18. .../lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | 1 +
  19. 1 file changed, 1 insertion(+)
  20. diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
  21. index fc01498aa228..eb2ee78c2f45 100644
  22. --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
  23. +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
  24. @@ -18,6 +18,7 @@
  25. // depends on _FILE_OFFSET_BITS setting.
  26. // To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.
  27. #undef _FILE_OFFSET_BITS
  28. +#undef _TIME_BITS
  29. #endif
  30. // Must go after undef _FILE_OFFSET_BITS.