Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 611136 - app-text/tesseract-3.04.01: libtesseract.so: undefined reference to 'TIFFFdOpen' and others (libtiff underlinking)
Summary: app-text/tesseract-3.04.01: libtesseract.so: undefined reference to 'TIFFFdOp...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: underlinking
  Show dependency tree
 
Reported: 2017-02-27 20:47 UTC by Marek Szuba
Modified: 2017-03-14 00:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Szuba archtester gentoo-dev 2017-02-27 20:47:07 UTC
Using gold as the system linker, app-text/tesseract-3.04.01 (which is stable on amd64) fails to build because its API library references media-libs/tiff symbols yet build scripts do not link against libtiff:

/bin/sh ../libtool  --tag=CXX   --mode=link x86_64-pc-linux-gnu-g++  -O2 -pipe -march=native -std=c++11 -lOpenCL -Wl,-O1 -Wl,--as-needed -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -O2 -pipe -march=native -o tesseract tesseract-tesseractmain.o libtesseract.la   -lrt -llept -lpthread 
libtool: link: x86_64-pc-linux-gnu-g++ -O2 -pipe -march=native -std=c++11 -Wl,-O1 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -O2 -pipe -march=native -o .libs/tesseract tesseract-tesseractmain.o  -lOpenCL -Wl,--as-needed ./.libs/libtesseract.so -lrt -llept -lpthread
./.libs/libtesseract.so: error: undefined reference to 'TIFFFdOpen'
./.libs/libtesseract.so: error: undefined reference to 'TIFFGetFieldDefaulted'
./.libs/libtesseract.so: error: undefined reference to 'TIFFGetField'
./.libs/libtesseract.so: error: undefined reference to 'TIFFScanlineSize'
./.libs/libtesseract.so: error: undefined reference to 'TIFFReadRGBAImageOriented'
./.libs/libtesseract.so: error: undefined reference to 'TIFFReadScanline'
./.libs/libtesseract.so: error: undefined reference to 'TIFFClientOpen'
./.libs/libtesseract.so: error: undefined reference to 'TIFFReadDirectory'
./.libs/libtesseract.so: error: undefined reference to 'TIFFCleanup'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:591: tesseract] Error 1
make[2]: Leaving directory '/var/tmp/portage/app-text/tesseract-3.04.01/work/tesseract-3.04.01/api'
make[1]: *** [Makefile:480: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-text/tesseract-3.04.01/work/tesseract-3.04.01'
make: *** [Makefile:389: all] Error 2

Manually adding -ltiff to the list of libraries in api/Makefile allows tesseract to build successfully, then again it is not a proper solution because e.g. the pkg-config file it installs still doesn't list that library.
Comment 1 Bernard Cafarelli gentoo-dev 2017-02-28 20:51:28 UTC
Thanks for taking this upstream too! 3.05 looks close to release also: https://github.com/tesseract-ocr/tesseract/issues/715

I will see what to do between backport, bump, or both
Comment 2 Bernard Cafarelli gentoo-dev 2017-03-14 00:12:49 UTC
I added 3.05.00 in tree with backported patch, let's see how this version behaves (minimal tests OK)