Mozilla 1.7 fails to link due to unresolved externals if the C++ flag -fno-default-inline is set: gmake[4]: Entering directory `/volatile/portage/mozilla-1.7/work/mozilla/xpcom/tools/registry' regxpcom.cpp g++ -o regxpcom.o -c -DXPCOM_GLUE -DOSTYPE=\"Linux2.4\" -DOSARCH=\"Linux\" -I./../../build -I../../../dist/include/string -I../../../dist/include/xpcom -I../../../dist/include -I/volatile/portage/mozilla-1.7/work/mozilla/dist/include/nspr -I/usr/X11R6/include -fPIC -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -march=athlon-xp -pipe -fno-default-inline -fforce-addr -Wno-deprecated -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -ffunction-sections -O2 -I/usr/X11R6/include -DMOZILLA_CLIENT -include ../../../mozilla-config.h -Wp,-MD,.deps/regxpcom.pp regxpcom.cpp g++ -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -march=athlon-xp -pipe -fno-default-inline -fforce-addr -Wno-deprecated -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -ffunction-sections -O2 -o regxpcom regxpcom.o -L../../../dist/bin -L../../../dist/lib ../../../dist/lib/libxpcomglue.a -L/volatile/portage/mozilla-1.7/work/mozilla/dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -ldl -lm regxpcom.o(.gnu.linkonce.t._ZN24nsGetServiceFromCategoryC2EPKcS1_P11nsISupportsPj+0x1c): In function `nsGetServiceFromCategory::nsGetServiceFromCategory[not-in-charge](char const*, char const*, nsISupports*, unsigned*)': : undefined reference to `vtable for nsGetServiceFromCategory' regxpcom.o(.gnu.linkonce.t._ZN24nsGetServiceFromCategoryC1EPKcS1_P11nsISupportsPj+0x1c): In function `nsGetServiceFromCategory::nsGetServiceFromCategory[in-charge](char const*, char const*, nsISupports*, unsigned*)': : undefined reference to `vtable for nsGetServiceFromCategory' ../../../dist/lib/libxpcomglue.a(nsDebug.o)(.gnu.linkonce.t._ZN11nsDebugImplD2Ev+0x10): In function `nsDebugImpl::~nsDebugImpl [not-in-charge]()': : undefined reference to `vtable for nsDebugImpl' ../../../dist/lib/libxpcomglue.a(nsDebug.o)(.gnu.linkonce.t._ZN11nsDebugImplD1Ev+0x10): In function `nsDebugImpl::~nsDebugImpl [in-charge]()': : undefined reference to `vtable for nsDebugImpl' collect2: ld returned 1 exit status gmake[4]: *** [regxpcom] Error 1 gmake[4]: Leaving directory `/volatile/portage/mozilla-1.7/work/mozilla/xpcom/tools/registry' gmake[3]: *** [libs] Error 2 gmake[3]: Leaving directory `/volatile/portage/mozilla-1.7/work/mozilla/xpcom/tools' gmake[2]: *** [libs] Error 2 gmake[2]: Leaving directory `/volatile/portage/mozilla-1.7/work/mozilla/xpcom' gmake[1]: *** [tier_2] Error 2 gmake[1]: Leaving directory `/volatile/portage/mozilla-1.7/work/mozilla' make: *** [default] Error 2 !!! ERROR: net-www/mozilla-1.7 failed. !!! Function src_compile, Line 370, Exitcode 2 !!! (no error message) Reproducible: Always Steps to Reproduce: 1. CXXFLAGS=-fno-default-inline emerge mozilla Actual Results: Linker failer of the description Expected Results: Linked application. filter the flag -fno-default-inline, build works fine then.
Created attachment 36223 [details, diff] mozilla-1.7.ebuild.diff Patch to filter the flag -fno-default-inline
The problem here is that flag-o-matic's strip-flags function is broken: if [ "${flag%%${y}}" = "" ] || [ "${flag:0:5}" = "-fno-" ] || [ "${flag:0:5}" = "-mno-" ] ; then NEW_CFLAGS="${NEW_CFLAGS} ${x}" Anything that starts with -fno- or -mno- is allowed into NEW_CFLAGS at the moment. :-|
Fixed now in flag-o-matic, thanks to Spanky. You will need to emerge --sync