[compiler-rt] 26800a2 - [sanitizer] Undef _TIME_BITS along with _FILE_OFFSET_BITS on Linux
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 3 11:48:40 PST 2023
Author: Khem Raj
Date: 2023-02-03T11:48:35-08:00
New Revision: 26800a2c7e7996dc773b4e990dd5cca41c45e1a9
URL: https://github.com/llvm/llvm-project/commit/26800a2c7e7996dc773b4e990dd5cca41c45e1a9
DIFF: https://github.com/llvm/llvm-project/commit/26800a2c7e7996dc773b4e990dd5cca41c45e1a9.diff
LOG: [sanitizer] Undef _TIME_BITS along with _FILE_OFFSET_BITS on Linux
On 32-bit glibc>=2.34 systems using 64bit time_t build fails because
_FILE_OFFSET_BITS is undefined here but _TIME_BITS is still set to 64
Fixes
```
/usr/include/features-time64.h:26:5: error: "_TIME_BITS=64 is allowed
only with _FILE_OFFSET_BITS=64"
| # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
| ^
| 1 error generated.
```
Reviewed By: thesamesam, MaskRay
Differential Revision: https://reviews.llvm.org/D140812
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index fc01498aa228..eb2ee78c2f45 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -18,6 +18,7 @@
// depends on _FILE_OFFSET_BITS setting.
// To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.
#undef _FILE_OFFSET_BITS
+#undef _TIME_BITS
#endif
// Must go after undef _FILE_OFFSET_BITS.
More information about the llvm-commits
mailing list