Skip to content

Commit 8c81edc

Browse files
committed
Set has_thread_local=true for android
1 parent f5578f0 commit 8c81edc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

compiler/rustc_target/src/spec/base/android.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub fn opts() -> TargetOptions {
55
base.os = "android".into();
66
base.is_like_android = true;
77
base.default_dwarf_version = 2;
8-
base.has_thread_local = false;
8+
base.has_thread_local = true;
99
base.supported_sanitizers = SanitizerSet::ADDRESS;
1010
// This is for backward compatibility, see https://github.com/rust-lang/rust/issues/49867
1111
// for context. (At that time, there was no `-C force-unwind-tables`, so the only solution

library/std/src/sys/unix/thread_local_dtor.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
// compiling from a newer linux to an older linux, so we also have a
1313
// fallback implementation to use as well.
1414
#[allow(unexpected_cfgs)]
15-
#[cfg(any(target_os = "linux", target_os = "fuchsia", target_os = "redox", target_os = "hurd"))]
15+
#[cfg(any(
16+
target_os = "linux",
17+
target_os = "android",
18+
target_os = "fuchsia",
19+
target_os = "redox",
20+
target_os = "hurd"
21+
))]
1622
// FIXME: The Rust compiler currently omits weakly function definitions (i.e.,
1723
// __cxa_thread_atexit_impl) and its metadata from LLVM IR.
1824
#[no_sanitize(cfi, kcfi)]

0 commit comments

Comments
 (0)