http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375
--- Comment #28 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-10 01:29:19 UTC --- With fixes for PR47234 and PR47233 I can build -fprofile-generate libxul. Didn't tried yet if the porfile apply, since build later dies at: /abuild/jh/trunk-install/bin/g++ -fpermissive -O3 -flto=24 -fuse-linker-plugin -fprofile-generate -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -fno-strict-aliasing -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -g -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-unix-print-2.0 -fPIC -shared -Wl,-z,defs -Wl,-h,libmozgnome.so -o libmozgnome.so nsGnomeModule.o nsAlertsService.o nsAlertsIconListener.o -lpthread -Wl,-rpath-link,/abuild/jh/build-mozilla-new8-prof/dist/bin -Wl,-rpath-link,/usr/local/lib /abuild/jh/build-mozilla-new8-prof/dist/lib/libxpcomglue_s.a -L/abuild/jh/build-mozilla-new8-prof/dist/bin -lxpcom -lmozalloc -L/abuild/jh/build-mozilla-new8-prof/dist/bin -lxpcom -lmozalloc -L/abuild/jh/build-mozilla-new8-prof/dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -lgobject-2.0 -lglib-2.0 -L/lib64 -lnotify -lgtk-x11-2.0 -ldbus-glib-1 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lz -lfontconfig -lgmodule-2.0 -ldbus-1 -lgobject-2.0 -lglib-2.0 -Wl,--version-script -Wl,/abuild/jh/mozilla-central2/mozilla-central/build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -ldl /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function gfxUnknownSurface::~gfxUnknownSurface():../../../dist/include/gfxASurface.h:247: error: undefined reference to 'vtable for gfxASurface' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function gfxUnknownSurface::~gfxUnknownSurface():../../../dist/include/gfxASurface.h:248: error: undefined reference to 'gfxASurface::RecordMemoryFreed()' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function gfxUnknownSurface::~gfxUnknownSurface():../../../dist/include/gfxASurface.h:247: error: undefined reference to 'vtable for gfxASurface' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function gfxUnknownSurface::~gfxUnknownSurface():../../../dist/include/gfxASurface.h:248: error: undefined reference to 'gfxASurface::RecordMemoryFreed()' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function gfxASurface::~gfxASurface():../../../dist/include/gfxASurface.h:247: error: undefined reference to 'vtable for gfxASurface' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function gfxASurface::~gfxASurface():../../../dist/include/gfxASurface.h:248: error: undefined reference to 'gfxASurface::RecordMemoryFreed()' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function gfxASurface::~gfxASurface():../../../dist/include/gfxASurface.h:247: error: undefined reference to 'vtable for gfxASurface' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function gfxASurface::~gfxASurface():../../../dist/include/gfxASurface.h:248: error: undefined reference to 'gfxASurface::RecordMemoryFreed()' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function _ZTV17gfxUnknownSurface.local.39.3126:cc0wLUAb.ltrans0.o(.data.rel.ro+0x10): error: undefined reference to 'gfxASurface::BeginPrinting(nsAString const&, nsAString const&)' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function _ZTV17gfxUnknownSurface.local.39.3126:cc0wLUAb.ltrans0.o(.data.rel.ro+0x18): error: undefined reference to 'gfxASurface::EndPrinting()' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function _ZTV17gfxUnknownSurface.local.39.3126:cc0wLUAb.ltrans0.o(.data.rel.ro+0x20): error: undefined reference to 'gfxASurface::AbortPrinting()' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function _ZTV17gfxUnknownSurface.local.39.3126:cc0wLUAb.ltrans0.o(.data.rel.ro+0x28): error: undefined reference to 'gfxASurface::BeginPage()' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function _ZTV17gfxUnknownSurface.local.39.3126:cc0wLUAb.ltrans0.o(.data.rel.ro+0x30): error: undefined reference to 'gfxASurface::EndPage()' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function _ZTV17gfxUnknownSurface.local.39.3126:cc0wLUAb.ltrans0.o(.data.rel.ro+0x38): error: undefined reference to 'gfxASurface::Finish()' /abuild/jh/trunk-install/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../x86_64-unknown-linux-gnu/bin/ld: /abuild/jh/tmp//cc0wLUAb.ltrans0.ltrans.o: in function _ZTV17gfxUnknownSurface.local.39.3126:cc0wLUAb.ltrans0.o(.data.rel.ro+0x40): error: undefined reference to 'gfxASurface::CreateSimilarSurface(gfxASurface::gfxContentType, gfxIntSize const&)' those seems suspicious. I saw similar problem previously - the vtables are there but they are not finalized. The non-LTO objects don't seem to reffer to them, so perhaps we do too much of folding... I am bit lost.