Linking error on mips/mipsel with patch for bug 521750

RESOLVED FIXED in mozilla1.9.3a5

Status

()

Core
XPCOM
RESOLVED FIXED
8 years ago
5 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

1.9.1 Branch
mozilla1.9.3a5
Other
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

8 years ago
The change from bug 521750 broke builds on mips and mipsel with the following error message:

../../staticlib/components/libxpconnect.a(xpcjsruntime.o):/build/buildd/xulrunner-1.9.1.5/js/src/xpconnect/src/xpcjsruntime.cpp:487: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
../../staticlib/components/libxpconnect.a(xpcthreadcontext.o):/build/buildd/xulrunner-1.9.1.5/js/src/xpconnect/src/xpcthreadcontext.cpp:493: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
../../staticlib/components/libnecko.a(nsSocketTransportService2.o):/build/buildd/xulrunner-1.9.1.5/netwerk/base/src/nsSocketTransportService2.cpp:437: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
../../staticlib/components/libnecko.a(nsSocketTransportService2.o):/build/buildd/xulrunner-1.9.1.5/netwerk/base/src/nsSocketTransportService2.cpp:383: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
../../staticlib/components/libgklayout.a(nsJSEnvironment.o): In function `DOMGCCallback':
/build/buildd/xulrunner-1.9.1.5/dom/src/base/nsJSEnvironment.cpp:3694: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
../../staticlib/components/libgklayout.a(nsDOMScriptObjectFactory.o):/build/buildd/xulrunner-1.9.1.5/dom/src/base/nsDOMScriptObjectFactory.cpp:384: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
../../staticlib/components/libgklayout.a(nsDOMThreadService.o):/build/buildd/xulrunner-1.9.1.5/dom/src/threads/nsDOMThreadService.cpp:1153: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
../../staticlib/components/libgklayout.a(nsDOMThreadService.o):/build/buildd/xulrunner-1.9.1.5/dom/src/threads/nsDOMThreadService.cpp:687: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
../../staticlib/components/libgklayout.a(nsDOMWorkerXHRProxy.o):/build/buildd/xulrunner-1.9.1.5/dom/src/threads/nsDOMWorkerXHRProxy.cpp:901: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
../../staticlib/components/libgklayout.a(nsDOMWorkerXHRProxy.o):/build/buildd/xulrunner-1.9.1.5/dom/src/threads/nsDOMWorkerXHRProxy.cpp:871: relocation truncated to fit: R_MIPS_TLS_GD against `gTLSIsMainThread'
collect2: ld returned 1 exit status

I guess this happens on trunk, too.
Summary: Linking error on mips/mipsel → Linking error on mips/mipsel with patch for bug 521750
Blocks: 521750
(Assignee)

Comment 1

8 years ago
So far, investigation seems to indicate this is a bug in binutils with R_MIPS_TLS_GD relocations, which are related to the use of __thread.

I tried several things, one of which was replacing the inline NS_IsMainThread function with a normal function call, which reduced significantly the amount of R_MIPS_TLS_GD relocations. This unfortunately didn't help.

It seems the issue is R_MIPS_TLS_GD relocations not being well supported when the GOTs are significantly filled up. For example, reducing the number of static components does help (especially excluding libgklayout).

So, until binutils is fixed, it looks like the best to do is to simply undefine NS_TLS for mips/mipsel. How would you prefer that to be done ?
(Assignee)

Comment 2

7 years ago
Created attachment 435832 [details] [diff] [review]
Patch
Assignee: nobody → mh+mozilla
Attachment #435832 - Flags: review?(benjamin)
Comment on attachment 435832 [details] [diff] [review]
Patch

Please add a comment referencing this bug and/or the binutils bug.
Attachment #435832 - Flags: review?(benjamin) → review+
(Assignee)

Comment 4

7 years ago
http://hg.mozilla.org/mozilla-central/rev/bfe106e6ca9a
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
(Assignee)

Updated

5 years ago
Depends on: 728136

Comment 5

5 years ago
According to http://sourceware.org/ml/binutils/2010-09/msg00042.html

"But after changing the max_count in got_per_bfd_arg from 16377 to 12000,
all relocation overflows disappear.

Then I found 12639 is the largest allowable value."
You need to log in before you can comment on or make changes to this bug.