]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: move c11 symbols into libc.
authorgfleury <gfleury@disroot.org>
Fri, 21 Nov 2025 19:13:36 +0000 (21:13 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 22 Nov 2025 02:28:48 +0000 (03:28 +0100)
thrd_{create,detach,exit,join}.
mtx_{init,destroy,lock,trylock,unlock,timeelock}.
cnd_{broadcast,destroy,init,signal,timewait,wait,destroy}
tss_{create,delete,get,set}. call_once.
Message-ID: <20251121191336.1224485-1-gfleury@disroot.org>

29 files changed:
htl/Versions
sysdeps/htl/c11-thread.h [new file with mode: 0644]
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
sysdeps/nptl/c11-thread.h [new file with mode: 0644]
sysdeps/pthread/Makefile
sysdeps/pthread/call_once.c
sysdeps/pthread/cnd_broadcast.c
sysdeps/pthread/cnd_destroy.c
sysdeps/pthread/cnd_init.c
sysdeps/pthread/cnd_signal.c
sysdeps/pthread/cnd_timedwait.c
sysdeps/pthread/cnd_wait.c
sysdeps/pthread/mtx_destroy.c
sysdeps/pthread/mtx_init.c
sysdeps/pthread/mtx_lock.c
sysdeps/pthread/mtx_timedlock.c
sysdeps/pthread/mtx_trylock.c
sysdeps/pthread/mtx_unlock.c
sysdeps/pthread/thrd_create.c
sysdeps/pthread/thrd_detach.c
sysdeps/pthread/thrd_exit.c
sysdeps/pthread/thrd_join.c
sysdeps/pthread/tss_create.c
sysdeps/pthread/tss_delete.c
sysdeps/pthread/tss_get.c
sysdeps/pthread/tss_set.c

index 2228f8fdd9958fdf9edf693984a8ca6ad196f7b3..cac34e623b8fb8ff7eb8dc34ede870ac96384b36 100644 (file)
@@ -149,6 +149,13 @@ libc {
   # C11 thread symbols.
   GLIBC_2.32 {
     thrd_current; thrd_equal; thrd_sleep; thrd_yield;
+    thrd_create; thrd_detach; thrd_exit; thrd_join;
+
+    mtx_destroy; mtx_init; mtx_lock; mtx_timedlock; mtx_trylock; mtx_unlock;
+    cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait;
+    tss_create; tss_delete; tss_get; tss_set;
+
+    call_once;
 
     pthread_cond_clockwait;
     pthread_clockjoin_np;
@@ -232,6 +239,19 @@ libc {
   }
 
   GLIBC_2.43 {
+    call_once;
+    cnd_broadcast;
+    cnd_destroy;
+    cnd_init;
+    cnd_signal;
+    cnd_timedwait;
+    cnd_wait;
+    mtx_destroy;
+    mtx_init;
+    mtx_lock;
+    mtx_timedlock;
+    mtx_trylock;
+    mtx_unlock;
     pthread_cancel;
     pthread_clockjoin_np;
     pthread_create;
@@ -268,6 +288,14 @@ libc {
     sem_trywait;
     sem_unlink;
     sem_wait;
+    thrd_create;
+    thrd_detach;
+    thrd_exit;
+    thrd_join;
+    tss_create;
+    tss_delete;
+    tss_get;
+    tss_set;
   }
 
   GLIBC_PRIVATE {
@@ -351,12 +379,7 @@ libpthread {
   }
 
   GLIBC_2.32 {
-    # C11 thread symbols.
-    thrd_create; thrd_detach; thrd_exit; thrd_join;
-    mtx_init; mtx_lock; mtx_timedlock; mtx_trylock; mtx_unlock; mtx_destroy;
-    call_once;
-    cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; cnd_timedwait; cnd_wait;
-    tss_create; tss_delete; tss_get; tss_set;
+    __libpthread_version_placeholder;
   }
 
   GLIBC_2.40 {
diff --git a/sysdeps/htl/c11-thread.h b/sysdeps/htl/c11-thread.h
new file mode 100644 (file)
index 0000000..d6ba38b
--- /dev/null
@@ -0,0 +1,2 @@
+#define C11_THREADS_INTRODUCED GLIBC_2_32
+#define C11_THREADS_IN_LIBC    GLIBC_2_43
index dbbb399febe442d810d9a737ebe99d6ae0ecb08f..08dcd85cd9153b05ab40ea9886514fcf217190ef 100644 (file)
@@ -2334,8 +2334,21 @@ GLIBC_2.3.4 xdr_quad_t F
 GLIBC_2.3.4 xdr_u_quad_t F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
+GLIBC_2.32 call_once F
+GLIBC_2.32 cnd_broadcast F
+GLIBC_2.32 cnd_destroy F
+GLIBC_2.32 cnd_init F
+GLIBC_2.32 cnd_signal F
+GLIBC_2.32 cnd_timedwait F
+GLIBC_2.32 cnd_wait F
 GLIBC_2.32 mach_print F
 GLIBC_2.32 mremap F
+GLIBC_2.32 mtx_destroy F
+GLIBC_2.32 mtx_init F
+GLIBC_2.32 mtx_lock F
+GLIBC_2.32 mtx_timedlock F
+GLIBC_2.32 mtx_trylock F
+GLIBC_2.32 mtx_unlock F
 GLIBC_2.32 pthread_clockjoin_np F
 GLIBC_2.32 pthread_cond_clockwait F
 GLIBC_2.32 pthread_mutex_clocklock F
@@ -2354,10 +2367,18 @@ GLIBC_2.32 sigabbrev_np F
 GLIBC_2.32 sigdescr_np F
 GLIBC_2.32 strerrordesc_np F
 GLIBC_2.32 strerrorname_np F
+GLIBC_2.32 thrd_create F
 GLIBC_2.32 thrd_current F
+GLIBC_2.32 thrd_detach F
 GLIBC_2.32 thrd_equal F
+GLIBC_2.32 thrd_exit F
+GLIBC_2.32 thrd_join F
 GLIBC_2.32 thrd_sleep F
 GLIBC_2.32 thrd_yield F
+GLIBC_2.32 tss_create F
+GLIBC_2.32 tss_delete F
+GLIBC_2.32 tss_get F
+GLIBC_2.32 tss_set F
 GLIBC_2.33 __x86_get_cpuid_feature_leaf F
 GLIBC_2.33 fstat F
 GLIBC_2.33 fstat64 F
@@ -2677,10 +2698,23 @@ GLIBC_2.42 uimaxabs F
 GLIBC_2.42 ulabs F
 GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
+GLIBC_2.43 call_once F
+GLIBC_2.43 cnd_broadcast F
+GLIBC_2.43 cnd_destroy F
+GLIBC_2.43 cnd_init F
+GLIBC_2.43 cnd_signal F
+GLIBC_2.43 cnd_timedwait F
+GLIBC_2.43 cnd_wait F
 GLIBC_2.43 free_aligned_sized F
 GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 mtx_destroy F
+GLIBC_2.43 mtx_init F
+GLIBC_2.43 mtx_lock F
+GLIBC_2.43 mtx_timedlock F
+GLIBC_2.43 mtx_trylock F
+GLIBC_2.43 mtx_unlock F
 GLIBC_2.43 pthread_cancel F
 GLIBC_2.43 pthread_clockjoin_np F
 GLIBC_2.43 pthread_create F
@@ -2717,6 +2751,14 @@ GLIBC_2.43 sem_timedwait F
 GLIBC_2.43 sem_trywait F
 GLIBC_2.43 sem_unlink F
 GLIBC_2.43 sem_wait F
+GLIBC_2.43 thrd_create F
+GLIBC_2.43 thrd_detach F
+GLIBC_2.43 thrd_exit F
+GLIBC_2.43 thrd_join F
+GLIBC_2.43 tss_create F
+GLIBC_2.43 tss_delete F
+GLIBC_2.43 tss_get F
+GLIBC_2.43 tss_set F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
index ff9c27321816392a676d94977b4b92470769a85a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,21 +0,0 @@
-GLIBC_2.32 call_once F
-GLIBC_2.32 cnd_broadcast F
-GLIBC_2.32 cnd_destroy F
-GLIBC_2.32 cnd_init F
-GLIBC_2.32 cnd_signal F
-GLIBC_2.32 cnd_timedwait F
-GLIBC_2.32 cnd_wait F
-GLIBC_2.32 mtx_destroy F
-GLIBC_2.32 mtx_init F
-GLIBC_2.32 mtx_lock F
-GLIBC_2.32 mtx_timedlock F
-GLIBC_2.32 mtx_trylock F
-GLIBC_2.32 mtx_unlock F
-GLIBC_2.32 thrd_create F
-GLIBC_2.32 thrd_detach F
-GLIBC_2.32 thrd_exit F
-GLIBC_2.32 thrd_join F
-GLIBC_2.32 tss_create F
-GLIBC_2.32 tss_delete F
-GLIBC_2.32 tss_get F
-GLIBC_2.32 tss_set F
index 7f0e601b8eef2c2cf87b5473a42f954bb058233e..c17d5399e4cb2b248cbe4d488589ec1885aa2498 100644 (file)
@@ -688,6 +688,7 @@ GLIBC_2.38 bzero F
 GLIBC_2.38 c16rtomb F
 GLIBC_2.38 c32rtomb F
 GLIBC_2.38 c8rtomb F
+GLIBC_2.38 call_once F
 GLIBC_2.38 calloc F
 GLIBC_2.38 canonicalize_file_name F
 GLIBC_2.38 catclose F
@@ -718,6 +719,12 @@ GLIBC_2.38 close_range F
 GLIBC_2.38 closedir F
 GLIBC_2.38 closefrom F
 GLIBC_2.38 closelog F
+GLIBC_2.38 cnd_broadcast F
+GLIBC_2.38 cnd_destroy F
+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 confstr F
 GLIBC_2.38 connect F
 GLIBC_2.38 copy_file_range F
@@ -1413,6 +1420,12 @@ GLIBC_2.38 msgrcv F
 GLIBC_2.38 msgsnd F
 GLIBC_2.38 msync F
 GLIBC_2.38 mtrace F
+GLIBC_2.38 mtx_destroy F
+GLIBC_2.38 mtx_init F
+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 munlock F
 GLIBC_2.38 munlockall F
 GLIBC_2.38 munmap F
@@ -2033,8 +2046,12 @@ GLIBC_2.38 telldir F
 GLIBC_2.38 tempnam F
 GLIBC_2.38 textdomain F
 GLIBC_2.38 tfind F
+GLIBC_2.38 thrd_create F
 GLIBC_2.38 thrd_current F
+GLIBC_2.38 thrd_detach F
 GLIBC_2.38 thrd_equal F
+GLIBC_2.38 thrd_exit F
+GLIBC_2.38 thrd_join F
 GLIBC_2.38 thrd_sleep F
 GLIBC_2.38 thrd_yield F
 GLIBC_2.38 thread_depress_abort F
@@ -2064,6 +2081,10 @@ GLIBC_2.38 towupper_l F
 GLIBC_2.38 truncate F
 GLIBC_2.38 truncate64 F
 GLIBC_2.38 tsearch F
+GLIBC_2.38 tss_create F
+GLIBC_2.38 tss_delete F
+GLIBC_2.38 tss_get F
+GLIBC_2.38 tss_set F
 GLIBC_2.38 ttyname F
 GLIBC_2.38 ttyname_r F
 GLIBC_2.38 ttyslot F
@@ -2354,10 +2375,23 @@ GLIBC_2.42 uimaxabs F
 GLIBC_2.42 ulabs F
 GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
+GLIBC_2.43 call_once F
+GLIBC_2.43 cnd_broadcast F
+GLIBC_2.43 cnd_destroy F
+GLIBC_2.43 cnd_init F
+GLIBC_2.43 cnd_signal F
+GLIBC_2.43 cnd_timedwait F
+GLIBC_2.43 cnd_wait F
 GLIBC_2.43 free_aligned_sized F
 GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 mtx_destroy F
+GLIBC_2.43 mtx_init F
+GLIBC_2.43 mtx_lock F
+GLIBC_2.43 mtx_timedlock F
+GLIBC_2.43 mtx_trylock F
+GLIBC_2.43 mtx_unlock F
 GLIBC_2.43 pthread_cancel F
 GLIBC_2.43 pthread_clockjoin_np F
 GLIBC_2.43 pthread_create F
@@ -2394,6 +2428,14 @@ GLIBC_2.43 sem_timedwait F
 GLIBC_2.43 sem_trywait F
 GLIBC_2.43 sem_unlink F
 GLIBC_2.43 sem_wait F
+GLIBC_2.43 thrd_create F
+GLIBC_2.43 thrd_detach F
+GLIBC_2.43 thrd_exit F
+GLIBC_2.43 thrd_join F
+GLIBC_2.43 tss_create F
+GLIBC_2.43 tss_delete F
+GLIBC_2.43 tss_get F
+GLIBC_2.43 tss_set F
 GLIBC_2.43 umaxabs F
 HURD_CTHREADS_0.3 __mutex_init F
 HURD_CTHREADS_0.3 __mutex_lock F
index b4f2a962506400995dabe4a9aac06a31c2f06351..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,21 +0,0 @@
-GLIBC_2.38 call_once F
-GLIBC_2.38 cnd_broadcast F
-GLIBC_2.38 cnd_destroy F
-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 mtx_destroy F
-GLIBC_2.38 mtx_init F
-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 thrd_create F
-GLIBC_2.38 thrd_detach F
-GLIBC_2.38 thrd_exit F
-GLIBC_2.38 thrd_join F
-GLIBC_2.38 tss_create F
-GLIBC_2.38 tss_delete F
-GLIBC_2.38 tss_get F
-GLIBC_2.38 tss_set F
diff --git a/sysdeps/nptl/c11-thread.h b/sysdeps/nptl/c11-thread.h
new file mode 100644 (file)
index 0000000..05ea8de
--- /dev/null
@@ -0,0 +1,2 @@
+#define C11_THREADS_INTRODUCED GLIBC_2_28
+#define C11_THREADS_IN_LIBC    GLIBC_2_34
index 1da3a9f55f2fa2605c31d0244a37e0b0015b57ca..c6ea59ee1654fe257445fa9c64b0a4341474f0f7 100644 (file)
@@ -26,15 +26,6 @@ headers += \
   # headers
 
 routines += \
-  pthread_atfork \
-  pthread_atfork_compat \
-  thrd_current \
-  thrd_equal \
-  thrd_sleep \
-  thrd_yield \
-  # routines
-
-$(libpthread-routines-var) += \
   call_once \
   cnd_broadcast \
   cnd_destroy \
@@ -48,15 +39,21 @@ $(libpthread-routines-var) += \
   mtx_timedlock \
   mtx_trylock \
   mtx_unlock \
+  pthread_atfork \
+  pthread_atfork_compat \
   thrd_create \
+  thrd_current \
   thrd_detach \
+  thrd_equal \
   thrd_exit \
   thrd_join \
+  thrd_sleep \
+  thrd_yield \
   tss_create \
   tss_delete \
   tss_get \
   tss_set \
-  # $(libpthread-routines-var)
+  # routines
 
 tests += \
   tst-abstime \
index 9c0eb397175b7795ed95dc7b265dc1e1d1fcfd70..4ed88c376e37b8de764a251ec2be1d1f7c649325 100644 (file)
@@ -20,6 +20,7 @@
 #include <shlib-compat.h>
 
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 void
 __call_once (once_flag *flag, void (*func)(void))
@@ -30,11 +31,7 @@ __call_once (once_flag *flag, void (*func)(void))
                  "alignof (once_flag) != alignof (pthread_once_t)");
   __pthread_once ((pthread_once_t *) flag, func);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __call_once, call_once, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __call_once, call_once, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__call_once, call_once)
+versioned_symbol (libc, __call_once, call_once, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __call_once, call_once, C11_THREADS_INTRODUCED);
 #endif
index 4bef01a383589d80b931b9e4037045da46de20ba..65b5c264bcff5752ccdd12126835d8e0a0974e8f 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "thrd_priv.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 int
 __cnd_broadcast (cnd_t *cond)
@@ -25,11 +26,7 @@ __cnd_broadcast (cnd_t *cond)
   int err_code = __pthread_cond_broadcast ((pthread_cond_t*) cond);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __cnd_broadcast, cnd_broadcast, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __cnd_broadcast, cnd_broadcast, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__cnd_broadcast, cnd_broadcast)
+versioned_symbol (libc, __cnd_broadcast, cnd_broadcast, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __cnd_broadcast, cnd_broadcast, C11_THREADS_INTRODUCED);
 #endif
index ed5e4332537d5c4d038374b959ec49cd34a878cd..6e852a27fd55105d7a7e5ec4af1f326dc18a0ac3 100644 (file)
 #include "thrd_priv.h"
 #include "pthreadP.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 void
 __cnd_destroy (cnd_t *cond)
 {
   __pthread_cond_destroy ((pthread_cond_t *) cond);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __cnd_destroy, cnd_destroy, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __cnd_destroy, cnd_destroy, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__cnd_destroy, cnd_destroy)
+versioned_symbol (libc, __cnd_destroy, cnd_destroy, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __cnd_destroy, cnd_destroy, C11_THREADS_INTRODUCED);
 #endif
index fce84deefbc16ccbf96002a350c2ef4022e3fccf..2c0aec392e03f6d4dceba69c8b1a106ad97c8bfc 100644 (file)
@@ -20,6 +20,7 @@
 #include <shlib-compat.h>
 
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 int
 __cnd_init (cnd_t *cond)
@@ -32,11 +33,7 @@ __cnd_init (cnd_t *cond)
   int err_code = __pthread_cond_init ((pthread_cond_t *)cond, NULL);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __cnd_init, cnd_init, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __cnd_init, cnd_init, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__cnd_init, cnd_init)
+versioned_symbol (libc, __cnd_init, cnd_init, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __cnd_init, cnd_init, C11_THREADS_INTRODUCED);
 #endif
index 2737ae144b3fa888ef507deb97a38e0e1246aa4c..2023b4cd419b0e04aeafbb173bf9e48b54fb386f 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "thrd_priv.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 int
 __cnd_signal (cnd_t *cond)
@@ -25,11 +26,8 @@ __cnd_signal (cnd_t *cond)
   int err_code = __pthread_cond_signal ((pthread_cond_t *) cond);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __cnd_signal, cnd_signal, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __cnd_signal, cnd_signal, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__cnd_signal, cnd_signal)
+
+versioned_symbol (libc, __cnd_signal, cnd_signal, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __cnd_signal, cnd_signal, C11_THREADS_INTRODUCED);
 #endif
index f0529d8f7fc38251e9670b50f95f3e2c810b8d9f..de49f6014e3c003d3e64c15fea11f9485c8a13bb 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <shlib-compat.h>
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 int
-cnd_timedwait (cnd_t *restrict cond, mtx_t *restrict mutex,
+__cnd_timedwait (cnd_t *restrict cond, mtx_t *restrict mutex,
               const struct timespec* restrict time_point)
 {
   int err_code = __pthread_cond_timedwait ((pthread_cond_t *) cond,
@@ -27,3 +29,7 @@ cnd_timedwait (cnd_t *restrict cond, mtx_t *restrict mutex,
                                           time_point);
   return thrd_err_map (err_code);
 }
+versioned_symbol (libc, __cnd_timedwait, cnd_timedwait, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __cnd_timedwait, cnd_timedwait, C11_THREADS_INTRODUCED);
+#endif
index 706466e0550516fdae2f07873380853fa8adaff7..b70b91af53ff5b738a081f7c558878cb5ced6d45 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "thrd_priv.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 int
 __cnd_wait (cnd_t *cond, mtx_t *mutex)
@@ -26,11 +27,7 @@ __cnd_wait (cnd_t *cond, mtx_t *mutex)
                                      (pthread_mutex_t *) mutex);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __cnd_wait, cnd_wait, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __cnd_wait, cnd_wait, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__cnd_wait, cnd_wait)
+versioned_symbol (libc, __cnd_wait, cnd_wait, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __cnd_wait, cnd_wait, C11_THREADS_INTRODUCED);
 #endif
index f4686663cd97ad39e914611d079b6a869eec9285..f3ded47ea3d3528c7f9d4628e414e761edae49c1 100644 (file)
 #include "thrd_priv.h"
 #include "pthreadP.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 void
 __mtx_destroy (mtx_t *mutex)
 {
   __pthread_mutex_destroy ((pthread_mutex_t *) mutex);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __mtx_destroy, mtx_destroy, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __mtx_destroy, mtx_destroy, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__mtx_destroy, mtx_destroy)
+versioned_symbol (libc, __mtx_destroy, mtx_destroy, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __mtx_destroy, mtx_destroy, C11_THREADS_INTRODUCED);
 #endif
index a807eca4ded3e24db83b63fd8536ff95841a356c..d48cd1524c0bf69a143111861c6c367c297f4435 100644 (file)
@@ -20,6 +20,7 @@
 #include <shlib-compat.h>
 
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 int
 __mtx_init (mtx_t *mutex, int type)
@@ -52,11 +53,7 @@ __mtx_init (mtx_t *mutex, int type)
   /* pthread_mutexattr_destroy implementation is a noop.  */
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __mtx_init, mtx_init, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __mtx_init, mtx_init, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__mtx_init, mtx_init)
+versioned_symbol (libc, __mtx_init, mtx_init, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __mtx_init, mtx_init, C11_THREADS_INTRODUCED);
 #endif
index 7318d4249e080fe8902d0f7954c7713c3405c3fc..d37f11d39bffa99421dfad5dbcce878842c950fc 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "thrd_priv.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 int
 __mtx_lock (mtx_t *mutex)
@@ -25,11 +26,7 @@ __mtx_lock (mtx_t *mutex)
   int err_code = __pthread_mutex_lock ((pthread_mutex_t *) mutex);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __mtx_lock, mtx_lock, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __mtx_lock, mtx_lock, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__mtx_lock, mtx_lock)
+versioned_symbol (libc, __mtx_lock, mtx_lock, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __mtx_lock, mtx_lock, C11_THREADS_INTRODUCED);
 #endif
index 8e7e0af725697b7b220f0c8a5c17f7f28c276f3a..bb1b12754ce3107c29d5ef5cf1779f0f13c34a99 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <shlib-compat.h>
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 int
-mtx_timedlock (mtx_t *restrict mutex,
+__mtx_timedlock (mtx_t *restrict mutex,
               const struct timespec *restrict time_point)
 {
   int err_code = __pthread_mutex_timedlock ((pthread_mutex_t *)mutex,
                                            time_point);
   return thrd_err_map (err_code);
 }
+versioned_symbol (libc, __mtx_timedlock, mtx_timedlock, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __mtx_timedlock, mtx_timedlock, C11_THREADS_INTRODUCED);
+#endif
index 57b3e6d27d44825c385c1c80f234563575f95ef0..9ecaf5cc76efef1f18ffa941b76269860f463c43 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <shlib-compat.h>
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 int
 __mtx_trylock (mtx_t *mutex)
@@ -25,11 +26,7 @@ __mtx_trylock (mtx_t *mutex)
   int err_code = __pthread_mutex_trylock ((pthread_mutex_t *) mutex);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __mtx_trylock, mtx_trylock, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __mtx_trylock, mtx_trylock, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__mtx_trylock, mtx_trylock)
+versioned_symbol (libc, __mtx_trylock, mtx_trylock, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __mtx_trylock, mtx_trylock, C11_THREADS_INTRODUCED);
 #endif
index 978a9ee1d4bb79a9453ba3ad9a91780ef5a07381..523626f9a0da113697268630003659889e14a0ee 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "thrd_priv.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 int
 __mtx_unlock (mtx_t *mutex)
@@ -25,11 +26,7 @@ __mtx_unlock (mtx_t *mutex)
   int err_code = __pthread_mutex_unlock ((pthread_mutex_t *) mutex);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __mtx_unlock, mtx_unlock, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __mtx_unlock, mtx_unlock, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__mtx_unlock, mtx_unlock)
+versioned_symbol (libc, __mtx_unlock, mtx_unlock, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __mtx_unlock, mtx_unlock, C11_THREADS_INTRODUCED);
 #endif
index 788eb62a31e2e35dbf74705936bc4b37b348a3b5..9dceeeaa5833cc3f2467010377c8172c9f5653c0 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "thrd_priv.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 int
 __thrd_create (thrd_t *thr, thrd_start_t func, void *arg)
@@ -29,11 +30,7 @@ __thrd_create (thrd_t *thr, thrd_start_t func, void *arg)
                                   (void* (*) (void*))func, arg);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __thrd_create, thrd_create, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libc, __thrd_create, thrd_create, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__thrd_create, thrd_create)
+versioned_symbol (libc, __thrd_create, thrd_create, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __thrd_create, thrd_create, C11_THREADS_INTRODUCED);
 #endif
index d1a059820703de192ee4c018fcc26aed7d73730c..3aa2a20cd27f2754e5f8103cecd265bcab72ca0c 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "thrd_priv.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 int
 __thrd_detach (thrd_t thr)
@@ -27,11 +28,7 @@ __thrd_detach (thrd_t thr)
   err_code = __pthread_detach (thr);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __thrd_detach, thrd_detach, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libc, __thrd_detach, thrd_detach, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__thrd_detach, thrd_detach)
+versioned_symbol (libc, __thrd_detach, thrd_detach, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __thrd_detach, thrd_detach, C11_THREADS_INTRODUCED);
 #endif
index 9207ac2cfcc59fa92efb09f1e631dbab1474d237..67d4fcf882fb8eb5faff856e98c7c2f3f94d9b9e 100644 (file)
 
 #include <shlib-compat.h>
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 _Noreturn void
 __thrd_exit (int res)
 {
   __pthread_exit ((void*)(uintptr_t) res);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __thrd_exit, thrd_exit, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __thrd_exit, thrd_exit, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__thrd_exit, thrd_exit)
+versioned_symbol (libc, __thrd_exit, thrd_exit, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __thrd_exit, thrd_exit, C11_THREADS_INTRODUCED);
 #endif
index ca9cf3b558fc04138fd083f9cffeaf8ecca49384..7e06eadb72028771af0864b55bb410238076f13f 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "thrd_priv.h"
 #include <shlib-compat.h>
+#include <c11-thread.h>
 
 int
 __thrd_join (thrd_t thr, int *res)
@@ -29,11 +30,7 @@ __thrd_join (thrd_t thr, int *res)
 
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __thrd_join, thrd_join, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libc, __thrd_join, thrd_join, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__thrd_join, thrd_join)
+versioned_symbol (libc, __thrd_join, thrd_join, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __thrd_join, thrd_join, C11_THREADS_INTRODUCED);
 #endif
index b99e80d8469c8699d5511b69bd4546d25c9f17bf..d778899766e4dd15beddc2edda7d1ea0734fc93b 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <shlib-compat.h>
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 int
 __tss_create (tss_t *tss_id, tss_dtor_t destructor)
@@ -32,11 +33,7 @@ __tss_create (tss_t *tss_id, tss_dtor_t destructor)
   int err_code = __pthread_key_create (tss_id, destructor);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __tss_create, tss_create, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __tss_create, tss_create, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__tss_create, tss_create)
+versioned_symbol (libc, __tss_create, tss_create, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __tss_create, tss_create, C11_THREADS_INTRODUCED);
 #endif
index 584f87889a68679be3cc188358049570beff09e0..a7771dc6cc6588c842673844043bbeaddb2b973f 100644 (file)
 
 #include <shlib-compat.h>
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 void
 __tss_delete (tss_t tss_id)
 {
   __pthread_key_delete (tss_id);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __tss_delete, tss_delete, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __tss_delete, tss_delete, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__tss_delete, tss_delete)
+versioned_symbol (libc, __tss_delete, tss_delete, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __tss_delete, tss_delete, C11_THREADS_INTRODUCED);
 #endif
index bb31cb1640c1440a5409ec39ee407bce3492551b..4d992ddda6daf50443d68f3209a97737ccf8424a 100644 (file)
 
 #include <shlib-compat.h>
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 void *
 __tss_get (tss_t tss_id)
 {
   return __pthread_getspecific (tss_id);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __tss_get, tss_get, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __tss_get, tss_get, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__tss_get, tss_get)
+versioned_symbol (libc, __tss_get, tss_get, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __tss_get, tss_get, C11_THREADS_INTRODUCED);
 #endif
index a751c37c2f506d4de00e3d8f086eab4f7d7bd4d8..9d9c282bfec53c5d959ec435cd2d0119c08b9007 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <shlib-compat.h>
 #include "thrd_priv.h"
+#include <c11-thread.h>
 
 int
 __tss_set (tss_t tss_id, void *val)
@@ -25,11 +26,7 @@ __tss_set (tss_t tss_id, void *val)
   int err_code = __pthread_setspecific (tss_id, val);
   return thrd_err_map (err_code);
 }
-#if PTHREAD_IN_LIBC
-versioned_symbol (libc, __tss_set, tss_set, GLIBC_2_34);
-# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34)
-compat_symbol (libpthread, __tss_set, tss_set, GLIBC_2_28);
-# endif
-#else /* !PTHREAD_IN_LIBC */
-strong_alias (__tss_set, tss_set)
+versioned_symbol (libc, __tss_set, tss_set, C11_THREADS_IN_LIBC);
+#if OTHER_SHLIB_COMPAT (libpthread, C11_THREADS_INTRODUCED, C11_THREADS_IN_LIBC)
+compat_symbol (libpthread, __tss_set, tss_set, C11_THREADS_INTRODUCED);
 #endif