Remove usage of extern_weak in fast_thread_local

This commit is contained in:
bjorn3 2020-07-16 12:55:03 +02:00
parent 748d516e0d
commit 4a21cff957

View File

@ -0,0 +1,45 @@
From 7496bb94a2fb2bc34629c9781c3bc3a470becaee Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Fri, 10 Apr 2020 13:47:42 +0200
Subject: [PATCH] Remove usage of extern_weak in fast_thread_local
---
src/libstd/sys/unix/fast_thread_local.rs | 20 --------------------
1 files changed, 0 insertions(+), 20 deletions(-)
diff --git a/src/libstd/sys/unix/fast_thread_local.rs b/src/libstd/sys/unix/fast_thread_local.rs
index 8730b4d..8d6e3d5 100644
--- a/src/libstd/sys/unix/fast_thread_local.rs
+++ b/src/libstd/sys/unix/fast_thread_local.rs
@@ -15,28 +15,8 @@
target_os = "emscripten"
))]
pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) {
- use crate::mem;
use crate::sys_common::thread_local::register_dtor_fallback;
- extern "C" {
- #[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 "C" fn(
- dtor: unsafe extern "C" 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);
}
--
2.20.1