Summary: | sci-libs/gdal-2.4.1 - ld: /usr/lib/libgif.so: error adding symbols: file in wrong format | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Dhalsim <massimo.mattia.info> |
Component: | Current packages | Assignee: | Sci-geo Project <sci-geosciences> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jarausch, jsmolic, massimo.mattia.info, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 506276 | ||
Attachments: |
build log (first part)
build log (second part) |
Description
Dhalsim
2019-10-03 07:50:26 UTC
(In reply to Dhalsim from comment #0) > partial build log: Please attach the entire build log to this bug report. Created attachment 591674 [details]
build log (first part)
It seems that the issue is on link phase there when linking (see also it on the attachment):
[...]
/bin/sh /var/tmp/portage/sci-libs/gdal-2.4.1/work/gdal-2.4.1/libtool --mode=link --silent x86_64-pc-linux-gnu-g++ -Wl,-O1 -Wl,--as-needed -lcrypto -lpoppler -ljson-c -L/usr//lib -L/usr/lib [...]
-L specify wrong lib dir. This went wrong since I switched to the newest 'no SYMLINK_LIB' 7.1 amd64 profile.
Created attachment 591676 [details]
build log (second part)
anyway the title of the bug should not refer specifically to libgif.so. As reported in the partial build log ld tries to link all wrong 32bit libraries specified trough -l<commonlibname> parameter. (for example json-c, exapt ans so on) I've tryed another AMD64 gentoo system and I have same issue. Same error emerging gdal 2.4.1 on my gentoo machine:
"/usr/lib/libgif.so: error adding symbols: file in wrong format"
It seems like gdal custom libtool script tries to link a 32 bit lib.
I did the following steps to get past this:
# emerge gdal
which will fail at above error then go to temp working dir:
# cd /var/tmp/portage/sci-libs/gdal-2.4.1/work/gdal-2.4.1
then edit file config.status changing the line that starts with
S["LIBS"]="-lcrypto ...
and contains references to wrong "usr//lib" (twice)
change them to "usr/lib64" (you can keep only one instance)
in my case diff look like this:
1161c1161
< S["LIBS"]="-lcrypto -ljson-c -L/usr//lib -lexpat -lopenjp2 -lgif -ljpeg -lgeotiff -ltiff -lpng -lz -L/usr/ -L/usr//lib -lm -lrt -ldl -lpcre"
---
> S["LIBS"]="-lcrypto -ljson-c -lexpat -lopenjp2 -lgif -ljpeg -lgeotiff -ltiff -lpng -lz -L/usr/ -L/usr/lib64 -lm -lrt -ldl -lpcre"
after this resume with ebuild (because emerge will undo changes):
# ebuild /usr/portage/sci-libs/gdal/gdal-2.4.1.ebuild compile
# ebuild /usr/portage/sci-libs/gdal/gdal-2.4.1.ebuild install
# ebuild /usr/portage/sci-libs/gdal/gdal-2.4.1.ebuild qmerge
if you install a different version than 2.4.1 of gdal with same error then change all "2.4.1" from above to you version.
This is probably due to [1], [2] and --with-libz="${EPREFIX}/usr/" --with-libjson-c="${EPREFIX}/usr/" in ebuild. [1] https://github.com/OSGeo/gdal/blob/aa38907e1937da576cafaf32d013942b437161f5/gdal/configure.ac#L1130 [2] https://github.com/OSGeo/gdal/blob/aa38907e1937da576cafaf32d013942b437161f5/gdal/configure.ac#L4791 *** Bug 701892 has been marked as a duplicate of this bug. *** Is it still a problem with 3.0.4-r1? @Andreas,Hi, confirmed also with sci-libs/gdal-3.0.4-r1. Still using cubus' edit and recompile workaround to merge. Reagrds. (In reply to Andreas Sturmlechner from comment #9) > Is it still a problem with 3.0.4-r1? No, thanks for reminding me, Helmut Fixed in later versions (In reply to Dhalsim from comment #10) > @Andreas,Hi, confirmed also with sci-libs/gdal-3.0.4-r1. > > Still using cubus' edit and recompile workaround to merge. > > Reagrds. Hmm, looks like it's not after all. Can you please test 3.2.1-r1? The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2df5bcead58163828cde20535e4b4f4204f4ecf commit a2df5bcead58163828cde20535e4b4f4204f4ecf Author: Sam James <sam@gentoo.org> AuthorDate: 2021-03-09 20:38:45 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-03-09 20:43:26 +0000 sci-libs/gdal: respect libdir To be upstreamed. Unfortunately, we can't do *everything* required in Gentoo in the patch, as there's a --with-local argument which I'd prefer to get rid of, but is a bit too invasive of a change for me to want to push upstream for now. So, we settle on a single sed in the ebuild, which is an improvement! Closes: https://bugs.gentoo.org/696106 Signed-off-by: Sam James <sam@gentoo.org> sci-libs/gdal/files/gdal-3.2.1-libdir.patch | 407 ++++++++++++++++++++++++++++ sci-libs/gdal/gdal-3.2.1-r1.ebuild | 11 +- 2 files changed, 416 insertions(+), 2 deletions(-) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d72b95c42efb6fa261ebe1849f298153c5dfc8a1 commit d72b95c42efb6fa261ebe1849f298153c5dfc8a1 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-03-09 22:06:24 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-03-09 22:08:09 +0000 sci-libs/gdal: add link to upstream PR Bug: https://bugs.gentoo.org/696106 Signed-off-by: Sam James <sam@gentoo.org> sci-libs/gdal/files/gdal-3.2.1-libdir.patch | 2 ++ 1 file changed, 2 insertions(+) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=871d75f47010b9efc658ea04690c18a837c67e1b commit 871d75f47010b9efc658ea04690c18a837c67e1b Author: Sam James <sam@gentoo.org> AuthorDate: 2021-03-09 22:09:59 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-03-09 22:09:59 +0000 sci-libs/gdal: update libdir patch slightly * Removed more obsolete libproj logic/checks * Fix json-c too Bug: https://bugs.gentoo.org/696106 Signed-off-by: Sam James <sam@gentoo.org> sci-libs/gdal/files/gdal-3.2.1-libdir.patch | 166 ++++++++++++++++------------ 1 file changed, 95 insertions(+), 71 deletions(-) |