Bug 1249703 - gdal-2.0.0-1.fc24 FTBFS: gdalserver.c:124:21: error: storage size of 'sHints' isn't known
gdal-2.0.0-1.fc24 FTBFS: gdalserver.c:124:21: error: storage size of 'sHints'...
Product: Fedora
Classification: Fedora
Component: gdal (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Devrim Gündüz
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-08-03 11:25 EDT by Petr Pisar
Modified: 2015-09-21 17:10 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-09-21 17:10:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Pisar 2015-08-03 11:25:19 EDT
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.11-1.fc24
	freetype-devel 	2.6.0-2.fc23 	> 	2.6.0-3.fc24
	sqlite 	> 	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
Comment 1 Jonathan Wakely 2015-08-08 11:45:49 EDT
Also failing in F23.

For addrinfo to be defined a feature test macro such as _GNU_SOURCE or _POSIX_SOURCE is needed.
Comment 2 Jonathan Wakely 2015-08-08 12:01:12 EDT
The bug is in gdalserver.c:

#if defined(__STDC_VERSION__)

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

The failure to build may be caused by a recent glibc change to correct which feature test macro is needed for addrinfo:

Comment 3 Jonathan Wakely 2015-08-09 07:20:04 EDT
Fixed in gdal-2.0.0-2.fc24 and gdal-2.0.0-2.fc23.

The patch should be reported upstream.
Comment 4 Volker Fröhlich 2015-09-21 17:10:12 EDT
Solved in r29667


Thank you, Jonathan!

Note You need to log in before you can comment on or make changes to this bug.