Check for --disable-elf-tls in rust toolchain

RESOLVED FIXED in Firefox 42

Status

defect
RESOLVED FIXED
4 years ago
Last year

People

(Reporter: rillian, Assigned: rillian)

Tracking

Trunk
mozilla42
All
macOS
Dependency tree / graph

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(1 attachment)

Stock rustc assumes atomic thread-local storage, which prevents linking with MACOSX_DEPLOYMENT_TARGET=10.6 and earlier, which we need to support for Firefox.

In rustc 1.1 and later there's a --disable-elf-tls configure switch which allows building an alternate toolchain which works around this issue.

Therefore when targetting 10.6 gecko's configure should test linkage against rust code to determine whether the available toolchain was built with this option.
When --enable-rust and MACOSX_DEPLOYMENT_TARGET=10.6, compile and test linking to a rust library to see if the toolchain has the necessary workarounds.

If it works, great, otherwise failt to build with suggested solutions as before.

This is a necessary for integration builds with rust enabled.
Attachment #8630870 - Flags: review?(ted)
Green on try, as expected since this doesn't change the default build.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=e17d07dea4c6
Tooltool manifest for a mac build of rust 1.1.0 with --disable-elf-tls.

[
{
"size": 61570496, 
"unpack": true,
"digest": "f4b40ac1caf95720e4e833e8f9f00bffd307b28da675e97b21decb15430310eb67cc2603e0d86a2760522bbe5cd78ca099bd17103bf8e64d28140f825aeed678", 
"algorithm": "sha512", 
"filename": "rustc.tar.xz"
}
]
Comment on attachment 8630870 [details] [diff] [review]
Configure check for rustc linkage

Review of attachment 8630870 [details] [diff] [review]:
-----------------------------------------------------------------

Bleh. Does rustc have a way to dump the configure options it was built with? It would be great if we could just ask the compiler if it supported this instead of having to compile a test program to find out.

r+ to unblock you, but I'd really like to not have to accumulate garbage in configure around a brand new toolchain that we wrote.
Attachment #8630870 - Flags: review?(ted) → review+
Thanks. 

AFAIK there's no way to dump the configure options. I filed https://github.com/rust-lang/rust/issues/27057

Would it help to hide it in build/autoconf/rust.m4?

I was going to look at the semver idea myself just for my own sanity building packages, and we already parse the version string, so I think that's the most direct solution. I could put it in manually in my builds now, but that doesn't help anyone else.
https://hg.mozilla.org/mozilla-central/rev/74244131ca06
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.