diff options
| author | bors <bors@rust-lang.org> | 2016-01-12 08:30:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-01-12 08:30:56 +0000 |
| commit | 3246eaec90d3369347da28353b8aa23c9347d592 (patch) | |
| tree | 94befa244a5d184bd361c458636536eb3c1f1ab6 | |
| parent | d6cb2791ce8a88402de896e2377e33b7479faad0 (diff) | |
| parent | e304fb43a3533d9ed79be91e217270747ca50edf (diff) | |
| download | rust-3246eaec90d3369347da28353b8aa23c9347d592.tar.gz rust-3246eaec90d3369347da28353b8aa23c9347d592.zip | |
Auto merge of #30678 - Amanieu:no_elf_tls, r=alexcrichton
I also re-enabled the use of `#[thread_local]` on AArch64. It was originally disabled in the PR that introduced AArch64 (#19790), but the reasons for this were not explained. `#[thread_local]` seems to work fine in my tests on AArch64, so I don't think this should be an issue. cc @alexcrichton @akiss77
| -rw-r--r-- | mk/crates.mk | 4 | ||||
| -rw-r--r-- | src/librustc_back/target/aarch64_unknown_linux_gnu.rs | 3 | ||||
| -rw-r--r-- | src/librustc_back/target/android_base.rs | 1 | ||||
| -rw-r--r-- | src/librustc_back/target/arm_linux_androideabi.rs | 1 | ||||
| -rw-r--r-- | src/libstd/thread/scoped_tls.rs | 41 |
5 files changed, 5 insertions, 45 deletions
diff --git a/mk/crates.mk b/mk/crates.mk index 2597c724da9..7542d91ce6d 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -175,9 +175,5 @@ endef $(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate)))) -ifdef CFG_DISABLE_ELF_TLS -RUSTFLAGS_std := --cfg no_elf_tls -endif - CRATEFILE_libc := $(SREL)src/liblibc/src/lib.rs RUSTFLAGS_libc := --cfg stdbuild diff --git a/src/librustc_back/target/aarch64_unknown_linux_gnu.rs b/src/librustc_back/target/aarch64_unknown_linux_gnu.rs index 21bfd87e412..51abab6609a 100644 --- a/src/librustc_back/target/aarch64_unknown_linux_gnu.rs +++ b/src/librustc_back/target/aarch64_unknown_linux_gnu.rs @@ -11,8 +11,7 @@ use target::Target; pub fn target() -> Target { - let mut base = super::linux_base::opts(); - base.has_elf_tls = false; + let base = super::linux_base::opts(); Target { llvm_target: "aarch64-unknown-linux-gnu".to_string(), target_endian: "little".to_string(), diff --git a/src/librustc_back/target/android_base.rs b/src/librustc_back/target/android_base.rs index 2883ffd6e9f..9791520e933 100644 --- a/src/librustc_back/target/android_base.rs +++ b/src/librustc_back/target/android_base.rs @@ -17,5 +17,6 @@ pub fn opts() -> TargetOptions { base.pre_link_args.push("-Wl,--allow-multiple-definition".to_string()); base.is_like_android = true; base.position_independent_executables = true; + base.has_elf_tls = false; base } diff --git a/src/librustc_back/target/arm_linux_androideabi.rs b/src/librustc_back/target/arm_linux_androideabi.rs index 7776aaacd00..732f1a353a8 100644 --- a/src/librustc_back/target/arm_linux_androideabi.rs +++ b/src/librustc_back/target/arm_linux_androideabi.rs @@ -13,7 +13,6 @@ use target::Target; pub fn target() -> Target { let mut base = super::android_base::opts(); base.features = "+v7".to_string(); - base.has_elf_tls = false; Target { llvm_target: "arm-linux-androideabi".to_string(), diff --git a/src/libstd/thread/scoped_tls.rs b/src/libstd/thread/scoped_tls.rs index 2c92bc504c8..dc0bc6dfe02 100644 --- a/src/libstd/thread/scoped_tls.rs +++ b/src/libstd/thread/scoped_tls.rs @@ -87,32 +87,9 @@ macro_rules! scoped_thread_local { issue = "0")] #[macro_export] #[allow_internal_unstable] -#[cfg(no_elf_tls)] macro_rules! __scoped_thread_local_inner { ($t:ty) => {{ - static _KEY: $crate::thread::__ScopedKeyInner<$t> = - $crate::thread::__ScopedKeyInner::new(); - fn _getit() -> &'static $crate::thread::__ScopedKeyInner<$t> { &_KEY } - $crate::thread::ScopedKey::new(_getit) - }} -} - -#[doc(hidden)] -#[unstable(feature = "thread_local_internals", - reason = "should not be necessary", - issue = "0")] -#[macro_export] -#[allow_internal_unstable] -#[cfg(not(no_elf_tls))] -macro_rules! __scoped_thread_local_inner { - ($t:ty) => {{ - #[cfg_attr(not(any(windows, - target_os = "android", - target_os = "ios", - target_os = "netbsd", - target_os = "openbsd", - target_arch = "aarch64")), - thread_local)] + #[cfg_attr(target_thread_local, thread_local)] static _KEY: $crate::thread::__ScopedKeyInner<$t> = $crate::thread::__ScopedKeyInner::new(); fn _getit() -> &'static $crate::thread::__ScopedKeyInner<$t> { &_KEY } @@ -221,13 +198,7 @@ impl<T> ScopedKey<T> { } } -#[cfg(not(any(windows, - target_os = "android", - target_os = "ios", - target_os = "netbsd", - target_os = "openbsd", - target_arch = "aarch64", - no_elf_tls)))] +#[cfg(target_thread_local)] #[doc(hidden)] mod imp { use cell::Cell; @@ -246,13 +217,7 @@ mod imp { } } -#[cfg(any(windows, - target_os = "android", - target_os = "ios", - target_os = "netbsd", - target_os = "openbsd", - target_arch = "aarch64", - no_elf_tls))] +#[cfg(not(target_thread_local))] #[doc(hidden)] mod imp { use cell::Cell; |
