Description of problem: GDAL is built without GEOS support in F23 and Rawhide although this appears to be accidental as gdal-devel is being required and --with-geos is passed to configure. It is working in F22 but not in F23 or Rawhide, as configure fails to find GEOSversion on those machines, reporting: checking for geos-config... /usr/bin/geos-config checking for GEOS version >= 3.1.0... yes checking for GEOSversion in -lgeos_c... no The actual failure can be found in config.log: configure:27222: checking for GEOSversion in -lgeos_c configure:27248: gcc -o conftest -I/usr/include -I/usr/include/libgeotiff -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld conftest.c -lgeos_c -L/usr/lib64 -lgeos_c >&5 /usr/bin/ld: /tmp/ccE6hHJB.o: relocation R_X86_64_PC32 against undefined symbol `GEOSversion' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status Which I suspect is related to the compiler hardening changes? It's possible the actual problem is the way libgeos_c was compiled though rather than being a GDAL problem? Version-Release number of selected component (if applicable): gdal-2.0.1-2.fc23.x86_64
This is very much a show stopper, e.g. no spatial intersection are possible with GDAL without GEOS. Is there any update on the current situation?
The build logs in koji says that problem is still there. http://koji.fedoraproject.org/koji/packageinfo?packageID=1826 https://kojipkgs.fedoraproject.org//packages/gdal/2.0.1/2.fc23/data/logs/x86_64/build.log https://kojipkgs.fedoraproject.org//packages/gdal/2.0.1/5.fc24/data/logs/x86_64/build.log
It could be solved by adding "BuildRequires: geos" into gdal.spec. There is already "BuildRequires: geos-devel". In my opinion, this should be enough. Rpmbuild should install geos as dependency of geos-devel. I think, that this is problem in packaging of geos.
That still sounds like a bug in geos though - geos-devel should be requiring geos, and indeed it does via requiring libgeos_c.so.1()(64bit) which is provided by geos. In addition https://kojipkgs.fedoraproject.org//packages/gdal/2.0.1/5.fc24/data/logs/x86_64/root.log clearly shows that geos was installed when gdal was build.
Sorry, I had incorrect build root, the "Buildrequires: geos" doesn't help.
The detection of geos_c is defined in ./m4/geos.m4 by following code AC_CHECK_LIB([geos_c], [GEOSversion], [HAVE_GEOS="yes"], [HAVE_GEOS="no"], [] ) In config.log is following message: gcc -o conftest -I/usr/include -I/usr/include/libgeotiff -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld conftest.c -lgeos_c -L/usr/lib64 -lgeos_c /usr/bin/ld: /tmp/ccIUxs6f.o: relocation R_X86_64_PC32 against undefined symbol `GEOSversion' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status I will try to prepare patch for that.
The bug is almost certainly that geos should be building that code -fPIC though.
I think it's saying that the conftest gcc line needs to have -fPIC. Workaround probably would be to just add -fPIC to CFLAGS.
The problem is that GEOSversion in libgeos_c is not PIC or pie so can't be linked into a pie executable, which the text program now is because of the hardening flags.
There's something odd going on here because the debuginfo appears clear, that geos_c is built PIC yet the linker is complaining. I've opened https://bugzilla.redhat.com/show_bug.cgi?id=1304277 against binutils to see if we can figure out what is going on.
So the real problem is that m4/geos.m4 ignores the CFLAGS that the spec file provided when compiling that test program - it discards CFLAGS and replaces them with the output of geos_config --cflags rather than just appending that.
Adding this line: sed -i 's|CFLAGS=\"${GEOS_CFLAGS}\"|CFLAGS=\"${CFLAGS} ${GEOS_CFLAGS}\"|g' configure to the spec patches up configure to make it find geos.
Thanks, I have applied that patch: https://jmlich.fedorapeople.org/gdal-2.0.2-2.fc24.src.rpm https://copr.fedorainfracloud.org/coprs/jmlich/playground/build/157644/ https://copr-be.cloud.fedoraproject.org/results/jmlich/playground/fedora-23-x86_64/00157644-gdal/build.log.gz now it says: checking for GEOSversion in -lgeos_c... yes
Thank you both for your help; fixed in Rawhide and F23 2.0.2 builds!
gdal-2.0.2-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7cb5cee691
gdal-2.0.2-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-7cb5cee691
gdal-2.0.2-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.