A while back, I posted a workaround that lets Mozilla compile and link properly, working around a bug that is present in GCC 4. I am happy to report that the GCC bug has been fixed on the GCC trunk, 4.1 branch, and 4.0 branch (it should appear in GCC4.0.4 and 4.1.1). I was very excited and immediately went off to build my own GCC and try to build XULRunner with it. No dice! Linking failed in toolkit/library with a similar error as before:
relocation R_X86_64_PC32 against `nsINIParser::Init(nsILocalFile*)' can not be used when making a shared object; recompile with -fPIC
This might look at first glance like the same bug as before, but it’s not: the previous bug was about builtin functions like memcpy, while this bug is about class member functions. It is apparently some bad interaction between #pragma GCC visibility push(hidden)
and a class-level attribute which is supposed to override that for default visibility. I managed after several hours of tedium to reduce the testcase to a 30-line .i file and have filed the bug with GCC.
For the moment, though, it appears that GCC4.0.4 and 4.1.1 will not be able to compile Mozilla without the same hacks as I suggested previously:
Configure with the following variable set:
ac_cv_visibility_pragma=no path/to/mozilla/configure –enable-options-here
or put this in your mozconfig:
ac_cv_visibility_pragma=no (Don’t prefix this with ac_add_options!)