aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgfleury <gfleury@disroot.org>2025-08-15 20:14:56 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-08-16 01:44:51 +0200
commita901f2599eff6ef8893d677cf9b0adf811d40587 (patch)
tree89739b5345f681171fde5c46df4954beab093784
parentd0667a77de6d637007cf22d3d2a83f6fd8412f87 (diff)
downloadglibc-a901f2599eff6ef8893d677cf9b0adf811d40587.zip
glibc-a901f2599eff6ef8893d677cf9b0adf811d40587.tar.gz
glibc-a901f2599eff6ef8893d677cf9b0adf811d40587.tar.bz2
htl: move pthread_detach into libc.
Message-ID: <20250815181500.107433-16-gfleury@disroot.org>
-rw-r--r--htl/Makefile2
-rw-r--r--htl/Versions5
-rw-r--r--htl/pt-detach.c10
-rw-r--r--sysdeps/htl/pthreadP.h2
-rw-r--r--sysdeps/mach/hurd/i386/libc.abilist3
-rw-r--r--sysdeps/mach/hurd/i386/libpthread.abilist1
-rw-r--r--sysdeps/mach/hurd/x86_64/libc.abilist3
-rw-r--r--sysdeps/mach/hurd/x86_64/libpthread.abilist1
8 files changed, 19 insertions, 8 deletions
diff --git a/htl/Makefile b/htl/Makefile
index 52f784a..4982409 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 4845742..322c09f 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 a29b68b..f0d43af 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 0deea22..98850e9 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 e795ff5..da2ad4a 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 bfec2a2..094f7de 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 bebf927..2e7e007 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 9164c47..926d31b 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