Bug 11423

Summary: can't build firefox 3.6.2 with gold
Product: binutils Reporter: Felix von Leitner <felix-glibc>
Component: binutilsAssignee: Ian Lance Taylor <ian>
Status: RESOLVED WORKSFORME    
Severity: normal CC: bug-binutils
Priority: P2    
Version: 2.21   
Target Milestone: ---   
Host: x86_64-unknown-linux-gnu Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu Last reconfirmed:

Description Felix von Leitner 2010-03-23 17:45:50 UTC
When my system LD is gold, the mozilla build fails.  Here's the error message:


make[4]: Entering directory `/tmp/mozilla-1.9.2/browser/app'
c++ -o firefox-bin -I/usr/X11R7/include -fno-rtti -fno-exceptions -Wall -
Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-
virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-
strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -O2 -fPIC -pipe  
nsBrowserApp.o    -lpthread   -Wl,-rpath-link,/tmp/mozilla-1.9.2/dist/bin -Wl,-
rpath-link,/opt/firefox64/lib  -L../../dist/bin -L../../dist/lib -Wl,--whole-
archive -L../../dist/lib -ljemalloc -Wl,--no-whole-archive  -lxul -
L/tmp/mozilla-1.9.2/dist/bin -lmozjs /tmp/mozilla-
1.9.2/dist/lib/libxpcomglue_s.a -L/tmp/mozilla-1.9.2/dist/bin -lxpcom -
L/tmp/mozilla-1.9.2/dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -
L/usr/X11R7/lib64 -lgtk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lfreetype -
lz -lfontconfig -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -
lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0     -L/usr/X11R7/lib64 -lX11  -lz  
-lasound -ldl -lm
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../../x86_64-unknown-linux-
gnu/bin/ld: error: hidden symbol 'nsCOMPtr_base::begin_assignment()' is not 
defined locally
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../../x86_64-unknown-linux-
gnu/bin/ld: error: hidden symbol 'nsCOMPtr_base::~nsCOMPtr_base()' is not 
defined locally
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../../x86_64-unknown-linux-
gnu/bin/ld: error: hidden symbol 'nsCOMPtr_base::begin_assignment()' is not 
defined locally
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../../x86_64-unknown-linux-
gnu/bin/ld: error: hidden symbol 'nsCOMPtr_base::begin_assignment()' is not 
defined locally
collect2: ld returned 1 exit status
make[4]: *** [firefox-bin] Error 1
make[4]: Leaving directory `/tmp/mozilla-1.9.2/browser/app'
make[3]: *** [libs] Error 2
make[3]: Leaving directory `/tmp/mozilla-1.9.2/browser'
make[2]: *** [libs_tier_app] Error 2
make[2]: Leaving directory `/tmp/mozilla-1.9.2'
make[1]: *** [tier_app] Error 2
make[1]: Leaving directory `/tmp/mozilla-1.9.2'
make: *** [default] Error 2

I don't know if this is a bug in mozilla or gold.  I'm using gcc 4.4.3 to build 
firefox.  I have seen this behavior before and then switched back to the old LD, 
but since gold is now needed to to link time optimization in LLVM, that is no 
longer an option.
Comment 1 Ian Lance Taylor 2010-03-24 05:57:43 UTC
Which gold sources are you using?

I also don't know whether this is a bug in mozilla or gold.  The error means that 
there is a relocation which references a hidden symbol which is not defined, or 
is defined in a shared object.  Either way the dynamic linker will not be able to 
satisfy the reference, and gold expects that the program will fail at runtime.

If you can find the definitions and references to 
nsCOMPtr_base::begin_assignment() and show the output of readelf -s, that would 
help.
Comment 2 Ian Lance Taylor 2010-11-17 14:04:54 UTC
I have heard that other people are able to build mozilla with current development versions of gold.  Is this still a problem for you?
Comment 3 Ian Lance Taylor 2011-02-04 14:22:18 UTC
Closing due to lack of reply and other reports of successful builds.  Please reopen if this is still a problem.