Created attachment 72525 [details] full build log Starting with cairo-1.12 (cairo-1.10 builds fine) the build fails on Gentoo with ld.gold selected as the default linker: CCLD cairo-sphinx /var/tmp/portage/x11-libs/cairo-1.12.8/work/cairo-1.12.8/src/.libs/libcairo.so: error: undefined reference to '__gxx_personality_v0' /var/tmp/portage/x11-libs/cairo-1.12.8/work/cairo-1.12.8/src/.libs/libcairo.so: error: undefined reference to '__cxa_begin_catch' /var/tmp/portage/x11-libs/cairo-1.12.8/work/cairo-1.12.8/src/.libs/libcairo.so: error: undefined reference to '__cxa_end_catch' /var/tmp/portage/x11-libs/cairo-1.12.8/work/cairo-1.12.8/src/.libs/libcairo.so: error: undefined reference to '__cxa_rethrow' /var/tmp/portage/x11-libs/cairo-1.12.8/work/cairo-1.12.8/src/.libs/libcairo.so: error: undefined reference to 'std::terminate()' /var/tmp/portage/x11-libs/cairo-1.12.8/work/cairo-1.12.8/src/.libs/libcairo.so: error: undefined reference to 'typeinfo for std::bad_alloc' /var/tmp/portage/x11-libs/cairo-1.12.8/temp/cc5T4JaP.ltrans5.ltrans.o:cc5T4JaP.ltrans5.o:function _cairo_boilerplate_qt_create_surface(char const*, _cairo_content, double, double, double, double, cairo_boilerplate_mode_t, void**) [clone .3247]: error: undefined reference to 'operator new(unsigned long)' /var/tmp/portage/x11-libs/cairo-1.12.8/temp/cc5T4JaP.ltrans5.ltrans.o:cc5T4JaP.ltrans5.o:function _cairo_boilerplate_qt_create_surface(char const*, _cairo_content, double, double, double, double, cairo_boilerplate_mode_t, void**) [clone .3247]: error: undefined reference to 'operator delete(void*)' collect2: ld returned 1 exit status
Are you sure that this really, really, *really* is a regression? I can't see anything that changed in cairo in this regard. Also, this problem is specific to the qt backend which is the only(?) C++ code in cairo. This backend is so experimental that it is not even listed as an experimental backend.
Created attachment 72584 [details] cairo-1.10 build log Indeed the build error goes away after disabling the qt backend. But cairo-1.10 built fine with gold and qt enabled (see attached log).
We also have a skia backend which is C++, but that's probably even more experimental than the qt backend. :-) Looks like the beos also needs C++, fwiw. Fwiw, `./configure --enable-qt` appears to result in a successful build on Ubuntu 12.04. But on Ubuntu 14.04 (gcc 4.8) using libqt4-dev, I see this error: 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 make[4]: *** [cairo-test-suite] Error 1 This is just saying that the library wasn't included in the linker command line. So it needs -lstdc++ added someplace, at a minimum. Almost certainly the cause of the originally reported problem. I've drummed up a patch that adds -lstdc++ and -lQtGui when --enable-qt is given, which seems to result in a successful build on 14.04 for me.
commit b384e86c6a2b15d26908ede73cb29098afe5e809 Author: Bryce Harrington <b.harrington@samsung.com> Date: Tue Jul 8 15:53:41 2014 -0700 configure.ac: Fix broken build for Qt backend When --enable-qt is specified, the build will break due to missing libstdc++: 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@@CX$ //usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status When using g++ to compile and link code, g++ automatically links libstdc++. However, in cairo we're using g++ only to compile, so need to explicitly link against libstdc++ for backends that need iostream, stl, or other stdc++ features. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59038 Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Uli Schlachter <psychon@znc.in>
This commit appears to have not yet reached cairo git yet. Also, I think -lm is also needed besides -lstdc++ for linking with ld.gold, but I will check once the fix is available.
Sorry, pushed
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.