]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Drop remnants of cthreads
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 11 Nov 2025 21:32:39 +0000 (22:32 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Wed, 12 Nov 2025 00:11:11 +0000 (01:11 +0100)
These are not used in GNU/Hurd since very long now.

19 files changed:
benchtests/strcoll-inputs/filelist#en_US.UTF-8
htl/Makefile
htl/Versions
htl/cthreads-compat.c [deleted file]
htl/libpthread_syms.a
htl/lockfile.c
htl/pt-initialize.c
hurd/Versions
mach/Makefile
mach/Versions
mach/mutex-solid.c [deleted file]
sysdeps/htl/pthread-functions.h
sysdeps/htl/pthreadP.h
sysdeps/mach/hurd/Makefile
sysdeps/mach/hurd/cthreads.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 0d8f1c722baae2d76342f21e0ad21bdfef1db541..e02df872dc295de862390a784022e4a26ebc23a2 100644 (file)
@@ -11696,7 +11696,6 @@ spin-lock.h
 spin-lock.c
 mig-dealloc.c
 errsystems.awk
-mutex-solid.c
 Machrules
 lock-intern.h
 errorlib.h
index 979f2904645ce00321bcc59dbe937d9314a4a72f..15cff60d3145e5c8a3a0ea15ff1ca8bc80a55f35 100644 (file)
@@ -35,7 +35,6 @@ libpthread-routines := \
   pt-getname-np \
   pt-setname-np \
   cancellation \
-  cthreads-compat \
   herrno \
   $(SYSDEPS) \
   # libpthread-routine
index f5ea540def7768f8de5615e560dbe681ee94bb27..b56b185a1095bde5117df435f6210160be71735f 100644 (file)
@@ -317,17 +317,6 @@ libpthread {
     __errno_location; __h_errno_location;
   }
   GLIBC_2.12 {
-    cthread_detach;
-    cthread_fork;
-    cthread_keycreate;
-    cthread_getspecific;
-    cthread_setspecific;
-    __mutex_lock_solid;
-    __mutex_unlock_solid;
-    _cthreads_flockfile;
-    _cthreads_ftrylockfile;
-    _cthreads_funlockfile;
-
     flockfile; ftrylockfile; funlockfile;
 
     pthread_atfork;
@@ -362,12 +351,7 @@ libpthread {
   GLIBC_PRIVATE {
     __pthread_initialize_minimal;
 
-    __cthread_detach;
-    __cthread_fork;
     __pthread_create;
-    __cthread_keycreate;
-    __cthread_getspecific;
-    __cthread_setspecific;
     __pthread_enable_asynccancel;
     __pthread_disable_asynccancel;
   }
diff --git a/htl/cthreads-compat.c b/htl/cthreads-compat.c
deleted file mode 100644 (file)
index d2bcf53..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Compatibility routines for cthreads.
-   Copyright (C) 2000-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 <assert.h>
-#include <pthreadP.h>
-
-#define        CTHREAD_KEY_INVALID (__cthread_key_t) -1
-
-void
-__cthread_detach (__cthread_t thread)
-{
-  int err;
-  pthread_t pthread = (pthread_t) (uintptr_t) thread;
-
-  err = __pthread_detach (pthread);
-  assert_perror (err);
-}
-weak_alias (__cthread_detach, cthread_detach)
-
-__cthread_t
-__cthread_fork (__cthread_fn_t func, void *arg)
-{
-  pthread_t thread;
-  int err;
-
-  err = __pthread_create (&thread, NULL, func, arg);
-  assert_perror (err);
-
-  return (__cthread_t) (uintptr_t) thread;
-}
-weak_alias (__cthread_fork, cthread_fork)
-
-int
-__cthread_keycreate (__cthread_key_t *key)
-{
-  error_t err;
-
-  err = __pthread_key_create (key, 0);
-  if (err)
-    {
-      errno = err;
-      *key = CTHREAD_KEY_INVALID;
-      err = -1;
-    }
-
-  return err;
-}
-weak_alias (__cthread_keycreate, cthread_keycreate)
-
-int
-__cthread_getspecific (__cthread_key_t key, void **val)
-{
-  *val = __pthread_getspecific (key);
-  return 0;
-}
-weak_alias (__cthread_getspecific, cthread_getspecific)
-
-int
-__cthread_setspecific (__cthread_key_t key, void *val)
-{
-  error_t err;
-
-  err = __pthread_setspecific (key, (const void *) val);
-  if (err)
-    {
-      errno = err;
-      err = -1;
-    }
-
-  return err;
-}
-weak_alias (__cthread_setspecific, cthread_setspecific)
-
-void
-__mutex_lock_solid (void *lock)
-{
-  __pthread_mutex_lock (lock);
-}
-
-void
-__mutex_unlock_solid (void *lock)
-{
-  if (__pthread_spin_trylock (lock) != 0)
-    /* Somebody already got the lock, that one will manage waking up others */
-    return;
-  __pthread_mutex_unlock (lock);
-}
index b299edd4de14bf1df9319d3bd0de02fb1873932b..dfce4a7a210bebeb297583260ab9696bb2ea47a5 100644 (file)
@@ -2,19 +2,6 @@
    is to start threading. */
 EXTERN(__pthread_initialize_minimal)
 
-/* Weak references in glibc that must be filled if glibc is to be
-   thread safe.  */
-EXTERN(cthread_detach)
-EXTERN(cthread_fork)
-EXTERN(cthread_keycreate)
-EXTERN(cthread_getspecific)
-EXTERN(cthread_setspecific)
-EXTERN(__mutex_lock_solid)
-EXTERN(__mutex_unlock_solid)
-/* For libio stream locking.  */
-EXTERN(_cthreads_flockfile)
-EXTERN(_cthreads_funlockfile)
-EXTERN(_cthreads_ftrylockfile)
 /* To create the sigthread and get its stack layout on fork */
 EXTERN(pthread_create)
 EXTERN(pthread_detach)
index 7cc2c26354e439fe728ad23886687fde08c64689..b76a59a17bd118346a04e883a0f4c0a8bdab6be5 100644 (file)
 #include <pthread.h>           /* Must come before <stdio.h>! */
 #include <stdio.h>
 
+#undef _IO_flockfile
+#undef _IO_funlockfile
+#undef _IO_ftrylockfile
+
 void
-_cthreads_flockfile (FILE *fp)
+_IO_flockfile (FILE *fp)
 {
   _IO_lock_lock (*fp->_lock);
 }
 
 void
-_cthreads_funlockfile (FILE *fp)
+_IO_funlockfile (FILE *fp)
 {
   _IO_lock_unlock (*fp->_lock);
 }
 
 int
-_cthreads_ftrylockfile (FILE *fp)
+_IO_ftrylockfile (FILE *fp)
 {
   return __libc_lock_trylock_recursive (*fp->_lock);
 }
 
-#undef _IO_flockfile
-#undef _IO_funlockfile
-#undef _IO_ftrylockfile
 #undef flockfile
 #undef funlockfile
 #undef ftrylockfile
 
-void _IO_flockfile (FILE *)
-     __attribute__ ((alias ("_cthreads_flockfile")));
-void _IO_funlockfile (FILE *)
-     __attribute__ ((alias ("_cthreads_funlockfile")));
-int _IO_ftrylockfile (FILE *)
-     __attribute__ ((alias ("_cthreads_ftrylockfile")));
-
 void flockfile (FILE *)
-     __attribute__ ((weak, alias ("_cthreads_flockfile")));
+     __attribute__ ((weak, alias ("_IO_flockfile")));
 void funlockfile (FILE *)
-     __attribute__ ((weak, alias ("_cthreads_funlockfile")));
+     __attribute__ ((weak, alias ("_IO_funlockfile")));
 int ftrylockfile (FILE *)
-     __attribute__ ((weak, alias ("_cthreads_ftrylockfile")));
+     __attribute__ ((weak, alias ("_IO_ftrylockfile")));
index a4e49edfa621f8e3a4a652648622fe55e7bd1a3b..86fe66fb3aeb52eb57f36fa82463acc6f5ba9259 100644 (file)
 
 #include <pt-internal.h>
 #include <set-hooks.h>
+#include <libio/libio.h>
 
 #include <pthread.h>
 #include <pthread-functions.h>
 
 #if IS_IN (libpthread)
 static const struct pthread_functions pthread_functions = {
-  .ptr__IO_flockfile = _cthreads_flockfile,
-  .ptr__IO_funlockfile = _cthreads_funlockfile,
-  .ptr__IO_ftrylockfile = _cthreads_ftrylockfile,
+  .ptr__IO_flockfile = _IO_flockfile,
+  .ptr__IO_funlockfile = _IO_funlockfile,
+  .ptr__IO_ftrylockfile = _IO_ftrylockfile,
 };
 #endif /* IS_IN (libpthread) */
 
index 439e8abf32a352f62d2ad262475215b9dec04f63..c1e60385426f93a5ca9317e31ad73707e5a5fee0 100644 (file)
@@ -140,11 +140,8 @@ libc {
 
   HURD_CTHREADS_0.3 {
     # weak refs to libthreads functions that libc calls iff libthreads in use
-    __cthread_fork; __pthread_create; __cthread_detach; __pthread_detach;
+    __pthread_create; __pthread_detach;
     __pthread_getattr_np; __pthread_attr_getstack;
-
-    # cthreads functions with stubs in libc
-    __cthread_keycreate; __cthread_getspecific; __cthread_setspecific;
   }
 
   GLIBC_PRIVATE {
index 38264c7af53bcc6337a8c97a7c2085dceb1b326a..f40a400657b435bce853abda870340e10f4f22ef 100644 (file)
@@ -22,7 +22,7 @@ include ../Makeconfig
 headers = mach_init.h mach.h mach_error.h mach-shortcuts.h mach/mach_traps.h \
          $(interface-headers) mach/mach.h mach/mig_support.h mach/error.h \
          $(lock-headers) machine-sp.h bits/mach/param.h
-lock = spin-solid spin-lock mutex-init mutex-solid
+lock = spin-solid spin-lock mutex-init
 lock-headers = lock-intern.h spin-lock.h
 routines = $(mach-syscalls) $(mach-shortcuts) \
           mach_init mig_strncpy mig_strlen mig_memcpy msg \
index 72e9d557db83a08f61cac76a92538a4447a7b500..468913cf8f7f081380f62479bda522eb4789260c 100644 (file)
@@ -63,8 +63,7 @@ libc {
   }
 
   HURD_CTHREADS_0.3 {
-    __mutex_init; __mutex_lock; __mutex_lock_solid; __mutex_trylock;
-    __mutex_unlock; __mutex_unlock_solid;
+    __mutex_init; __mutex_lock; __mutex_trylock; __mutex_unlock;
     __spin_lock; __spin_lock_init; __spin_lock_solid; __spin_try_lock;
     __spin_unlock;
   }
diff --git a/mach/mutex-solid.c b/mach/mutex-solid.c
deleted file mode 100644 (file)
index 1af9941..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Stub versions of mutex_lock_solid/mutex_unlock_solid for no -lthreads.
-   Copyright (C) 1995-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 <lock-intern.h>
-
-/* If pthread is linked in, it will define these functions itself to do
-   real pthread mutex locks.  This file will only be linked in when
-   pthread is not used, and `mutexes' are in fact just spin locks (and
-   some unused storage).  */
-
-void
-__mutex_lock_solid (void *lock)
-{
-  __spin_lock_solid (lock);
-}
-
-void
-__mutex_unlock_solid (void *lock)
-{
-}
index 1fde0aeaa338ca80d6dd20182bd912dab4ac25ec..2b1feb4e042f120fcc4fa03d40b11330a9416108 100644 (file)
 
 #include <pthread.h>
 
-void _cthreads_flockfile (FILE *);
-void _cthreads_funlockfile (FILE *);
-int _cthreads_ftrylockfile (FILE *);
-
 /* Data type shared with libc.  The libc uses it to pass on calls to
    the thread functions.  Wine pokes directly into this structure,
    so if possible avoid breaking it and append new hooks to the end.  */
index 9273a5885f68591cc469f66154a643a299aeaec8..8ea60949ecb2266e1bb4b2a62b55498b6618f758 100644 (file)
@@ -169,16 +169,10 @@ libc_hidden_proto (__pthread_setcanceltype);
 extern int __pthread_sigmask (int, const sigset_t *, sigset_t *);
 libc_hidden_proto (__pthread_sigmask);
 
-typedef struct __cthread *__cthread_t;
-typedef int __cthread_key_t;
-typedef void * (*__cthread_fn_t)(void *__arg);
-
-__cthread_t __cthread_fork (__cthread_fn_t, void *);
 int __pthread_create (pthread_t *newthread,
                      const pthread_attr_t *attr,
                      void *(*start_routine) (void *), void *arg);
 
-void __cthread_detach (__cthread_t);
 int __pthread_detach (pthread_t __threadp);
 libc_hidden_proto (__pthread_detach)
 void __pthread_exit (void *value) __attribute__ ((__noreturn__));
@@ -194,9 +188,6 @@ int __pthread_clockjoin_np (pthread_t __th, void **__thread_return,
                                  clockid_t __clockid,
                                 const struct timespec *__abstime);
 libc_hidden_proto (__pthread_clockjoin_np)
-int __cthread_keycreate (__cthread_key_t *);
-int __cthread_getspecific (__cthread_key_t, void **);
-int __cthread_setspecific (__cthread_key_t, void *);
 int __pthread_key_create (pthread_key_t *key, void (*destr) (void *));
 libc_hidden_proto (__pthread_key_create)
 void *__pthread_getspecific (pthread_key_t key);
index 2149f6343ef2d21063e0120c4b0f788627a43527..f1d688a6d33054f850c936e2a99b4ace8cbd99a5 100644 (file)
@@ -199,10 +199,6 @@ $(objpfx)rcrt0.o: $(objpfx)static-start.o $(objpfx)abi-note.o $(objpfx)init.o
 
 endif
 \f
-ifeq (hurd, $(subdir))
-sysdep_routines += cthreads
-endif
-
 ifeq (elf, $(subdir))
 sysdep-dl-routines += dl-tls-initialized
 endif
diff --git a/sysdeps/mach/hurd/cthreads.c b/sysdeps/mach/hurd/cthreads.c
deleted file mode 100644 (file)
index 70af797..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 1997-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 <libc-lock.h>
-#include <errno.h>
-#include <hurd.h>
-#include <stdlib.h>
-#include <pthreadP.h>
-
-/* Placeholder for key creation routine from Hurd cthreads library.  */
-int
-weak_function
-__cthread_keycreate (__cthread_key_t *key)
-{
-  *key = -1;
-  return __hurd_fail (ENOSYS);
-}
-
-/* Placeholder for key retrieval routine from Hurd cthreads library.  */
-int
-weak_function
-__cthread_getspecific (__cthread_key_t key, void **pval)
-{
-  *pval = NULL;
-  return __hurd_fail (ENOSYS);
-}
-
-/* Placeholder for key setting routine from Hurd cthreads library.  */
-int
-weak_function
-__cthread_setspecific (__cthread_key_t key, void *val)
-{
-  return __hurd_fail (ENOSYS);
-}
index a19d3a44a2117a1828e4f4046c6cafa740fe8d65..e5bd47ac397674663a5fca2bcaa83d37273fbb06 100644 (file)
@@ -2748,15 +2748,10 @@ GLIBC_2.9 ns_name_skip F
 GLIBC_2.9 ns_name_uncompress F
 GLIBC_2.9 ns_name_unpack F
 GLIBC_2.9 pipe2 F
-HURD_CTHREADS_0.3 __cthread_getspecific F
-HURD_CTHREADS_0.3 __cthread_keycreate F
-HURD_CTHREADS_0.3 __cthread_setspecific F
 HURD_CTHREADS_0.3 __mutex_init F
 HURD_CTHREADS_0.3 __mutex_lock F
-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_detach F
 HURD_CTHREADS_0.3 __pthread_getattr_np F
 HURD_CTHREADS_0.3 __spin_lock F
index a05cacf93f91ad5e45445c75073a4c3d789e68d6..b9fd3dd489d60702be91bf4398ce98a6e1f77b07 100644 (file)
@@ -1,19 +1,9 @@
-GLIBC_2.12 __mutex_lock_solid F
-GLIBC_2.12 __mutex_unlock_solid 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 _cthreads_flockfile F
-GLIBC_2.12 _cthreads_ftrylockfile F
-GLIBC_2.12 _cthreads_funlockfile F
 GLIBC_2.12 _pthread_spin_lock F
-GLIBC_2.12 cthread_detach F
-GLIBC_2.12 cthread_fork F
-GLIBC_2.12 cthread_getspecific F
-GLIBC_2.12 cthread_keycreate F
-GLIBC_2.12 cthread_setspecific F
 GLIBC_2.12 flockfile F
 GLIBC_2.12 ftrylockfile F
 GLIBC_2.12 funlockfile F
index 863312aa94c916c4415d900b5f19863a63084878..5fb477342e946ba7870e56265d621ac0227effc0 100644 (file)
@@ -2373,15 +2373,10 @@ GLIBC_2.43 sem_trywait F
 GLIBC_2.43 sem_unlink F
 GLIBC_2.43 sem_wait F
 GLIBC_2.43 umaxabs F
-HURD_CTHREADS_0.3 __cthread_getspecific F
-HURD_CTHREADS_0.3 __cthread_keycreate F
-HURD_CTHREADS_0.3 __cthread_setspecific F
 HURD_CTHREADS_0.3 __mutex_init F
 HURD_CTHREADS_0.3 __mutex_lock F
-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_detach F
 HURD_CTHREADS_0.3 __pthread_getattr_np F
 HURD_CTHREADS_0.3 __spin_lock F
index 0b1dcf1e8a28a14897dc626804b6f96d0bba9f39..e72dca501b664de98c44ff40b04430f4b2a33001 100644 (file)
@@ -3,16 +3,11 @@ GLIBC_2.38 _IO_ftrylockfile F
 GLIBC_2.38 _IO_funlockfile F
 GLIBC_2.38 __errno_location F
 GLIBC_2.38 __h_errno_location F
-GLIBC_2.38 __mutex_lock_solid F
-GLIBC_2.38 __mutex_unlock_solid 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 _cthreads_flockfile F
-GLIBC_2.38 _cthreads_ftrylockfile F
-GLIBC_2.38 _cthreads_funlockfile F
 GLIBC_2.38 _pthread_spin_lock F
 GLIBC_2.38 call_once F
 GLIBC_2.38 cnd_broadcast F
@@ -21,11 +16,6 @@ GLIBC_2.38 cnd_init F
 GLIBC_2.38 cnd_signal F
 GLIBC_2.38 cnd_timedwait F
 GLIBC_2.38 cnd_wait F
-GLIBC_2.38 cthread_detach F
-GLIBC_2.38 cthread_fork F
-GLIBC_2.38 cthread_getspecific F
-GLIBC_2.38 cthread_keycreate F
-GLIBC_2.38 cthread_setspecific F
 GLIBC_2.38 flockfile F
 GLIBC_2.38 ftrylockfile F
 GLIBC_2.38 funlockfile F