diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-29 05:32:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-29 05:32:53 +0200 |
| commit | f0e2895cf892e8abf0d19d8e09b1a58dd618f01e (patch) | |
| tree | 07d8dc4d22594143ec0f440f472c13db4bbe8653 /src/libstd/sys | |
| parent | d4757d5bbf8966a1a698d89a2c6003e5d5dbae5a (diff) | |
| parent | cce631a5a49c327eb301c9d65a17a39d7863da64 (diff) | |
| download | rust-f0e2895cf892e8abf0d19d8e09b1a58dd618f01e.tar.gz rust-f0e2895cf892e8abf0d19d8e09b1a58dd618f01e.zip | |
Rollup merge of #63963 - Wind-River:master_003, r=alexcrichton
remove the reference to __cxa_thread_atexit_impl r? @alexcrichton cc @n-salim
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/vxworks/fast_thread_local.rs | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/libstd/sys/vxworks/fast_thread_local.rs b/src/libstd/sys/vxworks/fast_thread_local.rs index f5a2e263d25..2e021980778 100644 --- a/src/libstd/sys/vxworks/fast_thread_local.rs +++ b/src/libstd/sys/vxworks/fast_thread_local.rs @@ -1,33 +1,10 @@ +// Copyright (c) 2019 Wind River Systems, Inc. + #![cfg(target_thread_local)] #![unstable(feature = "thread_local_internals", issue = "0")] -// Since what appears to be glibc 2.18 this symbol has been shipped which -// GCC and clang both use to invoke destructors in thread_local globals, so -// let's do the same! -// -// Note, however, that we run on lots older linuxes, as well as cross -// compiling from a newer linux to an older linux, so we also have a -// fallback implementation to use as well. -// -// Due to rust-lang/rust#18804, make sure this is not generic! pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) { - use crate::mem; use crate::sys_common::thread_local::register_dtor_fallback; - - extern { - #[linkage = "extern_weak"] - static __dso_handle: *mut u8; - #[linkage = "extern_weak"] - static __cxa_thread_atexit_impl: *const libc::c_void; - } - if !__cxa_thread_atexit_impl.is_null() { - type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8), - arg: *mut u8, - dso_handle: *mut u8) -> libc::c_int; - mem::transmute::<*const libc::c_void, F>(__cxa_thread_atexit_impl) - (dtor, t, &__dso_handle as *const _ as *mut _); - return - } register_dtor_fallback(t, dtor); } |
