[sanitizer_common] Restore sanitizer_procmaps_solaris.cpp compilation on Solaris...
authorRainer Orth <ro@gcc.gnu.org>
Fri, 23 Sep 2022 13:50:00 +0000 (15:50 +0200)
committerRainer Orth <ro@gcc.gnu.org>
Fri, 23 Sep 2022 13:50:00 +0000 (15:50 +0200)
When upstream `compiler-rt` was recently imported into GCC's
`libsanitizer`, Solaris 11.3 bootstrap broke because in 11.3
`<sys/procfs.h>` doesn't mix with largefile compilation.  I'd caused this
in D129837 <https://reviews.llvm.org/D129837> where I forgot that the code
still needs to support Solaris 11.3.

Fixed by restoring the `#undef _FILE_OFFSET_BITS`.

Tested on `sparc-sun-solaris2.11` and `amd64-pc-solaris2.11` (Solaris 11.4)
in LLVM and both Solaris 11.3 and 11.4 in GCC.

Differential Revision: https://reviews.llvm.org/D133556

compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp

index 6f43817..eeb49e2 100644 (file)
@@ -9,6 +9,8 @@
 // Information about the process mappings (Solaris-specific parts).
 //===----------------------------------------------------------------------===//
 
+// Before Solaris 11.4, <procfs.h> doesn't work in a largefile environment.
+#undef _FILE_OFFSET_BITS
 #include "sanitizer_platform.h"
 #if SANITIZER_SOLARIS
 #  include <fcntl.h>