1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
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
diff --git a/htl/Makefile b/htl/Makefile
index 310097914f..603af24ce4 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -31,7 +31,6 @@ libpthread-routines := \
pt-key-delete \
pt-getspecific \
pt-setspecific \
- pt-once \
pt-alloc \
pt-create \
pt-getattr \
@@ -186,6 +185,7 @@ routines := \
pt-mutexattr-setrobust \
pt-mutexattr-settype \
pt-nthreads \
+ pt-once \
pt-pthread_self \
pt-self pt-equal \
pt-setschedparam \
diff --git a/htl/Versions b/htl/Versions
index 3d2cb4e7a4..a07a3b3708 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -63,6 +63,7 @@ libc {
pthread_mutexattr_setprotocol;
pthread_mutexattr_setpshared;
pthread_mutexattr_settype;
+ pthread_once;
pthread_sigmask;
}
@@ -158,6 +159,7 @@ libc {
pthread_mutexattr_setpshared;
pthread_mutexattr_setrobust; pthread_mutexattr_setrobust_np;
pthread_mutexattr_settype;
+ pthread_once;
pthread_sigmask;
}
@@ -211,6 +213,7 @@ libc {
__pthread_mutexattr_destroy;
__pthread_mutexattr_init;
__pthread_mutexattr_settype;
+ __pthread_once;
__pthread_sigstate;
__pthread_sigstate_destroy;
__pthread_sigmask;
@@ -264,8 +267,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;
diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h
index 5085570baa..092eb35831 100644
--- a/sysdeps/htl/libc-lockP.h
+++ b/sysdeps/htl/libc-lockP.h
@@ -114,6 +114,7 @@ libc_hidden_proto (__pthread_rwlock_unlock)
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),
@@ -128,7 +129,6 @@ libc_hidden_proto (__pthread_setcancelstate)
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)
@@ -128,7 +129,6 @@ libc_hidden_proto (__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
diff --git a/sysdeps/htl/pt-once.c b/sysdeps/htl/pt-once.c
index 68fb2e1129..1f999ce492 100644
--- a/sysdeps/htl/pt-once.c
+++ b/sysdeps/htl/pt-once.c
@@ -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
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index bf62539c57..461df01ffb 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -88,6 +88,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
@@ -2595,6 +2596,7 @@ GLIBC_2.42 pthread_mutex_consistent_np 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
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index d9c1a1790a..b067d377b3 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -35,7 +35,6 @@ GLIBC_2.12 pthread_key_create 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
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index fb068ab45e..6f235d20ba 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -1579,6 +1579,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
@@ -2278,6 +2279,7 @@ GLIBC_2.42 pthread_mutex_consistent_np 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
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index 71ce1d6288..6b8acec832 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -55,7 +55,6 @@ GLIBC_2.38 pthread_key_create 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
|