[gdal-dev] GDAL 3.6.0 patch for building on iOS (and Mac Catalyst)

Nik Sands nik at nixanz.com
Fri Nov 11 19:04:09 PST 2022


Hi Even,

This patch worked fine to resolve the ‘pread64’ error on iOS and Mac Catalyst.

Thank you.
-Nik

> On 12 Nov 2022, at 12:12 pm, Even Rouault <even.rouault at spatialys.com> wrote:
> 
> Nik,
> 
> actually I've just modified it to the following that still tries to detect pread(). Can you test and report?
> 
> diff --git a/cmake/helpers/configure.cmake b/cmake/helpers/configure.cmake
> index f52ea47db3..0939ffadda 100644
> --- a/cmake/helpers/configure.cmake
> +++ b/cmake/helpers/configure.cmake
> @@ -241,16 +241,6 @@ else ()
>    check_type_size("off_t" SIZEOF_OFF_T)
> 
>    check_function_exists(pread64 HAVE_PREAD64)
> -  if( NOT HAVE_PREAD64 )
> -    check_c_source_compiles(
> -      "
> -         #include <sys/types.h>
> -         #include <sys/uio.h>
> -         #include <unistd.h>
> -         int main() { pread(0, NULL, 0, 0); return 0; }
> -        "
> -      HAVE_PREAD_BSD)
> -  endif()
> 
>    check_function_exists(ftruncate64 HAVE_FTRUNCATE64)
>    if (HAVE_FTRUNCATE64)
> @@ -280,6 +270,19 @@ else ()
>      unset(HAVE_FSEEK64 CACHE)
>      unset(HAVE_STATVFS64)
>      unset(HAVE_STATVFS64 CACHE)
> +    unset(HAVE_PREAD64)
> +    unset(HAVE_PREAD64 CACHE)
> +  endif()
> +
> +  if( NOT HAVE_PREAD64 )
> +    check_c_source_compiles(
> +      "
> +         #include <sys/types.h>
> +         #include <sys/uio.h>
> +         #include <unistd.h>
> +         int main() { pread(0, NULL, 0, 0); return 0; }
> +        "
> +      HAVE_PREAD_BSD)
>    endif()
> 
>    set(UNIX_STDIO_64 TRUE)
> 
> Le 12/11/2022 à 02:07, Even Rouault a écrit :
>> 
>> Le 12/11/2022 à 02:00, Nik Sands a écrit :
>>> Hi GDAL devs
>>> 
>>> It appears as though ‘pread64’, introduced in 3.6.0, has broken building on iOS in the same way that other ‘…64’ errors used to occur on version 3.5.0 before being patched for 3.5.2.
>>> 
>>> The attached patch (text content also pasted below) allows the build to continue past that point for iOS (and Mac Catalyst). I’m just an ignorant hobbyist who doesn’t really understand a lot of this stuff, so please check that what I’ve done here is correct!  :-)  If it’s all OK, then please apply this (or similar) patch for the next release.
>> 
>> Patch queued in https://github.com/OSGeo/gdal/pull/6673
>> 
>> Thanks
>> 
> -- 
> http://www.spatialys.com
> My software is free, but my time generally not.
> 


========================================================
NIK SANDS
Line Tamer | Time Traveller | Space Cadet

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221112/e094de34/attachment.htm>


More information about the gdal-dev mailing list