Bug 1284714 - GDAL is build without GEOS support
Summary: GDAL is build without GEOS support
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdal
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Devrim Gündüz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1304277
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-24 00:24 UTC by Tom Hughes
Modified: 2016-02-15 02:52 UTC (History)
10 users (show)

Fixed In Version: gdal-2.0.2-1.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-15 02:52:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tom Hughes 2015-11-24 00:24:06 UTC
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

Comment 1 Thomas Kreuzer 2016-02-02 12:36:14 UTC
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?

Comment 3 Jozef Mlich 2016-02-02 15:00:12 UTC
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.

Comment 4 Tom Hughes 2016-02-02 15:16:39 UTC
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.

Comment 5 Jozef Mlich 2016-02-02 16:24:33 UTC
Sorry, I had incorrect build root, the "Buildrequires: geos" doesn't help.

Comment 6 Jozef Mlich 2016-02-02 20:55:51 UTC
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.

Comment 7 Tom Hughes 2016-02-02 21:04:29 UTC
The bug is almost certainly that geos should be building that code -fPIC though.

Comment 8 Orion Poplawski 2016-02-02 21:09:49 UTC
I think it's saying that the conftest gcc line needs to have -fPIC.  Workaround probably would be to just add -fPIC to CFLAGS.

Comment 9 Tom Hughes 2016-02-02 21:11:44 UTC
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.

Comment 10 Tom Hughes 2016-02-03 09:04:02 UTC
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.

Comment 11 Tom Hughes 2016-02-03 09:13:51 UTC
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.

Comment 12 Tom Hughes 2016-02-03 09:26:08 UTC
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.

Comment 14 Volker Fröhlich 2016-02-04 23:35:31 UTC
Thank you both for your help; fixed in Rawhide and F23 2.0.2 builds!

Comment 15 Fedora Update System 2016-02-04 23:41:57 UTC
gdal-2.0.2-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7cb5cee691

Comment 16 Fedora Update System 2016-02-05 23:51:14 UTC
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

Comment 17 Fedora Update System 2016-02-15 02:52:39 UTC
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.


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