diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-10-21 21:08:13 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-10-21 21:08:13 +0000 |
| commit | 5efbbca8188abba6a3a3a3eea07afb3f824a806e (patch) | |
| tree | 0b6937ef0d17bb7d7bbfd84dd9b90da5952836e8 | |
| parent | 4c1f801b8198fc634abf558598b9038cd9fe9882 (diff) | |
| download | bcm5719-llvm-5efbbca8188abba6a3a3a3eea07afb3f824a806e.tar.gz bcm5719-llvm-5efbbca8188abba6a3a3a3eea07afb3f824a806e.zip | |
[sanitizer] Fix build with _FILE_OFFSET_BITS=64.
Sanitizer source is not affected by _FILE_OFFSET_BITS in general,
but this one file must be built with 32-bit off_t. More details in the code.
llvm-svn: 220328
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc index bbc1108dcdc..fc095224f92 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -15,6 +15,14 @@ #include "sanitizer_platform.h" #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC +// Tests in this file assume that off_t-dependent data structures match the +// libc ABI. For example, struct dirent here is what readdir() function (as +// exported from libc) returns, and not the user-facing "dirent", which +// depends on _FILE_OFFSET_BITS setting. +// To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below. +#ifdef _FILE_OFFSET_BITS +#undef _FILE_OFFSET_BITS +#endif #if SANITIZER_FREEBSD #define _WANT_RTENTRY #include <sys/param.h> |

