]> Savannah Git Hosting - gnulib.git/commitdiff
sigsegv, vma-iter: port to Solaris 10
authorPaul Eggert <eggert@trombone>
Sun, 22 Jan 2023 06:49:04 +0000 (00:49 -0600)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 22 Jan 2023 06:49:53 +0000 (00:49 -0600)
On this platform, <sys/types.h> does not define off_t if neither
_LP64 nor _FILE_OFFSET_BITS is defined, which can happen if we
#undef _FILE_OFFSET_BITS.  This became a problem with the new way
of doing stdbool, since config.h now includes <stdbool.h>, and
Solaris 10 <stdbool.h> includes <sys/feature_tests.h> which
arranges for _FILE_OFFSET_BITS to always be defined (if only to 32),
which <sys/types.h> assumes.
* lib/stackvma.c, lib/vma-iter.c (_FILE_OFFSET_BITS) [__sun && !_LP64]:
Define to 32 instead of leaving undefined.

ChangeLog
lib/stackvma.c
lib/vma-iter.c

index d474155df77ff3fcfa7f535f4f6d03e8d2da7d2b..ba55d6c859a38c48017fb37a5189fc5fbe27dec1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2023-01-22  Paul Eggert  <eggert@trombone>
+
+       sigsegv, vma-iter: port to Solaris 10
+       On this platform, <sys/types.h> does not define off_t if neither
+       _LP64 nor _FILE_OFFSET_BITS is defined, which can happen if we
+       #undef _FILE_OFFSET_BITS.  This became a problem with the new way
+       of doing stdbool, since config.h now includes <stdbool.h>, and
+       Solaris 10 <stdbool.h> includes <sys/feature_tests.h> which
+       arranges for _FILE_OFFSET_BITS to always be defined (if only to 32),
+       which <sys/types.h> assumes.
+       * lib/stackvma.c, lib/vma-iter.c (_FILE_OFFSET_BITS) [__sun && !_LP64]:
+       Define to 32 instead of leaving undefined.
+
 2023-01-21  Bruno Haible  <bruno@clisp.org>
 
        login_tty: Ensure declaration in <utmp.h>.
index 4408ca8e1531c30e5ac42ede611da51ca3ca6bc2..1224b7b07cdb740dd907a924ccff6c3d77ebc03a 100644 (file)
@@ -22,6 +22,7 @@
 /* On Solaris in 32-bit mode, when gnulib module 'largefile' is in use,
    prevent a compilation error
      "Cannot use procfs in the large file compilation environment"
+   while also preventing <sys/types.h> from not defining off_t.
    On Android, when targeting Android 4.4 or older with a GCC toolchain,
    prevent a compilation error
      "error: call to 'mmap' declared with attribute error: mmap is not
       switch to Clang."
    The files that we access in this compilation unit are less than 2 GB
    large.  */
-#if defined __sun || defined __ANDROID__
+#if defined __sun && !defined _LP64 && _FILE_OFFSET_BITS == 64
+# undef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 32
+#endif
+#ifdef __ANDROID__
 # undef _FILE_OFFSET_BITS
 #endif
 
index ccb221d27393e5b783eb61db959afdf81aa11197..2584d5ec34928d784ad5890840752eacab6e4d64 100644 (file)
@@ -20,6 +20,7 @@
 /* On Solaris in 32-bit mode, when gnulib module 'largefile' is in use,
    prevent a compilation error
      "Cannot use procfs in the large file compilation environment"
+   while also preventing <sys/types.h> from not defining off_t.
    On Android, when targeting Android 4.4 or older with a GCC toolchain,
    prevent a compilation error
      "error: call to 'mmap' declared with attribute error: mmap is not
       switch to Clang."
    The files that we access in this compilation unit are less than 2 GB
    large.  */
-#if defined __sun || defined __ANDROID__
+#if defined __sun && !defined _LP64 && _FILE_OFFSET_BITS == 64
+# undef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 32
+#endif
+#ifdef __ANDROID__
 # undef _FILE_OFFSET_BITS
 #endif