public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] move some htl symbol into libc
@ 2022-10-29 12:00 Guy-Fleury Iteriteka
  2022-10-29 12:00 ` [PATCH 1/4] htl: move __pthread-total " Guy-Fleury Iteriteka
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Guy-Fleury Iteriteka @ 2022-10-29 12:00 UTC (permalink / raw)
  To: libc-alpha; +Cc: Guy-Fleury Iteriteka

Hello,

can you help me moving the pthread_self into libc as an
example so that i can go ahead and move others that are not difficult
for me.

pthread_equal is removed from libpthread.so but
with the patch for pthread_self is in both libc.so and libpthread.so.

this is libpthread.so
-------
         U ___pthread_self@GLIBC_PRIVATE
00006630 t __pthread_self
00006630 t pthread_self
-------

and this libc.so
-------
00000028 b __GI____pthread_self
00000028 B ___pthread_self
001cf570 T __pthread_self
001cf570 W pthread_self
-------

i was thinking that it is with this makefile rule
------
extra-B-pthread.so = -B$(common-objpfx)htl/
------
in htl/Makefile that will force the pthread_self inclusion.
that would explain why pthread_equal is remove because it is in 
sysdeps/htl/.

thanks.
Guy-Fleury Iteriteka (4):
  htl: move __pthread-total into libc.
  htl: move ___pthread_self to libc
  htl: move pthread_equal into libc
  htl: move pthread_self into libc

 htl/Makefile                              |  5 ++---
 htl/Versions                              | 11 ++++++-----
 htl/forward.c                             |  8 --------
 htl/pt-create.c                           |  6 ------
 htl/pt-initialize.c                       |  2 --
 htl/pt-internal.h                         |  1 +
 htl/pt-total.c                            | 23 +++++++++++++++++++++++
 sysdeps/htl/pthread-functions.h           |  4 ----
 sysdeps/mach/hurd/htl/pt-dep-self.c       | 22 ++++++++++++++++++++++
 sysdeps/mach/hurd/htl/pt-sysdep.c         |  2 +-
 sysdeps/mach/hurd/htl/pt-sysdep.h         |  3 +++
 sysdeps/mach/hurd/i386/libc.abilist       |  2 ++
 sysdeps/mach/hurd/i386/libpthread.abilist |  2 --
 13 files changed, 60 insertions(+), 31 deletions(-)
 create mode 100644 htl/pt-total.c
 create mode 100644 sysdeps/mach/hurd/htl/pt-dep-self.c

-- 
2.37.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] htl: move __pthread-total into libc.
  2022-10-29 12:00 [PATCH 0/4] move some htl symbol into libc Guy-Fleury Iteriteka
@ 2022-10-29 12:00 ` Guy-Fleury Iteriteka
  2022-10-29 12:00 ` [PATCH 2/4] htl: move ___pthread_self to libc Guy-Fleury Iteriteka
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Guy-Fleury Iteriteka @ 2022-10-29 12:00 UTC (permalink / raw)
  To: libc-alpha; +Cc: Guy-Fleury Iteriteka

* htl/Makefile(routine): add pt-total.
  htl/Versions(libc[PRIVATE]): add __pthread-total.
  htl/pt-create.c(__pthread-total): remove it
  htl/pt-total.c: New file.
  htl/pt-total.c(__pthread-total): move definition here.
  htl/pt-internal(__pthread-total): add to it libc_hidden_proto
                                    proprerty.
---
 htl/Makefile      |  2 +-
 htl/Versions      |  1 +
 htl/pt-create.c   |  6 ------
 htl/pt-internal.h |  1 +
 htl/pt-total.c    | 23 +++++++++++++++++++++++
 5 files changed, 26 insertions(+), 7 deletions(-)
 create mode 100644 htl/pt-total.c

diff --git a/htl/Makefile b/htl/Makefile
index 0b403e2f..ad0e2645 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -164,7 +164,7 @@ headers :=				\
 
 distribute :=
 
-routines := forward libc_pthread_init alloca_cutoff htlfreeres
+routines := forward libc_pthread_init alloca_cutoff htlfreeres pt-total
 shared-only-routines = forward
 
 extra-libs := libpthread
diff --git a/htl/Versions b/htl/Versions
index 4e0ebac2..113110f4 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -30,6 +30,7 @@ libc {
     __libc_alloca_cutoff;
     __libc_pthread_init;
     __pthread_cleanup_stack;
+    __pthread_total;
   }
 }
 
diff --git a/htl/pt-create.c b/htl/pt-create.c
index 5d37edbb..34a63b6a 100644
--- a/htl/pt-create.c
+++ b/htl/pt-create.c
@@ -36,12 +36,6 @@
 # include <locale.h>
 #endif
 
-/* The total number of pthreads currently active.  This is defined
-   here since it would be really stupid to have a threads-using
-   program that doesn't call `pthread_create'.  */
-unsigned int __pthread_total;
-\f
-
 /* The entry-point for new threads.  */
 static void
 entry_point (struct __pthread *self, void *(*start_routine) (void *), void *arg)
diff --git a/htl/pt-internal.h b/htl/pt-internal.h
index f01cb7ce..b787acf8 100644
--- a/htl/pt-internal.h
+++ b/htl/pt-internal.h
@@ -165,6 +165,7 @@ __pthread_dequeue (struct __pthread *thread)
 
 /* The total number of threads currently active.  */
 extern unsigned int __pthread_total;
+libc_hidden_proto (__pthread_total)
 
 /* Concurrency hint.  */
 extern int __pthread_concurrency;
diff --git a/htl/pt-total.c b/htl/pt-total.c
new file mode 100644
index 00000000..8188131c
--- /dev/null
+++ b/htl/pt-total.c
@@ -0,0 +1,23 @@
+/* Thread counter variable.
+   Copyright (C) 2021-2022 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 <pt-internal.h>
+
+/* Number of threads running.  */
+unsigned int __pthread_total;
+libc_hidden_data_def (__pthread_total)
-- 
2.37.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/4] htl: move ___pthread_self to libc
  2022-10-29 12:00 [PATCH 0/4] move some htl symbol into libc Guy-Fleury Iteriteka
  2022-10-29 12:00 ` [PATCH 1/4] htl: move __pthread-total " Guy-Fleury Iteriteka
@ 2022-10-29 12:00 ` Guy-Fleury Iteriteka
  2022-10-29 12:00 ` [PATCH 3/4] htl: move pthread_equal into libc Guy-Fleury Iteriteka
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Guy-Fleury Iteriteka @ 2022-10-29 12:00 UTC (permalink / raw)
  To: libc-alpha; +Cc: Guy-Fleury Iteriteka

htl/Makefile(routine): add pt-dep-self
htl/Versions(___pthread_self): add to libc symbol
sysdeps/mach/hurd/htl/pt-dep-self.c: New file
sysdeps/mach/hurd/htl/pt-sysdep.c(___pthread_seld): remove
				definition.
sysdeps/mach/hurd/htl/pt-sysdep.h(___pthread_self):
				add hidden property
---
 htl/Makefile                        |  3 ++-
 htl/Versions                        |  1 +
 sysdeps/mach/hurd/htl/pt-dep-self.c | 22 ++++++++++++++++++++++
 sysdeps/mach/hurd/htl/pt-sysdep.c   |  2 +-
 sysdeps/mach/hurd/htl/pt-sysdep.h   |  3 +++
 5 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 sysdeps/mach/hurd/htl/pt-dep-self.c

diff --git a/htl/Makefile b/htl/Makefile
index ad0e2645..72e37fbd 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -164,7 +164,8 @@ headers :=				\
 
 distribute :=
 
-routines := forward libc_pthread_init alloca_cutoff htlfreeres pt-total
+routines := forward libc_pthread_init alloca_cutoff htlfreeres pt-total \
+	    pt-dep-self
 shared-only-routines = forward
 
 extra-libs := libpthread
diff --git a/htl/Versions b/htl/Versions
index 113110f4..9ec84811 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -31,6 +31,7 @@ libc {
     __libc_pthread_init;
     __pthread_cleanup_stack;
     __pthread_total;
+    ___pthread_self;
   }
 }
 
diff --git a/sysdeps/mach/hurd/htl/pt-dep-self.c b/sysdeps/mach/hurd/htl/pt-dep-self.c
new file mode 100644
index 00000000..82cb0524
--- /dev/null
+++ b/sysdeps/mach/hurd/htl/pt-dep-self.c
@@ -0,0 +1,22 @@
+/* Thread counter variable.
+   Copyright (C) 2021-2022 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 "pt-sysdep.h"
+
+__thread struct __pthread *___pthread_self;
+libc_hidden_tls_def (___pthread_self)
diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.c b/sysdeps/mach/hurd/htl/pt-sysdep.c
index 2d828545..3597166d 100644
--- a/sysdeps/mach/hurd/htl/pt-sysdep.c
+++ b/sysdeps/mach/hurd/htl/pt-sysdep.c
@@ -26,7 +26,7 @@
 #include <pt-internal.h>
 #include <pthreadP.h>
 
-__thread struct __pthread *___pthread_self;
+#include "pt-sysdep.h"
 
 static void
 reset_pthread_total (void)
diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.h b/sysdeps/mach/hurd/htl/pt-sysdep.h
index 854c365c..b28c60d0 100644
--- a/sysdeps/mach/hurd/htl/pt-sysdep.h
+++ b/sysdeps/mach/hurd/htl/pt-sysdep.h
@@ -20,6 +20,7 @@
 #define _PT_SYSDEP_H	1
 
 #include <mach.h>
+#include <stddef.h>
 
 /* XXX */
 #define _POSIX_THREAD_THREADS_MAX	64
@@ -32,6 +33,8 @@
   mach_msg_header_t wakeupmsg;
 
 extern __thread struct __pthread *___pthread_self;
+libc_hidden_tls_proto (___pthread_self)
+
 #ifdef DEBUG
 #define _pthread_self()                                            \
 	({                                                         \
-- 
2.37.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/4] htl: move pthread_equal into libc
  2022-10-29 12:00 [PATCH 0/4] move some htl symbol into libc Guy-Fleury Iteriteka
  2022-10-29 12:00 ` [PATCH 1/4] htl: move __pthread-total " Guy-Fleury Iteriteka
  2022-10-29 12:00 ` [PATCH 2/4] htl: move ___pthread_self to libc Guy-Fleury Iteriteka
@ 2022-10-29 12:00 ` Guy-Fleury Iteriteka
  2022-10-30 21:51   ` Samuel Thibault
  2022-10-29 12:00 ` [PATCH 4/4] htl: move pthread_self " Guy-Fleury Iteriteka
  2022-11-01 22:28 ` [PATCH 0/4] move some htl symbol " Samuel Thibault
  4 siblings, 1 reply; 12+ messages in thread
From: Guy-Fleury Iteriteka @ 2022-10-29 12:00 UTC (permalink / raw)
  To: libc-alpha; +Cc: Guy-Fleury Iteriteka

---
 htl/Makefile                              | 3 +--
 htl/Versions                              | 2 +-
 htl/forward.c                             | 4 ----
 htl/pt-initialize.c                       | 1 -
 sysdeps/htl/pthread-functions.h           | 2 --
 sysdeps/mach/hurd/i386/libc.abilist       | 1 +
 sysdeps/mach/hurd/i386/libpthread.abilist | 1 -
 7 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/htl/Makefile b/htl/Makefile
index 72e37fbd..a7b013ec 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -46,7 +46,6 @@ libpthread-routines := pt-attr pt-attr-destroy pt-attr-getdetachstate	    \
 	pt-alloc							    \
 	pt-create							    \
 	pt-getattr							    \
-	pt-equal							    \
 	pt-dealloc							    \
 	pt-detach							    \
 	pt-exit								    \
@@ -165,7 +164,7 @@ headers :=				\
 distribute :=
 
 routines := forward libc_pthread_init alloca_cutoff htlfreeres pt-total \
-	    pt-dep-self
+	    pt-dep-self pt-equal
 shared-only-routines = forward
 
 extra-libs := libpthread
diff --git a/htl/Versions b/htl/Versions
index 9ec84811..1ef8a6d0 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -83,7 +83,7 @@ libpthread {
     pthread_condattr_getpshared; pthread_condattr_init;
     pthread_condattr_setclock; pthread_condattr_setpshared;
 
-    pthread_create; pthread_detach; pthread_equal; pthread_exit;
+    pthread_create; pthread_detach; pthread_exit;
 
     pthread_getattr_np;
 
diff --git a/htl/forward.c b/htl/forward.c
index 00527348..d0f775a2 100644
--- a/htl/forward.c
+++ b/htl/forward.c
@@ -102,10 +102,6 @@ FORWARD (pthread_cond_timedwait,
 	 (pthread_cond_t *cond, pthread_mutex_t *mutex,
 	  const struct timespec *abstime), (cond, mutex, abstime), 0)
 
-FORWARD (pthread_equal, (pthread_t thread1, pthread_t thread2),
-	 (thread1, thread2), 1)
-
-
 /* Use an alias to avoid warning, as pthread_exit is declared noreturn.  */
 FORWARD_NORETURN (__pthread_exit, void, (void *retval), (retval),
 		  exit (EXIT_SUCCESS))
diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c
index 02e6ad6b..1d948c40 100644
--- a/htl/pt-initialize.c
+++ b/htl/pt-initialize.c
@@ -47,7 +47,6 @@ static const struct pthread_functions pthread_functions = {
   .ptr_pthread_cond_signal = __pthread_cond_signal,
   .ptr_pthread_cond_wait = __pthread_cond_wait,
   .ptr_pthread_cond_timedwait = __pthread_cond_timedwait,
-  .ptr_pthread_equal = __pthread_equal,
   .ptr___pthread_exit = __pthread_exit,
   .ptr_pthread_getschedparam = __pthread_getschedparam,
   .ptr_pthread_setschedparam = __pthread_setschedparam,
diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h
index ccccc8e5..095a61e6 100644
--- a/sysdeps/htl/pthread-functions.h
+++ b/sysdeps/htl/pthread-functions.h
@@ -45,7 +45,6 @@ int __pthread_cond_signal (pthread_cond_t *);
 int __pthread_cond_wait (pthread_cond_t *, pthread_mutex_t *);
 int __pthread_cond_timedwait (pthread_cond_t *, pthread_mutex_t *,
 			     const struct timespec *);
-int __pthread_equal (pthread_t, pthread_t);
 void __pthread_exit (void *) __attribute__ ((__noreturn__));
 int __pthread_getschedparam (pthread_t, int *, struct sched_param *);
 int __pthread_setschedparam (pthread_t, int,
@@ -101,7 +100,6 @@ struct pthread_functions
   int (*ptr_pthread_cond_wait) (pthread_cond_t *, pthread_mutex_t *);
   int (*ptr_pthread_cond_timedwait) (pthread_cond_t *, pthread_mutex_t *,
 				     const struct timespec *);
-  int (*ptr_pthread_equal) (pthread_t, pthread_t);
   void (*ptr___pthread_exit) (void *) __attribute__ ((__noreturn__));
   int (*ptr_pthread_getschedparam) (pthread_t, int *, struct sched_param *);
   int (*ptr_pthread_setschedparam) (pthread_t, int,
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 4e3200ef..26552958 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -28,6 +28,7 @@ GLIBC_2.11 mkostemps F
 GLIBC_2.11 mkostemps64 F
 GLIBC_2.11 mkstemps F
 GLIBC_2.11 mkstemps64 F
+GLIBC_2.12 pthread_equal F
 GLIBC_2.13 __fentry__ F
 GLIBC_2.14 syncfs F
 GLIBC_2.15 __fdelt_chk F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index b9c9b75c..84f2643b 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -65,7 +65,6 @@ GLIBC_2.12 pthread_condattr_setclock F
 GLIBC_2.12 pthread_condattr_setpshared F
 GLIBC_2.12 pthread_create F
 GLIBC_2.12 pthread_detach F
-GLIBC_2.12 pthread_equal F
 GLIBC_2.12 pthread_exit F
 GLIBC_2.12 pthread_getattr_np F
 GLIBC_2.12 pthread_getconcurrency F
-- 
2.37.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 4/4] htl: move pthread_self into libc
  2022-10-29 12:00 [PATCH 0/4] move some htl symbol into libc Guy-Fleury Iteriteka
                   ` (2 preceding siblings ...)
  2022-10-29 12:00 ` [PATCH 3/4] htl: move pthread_equal into libc Guy-Fleury Iteriteka
@ 2022-10-29 12:00 ` Guy-Fleury Iteriteka
  2022-10-31  7:24   ` Florian Weimer
  2022-11-01 22:28 ` [PATCH 0/4] move some htl symbol " Samuel Thibault
  4 siblings, 1 reply; 12+ messages in thread
From: Guy-Fleury Iteriteka @ 2022-10-29 12:00 UTC (permalink / raw)
  To: libc-alpha; +Cc: Guy-Fleury Iteriteka

---
 htl/Makefile                              | 3 +--
 htl/Versions                              | 7 +++----
 htl/forward.c                             | 4 ----
 htl/pt-initialize.c                       | 1 -
 sysdeps/htl/pthread-functions.h           | 2 --
 sysdeps/mach/hurd/i386/libc.abilist       | 1 +
 sysdeps/mach/hurd/i386/libpthread.abilist | 1 -
 7 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/htl/Makefile b/htl/Makefile
index a7b013ec..57bb22a2 100644
--- a/htl/Makefile
+++ b/htl/Makefile
@@ -51,7 +51,6 @@ libpthread-routines := pt-attr pt-attr-destroy pt-attr-getdetachstate	    \
 	pt-exit								    \
 	pt-initialize							    \
 	pt-join								    \
-	pt-self								    \
 	pt-sigmask							    \
 	pt-spin-inlines							    \
 	pt-cleanup							    \
@@ -164,7 +163,7 @@ headers :=				\
 distribute :=
 
 routines := forward libc_pthread_init alloca_cutoff htlfreeres pt-total \
-	    pt-dep-self pt-equal
+	    pt-dep-self pt-equal pt-self
 shared-only-routines = forward
 
 extra-libs := libpthread
diff --git a/htl/Versions b/htl/Versions
index 1ef8a6d0..59070181 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -25,7 +25,9 @@ libc {
   GLIBC_2.32 {
     thrd_current; thrd_equal; thrd_sleep; thrd_yield;
   }
-
+  GLIBC_2.36 {
+    __pthread_self;
+  }
   GLIBC_PRIVATE {
     __libc_alloca_cutoff;
     __libc_pthread_init;
@@ -119,9 +121,6 @@ libpthread {
     pthread_rwlockattr_destroy; pthread_rwlockattr_getpshared;
     pthread_rwlockattr_init; pthread_rwlockattr_setpshared;
 
-    pthread_self;
-    __pthread_self;
-
     pthread_setcancelstate; pthread_setcanceltype;
     pthread_setconcurrency; pthread_setschedparam;
     pthread_setschedprio; pthread_setspecific;
diff --git a/htl/forward.c b/htl/forward.c
index d0f775a2..41985f14 100644
--- a/htl/forward.c
+++ b/htl/forward.c
@@ -126,10 +126,6 @@ FORWARD (pthread_mutex_lock, (pthread_mutex_t *mutex), (mutex), 0)
 
 FORWARD (pthread_mutex_unlock, (pthread_mutex_t *mutex), (mutex), 0)
 
-
-FORWARD2 (pthread_self, pthread_t, (void), (), return 0)
-
-
 FORWARD (__pthread_setcancelstate, (int state, int *oldstate),
 	 (state, oldstate), 0)
 strong_alias (__pthread_setcancelstate, pthread_setcancelstate);
diff --git a/htl/pt-initialize.c b/htl/pt-initialize.c
index 1d948c40..225736fe 100644
--- a/htl/pt-initialize.c
+++ b/htl/pt-initialize.c
@@ -55,7 +55,6 @@ static const struct pthread_functions pthread_functions = {
   .ptr_pthread_mutex_lock = __pthread_mutex_lock,
   .ptr_pthread_mutex_trylock = __pthread_mutex_trylock,
   .ptr_pthread_mutex_unlock = __pthread_mutex_unlock,
-  .ptr_pthread_self = __pthread_self,
   .ptr___pthread_setcancelstate = __pthread_setcancelstate,
   .ptr_pthread_setcanceltype = __pthread_setcanceltype,
   .ptr___pthread_get_cleanup_stack = __pthread_get_cleanup_stack,
diff --git a/sysdeps/htl/pthread-functions.h b/sysdeps/htl/pthread-functions.h
index 095a61e6..4d9896ea 100644
--- a/sysdeps/htl/pthread-functions.h
+++ b/sysdeps/htl/pthread-functions.h
@@ -55,7 +55,6 @@ int _pthread_mutex_init (pthread_mutex_t *,
 int __pthread_mutex_lock (pthread_mutex_t *);
 int __pthread_mutex_trylock (pthread_mutex_t *);
 int __pthread_mutex_unlock (pthread_mutex_t *);
-pthread_t __pthread_self (void);
 int __pthread_setcancelstate (int, int *);
 int __pthread_setcanceltype (int, int *);
 struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
@@ -110,7 +109,6 @@ struct pthread_functions
   int (*ptr_pthread_mutex_lock) (pthread_mutex_t *);
   int (*ptr_pthread_mutex_trylock) (pthread_mutex_t *);
   int (*ptr_pthread_mutex_unlock) (pthread_mutex_t *);
-  pthread_t (*ptr_pthread_self) (void);
   int (*ptr___pthread_setcancelstate) (int, int *);
   int (*ptr_pthread_setcanceltype) (int, int *);
   struct __pthread_cancelation_handler **(*ptr___pthread_get_cleanup_stack) (void);
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 26552958..bfa47282 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -29,6 +29,7 @@ GLIBC_2.11 mkostemps64 F
 GLIBC_2.11 mkstemps F
 GLIBC_2.11 mkstemps64 F
 GLIBC_2.12 pthread_equal F
+GLIBC_2.12 pthread_self F
 GLIBC_2.13 __fentry__ F
 GLIBC_2.14 syncfs F
 GLIBC_2.15 __fdelt_chk F
diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist
index 84f2643b..d15ba070 100644
--- a/sysdeps/mach/hurd/i386/libpthread.abilist
+++ b/sysdeps/mach/hurd/i386/libpthread.abilist
@@ -108,7 +108,6 @@ GLIBC_2.12 pthread_rwlockattr_destroy F
 GLIBC_2.12 pthread_rwlockattr_getpshared F
 GLIBC_2.12 pthread_rwlockattr_init F
 GLIBC_2.12 pthread_rwlockattr_setpshared F
-GLIBC_2.12 pthread_self F
 GLIBC_2.12 pthread_setcancelstate F
 GLIBC_2.12 pthread_setcanceltype F
 GLIBC_2.12 pthread_setconcurrency F
-- 
2.37.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] htl: move pthread_equal into libc
  2022-10-29 12:00 ` [PATCH 3/4] htl: move pthread_equal into libc Guy-Fleury Iteriteka
@ 2022-10-30 21:51   ` Samuel Thibault
  0 siblings, 0 replies; 12+ messages in thread
From: Samuel Thibault @ 2022-10-30 21:51 UTC (permalink / raw)
  To: Guy-Fleury Iteriteka, Florian Weimer; +Cc: libc-alpha

Hello,

Florian, could you help us with making sure we are not screwing up with
the functions moves, since you have the experience with nptl?

Guy-Fleury Iteriteka via Libc-alpha, le sam. 29 oct. 2022 13:00:29 +0100, a ecrit:
> --- a/htl/Versions
> +++ b/htl/Versions
> @@ -83,7 +83,7 @@ libpthread {
>      pthread_condattr_getpshared; pthread_condattr_init;
>      pthread_condattr_setclock; pthread_condattr_setpshared;
>  
> -    pthread_create; pthread_detach; pthread_equal; pthread_exit;
> +    pthread_create; pthread_detach; pthread_exit;
>  
>      pthread_getattr_np;
>  

AIUI, we need to add it with the same symbol version in libc?

There is currently a 2.21 version in libc that was added with the
forwarding support, the symbol currently in libpthread is 2.12, so we'd
have to add that version into libc?

Guy-Fleury Iteriteka via Libc-alpha, le sam. 29 oct. 2022 13:00:30 +0100, a ecrit:
> diff --git a/htl/Versions b/htl/Versions
> index 1ef8a6d0..59070181 100644
> --- a/htl/Versions
> +++ b/htl/Versions
> @@ -25,7 +25,9 @@ libc {
>    GLIBC_2.32 {
>      thrd_current; thrd_equal; thrd_sleep; thrd_yield;
>    }
> -
> +  GLIBC_2.36 {
> +    __pthread_self;
> +  }
>    GLIBC_PRIVATE {
>      __libc_alloca_cutoff;
>      __libc_pthread_init;
> @@ -119,9 +121,6 @@ libpthread {
>      pthread_rwlockattr_destroy; pthread_rwlockattr_getpshared;
>      pthread_rwlockattr_init; pthread_rwlockattr_setpshared;
>  
> -    pthread_self;
> -    __pthread_self;
> -
>      pthread_setcancelstate; pthread_setcanceltype;
>      pthread_setconcurrency; pthread_setschedparam;
>      pthread_setschedprio; pthread_setspecific;

And similarly here.

Samuel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] htl: move pthread_self into libc
  2022-10-29 12:00 ` [PATCH 4/4] htl: move pthread_self " Guy-Fleury Iteriteka
@ 2022-10-31  7:24   ` Florian Weimer
  2022-11-01 19:19     ` Guy-Fleury Iteriteka
  0 siblings, 1 reply; 12+ messages in thread
From: Florian Weimer @ 2022-10-31  7:24 UTC (permalink / raw)
  To: Guy-Fleury Iteriteka via Libc-alpha; +Cc: Guy-Fleury Iteriteka

* Guy-Fleury Iteriteka via Libc-alpha:

> diff --git a/htl/Versions b/htl/Versions
> index 1ef8a6d0..59070181 100644
> --- a/htl/Versions
> +++ b/htl/Versions
> @@ -25,7 +25,9 @@ libc {
>    GLIBC_2.32 {
>      thrd_current; thrd_equal; thrd_sleep; thrd_yield;
>    }
> -
> +  GLIBC_2.36 {
> +    __pthread_self;
> +  }

This needs to be GLIBC_2.37 now.  I think it also needs to be
pthread_self (the public symbol).

> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index 26552958..bfa47282 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -29,6 +29,7 @@ GLIBC_2.11 mkostemps64 F
>  GLIBC_2.11 mkstemps F
>  GLIBC_2.11 mkstemps64 F
>  GLIBC_2.12 pthread_equal F
> +GLIBC_2.12 pthread_self F
>  GLIBC_2.13 __fentry__ F
>  GLIBC_2.14 syncfs F
>  GLIBC_2.15 __fdelt_chk F

“GLIBC_2.37 pthread_self” needs to show up there, in addition to the
GLIBC_2.12 version.

What's missing from this change is the construct for setting the
symbol versions, something like:

versioned_symbol (libc, __pthread_self, pthread_self, GLIBC_2_37);
#if OTHER_SHLIB_COMPAT (librt, GLIBC_2_12, GLIBC_2_37)
compat_symbol (libc, __pthread_self, pthread_self, GLIBC_2_12);
#endif

This sets the new symbol version explicitly and provides the old
version as a compatibility symbol.

It may be necessary to introduce a hidden prototype for
__pthread_self, to avoid check-localplt warnings.  You may have to use
libc_hidden_ver and a different name in the C function definition to
work around some symbol management limitations.  Another approach
could use an inline function for pthread_self or __pthread_self, so
that glibc-internal use of the symbol goes away completely.

Use of a __thread variable for ___pthread_self is problematic because
it interferes with dlmopen.  If you use THREAD_GETMEM instead, I
believe you can do away with the conditional check in pthread_self.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] htl: move pthread_self into libc
  2022-10-31  7:24   ` Florian Weimer
@ 2022-11-01 19:19     ` Guy-Fleury Iteriteka
  0 siblings, 0 replies; 12+ messages in thread
From: Guy-Fleury Iteriteka @ 2022-11-01 19:19 UTC (permalink / raw)
  To: Florian Weimer, Guy-Fleury Iteriteka via Libc-alpha

[-- Attachment #1: Type: text/plain, Size: 2179 bytes --]

Thanks I will retry this ween'k end

On October 31, 2022 9:24:59 AM GMT+02:00, Florian Weimer <fw@deneb.enyo.de> wrote:
>* Guy-Fleury Iteriteka via Libc-alpha:
>
>> diff --git a/htl/Versions b/htl/Versions
>> index 1ef8a6d0..59070181 100644
>> --- a/htl/Versions
>> +++ b/htl/Versions
>> @@ -25,7 +25,9 @@ libc {
>>    GLIBC_2.32 {
>>      thrd_current; thrd_equal; thrd_sleep; thrd_yield;
>>    }
>> -
>> +  GLIBC_2.36 {
>> +    __pthread_self;
>> +  }
>
>This needs to be GLIBC_2.37 now.  I think it also needs to be
>pthread_self (the public symbol).
>
>> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
>> index 26552958..bfa47282 100644
>> --- a/sysdeps/mach/hurd/i386/libc.abilist
>> +++ b/sysdeps/mach/hurd/i386/libc.abilist
>> @@ -29,6 +29,7 @@ GLIBC_2.11 mkostemps64 F
>>  GLIBC_2.11 mkstemps F
>>  GLIBC_2.11 mkstemps64 F
>>  GLIBC_2.12 pthread_equal F
>> +GLIBC_2.12 pthread_self F
>>  GLIBC_2.13 __fentry__ F
>>  GLIBC_2.14 syncfs F
>>  GLIBC_2.15 __fdelt_chk F
>
>“GLIBC_2.37 pthread_self” needs to show up there, in addition to the
>GLIBC_2.12 version.
>
>What's missing from this change is the construct for setting the
>symbol versions, something like:
>
>versioned_symbol (libc, __pthread_self, pthread_self, GLIBC_2_37);
>#if OTHER_SHLIB_COMPAT (librt, GLIBC_2_12, GLIBC_2_37)
>compat_symbol (libc, __pthread_self, pthread_self, GLIBC_2_12);
>#endif
>
>This sets the new symbol version explicitly and provides the old
>version as a compatibility symbol.
>
>It may be necessary to introduce a hidden prototype for
>__pthread_self, to avoid check-localplt warnings.  You may have to use
>libc_hidden_ver and a different name in the C function definition to
>work around some symbol management limitations.  Another approach
>could use an inline function for pthread_self or __pthread_self, so
>that glibc-internal use of the symbol goes away completely.
>
>Use of a __thread variable for ___pthread_self is problematic because
>it interferes with dlmopen.  If you use THREAD_GETMEM instead, I
>believe you can do away with the conditional check in pthread_self.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] move some htl symbol into libc
  2022-10-29 12:00 [PATCH 0/4] move some htl symbol into libc Guy-Fleury Iteriteka
                   ` (3 preceding siblings ...)
  2022-10-29 12:00 ` [PATCH 4/4] htl: move pthread_self " Guy-Fleury Iteriteka
@ 2022-11-01 22:28 ` Samuel Thibault
  2022-11-02 16:29   ` Samuel Thibault
  2022-11-03  8:51   ` Guy-Fleury Iteriteka
  4 siblings, 2 replies; 12+ messages in thread
From: Samuel Thibault @ 2022-11-01 22:28 UTC (permalink / raw)
  To: Guy-Fleury Iteriteka; +Cc: libc-alpha

Guy-Fleury Iteriteka via Libc-alpha, le sam. 29 oct. 2022 13:00:26 +0100, a ecrit:
> pthread_equal is removed from libpthread.so but
> with the patch for pthread_self is in both libc.so and libpthread.so.
> 
> this is libpthread.so
> -------
>          U ___pthread_self@GLIBC_PRIVATE
> 00006630 t __pthread_self
> 00006630 t pthread_self

I don't know why that would happen, but you can grep files in htl/ to
see where that is coming from exactly.

> i was thinking that it is with this makefile rule
> ------
> extra-B-pthread.so = -B$(common-objpfx)htl/

I don't actually why that is there.  It was probably cargo-culted and
probably it's worth trying to remove it.

Samuel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] move some htl symbol into libc
  2022-11-01 22:28 ` [PATCH 0/4] move some htl symbol " Samuel Thibault
@ 2022-11-02 16:29   ` Samuel Thibault
  2022-11-02 16:36     ` Guy-Fleury Iteriteka
  2022-11-03  8:51   ` Guy-Fleury Iteriteka
  1 sibling, 1 reply; 12+ messages in thread
From: Samuel Thibault @ 2022-11-02 16:29 UTC (permalink / raw)
  To: Guy-Fleury Iteriteka; +Cc: libc-alpha

Samuel Thibault, le mar. 01 nov. 2022 23:28:54 +0100, a ecrit:
> Guy-Fleury Iteriteka via Libc-alpha, le sam. 29 oct. 2022 13:00:26 +0100, a ecrit:
> > pthread_equal is removed from libpthread.so but
> > with the patch for pthread_self is in both libc.so and libpthread.so.
> > 
> > this is libpthread.so
> > -------
> >          U ___pthread_self@GLIBC_PRIVATE
> > 00006630 t __pthread_self
> > 00006630 t pthread_self
> 
> I don't know why that would happen, but you can grep files in htl/ to
> see where that is coming from exactly.

(I meant in the htl/ build tree, to make sure what .o file ends up
defining them)

Samuel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] move some htl symbol into libc
  2022-11-02 16:29   ` Samuel Thibault
@ 2022-11-02 16:36     ` Guy-Fleury Iteriteka
  0 siblings, 0 replies; 12+ messages in thread
From: Guy-Fleury Iteriteka @ 2022-11-02 16:36 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: libc-alpha



On November 2, 2022 6:29:22 PM GMT+02:00, Samuel Thibault <samuel.thibault@aquilenet.fr> wrote:
>Samuel Thibault, le mar. 01 nov. 2022 23:28:54 +0100, a ecrit:
>> Guy-Fleury Iteriteka via Libc-alpha, le sam. 29 oct. 2022 13:00:26 +0100, a ecrit:
>> > pthread_equal is removed from libpthread.so but
>> > with the patch for pthread_self is in both libc.so and libpthread.so.
>> > 
>> > this is libpthread.so
>> > -------
>> >          U ___pthread_self@GLIBC_PRIVATE
>> > 00006630 t __pthread_self
>> > 00006630 t pthread_self
>> 
>> I don't know why that would happen, but you can grep files in htl/ to
>> see where that is coming from exactly.
>
>(I meant in the htl/ build tree, to make sure what .o file ends up
>defining them)
>
will check that. Thanks
>Samuel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] move some htl symbol into libc
  2022-11-01 22:28 ` [PATCH 0/4] move some htl symbol " Samuel Thibault
  2022-11-02 16:29   ` Samuel Thibault
@ 2022-11-03  8:51   ` Guy-Fleury Iteriteka
  1 sibling, 0 replies; 12+ messages in thread
From: Guy-Fleury Iteriteka @ 2022-11-03  8:51 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 947 bytes --]

Hello,

On November 2, 2022 12:28:54 AM GMT+02:00, Samuel Thibault <samuel.thibault@aquilenet.fr> wrote:
>Guy-Fleury Iteriteka via Libc-alpha, le sam. 29 oct. 2022 13:00:26 +0100, a ecrit:
>> pthread_equal is removed from libpthread.so but
>> with the patch for pthread_self is in both libc.so and libpthread.so.
>> 
>> this is libpthread.so
>> -------
>> U ___pthread_self@GLIBC_PRIVATE
>> 00006630 t __pthread_self
>> 00006630 t pthread_self
>
>I don't know why that would happen, but you can grep files in htl/ to
>see where that is coming from exactly.
>
Sorry with a full rebuild it doesn't define in libpthread anymore. I will correct issue raised by Florian and send an update patch
>> i was thinking that it is with this makefile rule
>> ------
>> extra-B-pthread.so = -B$(common-objpfx)htl/
>
>I don't actually why that is there. It was probably cargo-culted and
>probably it's worth trying to remove it.
>
>Samuel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-11-03  8:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 12:00 [PATCH 0/4] move some htl symbol into libc Guy-Fleury Iteriteka
2022-10-29 12:00 ` [PATCH 1/4] htl: move __pthread-total " Guy-Fleury Iteriteka
2022-10-29 12:00 ` [PATCH 2/4] htl: move ___pthread_self to libc Guy-Fleury Iteriteka
2022-10-29 12:00 ` [PATCH 3/4] htl: move pthread_equal into libc Guy-Fleury Iteriteka
2022-10-30 21:51   ` Samuel Thibault
2022-10-29 12:00 ` [PATCH 4/4] htl: move pthread_self " Guy-Fleury Iteriteka
2022-10-31  7:24   ` Florian Weimer
2022-11-01 19:19     ` Guy-Fleury Iteriteka
2022-11-01 22:28 ` [PATCH 0/4] move some htl symbol " Samuel Thibault
2022-11-02 16:29   ` Samuel Thibault
2022-11-02 16:36     ` Guy-Fleury Iteriteka
2022-11-03  8:51   ` Guy-Fleury Iteriteka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).