gdal-2.0.0-1.fc24 fails to build in F24: libtool: compile: gcc -I/builddir/build/BUILD/gdal-2.0.0-fedora/port -I/builddir/build/BUILD/gdal-2.0.0-fedora/gcore -I/builddir/build/BUILD/gdal-2.0.0-fedora/alg -I/builddir/build/BUILD/gdal-2.0.0-fedora/ogr -I/builddir/build/BUILD/gdal-2.0.0-fedora/ogr/ogrsf_frmts -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fpic -Wall -Wdeclaration-after-statement -I/builddir/build/BUILD/gdal-2.0.0-fedora/frmts/vrt -DOGR_ENABLED -I/usr/include/libgeotiff -I/builddir/build/BUILD/gdal-2.0.0-fedora/port -I/usr/include -Iexternal/include -I/usr/include/cfitsio -DGDAL_COMPILATION -I/builddir/build/BUILD/gdal-2.0.0-fedora/ogr/ogrsf_frmts/geojson/libjson -I/builddir/build/BUILD/gdal-2.0.0-fedora/ogr/ogrsf_frmts/geojson -c gdalserver.c -fPIC -DPIC -o .libs/gdalserver.o [...] gdalserver.c: In function 'CreateSocketAndBindAndListen': gdalserver.c:124:21: error: storage size of 'sHints' isn't known struct addrinfo sHints; ^ Difference between working and failing build root: sqlite-devel 3.8.10.2-3.fc23 > 3.8.11-1.fc24 freetype-devel 2.6.0-2.fc23 > 2.6.0-3.fc24 sqlite 3.8.10.2-3.fc23 > 3.8.11-1.fc24 glibc 2.21.90-19.fc24 > 2.21.90-20.fc24 glibc-common 2.21.90-19.fc24 > 2.21.90-20.fc24 cups-libs 1:2.0.3-4.fc23 > 1:2.0.3-5.fc24 freetype 2.6.0-2.fc23 > 2.6.0-3.fc24 glibc-devel 2.21.90-19.fc24 > 2.21.90-20.fc24 glibc-headers 2.21.90-19.fc24 > 2.21.90-20.fc24
Also failing in F23. For addrinfo to be defined a feature test macro such as _GNU_SOURCE or _POSIX_SOURCE is needed.
The bug is in gdalserver.c: #if defined(__STDC_VERSION__) #define _XOPEN_SOURCE #endif That defines the macro to an empty string. For <netdb.h> to declare addrinfo it must be set to 600 or greater. From <features.h>: _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if Single Unix conformance is wanted, to 600 for the sixth revision, to 700 for the seventh revision. So gdalserver.c should have: #if defined(__STDC_VERSION__) #define _XOPEN_SOURCE 600 #endif The failure to build may be caused by a recent glibc change to correct which feature test macro is needed for addrinfo: https://sourceware.org/git/?p=glibc.git;a=commit;f=resolv/netdb.h;h=8737be806407be51f046b358d8824c4c968912de
Fixed in gdal-2.0.0-2.fc24 and gdal-2.0.0-2.fc23. The patch should be reported upstream.
Solved in r29667 https://trac.osgeo.org/gdal/ticket/6073 Thank you, Jonathan!