]> git.lizzy.rs Git - rust.git/commitdiff
Replace no_elf_tls with target_thread_local
authorAmanieu d'Antras <amanieu@gmail.com>
Sat, 2 Jan 2016 22:50:50 +0000 (22:50 +0000)
committerAmanieu d'Antras <amanieu@gmail.com>
Mon, 11 Jan 2016 10:38:36 +0000 (10:38 +0000)
mk/crates.mk
src/librustc_back/target/aarch64_unknown_linux_gnu.rs
src/librustc_back/target/android_base.rs
src/librustc_back/target/arm_linux_androideabi.rs
src/libstd/thread/scoped_tls.rs

index 2597c724da96fd7ad4aa096d7633bc6e3bc80635..7542d91ce6d50afdd9edf90c2660544c16a777e8 100644 (file)
@@ -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
index 21bfd87e412dd5d899ed8ad226d5b0b852d3fa2c..51abab6609a86c52997e73b576723a21a4204833 100644 (file)
@@ -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(),
index 2883ffd6e9f2244ccd24b24dea153eeac6422792..9791520e9339bbd8ad6908b74e70256abbf83673 100644 (file)
@@ -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
 }
index 7776aaacd00b1b8f2f2506265a79674658be9917..732f1a353a8bd719c1f363e5fec3c02c9837765d 100644 (file)
@@ -13,7 +13,6 @@
 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(),
index 2c92bc504c896bb5854139f1902a4098896b3c17..dc0bc6dfe024559ed6586ac04001950e4b732035 100644 (file)
@@ -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 @@ pub fn is_set(&'static self) -> bool {
     }
 }
 
-#[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 @@ pub unsafe fn get(&self) -> *mut T { self.inner.get() }
     }
 }
 
-#[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;