-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std: Add an option to disable ELF based TLS #25858
Conversation
This commit adds a ./configure option called `--disable-elf-tls` which disables ELF based TLS (that which is communicated to LLVM) on platforms which already support it. OSX 10.6 does not support this form of TLS, and some users of Rust need to target 10.6 and are unable to do so due to the usage of TLS. The standard library will continue to use ELF based TLS on OSX by default (as the officially supported platform is 10.7+), but this adds an option to compile the standard library in a way that is compatible with 10.6.
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
a907433
to
1b5f9cb
Compare
cc @rillian, this means that the custom build of Rust that Firefox uses will need to pass |
Thanks, @alexcrichton! I'm confused by 'ELF based TLS'. Is this the appropriate terminology for the same feature in Mach-O? |
Ah yeah maybe it isn't the best name after all, I was going off the LLVM documentation which indicates:
So maybe a more appropriate name would be |
Lol. If the alternative is a pthread_get/setspecific-based implementation, would plain |
This doesn't seem to be sufficient. I built yesterday's rustc master with you pr merged, and the linkage gtest we have in the gecko tree fails with
Sounds like std::sys::current_thread(). Is the thread_local! macro change not being propagated properly? Did I mess up my build somehow? |
Hm that's surprising, so you basically did this?
|
No, that has always worked, I assume because rustc does the linking in that case. The gecko build calls So:
|
A much simpler test is https://github.com/rillian/rust-ffi test
|
Well, that was with the rust 1.0.0 compiler. I works with the --disable-elf-tls build, so it's probably me. |
Perhaps you had a |
I must have been. I did a clean build of both and it works now. Sorry for the confusion. Works for me, please merge! |
No worries, thanks for the confirmation @rillian! |
@bors r+ |
📌 Commit 1b5f9cb has been approved by |
This commit adds a ./configure option called `--disable-elf-tls` which disables ELF based TLS (that which is communicated to LLVM) on platforms which already support it. OSX 10.6 does not support this form of TLS, and some users of Rust need to target 10.6 and are unable to do so due to the usage of TLS. The standard library will continue to use ELF based TLS on OSX by default (as the officially supported platform is 10.7+), but this adds an option to compile the standard library in a way that is compatible with 10.6. Closes #25342
92c3b9c
to
1b5f9cb
Compare
I think I borked my branch here, but all tests passed so merging manually. |
@alexcrichton What do you think about backporting this to 1.1? |
@rillian I figured you guys were building from source anyway, so would building from the 1.1 source be better than building from the master source? I don't think we'll be shipping a binary build of this unfortunately regardless. |
We could build from stable release source sooner, that's all. |
Eh, may as well nominate and see what happens! |
Discussed with @brson and we decided to accept for backporting. |
Lovely, thanks! |
This commit adds a ./configure option called
--disable-elf-tls
which disablesELF based TLS (that which is communicated to LLVM) on platforms which already
support it. OSX 10.6 does not support this form of TLS, and some users of Rust
need to target 10.6 and are unable to do so due to the usage of TLS. The
standard library will continue to use ELF based TLS on OSX by default (as the
officially supported platform is 10.7+), but this adds an option to compile the
standard library in a way that is compatible with 10.6.
Closes #25342