Bug 1249703 - gdal-2.0.0-1.fc24 FTBFS: gdalserver.c:124:21: error: storage size of 'sHints' isn't known
Summary: gdal-2.0.0-1.fc24 FTBFS: gdalserver.c:124:21: error: storage size of 'sHints'...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdal
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Devrim Gündüz
QA Contact: Fedora Extras Quality Assurance
URL: http://koji.fedoraproject.org/koji/ta...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-03 15:25 UTC by Petr Pisar
Modified: 2015-09-21 21:10 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-21 21:10:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2015-08-03 15:25:19 UTC
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

Comment 1 Jonathan Wakely 2015-08-08 15:45:49 UTC
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 16:01:12 UTC
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

Comment 3 Jonathan Wakely 2015-08-09 11:20:04 UTC
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 21:10:12 UTC
Solved in r29667

https://trac.osgeo.org/gdal/ticket/6073

Thank you, Jonathan!


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