[PATCH 13/13] htl: move pthread_attr_init into libc.
gfleury
gfleury@disroot.org
Mon Nov 18 11:21:45 GMT 2024
Signed-off-by: gfleury <gfleury@disroot.org>
---
htl/Makefile | 2 +-
htl/Versions | 4 ++--
htl/forward.c | 2 --
htl/pt-initialize.c | 1 -
sysdeps/htl/pt-attr-init.c | 8 +++++++-
sysdeps/htl/pthread-functions.h | 2 --
sysdeps/htl/pthreadP.h | 2 ++
sysdeps/mach/hurd/i386/libc.abilist | 2 ++
sysdeps/mach/hurd/i386/libpthread.abilist | 1 -
sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 -
10 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/htl/Makefile b/htl/Makefile
index 94c4ed1b..cb8ddfd9 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -25,7 +25,6 @@ SYSDEPS := lockfile
LCLHDRS :=
libpthread-routines := \
- pt-attr-init \
pt-barrier-destroy \
pt-barrier-init \
pt-barrier-wait \
@@ -211,6 +210,7 @@ routines := \
pt-attr-setscope \
pt-attr-setschedparam \
pt-attr-setguardsize \
+ pt-attr-init \
# routines
shared-only-routines = forward
diff --git a/htl/Versions b/htl/Versions
index 24d96647..e116563d 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -24,6 +24,8 @@ libc {
pthread_attr_setstack;
pthread_attr_setscope;
pthread_attr_setschedparam;
+ pthread_attr_init;
+ __pthread_attr_init;
}
GLIBC_2.21 {
@@ -107,8 +109,6 @@ libpthread {
pthread_atfork;
- pthread_attr_init;
-
pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait;
pthread_barrierattr_destroy; pthread_barrierattr_getpshared;
pthread_barrierattr_init; pthread_barrierattr_setpshared;
diff --git a/htl/forward.c b/htl/forward.c
index 179ec60b..7c0e16dc 100644
--- a/htl/forward.c
+++ b/htl/forward.c
@@ -53,8 +53,6 @@ name decl \
#define FORWARD(name, decl, params, defretval) \
FORWARD2 (name, int, decl, params, return defretval)
-FORWARD (pthread_attr_init, (pthread_attr_t *attr), (attr), 0)
-
FORWARD (pthread_condattr_destroy, (pthread_condattr_t *attr), (attr), 0)
FORWARD (pthread_condattr_init, (pthread_condattr_t *attr), (attr), 0)
diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c
index 835d7412..b082a13b 100644
--- a/htl/pt-initialize.c
+++ b/htl/pt-initialize.c
@@ -27,7 +27,6 @@
#if IS_IN (libpthread)
static const struct pthread_functions pthread_functions = {
- .ptr_pthread_attr_init = __pthread_attr_init,
.ptr_pthread_condattr_destroy = __pthread_condattr_destroy,
.ptr_pthread_condattr_init = __pthread_condattr_init,
.ptr_pthread_cond_broadcast = __pthread_cond_broadcast,
diff --git a/sysdeps/htl/pt-attr-init.c b/sysdeps/htl/pt-attr-init.c
index b01eb9ea..959df0cb 100644
--- a/sysdeps/htl/pt-attr-init.c
+++ b/sysdeps/htl/pt-attr-init.c
@@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <pthread.h>
+#include <shlib-compat.h>
#include <pt-internal.h>
int
@@ -27,4 +28,9 @@ __pthread_attr_init (pthread_attr_t *attr)
*attr = __pthread_default_attr;
return 0;
}
-weak_alias (__pthread_attr_init, pthread_attr_init);
+libc_hidden_def (__pthread_attr_init)
+versioned_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_21);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_21)
+compat_symbol (libc, __pthread_attr_init, pthread_attr_init, GLIBC_2_12);
+#endif
diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h
index d760b929..c2caed25 100644
--- a/sysdeps/htl/pthread-functions.h
+++ b/sysdeps/htl/pthread-functions.h
@@ -21,7 +21,6 @@
#include <pthread.h>
-int __pthread_attr_init (pthread_attr_t *);
int __pthread_condattr_destroy (pthread_condattr_t *);
int __pthread_condattr_init (pthread_condattr_t *);
int __pthread_cond_broadcast (pthread_cond_t *);
@@ -60,7 +59,6 @@ int _cthreads_ftrylockfile (FILE *);
struct pthread_functions
{
int (*ptr_pthread_attr_destroy) (pthread_attr_t *);
- int (*ptr_pthread_attr_init) (pthread_attr_t *);
int (*ptr_pthread_condattr_destroy) (pthread_condattr_t *);
int (*ptr_pthread_condattr_init) (pthread_condattr_t *);
int (*ptr_pthread_cond_broadcast) (pthread_cond_t *);
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index b0c9ceb2..0195b741 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -91,10 +91,12 @@ int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
size_t __stacksize);
int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *);
void __pthread_testcancel (void);
+int __pthread_attr_init (pthread_attr_t *attr);
#define __pthread_raise_internal(__sig) raise (__sig)
libc_hidden_proto (__pthread_self)
+libc_hidden_proto (__pthread_attr_init)
#if IS_IN (libpthread)
hidden_proto (__pthread_create)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 52293d74..8cf51661 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -39,6 +39,8 @@ GLIBC_2.12 pthread_attr_getscope F
GLIBC_2.12 pthread_attr_getstack F
GLIBC_2.12 pthread_attr_getstackaddr F
GLIBC_2.12 pthread_attr_getstacksize F
+GLIBC_2.12 pthread_attr_init F
+GLIBC_2.12 __pthread_attr_init F
GLIBC_2.12 pthread_attr_setdetachstate F
GLIBC_2.12 pthread_attr_setguardsize F
GLIBC_2.12 pthread_attr_setinheritsched F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index 86d79bbc..4e287c2e 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -22,7 +22,6 @@ GLIBC_2.12 flockfile F
GLIBC_2.12 ftrylockfile F
GLIBC_2.12 funlockfile F
GLIBC_2.12 pthread_atfork F
-GLIBC_2.12 pthread_attr_init F
GLIBC_2.12 pthread_barrier_destroy F
GLIBC_2.12 pthread_barrier_init F
GLIBC_2.12 pthread_barrier_wait F
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index 9e156b16..3396ea9e 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -39,7 +39,6 @@ GLIBC_2.38 mtx_lock F
GLIBC_2.38 mtx_timedlock F
GLIBC_2.38 mtx_trylock F
GLIBC_2.38 mtx_unlock F
-GLIBC_2.38 pthread_attr_init F
GLIBC_2.38 pthread_barrier_destroy F
GLIBC_2.38 pthread_barrier_init F
GLIBC_2.38 pthread_barrier_wait F
--
2.39.5
More information about the Libc-alpha
mailing list