]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: move pthread_key_*, pthread_get/setspecific
authorgfleury <gfleury@disroot.org>
Fri, 13 Jun 2025 18:43:48 +0000 (20:43 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 15 Jun 2025 19:21:12 +0000 (21:21 +0200)
Signed-off-by: gfleury <gfleury@disroot.org>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-ID: <20250613184440.1660335-1-gfleury@disroot.org>

16 files changed:
htl/Makefile
htl/Versions
htl/pt-initialize.c
htl/pt-internal.h
sysdeps/htl/libc-lockP.h
sysdeps/htl/pt-destroy-specific.c
sysdeps/htl/pt-getspecific.c
sysdeps/htl/pt-key-create.c
sysdeps/htl/pt-key-delete.c
sysdeps/htl/pt-setspecific.c
sysdeps/htl/pthread-functions.h
sysdeps/htl/pthreadP.h
sysdeps/mach/hurd/i386/libc.abilist
sysdeps/mach/hurd/i386/libpthread.abilist
sysdeps/mach/hurd/x86_64/libc.abilist
sysdeps/mach/hurd/x86_64/libpthread.abilist

index 603af24ce47e31033264ad495c6bb8e746fc552b..c4780479e35989432085dd1acf26151c533f9704 100644 (file)
@@ -25,12 +25,7 @@ SYSDEPS := lockfile
 LCLHDRS :=
 
 libpthread-routines := \
-  pt-destroy-specific \
   pt-init-specific \
-  pt-key-create \
-  pt-key-delete \
-  pt-getspecific \
-  pt-setspecific \
   pt-alloc \
   pt-create \
   pt-getattr \
@@ -161,7 +156,11 @@ routines := \
   pt-condattr-init \
   pt-condattr-setclock \
   pt-condattr-setpshared \
+  pt-destroy-specific \
   pt-getschedparam \
+  pt-getspecific \
+  pt-key-create \
+  pt-key-delete \
   pt-mutex-checklocked \
   pt-mutex-consistent \
   pt-mutex-destroy \
@@ -205,6 +204,7 @@ routines := \
   pt-setcancelstate \
   pt-setcanceltype \
   pt-setschedparam \
+  pt-setspecific \
   pt-sigmask \
   pt-sigstate \
   pt-sigstate-destroy \
index a07a3b3708501171bc8e28a44544b82337fb05f6..0052f82264d5f7b352279f641323f985aa0dad67 100644 (file)
@@ -2,6 +2,7 @@ libc {
 
   GLIBC_2.12 {
     pthread_self;
+    __pthread_key_create;
     __pthread_self;
     pthread_attr_getdetachstate;
     pthread_attr_getinheritsched;
@@ -12,6 +13,7 @@ libc {
     pthread_attr_setschedpolicy;
     pthread_equal;
     pthread_getschedparam;
+    pthread_getspecific;
     pthread_setschedparam;
     pthread_attr_destroy;
     pthread_attr_getguardsize;
@@ -45,6 +47,8 @@ libc {
     pthread_condattr_getpshared;
     pthread_condattr_setclock;
     pthread_condattr_setpshared;
+    pthread_key_create;
+    pthread_key_delete;
     pthread_mutex_destroy;
     pthread_mutex_getprioceiling;
     pthread_mutex_init;
@@ -79,6 +83,7 @@ libc {
     pthread_rwlockattr_setpshared;
     pthread_setcancelstate;
     pthread_setcanceltype;
+    pthread_setspecific;
     pthread_sigmask;
   }
 
@@ -154,6 +159,9 @@ libc {
     pthread_barrierattr_getpshared;
     pthread_barrierattr_init;
     pthread_barrierattr_setpshared;
+    pthread_getspecific;
+    pthread_key_create;
+    pthread_key_delete;
     pthread_mutex_consistent; pthread_mutex_consistent_np;
     pthread_mutex_getprioceiling;
     pthread_mutex_setprioceiling;
@@ -174,6 +182,7 @@ libc {
     pthread_rwlockattr_getpshared;
     pthread_rwlockattr_init;
     pthread_rwlockattr_setpshared;
+    pthread_setspecific;
   }
 
   GLIBC_PRIVATE {
@@ -203,6 +212,9 @@ libc {
     __pthread_cond_wait;
     __pthread_condattr_init;
     __pthread_default_condattr;
+    __pthread_destroy_specific;
+    __pthread_getspecific;
+    __pthread_key_delete;
     __pthread_mutex_checklocked;
     __pthread_mutex_destroy;
     __pthread_mutex_init;
@@ -214,6 +226,7 @@ libc {
     __pthread_mutexattr_init;
     __pthread_mutexattr_settype;
     __pthread_once;
+    __pthread_setspecific;
     __pthread_sigstate;
     __pthread_sigstate_destroy;
     __pthread_sigmask;
@@ -255,20 +268,16 @@ libpthread {
     pthread_getattr_np;
 
     pthread_getconcurrency; pthread_getcpuclockid;
-    pthread_getspecific;
 
     pthread_join;
 
-    pthread_key_create; pthread_key_delete;
-    __pthread_key_create;
-
     pthread_kill;
     __pthread_kill;
 
     pthread_mutex_transfer_np;
 
     pthread_setconcurrency;
-    pthread_setschedprio; pthread_setspecific;
+    pthread_setschedprio;
 
     pthread_testcancel;
     pthread_yield;
@@ -315,8 +324,6 @@ libpthread {
     __cthread_keycreate;
     __cthread_getspecific;
     __cthread_setspecific;
-    __pthread_getspecific;
-    __pthread_setspecific;
     __pthread_getattr_np;
     __pthread_enable_asynccancel;
     __pthread_disable_asynccancel;
index 658ba1eaf37a8a6dc172d697c376de9c7f4c3cc8..cd8b4678cdf1a81955db61aac93e71b645310bb3 100644 (file)
@@ -30,9 +30,6 @@ static const struct pthread_functions pthread_functions = {
   .ptr___pthread_exit = __pthread_exit,
   .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack,
   .ptr_pthread_once = __pthread_once,
-  .ptr___pthread_key_create = __pthread_key_create,
-  .ptr___pthread_getspecific = __pthread_getspecific,
-  .ptr___pthread_setspecific = __pthread_setspecific,
   .ptr__IO_flockfile = _cthreads_flockfile,
   .ptr__IO_funlockfile = _cthreads_funlockfile,
   .ptr__IO_ftrylockfile = _cthreads_ftrylockfile,
index d19579b33bb95af62a600a35f57b23dd881983ec..8b37838b8ea554a95cfe425e6d4d4744f5e341e2 100644 (file)
@@ -299,6 +299,7 @@ extern error_t __pthread_init_specific (struct __pthread *thread);
 /* Call the destructors on all of the thread specific data in THREAD.
    THREAD must be the calling thread.  */
 extern void __pthread_destroy_specific (struct __pthread *thread);
+libc_hidden_proto (__pthread_destroy_specific)
 
 
 /* Initialize newly create thread *THREAD's signal state data
index 092eb358317c760709f0eae9e9cabc0e9a87d581..e9977e46a1a9973fc78e6b7858636fb202acf97d 100644 (file)
@@ -126,15 +126,9 @@ libc_hidden_proto (__pthread_setcancelstate)
    single-threaded processes.  */
 #if !defined(__NO_WEAK_PTHREAD_ALIASES) && !IS_IN (libpthread)
 # ifdef weak_extern
-weak_extern (__pthread_key_create)
-weak_extern (__pthread_setspecific)
-weak_extern (__pthread_getspecific)
 weak_extern (__pthread_initialize)
 weak_extern (__pthread_atfork)
 # else
-#  pragma weak __pthread_key_create
-#  pragma weak __pthread_setspecific
-#  pragma weak __pthread_getspecific
 #  pragma weak __pthread_initialize
 #  pragma weak __pthread_atfork
 # endif
index e63b8075d1531423682b6a4961ce3e4d047c1732..b5eb0ba37a49099f2230b6ddec6284b4626fadee 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 
 #include <pt-internal.h>
+#include <string.h>
 
 void
 __pthread_destroy_specific (struct __pthread *thread)
@@ -100,3 +101,4 @@ __pthread_destroy_specific (struct __pthread *thread)
   memset (&thread->static_thread_specifics, 0,
          sizeof (thread->static_thread_specifics));
 }
+libc_hidden_def (__pthread_destroy_specific)
index 0052ce8f7a0006a81ea92faa94ef47c9ee48cd0c..d3ebb31dd4e4e7f14d07447631d05df41ea85241 100644 (file)
@@ -19,6 +19,7 @@
 #include <pthread.h>
 
 #include <pt-internal.h>
+#include <shlib-compat.h>
 
 void *
 __pthread_getspecific (pthread_key_t key)
@@ -42,5 +43,9 @@ __pthread_getspecific (pthread_key_t key)
 
   return self->thread_specifics[key];
 }
-weak_alias (__pthread_getspecific, pthread_getspecific);
-hidden_def (__pthread_getspecific)
+libc_hidden_def (__pthread_getspecific)
+versioned_symbol (libc, __pthread_getspecific, pthread_getspecific, GLIBC_2_42);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42)
+compat_symbol (libpthread, __pthread_getspecific, pthread_getspecific, GLIBC_2_12);
+#endif
index cf8a8d15a584fd906c6c6da20c4e3549ff278b85..92a9db8f1ee95128fe51a5e4ac455f3dcba1d513 100644 (file)
@@ -22,6 +22,9 @@
 
 #include <pt-internal.h>
 #include <pthreadP.h>
+#include <shlib-compat.h>
+#include <ldsodefs.h>
+
 
 pthread_mutex_t __pthread_key_lock;
 pthread_once_t __pthread_key_once = PTHREAD_ONCE_INIT;
@@ -116,5 +119,9 @@ do_search:
   __pthread_mutex_unlock (&__pthread_key_lock);
   return 0;
 }
-weak_alias (__pthread_key_create, pthread_key_create)
-hidden_def (__pthread_key_create)
+libc_hidden_def (__pthread_key_create)
+versioned_symbol (libc, __pthread_key_create, pthread_key_create, GLIBC_2_42);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42)
+compat_symbol (libpthread, __pthread_key_create, pthread_key_create, GLIBC_2_12);
+#endif
index 79879e99b7714258871b83be82c99871aa5ffb38..666314f2866bc25acb25f70fea603adb21972bbc 100644 (file)
@@ -19,6 +19,8 @@
 #include <pthread.h>
 
 #include <pt-internal.h>
+#include <shlib-compat.h>
+#include <ldsodefs.h>
 
 int
 __pthread_key_delete (pthread_key_t key)
@@ -69,4 +71,9 @@ __pthread_key_delete (pthread_key_t key)
 
   return err;
 }
-weak_alias (__pthread_key_delete, pthread_key_delete)
+libc_hidden_def (__pthread_key_delete)
+versioned_symbol (libc, __pthread_key_delete, pthread_key_delete, GLIBC_2_42);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42)
+compat_symbol (libpthread, __pthread_key_delete, pthread_key_delete, GLIBC_2_12);
+#endif
index dfd55b62251fc65fa42f6a7d979097a017cf8bbf..0535225264ebab8797baf652df2f1f8dbd746ecd 100644 (file)
@@ -19,6 +19,8 @@
 #include <pthread.h>
 
 #include <pt-internal.h>
+#include <shlib-compat.h>
+#include <string.h>
 
 int
 __pthread_setspecific (pthread_key_t key, const void *value)
@@ -68,5 +70,9 @@ __pthread_setspecific (pthread_key_t key, const void *value)
   self->thread_specifics[key] = (void *) value;
   return 0;
 }
-weak_alias (__pthread_setspecific, pthread_setspecific);
-hidden_def (__pthread_setspecific)
+libc_hidden_def (__pthread_setspecific)
+versioned_symbol (libc, __pthread_setspecific, pthread_setspecific, GLIBC_2_42);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_42)
+compat_symbol (libpthread, __pthread_setspecific, pthread_setspecific, GLIBC_2_12);
+#endif
index 467d0312e1ade9750b7a6691b4d826225cc09e45..31d85cc80c74820f320c188e7415e85ffce1cb2b 100644 (file)
@@ -24,9 +24,6 @@
 void __pthread_exit (void *) __attribute__ ((__noreturn__));
 struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
 int __pthread_once (pthread_once_t *, void (*) (void));
-int __pthread_key_create (pthread_key_t *, void (*) (void *));
-void *__pthread_getspecific (pthread_key_t);
-int __pthread_setspecific (pthread_key_t, const void *);
 
 void _cthreads_flockfile (FILE *);
 void _cthreads_funlockfile (FILE *);
@@ -40,9 +37,6 @@ struct pthread_functions
   void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__));
   struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void);
   int (*ptr_pthread_once) (pthread_once_t *, void (*) (void));
-  int (*ptr___pthread_key_create) (pthread_key_t *, void (*) (void *));
-  void *(*ptr___pthread_getspecific) (pthread_key_t);
-  int (*ptr___pthread_setspecific) (pthread_key_t, const void *);
   void (*ptr__IO_flockfile) (FILE *);
   void (*ptr__IO_funlockfile) (FILE *);
   int (*ptr__IO_ftrylockfile) (FILE *);
index 535deeb89fd1ce138d2e52bf07e4653c716b9b4b..64db024cc893a9cf09ac8c8d954795dc34e504a6 100644 (file)
@@ -182,9 +182,13 @@ int __cthread_keycreate (__cthread_key_t *);
 int __cthread_getspecific (__cthread_key_t, void **);
 int __cthread_setspecific (__cthread_key_t, void *);
 int __pthread_key_create (pthread_key_t *key, void (*destr) (void *));
+libc_hidden_proto (__pthread_key_create)
 void *__pthread_getspecific (pthread_key_t key);
+libc_hidden_proto (__pthread_getspecific)
 int __pthread_setspecific (pthread_key_t key, const void *value);
+libc_hidden_proto (__pthread_setspecific)
 int __pthread_key_delete (pthread_key_t key);
+libc_hidden_proto (__pthread_key_delete)
 int __pthread_once (pthread_once_t *once_control, void (*init_routine) (void));
 
 int __pthread_getattr_np (pthread_t, pthread_attr_t *);
@@ -216,9 +220,6 @@ libc_hidden_proto (__pthread_condattr_init)
 #if IS_IN (libpthread)
 hidden_proto (__pthread_create)
 hidden_proto (__pthread_detach)
-hidden_proto (__pthread_key_create)
-hidden_proto (__pthread_getspecific)
-hidden_proto (__pthread_setspecific)
 hidden_proto (__pthread_get_cleanup_stack)
 #endif
 
index 3e183f5c02ea05a31fb098239e98608de225f258..89a41a30c6a60a60b4202c0b1791fd32da193cc2 100644 (file)
@@ -28,6 +28,7 @@ GLIBC_2.11 mkostemps F
 GLIBC_2.11 mkostemps64 F
 GLIBC_2.11 mkstemps F
 GLIBC_2.11 mkstemps64 F
+GLIBC_2.12 __pthread_key_create F
 GLIBC_2.12 __pthread_self F
 GLIBC_2.12 pthread_attr_destroy F
 GLIBC_2.12 pthread_attr_getdetachstate F
@@ -70,6 +71,9 @@ GLIBC_2.12 pthread_condattr_setclock F
 GLIBC_2.12 pthread_condattr_setpshared F
 GLIBC_2.12 pthread_equal F
 GLIBC_2.12 pthread_getschedparam F
+GLIBC_2.12 pthread_getspecific F
+GLIBC_2.12 pthread_key_create F
+GLIBC_2.12 pthread_key_delete F
 GLIBC_2.12 pthread_mutex_destroy F
 GLIBC_2.12 pthread_mutex_getprioceiling F
 GLIBC_2.12 pthread_mutex_init F
@@ -106,6 +110,7 @@ GLIBC_2.12 pthread_self F
 GLIBC_2.12 pthread_setcancelstate F
 GLIBC_2.12 pthread_setcanceltype F
 GLIBC_2.12 pthread_setschedparam F
+GLIBC_2.12 pthread_setspecific F
 GLIBC_2.12 pthread_sigmask F
 GLIBC_2.13 __fentry__ F
 GLIBC_2.14 syncfs F
@@ -2593,6 +2598,9 @@ GLIBC_2.42 pthread_barrierattr_destroy F
 GLIBC_2.42 pthread_barrierattr_getpshared F
 GLIBC_2.42 pthread_barrierattr_init F
 GLIBC_2.42 pthread_barrierattr_setpshared F
+GLIBC_2.42 pthread_getspecific F
+GLIBC_2.42 pthread_key_create F
+GLIBC_2.42 pthread_key_delete F
 GLIBC_2.42 pthread_mutex_consistent F
 GLIBC_2.42 pthread_mutex_consistent_np F
 GLIBC_2.42 pthread_mutex_getprioceiling F
@@ -2614,6 +2622,7 @@ GLIBC_2.42 pthread_rwlockattr_destroy F
 GLIBC_2.42 pthread_rwlockattr_getpshared F
 GLIBC_2.42 pthread_rwlockattr_init F
 GLIBC_2.42 pthread_rwlockattr_setpshared F
+GLIBC_2.42 pthread_setspecific F
 GLIBC_2.42 uabs F
 GLIBC_2.42 uimaxabs F
 GLIBC_2.42 ulabs F
index b067d377b38d9e58dc17995e803d8bfcd22325fe..51535ac1c458819be7a99ee5a7b6dbea8b1eb4dc 100644 (file)
@@ -1,7 +1,6 @@
 GLIBC_2.12 __mutex_lock_solid F
 GLIBC_2.12 __mutex_unlock_solid F
 GLIBC_2.12 __pthread_get_cleanup_stack F
-GLIBC_2.12 __pthread_key_create F
 GLIBC_2.12 __pthread_kill F
 GLIBC_2.12 __pthread_mutex_transfer_np F
 GLIBC_2.12 __pthread_spin_destroy F
@@ -29,15 +28,11 @@ GLIBC_2.12 pthread_exit F
 GLIBC_2.12 pthread_getattr_np F
 GLIBC_2.12 pthread_getconcurrency F
 GLIBC_2.12 pthread_getcpuclockid F
-GLIBC_2.12 pthread_getspecific F
 GLIBC_2.12 pthread_join F
-GLIBC_2.12 pthread_key_create F
-GLIBC_2.12 pthread_key_delete F
 GLIBC_2.12 pthread_kill F
 GLIBC_2.12 pthread_mutex_transfer_np F
 GLIBC_2.12 pthread_setconcurrency F
 GLIBC_2.12 pthread_setschedprio F
-GLIBC_2.12 pthread_setspecific F
 GLIBC_2.12 pthread_spin_destroy F
 GLIBC_2.12 pthread_spin_init F
 GLIBC_2.12 pthread_spin_lock F
index 688ee26f4b25d0601216eee38ae01e749eb4ff9b..3e9ce8ba9c2cce1e0f684ea9973ad631812def4b 100644 (file)
@@ -392,6 +392,7 @@ GLIBC_2.38 __profile_frequency F
 GLIBC_2.38 __progname D 0x8
 GLIBC_2.38 __progname_full D 0x8
 GLIBC_2.38 __pthread_get_cleanup_stack F
+GLIBC_2.38 __pthread_key_create F
 GLIBC_2.38 __pthread_self F
 GLIBC_2.38 __ptsname_r_chk F
 GLIBC_2.38 __pwrite64 F
@@ -1554,6 +1555,9 @@ GLIBC_2.38 pthread_condattr_setpshared F
 GLIBC_2.38 pthread_equal F
 GLIBC_2.38 pthread_exit F
 GLIBC_2.38 pthread_getschedparam F
+GLIBC_2.38 pthread_getspecific F
+GLIBC_2.38 pthread_key_create F
+GLIBC_2.38 pthread_key_delete F
 GLIBC_2.38 pthread_mutex_clocklock F
 GLIBC_2.38 pthread_mutex_consistent F
 GLIBC_2.38 pthread_mutex_consistent_np F
@@ -1599,6 +1603,7 @@ GLIBC_2.38 pthread_self F
 GLIBC_2.38 pthread_setcancelstate F
 GLIBC_2.38 pthread_setcanceltype F
 GLIBC_2.38 pthread_setschedparam F
+GLIBC_2.38 pthread_setspecific F
 GLIBC_2.38 pthread_sigmask F
 GLIBC_2.38 ptrace F
 GLIBC_2.38 ptsname F
@@ -2276,6 +2281,9 @@ GLIBC_2.42 pthread_barrierattr_destroy F
 GLIBC_2.42 pthread_barrierattr_getpshared F
 GLIBC_2.42 pthread_barrierattr_init F
 GLIBC_2.42 pthread_barrierattr_setpshared F
+GLIBC_2.42 pthread_getspecific F
+GLIBC_2.42 pthread_key_create F
+GLIBC_2.42 pthread_key_delete F
 GLIBC_2.42 pthread_mutex_consistent F
 GLIBC_2.42 pthread_mutex_consistent_np F
 GLIBC_2.42 pthread_mutex_getprioceiling F
@@ -2297,6 +2305,7 @@ GLIBC_2.42 pthread_rwlockattr_destroy F
 GLIBC_2.42 pthread_rwlockattr_getpshared F
 GLIBC_2.42 pthread_rwlockattr_init F
 GLIBC_2.42 pthread_rwlockattr_setpshared F
+GLIBC_2.42 pthread_setspecific F
 GLIBC_2.42 uabs F
 GLIBC_2.42 uimaxabs F
 GLIBC_2.42 ulabs F
index 6b8acec832697c78859cbd0c952b97c3c0120303..a1ff462ba98973ee63253acbe687b03426460615 100644 (file)
@@ -6,7 +6,6 @@ GLIBC_2.38 __h_errno_location F
 GLIBC_2.38 __mutex_lock_solid F
 GLIBC_2.38 __mutex_unlock_solid F
 GLIBC_2.38 __pthread_get_cleanup_stack F
-GLIBC_2.38 __pthread_key_create F
 GLIBC_2.38 __pthread_kill F
 GLIBC_2.38 __pthread_mutex_transfer_np F
 GLIBC_2.38 __pthread_spin_destroy F
@@ -47,17 +46,13 @@ GLIBC_2.38 pthread_exit F
 GLIBC_2.38 pthread_getattr_np F
 GLIBC_2.38 pthread_getconcurrency F
 GLIBC_2.38 pthread_getcpuclockid F
-GLIBC_2.38 pthread_getspecific F
 GLIBC_2.38 pthread_hurd_cond_timedwait_np F
 GLIBC_2.38 pthread_hurd_cond_wait_np F
 GLIBC_2.38 pthread_join F
-GLIBC_2.38 pthread_key_create F
-GLIBC_2.38 pthread_key_delete F
 GLIBC_2.38 pthread_kill F
 GLIBC_2.38 pthread_mutex_transfer_np F
 GLIBC_2.38 pthread_setconcurrency F
 GLIBC_2.38 pthread_setschedprio F
-GLIBC_2.38 pthread_setspecific F
 GLIBC_2.38 pthread_spin_destroy F
 GLIBC_2.38 pthread_spin_init F
 GLIBC_2.38 pthread_spin_lock F