Skip to content

Commit cce631a

Browse files
authored
Merge pull request #9 from Wind-River/V7LIBC-948
remove the reference to __cxa_thread_atexit_impl
2 parents 602bea3 + 3b2c147 commit cce631a

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

src/libstd/sys/vxworks/fast_thread_local.rs

+2-25
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,10 @@
1+
// Copyright (c) 2019 Wind River Systems, Inc.
2+
13
#![cfg(target_thread_local)]
24
#![unstable(feature = "thread_local_internals", issue = "0")]
35

4-
// Since what appears to be glibc 2.18 this symbol has been shipped which
5-
// GCC and clang both use to invoke destructors in thread_local globals, so
6-
// let's do the same!
7-
//
8-
// Note, however, that we run on lots older linuxes, as well as cross
9-
// compiling from a newer linux to an older linux, so we also have a
10-
// fallback implementation to use as well.
11-
//
12-
// Due to rust-lang/rust#18804, make sure this is not generic!
136
pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
14-
use crate::mem;
157
use crate::sys_common::thread_local::register_dtor_fallback;
16-
17-
extern {
18-
#[linkage = "extern_weak"]
19-
static __dso_handle: *mut u8;
20-
#[linkage = "extern_weak"]
21-
static __cxa_thread_atexit_impl: *const libc::c_void;
22-
}
23-
if !__cxa_thread_atexit_impl.is_null() {
24-
type F = unsafe extern fn(dtor: unsafe extern fn(*mut u8),
25-
arg: *mut u8,
26-
dso_handle: *mut u8) -> libc::c_int;
27-
mem::transmute::<*const libc::c_void, F>(__cxa_thread_atexit_impl)
28-
(dtor, t, &__dso_handle as *const _ as *mut _);
29-
return
30-
}
318
register_dtor_fallback(t, dtor);
329
}
3310

0 commit comments

Comments
 (0)