Skip to content

Commit

Permalink
[sanitizer] Undef _TIME_BITS along with _FILE_OFFSET_BITS on Linux
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kraj authored and MaskRay committed Feb 3, 2023
1 parent a8f13db commit 26800a2
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 26800a2

Please sign in to comment.