htl: move pthread_spin_{destroy, lock, init, trylock, unlock) and remove _pthread_spi...
authorgfleury <gfleury@disroot.org>
Thu, 20 Nov 2025 08:56:47 +0000 (10:56 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 20 Nov 2025 23:29:44 +0000 (00:29 +0100)
Message-ID: <20251120085647.326643-1-gfleury@disroot.org>

12 files changed:
htl/Makefile
htl/Versions
htl/pt-spin-inlines.c
sysdeps/htl/Versions
sysdeps/htl/pthreadP.h
sysdeps/i386/i686/pthread_spin_trylock.S
sysdeps/i386/nptl/pthread_spin_trylock.S [moved from sysdeps/i386/pthread_spin_trylock.S with 100% similarity]
sysdeps/mach/htl/pt-spin.c [deleted file]
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 9f14f15c41ef3972ecf9ee70c71de2307a4cd749..072db7eec8b706d14eb649466e88f7487be4ef9c 100644 (file)
@@ -24,10 +24,7 @@ SYSDEPS :=
 
 LCLHDRS :=
 
-libpthread-routines := \
-  pt-spin-inlines \
-  pt-spin \
-  # libpthread-routine
+libpthread-routines :=
 
 headers := \
   bits/cancelation.h \
@@ -36,7 +33,6 @@ headers := \
   bits/pthreadtypes-arch.h \
   bits/pthreadtypes.h \
   bits/semaphore.h \
-  bits/spin-lock-inline.h \
   bits/thread-shared-types.h \
   bits/types/__pthread_key.h \
   bits/types/__pthread_spinlock_t.h \
@@ -182,6 +178,7 @@ routines := \
   pt-sigstate \
   pt-sigstate-destroy \
   pt-sigstate-init \
+  pt-spin-inlines \
   pt-stack-alloc \
   pt-startup \
   pt-sysdep \
index 0eff9fd7befe9152d26c4219fcdf489d63763b4f..25b79f0824a6d22ed62438bab7e8fb4503b9f98a 100644 (file)
@@ -101,6 +101,11 @@ libc {
     pthread_setschedprio;
     pthread_setspecific;
     pthread_sigmask;
+    pthread_spin_destroy;
+    pthread_spin_init;
+    pthread_spin_lock;
+    pthread_spin_trylock;
+    pthread_spin_unlock;
     pthread_testcancel;
     pthread_yield;
     sem_close;
@@ -242,6 +247,11 @@ libc {
     pthread_setconcurrency;
     pthread_setname_np;
     pthread_setschedprio;
+    pthread_spin_destroy;
+    pthread_spin_init;
+    pthread_spin_lock;
+    pthread_spin_trylock;
+    pthread_spin_unlock;
     pthread_testcancel;
     pthread_timedjoin_np;
     pthread_tryjoin_np;
@@ -335,12 +345,6 @@ libpthread {
 
   GLIBC_2.12 {
     pthread_atfork;
-
-    pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
-    pthread_spin_trylock; pthread_spin_unlock;
-    __pthread_spin_destroy; __pthread_spin_init;
-    __pthread_spin_lock; __pthread_spin_trylock; __pthread_spin_unlock;
-    _pthread_spin_lock;
   }
   GLIBC_2.21 {
     __libpthread_version_placeholder;
index 6e1e218eb2f3eb040353d862e25c64f0a930d7a4..6bdd4ee021eaf943f963dde239cffc00e7f3f997 100644 (file)
 #define __PT_SPIN_INLINE       /* empty */
 
 #include <pthread.h>
+#include <shlib-compat.h>
 
-/* Weak aliases for the spin lock functions.  */
-weak_alias (__pthread_spin_destroy, pthread_spin_destroy);
-weak_alias (__pthread_spin_init, pthread_spin_init);
-weak_alias (__pthread_spin_trylock, pthread_spin_trylock);
-weak_alias (__pthread_spin_lock, pthread_spin_lock);
-weak_alias (__pthread_spin_unlock, pthread_spin_unlock);
+libc_hidden_def (__pthread_spin_destroy)
+versioned_symbol (libc, __pthread_spin_destroy, pthread_spin_destroy, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libc, __pthread_spin_destroy, pthread_spin_destroy, GLIBC_2_12);
+#endif
+
+libc_hidden_def (__pthread_spin_init)
+versioned_symbol (libc, __pthread_spin_init, pthread_spin_init, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libc, __pthread_spin_init, pthread_spin_init, GLIBC_2_12);
+#endif
+
+libc_hidden_def (__pthread_spin_trylock)
+versioned_symbol (libc, __pthread_spin_trylock, pthread_spin_trylock, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libc, __pthread_spin_trylock, pthread_spin_trylock, GLIBC_2_12);
+#endif
+
+libc_hidden_def (__pthread_spin_lock)
+versioned_symbol (libc, __pthread_spin_lock, pthread_spin_lock, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libc, __pthread_spin_lock, pthread_spin_lock, GLIBC_2_12);
+#endif
+
+libc_hidden_def (__pthread_spin_unlock)
+versioned_symbol (libc, __pthread_spin_unlock, pthread_spin_unlock, GLIBC_2_43);
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libc, __pthread_spin_unlock, pthread_spin_unlock, GLIBC_2_12);
+#endif
index 7b5450d20efdab893165e6a9e3ddaa3f3a545135..e3c9a593fdb01e96bc0be8158de1be7c7c561a7b 100644 (file)
@@ -4,10 +4,6 @@ libc {
     __vm_deallocate; __mach_port_insert_right; __mach_reply_port;
     __mig_init; __vm_allocate; __mach_port_allocate;
 
-    # functions used in inline functions or macros
-    __pthread_spin_destroy; __pthread_spin_init; __pthread_spin_lock;
-    _pthread_spin_lock; __pthread_spin_trylock; __pthread_spin_unlock;
-
     # p*
     pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
     pthread_spin_trylock; pthread_spin_unlock;
index 6ea1e79a92f3fd7e4322cca4ab9221413798f9a8..fb6a84b44ebfcd85b00be5d003b97eb5ca44f9aa 100644 (file)
@@ -231,6 +231,17 @@ libc_hidden_proto (__pthread_getname_np)
 int __pthread_setname_np (pthread_t __target_thread, const char *__name);
 libc_hidden_proto (__pthread_setname_np)
 
+int __pthread_spin_destroy (pthread_spinlock_t *__lock);
+libc_hidden_proto (__pthread_spin_destroy)
+int __pthread_spin_init (pthread_spinlock_t *__lock, int __pshared);
+libc_hidden_proto (__pthread_spin_init)
+int __pthread_spin_lock (pthread_spinlock_t *__lock);
+libc_hidden_proto (__pthread_spin_lock)
+int __pthread_spin_trylock (pthread_spinlock_t *__lock);
+libc_hidden_proto (__pthread_spin_trylock)
+int __pthread_spin_unlock (pthread_spinlock_t *__lock);
+libc_hidden_proto (__pthread_spin_unlock)
+
 #define __pthread_raise_internal(__sig) raise (__sig)
 
 libc_hidden_proto (__pthread_self)
index 49161fec86f89405d59bbd39e338a5aaeb09ee81..129bb239c3cd02d2db5a5eedb6ad10b76a8a1b67 100644 (file)
@@ -16,4 +16,4 @@
    <https://www.gnu.org/licenses/>.  */
 
 #define HAVE_CMOV      1
-#include <sysdeps/i386/pthread_spin_trylock.S>
+#include <sysdeps/i386/nptl/pthread_spin_trylock.S>
diff --git a/sysdeps/mach/htl/pt-spin.c b/sysdeps/mach/htl/pt-spin.c
deleted file mode 100644 (file)
index ff7db55..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Spin locks.  Mach version.
-   Copyright (C) 2002-2025 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library;  if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <machine-lock.h>
-
-/* In glibc.  */
-extern void __spin_lock_solid (__spin_lock_t *lock);
-
-/* Lock the spin lock object LOCK.  If the lock is held by another
-   thread spin until it becomes available.  */
-int
-_pthread_spin_lock (__spin_lock_t *lock)
-{
-  __spin_lock_solid (lock);
-  return 0;
-}
index 0556602ab7f898695b023c82fcac855eef5a0f82..032ef39d22033e193c5f1aae3be6d82dd8759e40 100644 (file)
@@ -130,6 +130,11 @@ GLIBC_2.12 pthread_setschedparam F
 GLIBC_2.12 pthread_setschedprio F
 GLIBC_2.12 pthread_setspecific F
 GLIBC_2.12 pthread_sigmask F
+GLIBC_2.12 pthread_spin_destroy F
+GLIBC_2.12 pthread_spin_init F
+GLIBC_2.12 pthread_spin_lock F
+GLIBC_2.12 pthread_spin_trylock F
+GLIBC_2.12 pthread_spin_unlock F
 GLIBC_2.12 pthread_testcancel F
 GLIBC_2.12 pthread_yield F
 GLIBC_2.12 sem_close F
@@ -2691,6 +2696,11 @@ GLIBC_2.43 pthread_mutex_transfer_np F
 GLIBC_2.43 pthread_setconcurrency F
 GLIBC_2.43 pthread_setname_np F
 GLIBC_2.43 pthread_setschedprio F
+GLIBC_2.43 pthread_spin_destroy F
+GLIBC_2.43 pthread_spin_init F
+GLIBC_2.43 pthread_spin_lock F
+GLIBC_2.43 pthread_spin_trylock F
+GLIBC_2.43 pthread_spin_unlock F
 GLIBC_2.43 pthread_testcancel F
 GLIBC_2.43 pthread_timedjoin_np F
 GLIBC_2.43 pthread_tryjoin_np F
index 24e6bd2c4af6f884d8cbfb01ba0d9352930a0467..75636d84785a87215fc2d2aa8fe9608cc4fd7539 100644 (file)
@@ -1,15 +1,4 @@
-GLIBC_2.12 __pthread_spin_destroy F
-GLIBC_2.12 __pthread_spin_init F
-GLIBC_2.12 __pthread_spin_lock F
-GLIBC_2.12 __pthread_spin_trylock F
-GLIBC_2.12 __pthread_spin_unlock F
-GLIBC_2.12 _pthread_spin_lock F
 GLIBC_2.12 pthread_atfork F
-GLIBC_2.12 pthread_spin_destroy F
-GLIBC_2.12 pthread_spin_init F
-GLIBC_2.12 pthread_spin_lock F
-GLIBC_2.12 pthread_spin_trylock F
-GLIBC_2.12 pthread_spin_unlock F
 GLIBC_2.32 call_once F
 GLIBC_2.32 cnd_broadcast F
 GLIBC_2.32 cnd_destroy F
index 62e82a08874b0c658d8623e08b08cf3c0f55cc2a..7f0e601b8eef2c2cf87b5473a42f954bb058233e 100644 (file)
@@ -1621,6 +1621,11 @@ GLIBC_2.38 pthread_setschedparam F
 GLIBC_2.38 pthread_setschedprio F
 GLIBC_2.38 pthread_setspecific F
 GLIBC_2.38 pthread_sigmask F
+GLIBC_2.38 pthread_spin_destroy F
+GLIBC_2.38 pthread_spin_init F
+GLIBC_2.38 pthread_spin_lock F
+GLIBC_2.38 pthread_spin_trylock F
+GLIBC_2.38 pthread_spin_unlock F
 GLIBC_2.38 pthread_testcancel F
 GLIBC_2.38 pthread_timedjoin_np F
 GLIBC_2.38 pthread_tryjoin_np F
@@ -2369,6 +2374,11 @@ GLIBC_2.43 pthread_mutex_transfer_np F
 GLIBC_2.43 pthread_setconcurrency F
 GLIBC_2.43 pthread_setname_np F
 GLIBC_2.43 pthread_setschedprio F
+GLIBC_2.43 pthread_spin_destroy F
+GLIBC_2.43 pthread_spin_init F
+GLIBC_2.43 pthread_spin_lock F
+GLIBC_2.43 pthread_spin_trylock F
+GLIBC_2.43 pthread_spin_unlock F
 GLIBC_2.43 pthread_testcancel F
 GLIBC_2.43 pthread_timedjoin_np F
 GLIBC_2.43 pthread_tryjoin_np F
index 57d796482bc9c6d9d7b393ed88e0a0d8a025d60a..b4f2a962506400995dabe4a9aac06a31c2f06351 100644 (file)
@@ -1,9 +1,3 @@
-GLIBC_2.38 __pthread_spin_destroy F
-GLIBC_2.38 __pthread_spin_init F
-GLIBC_2.38 __pthread_spin_lock F
-GLIBC_2.38 __pthread_spin_trylock F
-GLIBC_2.38 __pthread_spin_unlock F
-GLIBC_2.38 _pthread_spin_lock F
 GLIBC_2.38 call_once F
 GLIBC_2.38 cnd_broadcast F
 GLIBC_2.38 cnd_destroy F
@@ -17,11 +11,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_spin_destroy F
-GLIBC_2.38 pthread_spin_init F
-GLIBC_2.38 pthread_spin_lock F
-GLIBC_2.38 pthread_spin_trylock F
-GLIBC_2.38 pthread_spin_unlock F
 GLIBC_2.38 thrd_create F
 GLIBC_2.38 thrd_detach F
 GLIBC_2.38 thrd_exit F
This page took 0.117234 seconds and 5 git commands to generate.