From: gfleury <gfle...@disroot.org> Message-ID: <20250815181500.107433-16-gfle...@disroot.org> --- htl/Makefile | 2 +- htl/Versions | 5 +++-- htl/pt-detach.c | 10 ++++++++-- sysdeps/htl/pthreadP.h | 2 +- sysdeps/mach/hurd/i386/libc.abilist | 3 +++ sysdeps/mach/hurd/i386/libpthread.abilist | 1 - sysdeps/mach/hurd/x86_64/libc.abilist | 3 +++ sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 - 8 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/htl/Makefile b/htl/Makefile index 52f784a72d..4982409c77 100644 --- a/htl/Makefile +++ b/htl/Makefile @@ -26,7 +26,6 @@ LCLHDRS := libpthread-routines := \ pt-create \ - pt-detach \ pt-exit \ pt-initialize \ pt-join \ @@ -140,6 +139,7 @@ routines := \ pt-condattr-setpshared \ pt-dealloc \ pt-destroy-specific \ + pt-detach \ pt-docancel \ pt-getattr \ pt-getconcurrency \ diff --git a/htl/Versions b/htl/Versions index 4845742fc3..322c09f908 100644 --- a/htl/Versions +++ b/htl/Versions @@ -52,6 +52,7 @@ libc { pthread_condattr_getpshared; pthread_condattr_setclock; pthread_condattr_setpshared; + pthread_detach; pthread_getattr_np; pthread_getconcurrency; pthread_key_create; @@ -200,6 +201,7 @@ libc { GLIBC_2.43 { pthread_cancel; + pthread_detach; pthread_getattr_np; pthread_getconcurrency; pthread_getcpuclockid; @@ -295,7 +297,7 @@ libpthread { pthread_atfork; - pthread_create; pthread_detach; pthread_exit; + pthread_create; pthread_exit; pthread_join; @@ -336,7 +338,6 @@ libpthread { __cthread_detach; __cthread_fork; - __pthread_detach; __pthread_create; __cthread_keycreate; __cthread_getspecific; diff --git a/htl/pt-detach.c b/htl/pt-detach.c index a29b68b4b0..f0d43af7f6 100644 --- a/htl/pt-detach.c +++ b/htl/pt-detach.c @@ -21,6 +21,8 @@ #include <stddef.h> #include <pt-internal.h> +#include <shlib-compat.h> +#include <ldsodefs.h> /* Indicate that the storage for THREAD can be reclaimed when it terminates. */ @@ -71,5 +73,9 @@ __pthread_detach (pthread_t thread) return err; } -weak_alias (__pthread_detach, pthread_detach) -hidden_def (__pthread_detach) +libc_hidden_def (__pthread_detach) +versioned_symbol (libc, __pthread_detach, pthread_detach, GLIBC_2_43); + +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43) +compat_symbol (libpthread, __pthread_detach, pthread_detach, GLIBC_2_12); +#endif diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h index 0deea22e8a..98850e9f1d 100644 --- a/sysdeps/htl/pthreadP.h +++ b/sysdeps/htl/pthreadP.h @@ -180,6 +180,7 @@ int __pthread_create (pthread_t *newthread, void __cthread_detach (__cthread_t); int __pthread_detach (pthread_t __threadp); +libc_hidden_proto (__pthread_detach) void __pthread_exit (void *value) __attribute__ ((__noreturn__)); int __pthread_join (pthread_t, void **); int __cthread_keycreate (__cthread_key_t *); @@ -230,7 +231,6 @@ libc_hidden_proto (__pthread_get_cleanup_stack) #if IS_IN (libpthread) hidden_proto (__pthread_create) -hidden_proto (__pthread_detach) #endif #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread) diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index e795ff5ace..da2ad4ae66 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -73,6 +73,7 @@ GLIBC_2.12 pthread_condattr_getpshared F GLIBC_2.12 pthread_condattr_init F GLIBC_2.12 pthread_condattr_setclock F GLIBC_2.12 pthread_condattr_setpshared F +GLIBC_2.12 pthread_detach F GLIBC_2.12 pthread_equal F GLIBC_2.12 pthread_getattr_np F GLIBC_2.12 pthread_getconcurrency F @@ -2646,6 +2647,7 @@ GLIBC_2.42 uimaxabs F GLIBC_2.42 ulabs F GLIBC_2.42 ullabs F GLIBC_2.43 pthread_cancel F +GLIBC_2.43 pthread_detach F GLIBC_2.43 pthread_getattr_np F GLIBC_2.43 pthread_getconcurrency F GLIBC_2.43 pthread_getcpuclockid F @@ -2720,6 +2722,7 @@ HURD_CTHREADS_0.3 __mutex_lock_solid F HURD_CTHREADS_0.3 __mutex_trylock F HURD_CTHREADS_0.3 __mutex_unlock F HURD_CTHREADS_0.3 __mutex_unlock_solid F +HURD_CTHREADS_0.3 __pthread_detach F HURD_CTHREADS_0.3 __pthread_getattr_np F HURD_CTHREADS_0.3 __spin_lock F HURD_CTHREADS_0.3 __spin_lock_init F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index bfec2a2ad3..094f7de25f 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -19,7 +19,6 @@ GLIBC_2.12 ftrylockfile F GLIBC_2.12 funlockfile F GLIBC_2.12 pthread_atfork F GLIBC_2.12 pthread_create F -GLIBC_2.12 pthread_detach F GLIBC_2.12 pthread_exit F GLIBC_2.12 pthread_join F GLIBC_2.12 pthread_spin_destroy F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index bebf927688..2e7e00773a 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -1555,6 +1555,7 @@ GLIBC_2.38 pthread_condattr_getpshared F GLIBC_2.38 pthread_condattr_init F GLIBC_2.38 pthread_condattr_setclock F GLIBC_2.38 pthread_condattr_setpshared F +GLIBC_2.38 pthread_detach F GLIBC_2.38 pthread_equal F GLIBC_2.38 pthread_exit F GLIBC_2.38 pthread_getattr_np F @@ -2328,6 +2329,7 @@ GLIBC_2.42 uimaxabs F GLIBC_2.42 ulabs F GLIBC_2.42 ullabs F GLIBC_2.43 pthread_cancel F +GLIBC_2.43 pthread_detach F GLIBC_2.43 pthread_getattr_np F GLIBC_2.43 pthread_getconcurrency F GLIBC_2.43 pthread_getcpuclockid F @@ -2346,6 +2348,7 @@ HURD_CTHREADS_0.3 __mutex_lock_solid F HURD_CTHREADS_0.3 __mutex_trylock F HURD_CTHREADS_0.3 __mutex_unlock F HURD_CTHREADS_0.3 __mutex_unlock_solid F +HURD_CTHREADS_0.3 __pthread_detach F HURD_CTHREADS_0.3 __pthread_getattr_np F HURD_CTHREADS_0.3 __spin_lock F HURD_CTHREADS_0.3 __spin_lock_init F diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist index 9164c479a1..926d31b9cf 100644 --- a/sysdeps/mach/hurd/x86_64/libpthread.abilist +++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist @@ -37,7 +37,6 @@ GLIBC_2.38 mtx_trylock F GLIBC_2.38 mtx_unlock F GLIBC_2.38 pthread_clockjoin_np F GLIBC_2.38 pthread_create F -GLIBC_2.38 pthread_detach F GLIBC_2.38 pthread_exit F GLIBC_2.38 pthread_hurd_cond_timedwait_np F GLIBC_2.38 pthread_hurd_cond_wait_np F -- 2.47.2