[PATCH] D54101: [Sanitizers] Solaris largefile fixes

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 5 05:35:33 PST 2018


ro created this revision.
ro added a reviewer: kcc.
ro added a project: Sanitizers.
Herald added subscribers: Sanitizers, fedor.sergeev, kubamracek, jyknight.

While testing the Solaris libsanitizer port on GCC mainline, I found that I'd messed up
the largefile checks in various ways, some of which showed as compile failures
(wrong structure sizes and member offsets), others at runtime, some of those only
on sparc as a big-endian target.

This patch fixes all of them:

- OFF_T is now correctly defined for 32-bit largefile and traditional environments, and 64-bit.

- The definition of __sanitizer_dirent now checks the correct conditionals.

- sanitizer_procmaps_solaris.cc undefines ```_FILE_OFFSET_BITS```: before Solaris 11.4 ```<procfs.h>``` doesn't even compile with largefile support enabled, but the use at hand doesn't need it anyway while g++ 9 will define```_FILE_OFFSET_BITS=64``` out of the box.

- With full largefile support enabled, one needs to use e.g. ```mmap64``` instead of ```mmap```; this is hidden behind macros.

With this patch I could bootstrap gcc mainline on both sparc-sun-solaris2.11 and
i386-pc-solaris2.11.  In addition, I've successfully built llvm on i386-pc-solaris2.11.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D54101

Files:
  lib/sanitizer_common/sanitizer_internal_defs.h
  lib/sanitizer_common/sanitizer_platform_limits_solaris.h
  lib/sanitizer_common/sanitizer_procmaps_solaris.cc
  lib/sanitizer_common/sanitizer_solaris.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54101.172572.patch
Type: text/x-patch
Size: 4893 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181105/df830fc4/attachment.bin>


More information about the llvm-commits mailing list