Closed
Bug 1164109
Opened 9 years ago
Closed 9 years ago
rust code fails to link on macosx because of thread-local storage
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox41 fixed)
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: rillian, Assigned: rillian)
References
Details
Attachments
(1 file, 3 obsolete files)
1.51 KB,
patch
|
Details | Diff | Splinter Review |
On MacOS X Yosemite
$ ./mach gtest rust.*
[...]
0:05.15 ld: targeted OS version does not support use of thread local variables in __ZN6thread7current20hcfeed7bdf861e757etbE for architecture x86_64
0:05.15 clang: error: linker command failed with exit code 1 (use -v to see invocation)
0:05.15 make[2]: *** [XUL] Error 1
I swear this worked last week, but maybe not. Still fine on linux64.
Comment 1•9 years ago
|
||
Was the build targeting OSX 10.6 or prior? Currently Rust uses TLS features that were added in 10.7 and it's known to not work on 10.6 and prior, but 10.7+ should all work just fine (which would make this quite suspicious!).
Comment 2•9 years ago
|
||
(In reply to Alex Crichton [:acrichto] from comment #1)
> Was the build targeting OSX 10.6 or prior? Currently Rust uses TLS features
> that were added in 10.7 and it's known to not work on 10.6 and prior, but
> 10.7+ should all work just fine (which would make this quite suspicious!).
Does this mean that Rust cannot target OSX 10.6 at all? Or does Rust have an issue with 10.6 only if we're using TLS?
:gps, would this be a problem for Firefox integration?
Comment 3•9 years ago
|
||
Yes this means that the standard library will not target 10.6 right now. Note that this is the only known incompatibility with 10.6, and there are likely ways to work around it, so this is not a fundamental issue, it will just require some work on our side.
Comment 4•9 years ago
|
||
Filed https://github.com/rust-lang/rust/issues/25342 so we don't forget
Assignee | ||
Comment 5•9 years ago
|
||
Adding an explicit -lpthread resolves the issue.
Assignee: nobody → giles
Attachment #8604802 -
Flags: review?(ted)
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8604802 [details] [diff] [review]
Incude -lpthread for gtest
Nevermind.
Attachment #8604802 -
Attachment is obsolete: true
Attachment #8604802 -
Flags: review?(ted)
Assignee | ||
Comment 7•9 years ago
|
||
Thanks, Alex. I couldn't figure out what was triggering the error message. I guess the linker recognizes the tls-related pthread calls?
In any case, 'ac_add_options --enable-macos-target=10.7' does resolve the issue for me.
Comment 8•9 years ago
|
||
(In reply to Ralph Giles (:rillian) from comment #7)
> I guess the linker recognizes the tls-related pthread calls?
The current implementation of thread local variables on OSX actually involves a few compiler attributes and avoids pthread entirely, but it looks like the OSX linker is smart enough to know that when you're targeting an older version of OSX that they won't work correctly.
> In any case, 'ac_add_options --enable-macos-target=10.7' does resolve the
> issue for me.
Good to hear!
Assignee | ||
Comment 9•9 years ago
|
||
Add a configure check to prevent building with the unsupported configuration until we can find a better work-around.
Attachment #8604930 -
Flags: review?(ted)
Comment 10•9 years ago
|
||
How much of a hindrance is it that the Rust standard library doesn't work on OSX 10.6 right now? Should we try to prioritize compliance, or is it just a "nice to have"?
Comment 11•9 years ago
|
||
At the moment, 10.6 support is "this needs to work to ship Rust code with Firefox".
Comment 12•9 years ago
|
||
Firefox has more users on OSX 10.6 than Linux, iirc, so if you want code to ship in Firefox on OSX, it needs to work on 10.6.
Comment 13•9 years ago
|
||
Thanks for the clarifications! I'll try to investigate soon how hard it would be to lift this blocker for running on 10.6.
Assignee | ||
Updated•9 years ago
|
OS: Unspecified → Mac OS X
Hardware: Unspecified → All
Comment 14•9 years ago
|
||
Comment on attachment 8604930 [details] [diff] [review]
Require MacOS X 10.7 or later when compiling rust
Review of attachment 8604930 [details] [diff] [review]:
-----------------------------------------------------------------
If you haven't already, please file a bug on the root issue here so that we can make that block shipping this with Firefox (whether the decision is "drop 10.6 support" or "support 10.6 in Rust").
Attachment #8604930 -
Flags: review?(ted) → review+
Assignee | ||
Comment 15•9 years ago
|
||
Move the 'checking' message inside the conditional to avoid misleading logs. Carrying forward r=ted.
Attachment #8604930 -
Attachment is obsolete: true
Assignee | ||
Comment 16•9 years ago
|
||
Attachment #8608401 -
Attachment is obsolete: true
Comment 17•9 years ago
|
||
Comment 18•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Comment 19•9 years ago
|
||
I tried to trace the mp4parser rust code but got similar error on m-c (286303:eb25b90a05c1) today.
11:35.33 ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
11:35.33 ld: targeted OS version does not support use of thread local variables in __ZN10sys_common11thread_info14current_thread20h67a0745d7f70577eJAsE for architecture x86_64
11:35.33 clang: error: linker command failed with exit code 1 (use -v to see invocation)
11:35.33 make[5]: *** [XUL] Error 1
11:35.33 make[4]: *** [toolkit/library/target] Error 2
11:35.33 make[4]: *** Waiting for unfinished jobs....
11:35.33 jsapi-tests
11:36.14 ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
11:37.51 ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
11:37.52 make[3]: *** [compile] Error 2
11:37.52 make[2]: *** [default] Error 2
11:37.52 make[1]: *** [realbuild] Error 2
11:37.52 make: *** [build] Error 2
11:37.57 410 compiler warnings present.
My .mozconfig is:
ac_add_options --enable-debug
ac_add_options --disable-optimize
ac_add_options --enable-rust
Build environment is:
OS X 10.11.3
rustc 1.6.0 (c30b771ad 2016-01-19)
xcode 7.2.1
Any suggestion?
Comment 20•8 years ago
|
||
(In reply to Alfredo Yang (:alfredo) from comment #19)
> I tried to trace the mp4parser rust code but got similar error on m-c
> (286303:eb25b90a05c1) today.
Alfredo, did you ever find a resolution? I just ran into the same problem today.
Comment 21•8 years ago
|
||
(In reply to Jonathan Chan [:jyc] from comment #20)
> (In reply to Alfredo Yang (:alfredo) from comment #19)
> > I tried to trace the mp4parser rust code but got similar error on m-c
> > (286303:eb25b90a05c1) today.
>
> Alfredo, did you ever find a resolution? I just ran into the same problem
> today.
No. :(
Comment 22•8 years ago
|
||
(In reply to Jonathan Chan [:jyc] from comment #20)
> (In reply to Alfredo Yang (:alfredo) from comment #19)
> > I tried to trace the mp4parser rust code but got similar error on m-c
> > (286303:eb25b90a05c1) today.
>
> Alfredo, did you ever find a resolution? I just ran into the same problem
> today.
https://bugzilla.mozilla.org/show_bug.cgi?id=1188030#c14
You can try it, it works on my laptop.
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•