[PATCH 5/7] htl: move sem_post into libc.

gfleury gfleury@disroot.org
Sun Aug 17 10:40:20 GMT 2025


---
 htl/Makefile                                | 2 +-
 htl/Versions                                | 3 ++-
 sysdeps/htl/include/semaphore.h             | 2 +-
 sysdeps/htl/sem-post.c                      | 8 ++++++--
 sysdeps/mach/hurd/i386/libc.abilist         | 2 ++
 sysdeps/mach/hurd/i386/libpthread.abilist   | 1 -
 sysdeps/mach/hurd/x86_64/libc.abilist       | 2 ++
 sysdeps/mach/hurd/x86_64/libpthread.abilist | 1 -
 8 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/htl/Makefile b/htl/Makefile
index 9c702eee..9f9f5ed7 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -34,7 +34,6 @@ libpthread-routines := \
   pt-spin \
   pt-getname-np \
   pt-setname-np \
-  sem-post \
   sem-timedwait \
   sem-trywait \
   sem_unlink \
@@ -210,6 +209,7 @@ routines := \
   sem-getvalue \
   sem-init \
   sem_open \
+  sem-post \
   sem_routines \
   # routines
 shared-only-routines = forward
diff --git a/htl/Versions b/htl/Versions
index 5b83e1ce..ff1d5b93 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -106,6 +106,7 @@ libc {
     sem_getvalue;
     sem_init;
     sem_open;
+    sem_post;
   }
 
   GLIBC_2.21 {
@@ -229,6 +230,7 @@ libc {
     sem_getvalue;
     sem_init;
     sem_open;
+    sem_post;
   }
 
   GLIBC_PRIVATE {
@@ -321,7 +323,6 @@ libpthread {
 
     pthread_create;
 
-    sem_post;
     sem_timedwait; sem_trywait; sem_unlink; sem_wait;
 
     pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
diff --git a/sysdeps/htl/include/semaphore.h b/sysdeps/htl/include/semaphore.h
index 58fa2bf3..5e5d3c18 100644
--- a/sysdeps/htl/include/semaphore.h
+++ b/sysdeps/htl/include/semaphore.h
@@ -3,7 +3,7 @@
 
 #ifndef _ISOMAC
 extern __typeof (sem_post) __sem_post;
-libpthread_hidden_proto (__sem_post)
+libc_hidden_proto (__sem_post)
 #endif
 
 #endif
diff --git a/sysdeps/htl/sem-post.c b/sysdeps/htl/sem-post.c
index 36f20f97..419a5ec2 100644
--- a/sysdeps/htl/sem-post.c
+++ b/sysdeps/htl/sem-post.c
@@ -23,6 +23,7 @@
 #include <hurd.h>
 
 #include <pt-internal.h>
+#include <shlib-compat.h>
 
 int
 __sem_post (sem_t *sem)
@@ -61,5 +62,8 @@ __sem_post (sem_t *sem)
 
   return 0;
 }
-libpthread_hidden_def (__sem_post)
-strong_alias (__sem_post, sem_post);
+libc_hidden_def (__sem_post)
+versioned_symbol (libc, __sem_post, sem_post, GLIBC_2_43);
+# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_12, GLIBC_2_43)
+compat_symbol (libpthread, __sem_post, sem_post, GLIBC_2_12);
+#endif
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 9764b605..661bbf95 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -133,6 +133,7 @@ GLIBC_2.12 sem_destroy F
 GLIBC_2.12 sem_getvalue F
 GLIBC_2.12 sem_init F
 GLIBC_2.12 sem_open F
+GLIBC_2.12 sem_post F
 GLIBC_2.13 __fentry__ F
 GLIBC_2.14 syncfs F
 GLIBC_2.15 __fdelt_chk F
@@ -2676,6 +2677,7 @@ GLIBC_2.43 sem_destroy F
 GLIBC_2.43 sem_getvalue F
 GLIBC_2.43 sem_init F
 GLIBC_2.43 sem_open F
+GLIBC_2.43 sem_post F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index c7e8bc5a..07dd7537 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -24,7 +24,6 @@ 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 sem_post F
 GLIBC_2.12 sem_timedwait F
 GLIBC_2.12 sem_trywait F
 GLIBC_2.12 sem_unlink F
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index e64bf542..6fa0e6f0 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -1764,6 +1764,7 @@ GLIBC_2.38 sem_destroy F
 GLIBC_2.38 sem_getvalue F
 GLIBC_2.38 sem_init F
 GLIBC_2.38 sem_open F
+GLIBC_2.38 sem_post F
 GLIBC_2.38 semctl F
 GLIBC_2.38 semget F
 GLIBC_2.38 semop F
@@ -2357,6 +2358,7 @@ GLIBC_2.43 sem_destroy F
 GLIBC_2.43 sem_getvalue F
 GLIBC_2.43 sem_init F
 GLIBC_2.43 sem_open F
+GLIBC_2.43 sem_post F
 HURD_CTHREADS_0.3 __cthread_getspecific F
 HURD_CTHREADS_0.3 __cthread_keycreate F
 HURD_CTHREADS_0.3 __cthread_setspecific F
diff --git a/sysdeps/mach/hurd/x86_64/libpthread.abilist b/sysdeps/mach/hurd/x86_64/libpthread.abilist
index ee0fac30..38cf0d25 100644
--- a/sysdeps/mach/hurd/x86_64/libpthread.abilist
+++ b/sysdeps/mach/hurd/x86_64/libpthread.abilist
@@ -44,7 +44,6 @@ GLIBC_2.38 pthread_spin_lock F
 GLIBC_2.38 pthread_spin_trylock F
 GLIBC_2.38 pthread_spin_unlock F
 GLIBC_2.38 sem_clockwait F
-GLIBC_2.38 sem_post F
 GLIBC_2.38 sem_timedwait F
 GLIBC_2.38 sem_trywait F
 GLIBC_2.38 sem_unlink F
-- 
2.47.2



More information about the Libc-alpha mailing list