From: gfleury <gfle...@disroot.org>

Message-ID: <20250815181500.107433-13-gfle...@disroot.org>
---
 htl/Makefile                                | 2 +-
 htl/Versions                                | 5 ++---
 htl/pt-getattr.c                            | 9 ++++++++-
 sysdeps/htl/pthreadP.h                      | 1 +
 sysdeps/mach/hurd/i386/libc.abilist         | 3 +++
 sysdeps/mach/hurd/i386/libpthread.abilist   | 1 -
 sysdeps/mach/hurd/x86_64/libc.abilist       | 3 +++
 sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 -
 8 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/htl/Makefile b/htl/Makefile
index ecfa3c1779..64e484c589 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -26,7 +26,6 @@ LCLHDRS :=
 
 libpthread-routines := \
   pt-create \
-  pt-getattr \
   pt-detach \
   pt-exit \
   pt-initialize \
@@ -144,6 +143,7 @@ routines := \
   pt-dealloc \
   pt-destroy-specific \
   pt-docancel \
+  pt-getattr \
   pt-getconcurrency \
   pt-getcpuclockid \
   pt-getschedparam \
diff --git a/htl/Versions b/htl/Versions
index 0f22745914..c94bd61500 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -51,6 +51,7 @@ libc {
     pthread_condattr_getpshared;
     pthread_condattr_setclock;
     pthread_condattr_setpshared;
+    pthread_getattr_np;
     pthread_getconcurrency;
     pthread_key_create;
     pthread_key_delete;
@@ -197,6 +198,7 @@ libc {
 
   GLIBC_2.43 {
     pthread_cancel;
+    pthread_getattr_np;
     pthread_getconcurrency;
     pthread_getcpuclockid;
     pthread_kill;
@@ -293,8 +295,6 @@ libpthread {
 
     pthread_create; pthread_detach; pthread_exit;
 
-    pthread_getattr_np;
-
     pthread_join;
 
     pthread_mutex_transfer_np;
@@ -341,7 +341,6 @@ libpthread {
     __cthread_keycreate;
     __cthread_getspecific;
     __cthread_setspecific;
-    __pthread_getattr_np;
     __pthread_enable_asynccancel;
     __pthread_disable_asynccancel;
   }
diff --git a/htl/pt-getattr.c b/htl/pt-getattr.c
index a851514709..74b86ca767 100644
--- a/htl/pt-getattr.c
+++ b/htl/pt-getattr.c
@@ -21,6 +21,8 @@
 #include <pthread.h>
 
 #include <pt-internal.h>
+#include <shlib-compat.h>
+#include <ldsodefs.h>
 
 /* Initialize thread attribute *ATTR with attributes corresponding to the
    already running thread THREAD.  It shall be called on an uninitialized ATTR
@@ -48,4 +50,9 @@ __pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
 
   return 0;
 }
-weak_alias (__pthread_getattr_np, pthread_getattr_np)
+libc_hidden_def (__pthread_getattr_np)
+versioned_symbol (libc, __pthread_getattr_np, pthread_getattr_np, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libpthread, __pthread_getattr_np, pthread_getattr_np, 
GLIBC_2_12);
+#endif
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index dd9d77776f..0deea22e8a 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -196,6 +196,7 @@ 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 *);
+libc_hidden_proto (__pthread_getattr_np)
 int __pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr,
                                 void **__restrict __stackaddr);
 libc_hidden_proto (__pthread_attr_getstackaddr)
diff --git a/sysdeps/mach/hurd/i386/libc.abilist 
b/sysdeps/mach/hurd/i386/libc.abilist
index a676cd0f75..0cbff57785 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -73,6 +73,7 @@ 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_equal F
+GLIBC_2.12 pthread_getattr_np F
 GLIBC_2.12 pthread_getconcurrency F
 GLIBC_2.12 pthread_getcpuclockid F
 GLIBC_2.12 pthread_getschedparam F
@@ -2643,6 +2644,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_getattr_np F
 GLIBC_2.43 pthread_getconcurrency F
 GLIBC_2.43 pthread_getcpuclockid F
 GLIBC_2.43 pthread_kill F
@@ -2715,6 +2717,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_getattr_np F
 HURD_CTHREADS_0.3 __spin_lock F
 HURD_CTHREADS_0.3 __spin_lock_init F
 HURD_CTHREADS_0.3 __spin_lock_solid F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist 
b/sysdeps/mach/hurd/i386/libpthread.abilist
index 044fb1c355..3d22516688 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -22,7 +22,6 @@ 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_getattr_np F
 GLIBC_2.12 pthread_join F
 GLIBC_2.12 pthread_mutex_transfer_np 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 dff8eee881..2b983e489d 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -1556,6 +1556,7 @@ GLIBC_2.38 pthread_condattr_setclock F
 GLIBC_2.38 pthread_condattr_setpshared F
 GLIBC_2.38 pthread_equal F
 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_getschedparam F
@@ -2325,6 +2326,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_getattr_np F
 GLIBC_2.43 pthread_getconcurrency F
 GLIBC_2.43 pthread_getcpuclockid F
 GLIBC_2.43 pthread_kill F
@@ -2341,6 +2343,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_getattr_np F
 HURD_CTHREADS_0.3 __spin_lock F
 HURD_CTHREADS_0.3 __spin_lock_init F
 HURD_CTHREADS_0.3 __spin_lock_solid F
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist 
b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index 66f06f82b3..cf45150539 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -40,7 +40,6 @@ 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_getattr_np 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
-- 
2.47.2


Reply via email to