]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: move ___pthread_self into libc.
authorGuy-Fleury Iteriteka <gfleury@disroot.org>
Sat, 18 Mar 2023 09:58:25 +0000 (11:58 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 4 Apr 2023 23:26:34 +0000 (01:26 +0200)
sysdeps/mach/hurd/htl/pt-pthread_self.c: New file.
htl/Makefile: .. Add it to libc routine.
sysdeps/mach/hurd/htl/pt-sysdep.c(__pthread_self): Remove it.
sysdeps/mach/hurd/htl/pt-sysdep.h(__pthread_self): Add hidden propertie.
htl/Versions(__pthread_self) Version it as private symbol.

Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org>
Message-Id: <20230318095826.1125734-3-gfleury@disroot.org>

htl/Makefile
htl/Versions
sysdeps/mach/hurd/htl/pt-pthread_self.c [new file with mode: 0644]
sysdeps/mach/hurd/htl/pt-sysdep.c
sysdeps/mach/hurd/htl/pt-sysdep.h

index 9194c4fb855e515a7b10ecdcc22edf8360664f91..622e85cef845473f6a83fdb82dbde471b67d4be1 100644 (file)
@@ -164,7 +164,7 @@ headers :=                          \
 
 distribute :=
 
-routines := forward libc_pthread_init alloca_cutoff htlfreeres pt-nthreads
+routines := forward libc_pthread_init alloca_cutoff htlfreeres pt-nthreads pt-pthread_self
 shared-only-routines = forward
 
 extra-libs := libpthread
index 113110f42e168957c473929addec39ffa36457f8..9ec848119e15eb1e813120d368c530c40d8c7374 100644 (file)
@@ -31,6 +31,7 @@ libc {
     __libc_pthread_init;
     __pthread_cleanup_stack;
     __pthread_total;
+    ___pthread_self;
   }
 }
 
diff --git a/sysdeps/mach/hurd/htl/pt-pthread_self.c b/sysdeps/mach/hurd/htl/pt-pthread_self.c
new file mode 100644 (file)
index 0000000..c100471
--- /dev/null
@@ -0,0 +1,22 @@
+/* ___pthread_self variable.
+   Copyright (C) 2021-2023 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)
index 0e8b537bdc4a21f292d65bd5d114666e077a0cc6..55b1a86e0095ad502305006a393b91fc7946487d 100644 (file)
@@ -26,8 +26,6 @@
 #include <pt-internal.h>
 #include <pthreadP.h>
 
-__thread struct __pthread *___pthread_self;
-
 static void
 reset_pthread_total (void)
 {
index bb32c28e01fb08207981324c9815b6b8ad2d567a..d533450b116142cd0583e21a8459d8a9891133bb 100644 (file)
@@ -19,6 +19,7 @@
 #ifndef _PT_SYSDEP_H
 #define _PT_SYSDEP_H   1
 
+#include <stddef.h>
 #include <mach.h>
 
 /* XXX */
@@ -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()                                            \
        ({                                                         \