Bug 26351 - Build failure in upgrade to poppler-0.13.0
Summary: Build failure in upgrade to poppler-0.13.0
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium critical
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-31 10:16 UTC by David Ronis
Modified: 2010-02-10 15:09 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Proposed patch (674 bytes, patch)
2010-02-10 08:34 UTC, Jürg Billeter
Details | Splinter Review

Description David Ronis 2010-01-31 10:16:38 UTC
I just tried upgrading from 0.12.2 to 0.13.3 on a slackware 12.2 box in a garnome 2.29.6 build environment.  The build dies with:

  CXXLD  pdffonts
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_destroy_compress(jpeg_compress_struct*)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_start_compress(jpeg_compress_struct*, int)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_stdio_dest(jpeg_compress_struct*, _IO_FILE*)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_finish_compress(jpeg_compress_struct*)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_write_scanlines(jpeg_compress_struct*, unsigned char**, unsigned int)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_set_defaults(jpeg_compress_struct*)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_CreateCompress(jpeg_compress_struct*, int, unsigned int)'
collect2: ld returned 1 exit status

Configure correctly figures out that I have a plain libjpeg and the library seems to have the missing symbols defined.  My bet is that that -ljpeg was omitted form the ld command.
Comment 1 Albert Astals Cid 2010-01-31 10:32:14 UTC
why because instead of betting you run make V=1 and see the reality?
Comment 2 Jürg Billeter 2010-02-03 08:11:17 UTC
Same problem here:

make[2]: Entering directory `/home/juerg/.local/src/poppler-0.13.0/utils'
/bin/sh ../libtool  --tag=CXX   --mode=link g++  -Wall -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -ansi -g -O2   -o pdffonts pdffonts.o parseargs.o ../poppler/libpoppler.la  -lfontconfig   -lz 
libtool: link: g++ -Wall -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -ansi -g -O2 -o .libs/pdffonts pdffonts.o parseargs.o  ../poppler/.libs/libpoppler.so -lfontconfig -lz -pthread
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_destroy_compress(jpeg_compress_struct*)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_start_compress(jpeg_compress_struct*, int)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_CreateCompress(jpeg_compress_struct*, int, unsigned long)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_stdio_dest(jpeg_compress_struct*, _IO_FILE*)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_finish_compress(jpeg_compress_struct*)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_write_scanlines(jpeg_compress_struct*, unsigned char**, unsigned int)'
../poppler/.libs/libpoppler.so: undefined reference to `jpeg_set_defaults(jpeg_compress_struct*)'
collect2: ld returned 1 exit status
make[2]: *** [pdffonts] Error 1
make[2]: Leaving directory `/home/juerg/.local/src/poppler-0.13.0/utils'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/juerg/.local/src/poppler-0.13.0'
make: *** [all] Error 2
Comment 3 Albert Astals Cid 2010-02-03 11:08:33 UTC
Hmmm, this is not enough, i want to see the link line that links libpoppler, can you please search for it? If you don't know what i'm talking about just get all the make output and attach it to a file to the bug.

I'm also interested in the configure options you are passing (if any)
Comment 4 Jürg Billeter 2010-02-03 11:14:13 UTC
./configure --prefix=/usr --libexecdir=/usr/lib --localstatedir=/var/lib --sysconfdir=/etc --enable-zlib --disable-static --enable-xpdf-headers --enable-gdk --disable-splash-output --disable-poppler-qt4 --disable-poppler-qt

...

/bin/sh ../libtool  --tag=CXX   --mode=link g++  -Wall -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -ansi -g -O2 -pthread -version-info 6:0:0   -o libpoppler.la -rpath /usr/lib  DCTStream.lo FlateStream.lo JPXStream.lo ABWOutputDev.lo Annot.lo Array.lo BuiltinFont.lo BuiltinFontTables.lo Catalog.lo CharCodeToUnicode.lo CMap.lo DateInfo.lo Decrypt.lo Dict.lo Error.lo FileSpec.lo FontEncodingTables.lo Form.lo FontInfo.lo Function.lo Gfx.lo GfxFont.lo GfxState.lo GlobalParams.lo JArithmeticDecoder.lo JBIG2Stream.lo Lexer.lo Link.lo Movie.lo NameToCharCode.lo Object.lo OptionalContent.lo Outline.lo OutputDev.lo Page.lo PageTransition.lo Parser.lo PDFDoc.lo PDFDocEncoding.lo PopplerCache.lo ProfileData.lo PreScanOutputDev.lo PSTokenizer.lo Stream.lo UnicodeMap.lo UnicodeTypeTable.lo XRef.lo PSOutputDev.lo TextOutputDev.lo PageLabelInfo.lo SecurityHandler.lo Sound.lo XpdfPluginAPI.lo ../goo/libgoo.la ../fofi/libfofi.la -llcms    -ljpeg -lpng -lz  -lxml2   -lfreetype   -lfontconfig     -lz 
libtool: link: g++ -shared -nostdlib /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/crtbeginS.o  .libs/DCTStream.o .libs/FlateStream.o .libs/JPXStream.o .libs/ABWOutputDev.o .libs/Annot.o .libs/Array.o .libs/BuiltinFont.o .libs/BuiltinFontTables.o .libs/Catalog.o .libs/CharCodeToUnicode.o .libs/CMap.o .libs/DateInfo.o .libs/Decrypt.o .libs/Dict.o .libs/Error.o .libs/FileSpec.o .libs/FontEncodingTables.o .libs/Form.o .libs/FontInfo.o .libs/Function.o .libs/Gfx.o .libs/GfxFont.o .libs/GfxState.o .libs/GlobalParams.o .libs/JArithmeticDecoder.o .libs/JBIG2Stream.o .libs/Lexer.o .libs/Link.o .libs/Movie.o .libs/NameToCharCode.o .libs/Object.o .libs/OptionalContent.o .libs/Outline.o .libs/OutputDev.o .libs/Page.o .libs/PageTransition.o .libs/Parser.o .libs/PDFDoc.o .libs/PDFDocEncoding.o .libs/PopplerCache.o .libs/ProfileData.o .libs/PreScanOutputDev.o .libs/PSTokenizer.o .libs/Stream.o .libs/UnicodeMap.o .libs/UnicodeTypeTable.o .libs/XRef.o .libs/PSOutputDev.o .libs/TextOutputDev.o .libs/PageLabelInfo.o .libs/SecurityHandler.o .libs/Sound.o .libs/XpdfPluginAPI.o  -Wl,--whole-archive ../goo/.libs/libgoo.a ../fofi/.libs/libfofi.a -Wl,--no-whole-archive  -llcms -ljpeg -lpng -lxml2 -lfreetype -lfontconfig -lz -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/crtendS.o /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../../lib/crtn.o  -pthread   -pthread -Wl,-soname -Wl,libpoppler.so.6 -o .libs/libpoppler.so.6.0.0
libtool: link: (cd ".libs" && rm -f "libpoppler.so.6" && ln -s "libpoppler.so.6.0.0" "libpoppler.so.6")
libtool: link: (cd ".libs" && rm -f "libpoppler.so" && ln -s "libpoppler.so.6.0.0" "libpoppler.so")
libtool: link: ( cd ".libs" && rm -f "libpoppler.la" && ln -s "../libpoppler.la" "libpoppler.la" )
Comment 5 Albert Astals Cid 2010-02-06 12:13:58 UTC
There is something weird going on, as you can see -ljpeg is linked in when compiling libpoppler so it should "be there" when compiling pdffonts too, do you by any chance have libjpeg.so in a "non standard path"?
Comment 6 David Ronis 2010-02-06 15:35:58 UTC
Here it's in /usr/lib

Comment 7 Jürg Billeter 2010-02-08 06:05:18 UTC
It's in /usr/lib here as well. I don't see what causes the error, not even adding -ljpeg to the pdffonts link line changes anything.

For reference:

$ ldd poppler/.libs/libpoppler.so | grep jpeg
	libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007f3f68d0f000)

$ readelf -d poppler/.libs/libpoppler.so | grep jpeg
 0x0000000000000001 (NEEDED)             Shared library: [libjpeg.so.62]
Comment 8 Albert Astals Cid 2010-02-09 15:13:38 UTC
are you sure you don't have two libjpegs or libpopplers around that mess up? I mean it should work, adding -ljpeg to pdffonts should not be needed, but if adding it doesn't make it work it seems to me something is wrong in your system.
Comment 9 Jürg Billeter 2010-02-09 15:19:14 UTC
The error even happens in an isolated build environment that gets recreated all the time. Definitely only one version of libjpeg and no other version of poppler. Poppler 0.12.3 and many packages depending on libjpeg build perfectly fine there. If you don't have an idea what might cause the issue, I can try to find some time to bisect it tomorrow.
Comment 10 Albert Astals Cid 2010-02-09 16:05:59 UTC
please
Comment 11 Jürg Billeter 2010-02-09 23:34:37 UTC
d67511c92022121066f43003f01b955962ddcd33 is the first bad commit
commit d67511c92022121066f43003f01b955962ddcd33
Author: Stefan Thomas <thomas@eload24.com>
Date:   Fri Oct 9 00:09:23 2009 +0200

    Add -jpeg to pdftoppm
Comment 12 Jürg Billeter 2010-02-10 08:34:29 UTC
Created attachment 33218 [details] [review]
Proposed patch

jpeglib.h does not use extern "C", which breaks inclusion from C++ code. This patch wraps #include <jpeglib.h> in extern "C" and fixes the build for me.
Comment 13 Jürg Billeter 2010-02-10 08:45:31 UTC
I've just noticed that this appears to be fixed in libjpeg 8, so it's probably only an issue with the old libjpeg 6b I was using.
Comment 14 Albert Astals Cid 2010-02-10 15:09:26 UTC
Pushed, thanks for the investigation.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.