local-pthread_once
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Thu, 17 Jul 2025 11:21:32 +0000 (13:21 +0200)
committerAurelien Jarno <aurel32@debian.org>
Thu, 17 Jul 2025 11:21:32 +0000 (13:21 +0200)
Note: compared to upstream, this was changed to exposing pthread_once as version

2.41. When 2.42 gets integrated, we'll want to keep the 2.41 symbol until we
rebuild packages against the 2.42 symbol. This is done by
local-pthread_once-2.42.diff which is to be used instead of
local-pthread_once.diff in 2.42

commit ccdb68e829a31e4cda8339ea0d2dc3e51fb81ba5
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Mar 2 15:16:45 2025 +0100

    htl: move pthread_once into libc

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name local-pthread_once.diff

htl/Makefile
htl/Versions
sysdeps/htl/libc-lockP.h
sysdeps/htl/pt-once.c
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 551d4c01d3205025c4f961d32c58af99740d7cb1..db411e679e86698fa983e421a7de543e8abfc05d 100644 (file)
@@ -39,7 +39,6 @@ libpthread-routines := \
   pt-key-delete \
   pt-getspecific \
   pt-setspecific \
-  pt-once \
   pt-alloc \
   pt-create \
   pt-getattr \
@@ -202,6 +201,7 @@ routines := \
   pt-mutexattr-setrobust \
   pt-mutexattr-settype \
   pt-nthreads \
+  pt-once \
   pt-pthread_self \
   pt-self pt-equal \
   pt-setschedparam \
index f1393ebe34611a9aceb9d90d812b7cfe5eaecd8f..e574e3def1de306147c9c93e1906939f0c98ed10 100644 (file)
@@ -48,6 +48,7 @@ libc {
     pthread_mutexattr_setprotocol;
     pthread_mutexattr_setpshared;
     pthread_mutexattr_settype;
+    pthread_once;
     pthread_sigmask;
   }
 
@@ -106,6 +107,7 @@ libc {
     pthread_mutexattr_setpshared;
     pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np;
     pthread_mutexattr_settype;
+    pthread_once;
     pthread_sigmask;
   }
 
@@ -140,6 +142,7 @@ libc {
     __pthread_mutexattr_destroy;
     __pthread_mutexattr_init;
     __pthread_mutexattr_settype;
+    __pthread_once;
     __pthread_sigstate;
     __pthread_sigstate_destroy;
     __pthread_sigmask;
@@ -200,8 +203,6 @@ libpthread {
     pthread_mutex_timedlock; pthread_mutex_transfer_np;
     pthread_mutex_trylock; pthread_mutex_unlock;
 
-    pthread_once;
-
     pthread_rwlock_destroy; pthread_rwlock_init; pthread_rwlock_rdlock;
     pthread_rwlock_timedrdlock; pthread_rwlock_timedwrlock;
     pthread_rwlock_tryrdlock; pthread_rwlock_trywrlock;
index a3a53e8833a56452f4c5000919aa3cc38eba0a25..f909ca0fe40c2b9675a528cb510968c93e0defbd 100644 (file)
@@ -111,6 +111,7 @@ extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
 
 extern int __pthread_once (pthread_once_t *__once_control,
                           void (*__init_routine) (void));
+libc_hidden_proto (__pthread_once);
 
 extern int __pthread_atfork (void (*__prepare) (void),
                             void (*__parent) (void),
@@ -136,7 +137,6 @@ weak_extern (__pthread_rwlock_unlock)
 weak_extern (__pthread_key_create)
 weak_extern (__pthread_setspecific)
 weak_extern (__pthread_getspecific)
-weak_extern (__pthread_once)
 weak_extern (__pthread_initialize)
 weak_extern (__pthread_atfork)
 weak_extern (__pthread_setcancelstate)
@@ -156,7 +156,6 @@ weak_extern (__pthread_setcancelstate)
 #  pragma weak __pthread_key_create
 #  pragma weak __pthread_setspecific
 #  pragma weak __pthread_getspecific
-#  pragma weak __pthread_once
 #  pragma weak __pthread_initialize
 #  pragma weak __pthread_atfork
 #  pragma weak __pthread_setcancelstate
index 68fb2e1129ddbbcaf04716b31c687cd8d135a2da..019dccbfad2682fd2dce0dbd00d622fa134d591e 100644 (file)
@@ -20,6 +20,7 @@
 #include <atomic.h>
 
 #include <pt-internal.h>
+#include <shlib-compat.h>
 
 static void
 clear_once_control (void *arg)
@@ -53,4 +54,9 @@ __pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
 
   return 0;
 }
-weak_alias (__pthread_once, pthread_once);
+libc_hidden_def (__pthread_once)
+versioned_symbol (libc, __pthread_once, pthread_once, GLIBC_2_41);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_41)
+compat_symbol (libpthread, __pthread_once, pthread_once, GLIBC_2_12);
+#endif
index 40f35ee047a9871d2897901dd49a54718e5f253a..1c283f6e66d4bde2438d43dab083c60e581bc9e9 100644 (file)
@@ -73,6 +73,7 @@ GLIBC_2.12 pthread_mutexattr_setprioceiling F
 GLIBC_2.12 pthread_mutexattr_setprotocol F
 GLIBC_2.12 pthread_mutexattr_setpshared F
 GLIBC_2.12 pthread_mutexattr_settype F
+GLIBC_2.12 pthread_once F
 GLIBC_2.12 pthread_self F
 GLIBC_2.12 pthread_setschedparam F
 GLIBC_2.12 pthread_sigmask F
@@ -2547,6 +2548,7 @@ GLIBC_2.41 pthread_mutexattr_setpshared F
 GLIBC_2.41 pthread_mutexattr_setrobust F
 GLIBC_2.41 pthread_mutexattr_setrobust_np F
 GLIBC_2.41 pthread_mutexattr_settype F
+GLIBC_2.41 pthread_once F
 GLIBC_2.41 pthread_sigmask F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
index b925871a0bf2906ad6648702c576d35a2af80be2..1d0e6ed9af26e9718f2ed8c7d6605169afacb4df 100644 (file)
@@ -50,7 +50,6 @@ GLIBC_2.12 pthread_mutex_timedlock F
 GLIBC_2.12 pthread_mutex_transfer_np F
 GLIBC_2.12 pthread_mutex_trylock F
 GLIBC_2.12 pthread_mutex_unlock F
-GLIBC_2.12 pthread_once F
 GLIBC_2.12 pthread_rwlock_destroy F
 GLIBC_2.12 pthread_rwlock_init F
 GLIBC_2.12 pthread_rwlock_rdlock F
index aaf55cbaf4e92e2bd1a0bba7cd0e3ed0d754f6d2..e18708e23f9a7ed56c1e43b83079159b40851afc 100644 (file)
@@ -1565,6 +1565,7 @@ GLIBC_2.38 pthread_mutexattr_setpshared F
 GLIBC_2.38 pthread_mutexattr_setrobust F
 GLIBC_2.38 pthread_mutexattr_setrobust_np F
 GLIBC_2.38 pthread_mutexattr_settype F
+GLIBC_2.38 pthread_once F
 GLIBC_2.38 pthread_self F
 GLIBC_2.38 pthread_setcancelstate F
 GLIBC_2.38 pthread_setcanceltype F
@@ -2236,6 +2237,7 @@ GLIBC_2.41 pthread_mutexattr_setpshared F
 GLIBC_2.41 pthread_mutexattr_setrobust F
 GLIBC_2.41 pthread_mutexattr_setrobust_np F
 GLIBC_2.41 pthread_mutexattr_settype F
+GLIBC_2.41 pthread_once F
 GLIBC_2.41 pthread_sigmask F
 HURD_CTHREADS_0.3 __cthread_getspecific F
 HURD_CTHREADS_0.3 __cthread_keycreate F
index 608901fb0014785849846cc96451bcd9e992067a..fc075d5d9215728c45b7ce0e65086425e1fab98c 100644 (file)
@@ -73,7 +73,6 @@ GLIBC_2.38 pthread_mutex_timedlock F
 GLIBC_2.38 pthread_mutex_transfer_np F
 GLIBC_2.38 pthread_mutex_trylock F
 GLIBC_2.38 pthread_mutex_unlock F
-GLIBC_2.38 pthread_once F
 GLIBC_2.38 pthread_rwlock_clockrdlock F
 GLIBC_2.38 pthread_rwlock_clockwrlock F
 GLIBC_2.38 pthread_rwlock_destroy F