[cairo] [PATCH 4/4] configure.ac: Fix broken build for Qt backend
Bryce W. Harrington
b.harrington at samsung.com
Wed Jul 9 20:22:53 PDT 2014
On Wed, Jul 09, 2014 at 11:29:20AM +0200, Uli Schlachter wrote:
> On 09.07.2014 03:13, Bryce W. Harrington wrote:
> > When --enable-qt is specified, the build will break on newer versions of
> > gcc with linker errors like:
> >
> > CCLD cairo-test-suite
> > /usr/bin/ld: ../boilerplate/.libs/libcairoboilerplate.a(libcairoboilerplate_cxx_la-cairo-boilerplate-qt.o): undefined reference to symbol '__gxx_personality_v0@@CXXABI_1.3'
> > //usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
> > collect2: error: ld returned 1 exit status
> >
> > This is because we're not linking against libstdc++ and libQtGui as
> > required.
> >
> > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59038
> > Signed-off-by: Bryce Harrington <b.harrington at samsung.com>
> > ---
> > configure.ac | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/configure.ac b/configure.ac
> > index fca6fc5..6af5144 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -191,6 +191,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(qt, Qt, no, [
> > [qt_REQUIRES=""
> > use_qt="no (requires Qt4 development libraries)"
> > ])
> > + qt_NONPKGCONFIG_LIBS="-lQtGui -lstdc++"
> > ])
> >
> > dnl ===========================================================================
> >
>
> I am not totally sure, but doesn't this just overwrite the results from
> pkg-config? I was wondering why you also need to add -lQtGui and I guess this is
> why.
I don't think it overwrites the results. Else I'd have had to include
-lQtCore as well. The *_NONPKGCONFIG_LIBS variables appear to be for
accumulating libraries that pkgconfig *didn't* detect. This is used by
most of the other backends, so I think my usage here is correct.
However, in doublechecking it looks like -lQtGui can indeed by omitted.
> Also, the correct fix would be to link libcairo.so with a c++ linker so that it
> can automatically add the needed C++ libraries. However, I have no idea how to
> do that. :/
Presumably we'd just redefine LD when BUILD_CXX is turned on.
build/libtool.m4 has a bunch of logic to figure out which C++ compiler
to use, there's probably some switches to control ld too.
But who knows what can of worms redefining the linker would bring us.
And maybe it's better to just link in libstdc++ only when needed, so
backends that don't actually use iostream or stl can avoid bringing in
its bloat. (Although, it looks like this only applies for the beos
backend, and who knows when that was last compiled...?)
Bryce
More information about the cairo
mailing list