From 0f80726cd33395e0d2f1ff173bc5d5713ee2c228 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 22 Jan 2023 00:49:04 -0600 Subject: [PATCH] sigsegv, vma-iter: port to Solaris 10 On this platform, does not define off_t if neither _LP64 nor _FILE_OFFSET_BITS is defined, which can happen if we of doing stdbool, since config.h now includes , and Solaris 10 includes which arranges for _FILE_OFFSET_BITS to always be defined (if only to 32), which assumes. * lib/stackvma.c, lib/vma-iter.c (_FILE_OFFSET_BITS) [__sun && !_LP64]: Define to 32 instead of leaving undefined. --- ChangeLog | 13 +++++++++++++ lib/stackvma.c | 7 ++++++- lib/vma-iter.c | 7 ++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index af1e559d94..ca8306d1e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2023-01-22 Paul Eggert + + sigsegv, vma-iter: port to Solaris 10 + On this platform, 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 , and + Solaris 10 includes which + arranges for _FILE_OFFSET_BITS to always be defined (if only to 32), + which assumes. + * lib/stackvma.c, lib/vma-iter.c (_FILE_OFFSET_BITS) [__sun && !_LP64]: + Define to 32 instead of leaving undefined. + 2023-01-19 Paul Eggert snippet/_Noreturn: work around Clang _Noreturn bug diff --git a/lib/stackvma.c b/lib/stackvma.c index 4408ca8e15..1224b7b07c 100644 --- a/lib/stackvma.c +++ b/lib/stackvma.c @@ -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 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 @@ -30,7 +31,11 @@ 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 diff --git a/lib/vma-iter.c b/lib/vma-iter.c index ccb221d273..2584d5ec34 100644 --- a/lib/vma-iter.c +++ b/lib/vma-iter.c @@ -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 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 @@ -28,7 +29,11 @@ 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 -- 2.39.5