Skip to content
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

Obsolete the --disable-elf-tls configure option #26581

Closed
alexcrichton opened this issue Jun 26, 2015 · 1 comment
Closed

Obsolete the --disable-elf-tls configure option #26581

alexcrichton opened this issue Jun 26, 2015 · 1 comment

Comments

@alexcrichton
Copy link
Member

This option was added to support OSX 10.6, but it's not ideal as it requires that a separate toolchain of Rust is downloaded to compile Rust code for Firefox on OSX. Ideally our support would look something like this:

  • The compiler recognizes the "standard method" of specifying that OSX 10.6 is being targeted (not the current version). I believe that this is an environment variable?
  • The compiler will then generate an appropriate #[cfg] when this is set to allow the crate to know that it's targeting 10.6 (or whatever the relevant OSX target is)
  • The standard library is then compiled against 10.6 always
  • The macros in the standard library will then select the "best implementation" based on the context they're built into.

This will incur a perf hit for the standard library itself, but it would allow us to go back to "one distribution works everywhere" which is much nicer than "go build a separate copy of Rust to work on 10.6".

cc @rillian

@rillian
Copy link
Contributor

rillian commented Jun 26, 2015

For Firefox we use MACOSX_DEPLOYMENT_TARGET=10.6 in the environment. This is supported by clang, and overridden by the command line -mmacosx-version-min switch.

I guess that would become #[cfg(macosx_deployment_target)] or maybe #[cfg(target_version)].

MACOSX_DEPLOYMENT_TARGET
           If -mmacosx-version-min is unspecified, the default deployment target
           is read from this environment variable.  This option only affects
           darwin targets.

To match clang's behaviour here rustc would include two versions of the standard library and selectively link to the one with or without TLS based on this variable. This is still a step in that direction, though, so I'm fine with the proposed change. "One distribution" is definitely better for our use in Firefox.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Dec 19, 2015
This transitions the standard library's `thread_local!` macro to use the
freshly-added and gated `#[cfg(target_thread_local)]` attribute. This greatly
simplifies the `#[cfg]` logic in play here, but requires that the standard
library expose both the OS and ELF TLS implementation modules as unstable
implementation details.

The implementation details were shuffled around a bit but end up generally
compiling to the same thing.

Closes rust-lang#26581 (this supersedes the need for the option)
Closes rust-lang#27057 (this also starts ignoring the option)
jroesch pushed a commit to jroesch/rust that referenced this issue Jan 4, 2016
This transitions the standard library's `thread_local!` macro to use the
freshly-added and gated `#[cfg(target_thread_local)]` attribute. This greatly
simplifies the `#[cfg]` logic in play here, but requires that the standard
library expose both the OS and ELF TLS implementation modules as unstable
implementation details.

The implementation details were shuffled around a bit but end up generally
compiling to the same thing.

Closes rust-lang#26581 (this supersedes the need for the option)
Closes rust-lang#27057 (this also starts ignoring the option)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants