Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 511448

Summary: x11-libs/cairo-1.12.16-r3 - .../work/cairo-1.12.16-x86: ld: error: cannot find -lpoppler-glib -lrsvg-2 -lspectre
Product: Gentoo Linux Reporter: Homer <gentoo>
Component: [OLD] LibraryAssignee: Alexandre Rostovtsev (RETIRED) <tetromino>
Status: RESOLVED DUPLICATE    
Severity: normal CC: Adrian.Bassett, gentoo, multilib+disabled, x11, yngwin
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=511614
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: x11-libs:cairo-1.12.16-r3:20140524-073327.log.gz
x11-libs:cairo-1.12.16-r3:20140527-070402.log.gz
x11-libs:cairo-1.12.16-r3:20140527-070402-config.log
emerge-info.txt
x11-libs:cairo-1.12.16-r3:20140527-212241-config-debug.log

Description Homer 2014-05-25 13:40:33 UTC
Cairo is multilib, but unfortunately its dependencies aren't, which results in the following errors:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping inc
ompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../libpoppler-glib.so while searching for pop
pler-glib
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping inc
ompatible /usr/lib/libpoppler-glib.so while searching for poppler-glib
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: error: cannot find -l
poppler-glib
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping inc
ompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../librsvg-2.so while searching for rsvg-2
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping inc
ompatible /usr/lib/librsvg-2.so while searching for rsvg-2
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: error: cannot find -l
rsvg-2
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping inc
ompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../libspectre.so while searching for spectre
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: warning: skipping incompatible /usr/lib/libspectre.so while searching for spectre
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: error: cannot find -lspectre
...
any2ppm-any2ppm.o:any2ppm.c:function ps_convert: error: undefined reference to 'spectre_document_free'
collect2: error: ld returned 1 exit status
make[4]: *** [any2ppm] Error 1

Closer examination reveals its trying to link 64-bit dependencies to it's 32-bit multilib libraries, because there are no 32-bit versions of poppler, librsvg and libspectre available. I assume the solution is to make those three packages multilib.

Reproducible: Always

Steps to Reproduce:
1. emerge =x11-libs/cairo-1.12.16-r3
Actual Results:  
Build fails at linker.

Expected Results:  
Linked dependencies should be multilib, and the build should succeed. 

This is quite a nasty one for me, as I'm unable to update until this is resolved.
Comment 1 Homer 2014-05-25 13:42:34 UTC
Created attachment 377620 [details]
x11-libs:cairo-1.12.16-r3:20140524-073327.log.gz
Comment 2 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-05-26 12:30:46 UTC
Please also attach config.log
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-26 14:09:27 UTC
Please attach or paste your 'emerge --info'.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-26 14:27:04 UTC
Looking at the configure.ac, we are missing the following optional deps:

1. for postscript testing: app-text/ghostscript-gpl (for 'gs' binary), app-text/libspectre,

2. for PDF testing: app-text/poppler (poppler-glib),

3. for SVG testing: gnome-base/librsvg.

It seems that currently we're assuming those tests are optional and they are executed if user has appropriate deps installed. However, we may consider adding those deps to 'test?' to enable more complete testing.

As for this particular issue, I suspect the user has custom PKG_CONFIG_PATH or another interference that causes the 32-bit version tests to find 64-bit pkg-config files. As a result, they would assume dependency libraries are installed and enable relevant tests.
Comment 5 Homer 2014-05-27 07:14:37 UTC
Created attachment 377688 [details]
x11-libs:cairo-1.12.16-r3:20140527-070402.log.gz
Comment 6 Homer 2014-05-27 07:15:26 UTC
Created attachment 377690 [details]
x11-libs:cairo-1.12.16-r3:20140527-070402-config.log
Comment 7 Homer 2014-05-27 07:15:59 UTC
Created attachment 377692 [details]
emerge-info.txt
Comment 8 Homer 2014-05-27 07:39:14 UTC
(In reply to Michał Górny from comment #4)
> I suspect the user has custom PKG_CONFIG_PATH

Not as far as I'm aware.

> or another interference that causes the 32-bit version tests to find 64-bit
> pkg-config files.

Again, none that I've consciously created.

I have been using LTO, Graphite and Gold, but even disabling all three of those features for a vanilla build produces the same error. I've even tried rebuilding the dependencies with vanilla flags to see if that resolves the problem, to no effect. The only thing that currently enables me to build cairo is appending the "-m64" flag via package.env (disabled for the above test build), which unfortunately gives me 64-bit binaries in /usr/lib32, but at least enables me to move forward and update my system.

This is the only package affected by this problem, as far as I can tell.
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-27 13:44:53 UTC
Any chance you have been using crossdev w/ i686-pc-linux-gnu?
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-27 15:01:23 UTC
Also, it could be helpful if you could attach config.log of build with:

    PKG_CONFIG_DEBUG_SPEW=1 emerge -1v x11-libs/cairo
Comment 11 Homer 2014-05-27 21:18:13 UTC
(In reply to Michał Górny from comment #9)
> Any chance you have been using crossdev w/ i686-pc-linux-gnu?

I do have crossdev installed for distcc builds, but distcc is not enabled locally in the make.conf, only in remote clients, so I see no reason why that would have any effect on local builds, and again it has not affected any other package.
Comment 12 Homer 2014-05-27 21:28:12 UTC
Created attachment 377738 [details]
x11-libs:cairo-1.12.16-r3:20140527-212241-config-debug.log

Re: comment #10.
Comment 13 Homer 2014-05-27 21:33:00 UTC
cat //usr/lib/pkgconfig/poppler.pc  
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib64
includedir=${prefix}/include

Name: poppler
Description: PDF rendering library
Version: 0.24.5

Libs: -L${libdir} -lpoppler
Cflags: -I${includedir}/poppler

Is that the correct libdir?
Comment 14 Homer 2014-05-27 21:34:30 UTC
equery check app-text/poppler
* Checking app-text/poppler-0.24.5 ...
   219 out of 219 files passed
Comment 15 Alexandre Rostovtsev (RETIRED) gentoo-dev 2014-05-27 22:31:17 UTC
(In reply to Homer from comment #11)
> I do have crossdev installed for distcc builds, but distcc is not enabled
> locally in the make.conf, only in remote clients, so I see no reason why
> that would have any effect on local builds

Because crossdev installs its wrapped version of pkg-config into /usr/bin, messing up Gentoo's normal multilib handling.

Please check your /usr/bin/i686-pc-linux-gnu-pkg-config file. Is it a normal 32-bit executable (so "file /usr/bin/i686-pc-linux-gnu-pkg-config" should say something like "ELF 32-bit LSB executable, Intel 80386") or a wrapper script belonging to crossdev?

(And if you don't have i686-pc-linux-gnu-pkg-config - please re-emerge dev-util/pkgconfig with ABI_X86="32 64")
Comment 16 Homer 2014-05-28 02:13:42 UTC
(In reply to Alexandre Rostovtsev from comment #15)

> Because crossdev installs its wrapped version of pkg-config into /usr/bin,
> messing up Gentoo's normal multilib handling.

OK, but why would only this one package be affected, if this is the cause?

> Please check your /usr/bin/i686-pc-linux-gnu-pkg-config file. Is it a normal
> 32-bit executable (so "file /usr/bin/i686-pc-linux-gnu-pkg-config" should
> say something like "ELF 32-bit LSB executable, Intel 80386") or a wrapper
> script belonging to crossdev?

It's a crossdev wrapper.

> (And if you don't have i686-pc-linux-gnu-pkg-config - please re-emerge
> dev-util/pkgconfig with ABI_X86="32 64")

Will this prevent crossdev from working?
Comment 17 Homer 2014-05-28 02:57:53 UTC
OK, so I had to unmask dev-util/pkgconfig-0.28-r1 to get a version that supports the ABI_X86="32" flag (bug #494748). It complained about a file collison, but went ahead and replaced /usr/bin/i686-pc-linux-gnu-pkg-config anyway, which is now a 32-bit binary.

x11-libs/cairo-1.12.16-r3 now builds OK, even with LTO and Graphite (but not with the Gold linker - separate issue).

I haven't tested crossdev to see if it still works. Is there anything special I need to do now?

I assume Bug #500338 is the right place to continue? If so then please close.

Thanks.
Comment 18 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-28 06:55:10 UTC

*** This bug has been marked as a duplicate of bug 500338 ***