From 73abc78407de95d76bf753c34ca1a2333dc3e537 Mon Sep 17 00:00:00 2001 From: name1e5s Date: Sun, 17 Apr 2022 19:29:18 +0800 Subject: [PATCH] set has_thread_local=true for android --- Cargo.lock | 4 ++-- compiler/rustc_target/src/spec/android_base.rs | 2 +- library/std/Cargo.toml | 2 +- library/std/src/sys/unix/thread_local_dtor.rs | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73dc7f03236d1..9c5ec15abc8b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -741,9 +741,9 @@ dependencies = [ [[package]] name = "compiler_builtins" -version = "0.1.71" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "163437f05ca8f29d7e9128ea728dedf5eb620e445fbca273641d3a3050305f23" +checksum = "afdbb35d279238cf77f0c9e8d90ad50d6c7bff476ab342baafa29440f0f10bff" dependencies = [ "cc", "rustc-std-workspace-core", diff --git a/compiler/rustc_target/src/spec/android_base.rs b/compiler/rustc_target/src/spec/android_base.rs index c2b9d696776f5..e29334d429db9 100644 --- a/compiler/rustc_target/src/spec/android_base.rs +++ b/compiler/rustc_target/src/spec/android_base.rs @@ -5,7 +5,7 @@ pub fn opts() -> TargetOptions { base.os = "android".into(); base.dwarf_version = Some(2); base.position_independent_executables = true; - base.has_thread_local = false; + base.has_thread_local = true; // This is for backward compatibility, see https://github.com/rust-lang/rust/issues/49867 // for context. (At that time, there was no `-C force-unwind-tables`, so the only solution // was to always emit `uwtable`). diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index f2d6583206035..378f296e19e96 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -16,7 +16,7 @@ panic_unwind = { path = "../panic_unwind", optional = true } panic_abort = { path = "../panic_abort" } core = { path = "../core" } libc = { version = "0.2.116", default-features = false, features = ['rustc-dep-of-std'] } -compiler_builtins = { version = "0.1.71" } +compiler_builtins = { version = "0.1.72" } profiler_builtins = { path = "../profiler_builtins", optional = true } unwind = { path = "../unwind" } hashbrown = { version = "0.12", default-features = false, features = ['rustc-dep-of-std'] } diff --git a/library/std/src/sys/unix/thread_local_dtor.rs b/library/std/src/sys/unix/thread_local_dtor.rs index c3f410353b915..c6a34d520c12b 100644 --- a/library/std/src/sys/unix/thread_local_dtor.rs +++ b/library/std/src/sys/unix/thread_local_dtor.rs @@ -13,6 +13,7 @@ // fallback implementation to use as well. #[cfg(any( target_os = "linux", + target_os = "android", target_os = "fuchsia", target_os = "redox", target_os = "emscripten"