From f47f1d91af985a9028fb399da21eab460d887a15 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 21 May 2021 22:35:00 +0200 Subject: nptl: Move pthread_create, thrd_create into libc The symbols were moved using scripts/move-symbol-to-libc.py. The libpthread placeholder symbols need some changes because some symbol versions have gone away completely. But __errno_location@@GLIBC_2.0 still exists, so the GLIBC_2.0 version is still there. The internal __pthread_create symbol now points to the correct function, so the sysdeps/nptl/thrd_create.c override is no longer necessary. There was an issue how the hidden alias of pthread_getattr_default_np was defined, so this commit cleans up that aspects and removes the GLIBC_PRIVATE export altogether. Reviewed-by: Adhemerval Zanella --- sysdeps/pthread/Makefile | 3 +-- sysdeps/pthread/thrd_create.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'sysdeps/pthread') diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile index b15d085f51..bca642f438 100644 --- a/sysdeps/pthread/Makefile +++ b/sysdeps/pthread/Makefile @@ -31,8 +31,6 @@ headers += threads.h routines += thrd_current thrd_equal thrd_sleep thrd_yield -libpthread-routines += thrd_create - $(libpthread-routines-var) += \ call_once \ cnd_broadcast \ @@ -47,6 +45,7 @@ $(libpthread-routines-var) += \ mtx_timedlock \ mtx_trylock \ mtx_unlock \ + thrd_create \ thrd_detach \ thrd_exit \ thrd_join \ diff --git a/sysdeps/pthread/thrd_create.c b/sysdeps/pthread/thrd_create.c index 07848c0aab..3cb9f1cefb 100644 --- a/sysdeps/pthread/thrd_create.c +++ b/sysdeps/pthread/thrd_create.c @@ -17,9 +17,10 @@ . */ #include "thrd_priv.h" +#include int -thrd_create (thrd_t *thr, thrd_start_t func, void *arg) +__thrd_create (thrd_t *thr, thrd_start_t func, void *arg) { _Static_assert (sizeof (thrd_t) == sizeof (pthread_t), "sizeof (thrd_t) != sizeof (pthread_t)"); @@ -28,3 +29,11 @@ thrd_create (thrd_t *thr, thrd_start_t func, void *arg) (void* (*) (void*))func, arg); return thrd_err_map (err_code); } +#if PTHREAD_IN_LIBC +versioned_symbol (libc, __thrd_create, thrd_create, GLIBC_2_34); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34) +compat_symbol (libc, __thrd_create, thrd_create, GLIBC_2_28); +# endif +#else /* !PTHREAD_IN_LIBC */ +strong_alias (__thrd_create, thrd_create) +#endif -- cgit v1.2.3