aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-11 11:08:00 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-11 11:24:39 +0200
commitdf65f897e9501aa5b64a5cbcb101301715f2ec2f (patch)
treeed8e6ba638dde4a447fb1a30107a62f8287dcb4f
parent8fbb33b3f74560ea3c74d289bdf59cffce52b463 (diff)
downloadglibc-df65f897e9501aa5b64a5cbcb101301715f2ec2f.tar.xz
glibc-df65f897e9501aa5b64a5cbcb101301715f2ec2f.zip
nptl: Move pthread_detach, thrd_detach into libc
The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/Versions6
-rw-r--r--nptl/pthreadP.h1
-rw-r--r--nptl/pthread_detach.c14
-rw-r--r--sysdeps/pthread/Makefile3
-rw-r--r--sysdeps/pthread/thrd_detach.c11
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/arc/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/arc/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/arm/le/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/arm/le/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/csky/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/csky/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/i386/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/i386/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/le/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/le/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/sh/le/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sh/le/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist2
67 files changed, 157 insertions, 66 deletions
diff --git a/nptl/Makefile b/nptl/Makefile
index 9c69b864f0..5e0347b5b1 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -95,6 +95,7 @@ routines = \
pthread_condattr_init \
pthread_condattr_setclock \
pthread_condattr_setpshared \
+ pthread_detach \
pthread_equal \
pthread_exit \
pthread_getaffinity \
@@ -198,7 +199,6 @@ libpthread-routines = \
pthread_cancel \
pthread_clockjoin \
pthread_create \
- pthread_detach \
pthread_getattr_default_np \
pthread_getconcurrency \
pthread_getcpuclockid \
diff --git a/nptl/Versions b/nptl/Versions
index da610a4803..46ae34a1a2 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -37,6 +37,7 @@ libc {
pthread_cond_wait;
pthread_condattr_destroy;
pthread_condattr_init;
+ pthread_detach;
pthread_equal;
pthread_exit;
pthread_getschedparam;
@@ -186,6 +187,7 @@ libc {
mtx_trylock;
mtx_unlock;
thrd_current;
+ thrd_detach;
thrd_equal;
thrd_exit;
thrd_sleep;
@@ -240,6 +242,7 @@ libc {
pthread_condattr_getpshared;
pthread_condattr_setclock;
pthread_condattr_setpshared;
+ pthread_detach;
pthread_getspecific;
pthread_key_create;
pthread_key_delete;
@@ -295,6 +298,7 @@ libc {
sem_trywait;
sem_unlink;
sem_wait;
+ thrd_detach;
thrd_exit;
tss_create;
tss_delete;
@@ -365,7 +369,6 @@ libpthread {
funlockfile;
pthread_cancel;
pthread_create;
- pthread_detach;
pthread_join;
pthread_sigmask;
}
@@ -449,7 +452,6 @@ libpthread {
# C11 thread symbols.
GLIBC_2.28 {
thrd_create;
- thrd_detach;
thrd_join;
}
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index d580f71a38..34d133b187 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -529,6 +529,7 @@ extern int __pthread_atfork (void (*prepare) (void), void (*parent) (void),
extern pthread_t __pthread_self (void);
extern int __pthread_equal (pthread_t thread1, pthread_t thread2);
extern int __pthread_detach (pthread_t th);
+libc_hidden_proto (__pthread_detach)
extern int __pthread_cancel (pthread_t th);
extern int __pthread_kill (pthread_t threadid, int signo);
extern void __pthread_exit (void *value) __attribute__ ((__noreturn__));
diff --git a/nptl/pthread_detach.c b/nptl/pthread_detach.c
index 410255bbe1..ac50db9b0e 100644
--- a/nptl/pthread_detach.c
+++ b/nptl/pthread_detach.c
@@ -19,10 +19,10 @@
#include <errno.h>
#include "pthreadP.h"
#include <atomic.h>
-
+#include <shlib-compat.h>
int
-__pthread_detach (pthread_t th)
+___pthread_detach (pthread_t th)
{
struct pthread *pd = (struct pthread *) th;
@@ -53,4 +53,12 @@ __pthread_detach (pthread_t th)
return result;
}
-weak_alias (__pthread_detach, pthread_detach)
+versioned_symbol (libc, ___pthread_detach, pthread_detach, GLIBC_2_34);
+libc_hidden_ver (___pthread_detach, __pthread_detach)
+#ifndef SHARED
+strong_alias (___pthread_detach, __pthread_detach)
+#endif
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34)
+compat_symbol (libc, ___pthread_detach, pthread_detach, GLIBC_2_0);
+#endif
diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
index 54bb11bab9..ec8e3af577 100644
--- a/sysdeps/pthread/Makefile
+++ b/sysdeps/pthread/Makefile
@@ -31,7 +31,7 @@ headers += threads.h
routines += thrd_current thrd_equal thrd_sleep thrd_yield
-libpthread-routines += thrd_create thrd_detach thrd_join
+libpthread-routines += thrd_create thrd_join
$(libpthread-routines-var) += \
call_once \
@@ -47,6 +47,7 @@ $(libpthread-routines-var) += \
mtx_timedlock \
mtx_trylock \
mtx_unlock \
+ thrd_detach \
thrd_exit \
tss_create \
tss_delete \
diff --git a/sysdeps/pthread/thrd_detach.c b/sysdeps/pthread/thrd_detach.c
index cbc63f57a2..29ac011d5b 100644
--- a/sysdeps/pthread/thrd_detach.c
+++ b/sysdeps/pthread/thrd_detach.c
@@ -17,12 +17,21 @@
<https://www.gnu.org/licenses/>. */
#include "thrd_priv.h"
+#include <shlib-compat.h>
int
-thrd_detach (thrd_t thr)
+__thrd_detach (thrd_t thr)
{
int err_code;
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)
+#endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index caee529c98..b5b0b44697 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/