From: Florian Weimer Date: Wed, 20 May 2020 13:40:35 +0000 (+0200) Subject: Add the __libc_single_threaded variable X-Git-Tag: upstream/2.34~1736 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=706ad1e7af37be1d25fc2359bda006d31fe0d11b;p=platform%2Fupstream%2Fglibc.git Add the __libc_single_threaded variable The variable is placed in libc.so, and it can be true only in an outer libc, not libcs loaded via dlmopen or static dlopen. Since thread creation from inner namespaces does not work, pthread_create can update __libc_single_threaded directly. Using __libc_early_init and its initial flag, implementation of this variable is very straightforward. A future version may reset the flag during fork (but not in an inner namespace), or after joining all threads except one. Reviewed-by: DJ Delorie --- diff --git a/NEWS b/NEWS index a12b937..839934d 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,12 @@ Major new features: The GNU C Library manual has details on integration of Restartable Sequences. +* The GNU C Library now provides the header file + which declares the variable __libc_single_threaded. Applications are + encouraged to use this variable for single-thread optimizations, + instead of weak references to symbols historically defined in + libpthread. + Deprecated and removed features, and other changes affecting compatibility: * The deprecated header and the sysctl function have been diff --git a/elf/Makefile b/elf/Makefile index 6fe1df9..81a696c 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -155,7 +155,9 @@ endif tests-static-normal := tst-leaks1-static tst-array1-static tst-array5-static \ tst-dl-iter-static \ tst-tlsalign-static tst-tlsalign-extern-static \ - tst-linkall-static tst-env-setuid tst-env-setuid-tunables + tst-linkall-static tst-env-setuid tst-env-setuid-tunables \ + tst-single_threaded-static tst-single_threaded-pthread-static + tests-static-internal := tst-tls1-static tst-tls2-static \ tst-ptrguard1-static tst-stackguard1-static \ tst-tls1-static-non-pie tst-libc_dlvsym-static @@ -174,9 +176,11 @@ tests-internal := tst-tls1 tst-tls2 $(tests-static-internal) tests-static := $(tests-static-normal) $(tests-static-internal) ifeq (yes,$(build-shared)) -tests-static += tst-tls9-static -tst-tls9-static-ENV = \ - LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn +tests-static += tst-tls9-static tst-single_threaded-static-dlopen +static-dlopen-environment = \ + LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn +tst-tls9-static-ENV = $(static-dlopen-environment) +tst-single_threaded-static-dlopen-ENV = $(static-dlopen-environment) tests += restest1 preloadtest loadfail multiload origtest resolvfail \ constload1 order noload filter \ @@ -204,7 +208,8 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \ tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenfail \ tst-dlopenfail-2 \ tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlopen \ - tst-audit14 tst-audit15 tst-audit16 + tst-audit14 tst-audit15 tst-audit16 \ + tst-single_threaded tst-single_threaded-pthread # reldep9 tests-internal += loadtest unload unload2 circleload1 \ neededtest neededtest2 neededtest3 neededtest4 \ @@ -317,7 +322,9 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ tst-dlopenfailmod1 tst-dlopenfaillinkmod tst-dlopenfailmod2 \ tst-dlopenfailmod3 tst-ldconfig-ld-mod \ tst-filterobj-flt tst-filterobj-aux tst-filterobj-filtee \ - tst-auditlogmod-1 tst-auditlogmod-2 tst-auditlogmod-3 + tst-auditlogmod-1 tst-auditlogmod-2 tst-auditlogmod-3 \ + tst-single_threaded-mod1 tst-single_threaded-mod2 \ + tst-single_threaded-mod3 tst-single_threaded-mod4 # Most modules build with _ISOMAC defined, but those filtered out # depend on internal headers. modules-names-tests = $(filter-out ifuncmod% tst-libc_dlvsym-dso tst-tlsmod%,\ @@ -1748,3 +1755,17 @@ $(objpfx)tst-auxobj: $(objpfx)tst-filterobj-aux.so $(objpfx)tst-auxobj-dlopen: $(libdl) $(objpfx)tst-auxobj.out: $(objpfx)tst-filterobj-filtee.so $(objpfx)tst-auxobj-dlopen.out: $(objpfx)tst-filterobj-filtee.so + +$(objpfx)tst-single_threaded: $(objpfx)tst-single_threaded-mod1.so $(libdl) +$(objpfx)tst-single_threaded.out: \ + $(objpfx)tst-single_threaded-mod2.so $(objpfx)tst-single_threaded-mod3.so +$(objpfx)tst-single_threaded-static-dlopen: \ + $(objpfx)tst-single_threaded-mod1.o $(common-objpfx)dlfcn/libdl.a +$(objpfx)tst-single_threaded-static-dlopen.out: \ + $(objpfx)tst-single_threaded-mod2.so +$(objpfx)tst-single_threaded-pthread: \ + $(objpfx)tst-single_threaded-mod1.so $(libdl) $(shared-thread-library) +$(objpfx)tst-single_threaded-pthread.out: \ + $(objpfx)tst-single_threaded-mod2.so $(objpfx)tst-single_threaded-mod3.so \ + $(objpfx)tst-single_threaded-mod4.so +$(objpfx)tst-single_threaded-pthread-static: $(static-thread-library) diff --git a/elf/libc_early_init.c b/elf/libc_early_init.c index f0fcf64..86da66d 100644 --- a/elf/libc_early_init.c +++ b/elf/libc_early_init.c @@ -19,13 +19,18 @@ #include #include #include +#include void __libc_early_init (_Bool initial) { /* Initialize ctype data. */ __ctype_init (); + /* Register rseq ABI to the kernel for the main program's libc. */ if (initial) rseq_register_current_thread (); + + /* Only the outer namespace is marked as single-threaded. */ + __libc_single_threaded = initial; } diff --git a/elf/tst-single_threaded-mod1.c b/elf/tst-single_threaded-mod1.c new file mode 100644 index 0000000..a66de65 --- /dev/null +++ b/elf/tst-single_threaded-mod1.c @@ -0,0 +1,25 @@ +/* Test support for single-thread optimizations. Shared object 1. + Copyright (C) 2020 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 + . */ + +#include + +_Bool +single_threaded_1 (void) +{ + return __libc_single_threaded; +} diff --git a/elf/tst-single_threaded-mod2.c b/elf/tst-single_threaded-mod2.c new file mode 100644 index 0000000..74d1e2a --- /dev/null +++ b/elf/tst-single_threaded-mod2.c @@ -0,0 +1,25 @@ +/* Test support for single-thread optimizations. Shared object 2. + Copyright (C) 2020 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 + . */ + +#include + +_Bool +single_threaded_2 (void) +{ + return __libc_single_threaded; +} diff --git a/elf/tst-single_threaded-mod3.c b/elf/tst-single_threaded-mod3.c new file mode 100644 index 0000000..ac5e49c --- /dev/null +++ b/elf/tst-single_threaded-mod3.c @@ -0,0 +1,25 @@ +/* Test support for single-thread optimizations. Shared object 3. + Copyright (C) 2020 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 + . */ + +#include + +_Bool +single_threaded_3 (void) +{ + return __libc_single_threaded; +} diff --git a/elf/tst-single_threaded-mod4.c b/elf/tst-single_threaded-mod4.c new file mode 100644 index 0000000..9f3a8ec --- /dev/null +++ b/elf/tst-single_threaded-mod4.c @@ -0,0 +1,25 @@ +/* Test support for single-thread optimizations. Shared object 4. + Copyright (C) 2020 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 + . */ + +#include + +_Bool +single_threaded_4 (void) +{ + return __libc_single_threaded; +} diff --git a/elf/tst-single_threaded-pthread-static.c b/elf/tst-single_threaded-pthread-static.c new file mode 100644 index 0000000..9f383a0 --- /dev/null +++ b/elf/tst-single_threaded-pthread-static.c @@ -0,0 +1,86 @@ +/* Test support for single-thread optimizations. With threads, static version. + Copyright (C) 2020 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 + . */ + +/* This test is a stripped-down version of + tst-single_threaded-pthread.c, without any loading of dynamic + objects. */ + +#include +#include +#include +#include + +/* First barrier synchronizes main thread, thread 1, thread 2. */ +static pthread_barrier_t barrier1; + +/* Second barrier synchronizes main thread, thread 2. */ +static pthread_barrier_t barrier2; + +static void * +threadfunc (void *closure) +{ + TEST_VERIFY (!__libc_single_threaded); + + /* Wait for the main thread and the other thread. */ + xpthread_barrier_wait (&barrier1); + TEST_VERIFY (!__libc_single_threaded); + + /* Second thread waits on second barrier, too. */ + if (closure != NULL) + xpthread_barrier_wait (&barrier2); + TEST_VERIFY (!__libc_single_threaded); + + return NULL; +} + +static int +do_test (void) +{ + TEST_VERIFY (__libc_single_threaded); + + /* Two threads plus main thread. */ + xpthread_barrier_init (&barrier1, NULL, 3); + + /* Main thread and second thread. */ + xpthread_barrier_init (&barrier2, NULL, 2); + + pthread_t thr1 = xpthread_create (NULL, threadfunc, NULL); + TEST_VERIFY (!__libc_single_threaded); + + pthread_t thr2 = xpthread_create (NULL, threadfunc, &thr2); + TEST_VERIFY (!__libc_single_threaded); + + xpthread_barrier_wait (&barrier1); + TEST_VERIFY (!__libc_single_threaded); + + /* Join first thread. This should not bring us back into + single-threaded mode. */ + xpthread_join (thr1); + TEST_VERIFY (!__libc_single_threaded); + + /* We may be back in single-threaded mode after joining both + threads, but this is not guaranteed. */ + xpthread_barrier_wait (&barrier2); + xpthread_join (thr2); + printf ("info: __libc_single_threaded after joining all threads: %d\n", + __libc_single_threaded); + + return 0; +} + +#include diff --git a/elf/tst-single_threaded-pthread.c b/elf/tst-single_threaded-pthread.c new file mode 100644 index 0000000..b7112b0 --- /dev/null +++ b/elf/tst-single_threaded-pthread.c @@ -0,0 +1,174 @@ +/* Test support for single-thread optimizations. With threads. + Copyright (C) 2020 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 + . */ + +#include +#include +#include +#include +#include +#include +#include + +/* First barrier synchronizes main thread, thread 1, thread 2. */ +static pthread_barrier_t barrier1; + +/* Second barrier synchronizes main thread, thread 2. */ +static pthread_barrier_t barrier2; + +/* Defined in tst-single-threaded-mod1.so. */ +_Bool single_threaded_1 (void); + +/* Initialized via dlsym. */ +static _Bool (*single_threaded_2) (void); +static _Bool (*single_threaded_3) (void); +static _Bool (*single_threaded_4) (void); + +static void * +threadfunc (void *closure) +{ + TEST_VERIFY (!__libc_single_threaded); + TEST_VERIFY (!single_threaded_1 ()); + TEST_VERIFY (!single_threaded_2 ()); + + /* Wait until the main thread loads more functions. */ + xpthread_barrier_wait (&barrier1); + + TEST_VERIFY (!__libc_single_threaded); + TEST_VERIFY (!single_threaded_1 ()); + TEST_VERIFY (!single_threaded_2 ()); + TEST_VERIFY (!single_threaded_3 ()); + TEST_VERIFY (!single_threaded_4 ()); + + /* Second thread waits on second barrier, too. */ + if (closure != NULL) + xpthread_barrier_wait (&barrier2); + TEST_VERIFY (!__libc_single_threaded); + TEST_VERIFY (!single_threaded_1 ()); + TEST_VERIFY (!single_threaded_2 ()); + TEST_VERIFY (!single_threaded_3 ()); + TEST_VERIFY (!single_threaded_4 ()); + + return NULL; +} + +/* Used for closure arguments to the subprocess function. */ +static char expected_false = 0; +static char expected_true = 1; + +/* A subprocess inherits currently inherits the single-threaded state + of the parent process. */ +static void +subprocess (void *closure) +{ + const char *expected = closure; + TEST_COMPARE (__libc_single_threaded, *expected); + TEST_COMPARE (single_threaded_1 (), *expected); + if (single_threaded_2 != NULL) + TEST_COMPARE (single_threaded_2 (), *expected); + if (single_threaded_3 != NULL) + TEST_COMPARE (single_threaded_3 (), *expected); + if (single_threaded_4 != NULL) + TEST_VERIFY (!single_threaded_4 ()); +} + +static int +do_test (void) +{ + printf ("info: main __libc_single_threaded address: %p\n", + &__libc_single_threaded); + TEST_VERIFY (__libc_single_threaded); + TEST_VERIFY (single_threaded_1 ()); + support_isolate_in_subprocess (subprocess, &expected_true); + + void *handle_mod2 = xdlopen ("tst-single_threaded-mod2.so", RTLD_LAZY); + single_threaded_2 = xdlsym (handle_mod2, "single_threaded_2"); + TEST_VERIFY (single_threaded_2 ()); + + /* Two threads plus main thread. */ + xpthread_barrier_init (&barrier1, NULL, 3); + + /* Main thread and second thread. */ + xpthread_barrier_init (&barrier2, NULL, 2); + + pthread_t thr1 = xpthread_create (NULL, threadfunc, NULL); + TEST_VERIFY (!__libc_single_threaded); + TEST_VERIFY (!single_threaded_1 ()); + TEST_VERIFY (!single_threaded_2 ()); + support_isolate_in_subprocess (subprocess, &expected_false); + + pthread_t thr2 = xpthread_create (NULL, threadfunc, &thr2); + TEST_VERIFY (!__libc_single_threaded); + TEST_VERIFY (!single_threaded_1 ()); + TEST_VERIFY (!single_threaded_2 ()); + support_isolate_in_subprocess (subprocess, &expected_false); + + /* Delayed library load, while already multi-threaded. */ + void *handle_mod3 = xdlopen ("tst-single_threaded-mod3.so", RTLD_LAZY); + single_threaded_3 = xdlsym (handle_mod3, "single_threaded_3"); + TEST_VERIFY (!__libc_single_threaded); + TEST_VERIFY (!single_threaded_1 ()); + TEST_VERIFY (!single_threaded_2 ()); + TEST_VERIFY (!single_threaded_3 ()); + support_isolate_in_subprocess (subprocess, &expected_false); + + /* Same with dlmopen. */ + void *handle_mod4 = dlmopen (LM_ID_NEWLM, "tst-single_threaded-mod4.so", + RTLD_LAZY); + single_threaded_4 = xdlsym (handle_mod4, "single_threaded_4"); + TEST_VERIFY (!__libc_single_threaded); + TEST_VERIFY (!single_threaded_1 ()); + TEST_VERIFY (!single_threaded_2 ()); + TEST_VERIFY (!single_threaded_3 ()); + TEST_VERIFY (!single_threaded_4 ()); + support_isolate_in_subprocess (subprocess, &expected_false); + + /* Run the newly loaded functions from the other threads as + well. */ + xpthread_barrier_wait (&barrier1); + TEST_VERIFY (!__libc_single_threaded); + TEST_VERIFY (!single_threaded_1 ()); + TEST_VERIFY (!single_threaded_2 ()); + TEST_VERIFY (!single_threaded_3 ()); + TEST_VERIFY (!single_threaded_4 ()); + support_isolate_in_subprocess (subprocess, &expected_false); + + /* Join first thread. This should not bring us back into + single-threaded mode. */ + xpthread_join (thr1); + TEST_VERIFY (!__libc_single_threaded); + TEST_VERIFY (!single_threaded_1 ()); + TEST_VERIFY (!single_threaded_2 ()); + TEST_VERIFY (!single_threaded_3 ()); + TEST_VERIFY (!single_threaded_4 ()); + support_isolate_in_subprocess (subprocess, &expected_false); + + /* We may be back in single-threaded mode after joining both + threads, but this is not guaranteed. */ + xpthread_barrier_wait (&barrier2); + xpthread_join (thr2); + printf ("info: __libc_single_threaded after joining all threads: %d\n", + __libc_single_threaded); + + xdlclose (handle_mod4); + xdlclose (handle_mod3); + xdlclose (handle_mod2); + + return 0; +} + +#include diff --git a/elf/tst-single_threaded-static-dlopen.c b/elf/tst-single_threaded-static-dlopen.c new file mode 100644 index 0000000..f335883 --- /dev/null +++ b/elf/tst-single_threaded-static-dlopen.c @@ -0,0 +1,57 @@ +/* Test support for single-thread optimizations. No threads, static dlopen. + Copyright (C) 2020 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 + . */ + +/* In a static dlopen scenario, the single-threaded optimization is + not possible because their is no globally shared dynamic linker + across all namespaces. */ + +#include +#include +#include +#include + +static int +do_test (void) +{ + TEST_VERIFY (__libc_single_threaded); + + /* Defined in tst-single-threaded-mod1.o. */ + extern _Bool single_threaded_1 (void); + TEST_VERIFY (single_threaded_1 ()); + + /* A failed dlopen does not change the multi-threaded status. */ + TEST_VERIFY (dlopen ("tst-single_threaded-does-not-exist.so", RTLD_LAZY) + == NULL); + TEST_VERIFY (__libc_single_threaded); + TEST_VERIFY (single_threaded_1 ()); + + /* And neither does a successful dlopen for outer (static) libc. */ + void *handle_mod2 = xdlopen ("tst-single_threaded-mod2.so", RTLD_LAZY); + _Bool (*single_threaded_2) (void) + = xdlsym (handle_mod2, "single_threaded_2"); + TEST_VERIFY (__libc_single_threaded); + TEST_VERIFY (single_threaded_1 ()); + /* The inner libc always assumes multi-threaded use. */ + TEST_VERIFY (!single_threaded_2 ()); + + xdlclose (handle_mod2); + + return 0; +} + +#include diff --git a/elf/tst-single_threaded-static.c b/elf/tst-single_threaded-static.c new file mode 100644 index 0000000..593da88 --- /dev/null +++ b/elf/tst-single_threaded-static.c @@ -0,0 +1,29 @@ +/* Test support for single-thread optimizations. Static, no threads. + Copyright (C) 2020 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 + . */ + +#include +#include + +static int +do_test (void) +{ + TEST_VERIFY (__libc_single_threaded); + return 0; +} + +#include diff --git a/elf/tst-single_threaded.c b/elf/tst-single_threaded.c new file mode 100644 index 0000000..2c36342 --- /dev/null +++ b/elf/tst-single_threaded.c @@ -0,0 +1,70 @@ +/* Test support for single-thread optimizations. No threads. + Copyright (C) 2020 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 + . */ + +#include +#include +#include +#include +#include +#include + +/* Defined in tst-single-threaded-mod1.so. */ +extern _Bool single_threaded_1 (void); + +/* Initialized via dlsym. */ +_Bool (*single_threaded_2) (void); +_Bool (*single_threaded_3) (void); + +static void +subprocess (void *closure) +{ + TEST_VERIFY (__libc_single_threaded); + TEST_VERIFY (single_threaded_1 ()); + if (single_threaded_2 != NULL) + TEST_VERIFY (single_threaded_2 ()); + if (single_threaded_3 != NULL) + TEST_VERIFY (!single_threaded_3 ()); +} + +static int +do_test (void) +{ + TEST_VERIFY (__libc_single_threaded); + TEST_VERIFY (single_threaded_1 ()); + support_isolate_in_subprocess (subprocess, NULL); + + void *handle_mod2 = xdlopen ("tst-single_threaded-mod2.so", RTLD_LAZY); + single_threaded_2 = xdlsym (handle_mod2, "single_threaded_2"); + TEST_VERIFY (single_threaded_2 ()); + support_isolate_in_subprocess (subprocess, NULL); + + /* The current implementation treats the inner namespace as + multi-threaded. */ + void *handle_mod3 = dlmopen (LM_ID_NEWLM, "tst-single_threaded-mod3.so", + RTLD_LAZY); + single_threaded_3 = xdlsym (handle_mod3, "single_threaded_3"); + TEST_VERIFY (!single_threaded_3 ()); + support_isolate_in_subprocess (subprocess, NULL); + + xdlclose (handle_mod3); + xdlclose (handle_mod2); + + return 0; +} + +#include diff --git a/htl/pt-create.c b/htl/pt-create.c index f501a12..7ac875c 100644 --- a/htl/pt-create.c +++ b/htl/pt-create.c @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -104,6 +105,10 @@ __pthread_create_internal (struct __pthread **thread, sigset_t sigset; size_t stacksize; + /* Avoid a data race in the multi-threaded case. */ + if (__libc_single_threaded) + __libc_single_threaded = 0; + /* Allocate a new thread structure. */ err = __pthread_alloc (&pthread); if (err) diff --git a/include/sys/single_threaded.h b/include/sys/single_threaded.h new file mode 100644 index 0000000..18f6972 --- /dev/null +++ b/include/sys/single_threaded.h @@ -0,0 +1 @@ +#include diff --git a/misc/Makefile b/misc/Makefile index 67c5237..58959f6 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -37,7 +37,8 @@ headers := sys/uio.h bits/uio-ext.h bits/uio_lim.h \ bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h bits/error.h \ bits/select2.h bits/hwcap.h sys/auxv.h \ sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \ - bits/err-ldbl.h bits/error-ldbl.h + bits/err-ldbl.h bits/error-ldbl.h \ + sys/single_threaded.h routines := brk sbrk sstk ioctl \ readv writev preadv preadv64 pwritev pwritev64 \ @@ -72,7 +73,7 @@ routines := brk sbrk sstk ioctl \ fgetxattr flistxattr fremovexattr fsetxattr getxattr \ listxattr lgetxattr llistxattr lremovexattr lsetxattr \ removexattr setxattr getauxval ifunc-impl-list makedev \ - allocate_once fd_to_filename + allocate_once fd_to_filename single_threaded generated += tst-error1.mtrace tst-error1-mem.out \ tst-allocate_once.mtrace tst-allocate_once-mem.out diff --git a/misc/Versions b/misc/Versions index e749582..95666f6 100644 --- a/misc/Versions +++ b/misc/Versions @@ -161,6 +161,9 @@ libc { GLIBC_2.30 { twalk_r; } + GLIBC_2.32 { + __libc_single_threaded; + } GLIBC_PRIVATE { __madvise; __mktemp; diff --git a/misc/single_threaded.c b/misc/single_threaded.c new file mode 100644 index 0000000..6d975c0 --- /dev/null +++ b/misc/single_threaded.c @@ -0,0 +1,27 @@ +/* Support for single-thread optimizations. Statically linked version. + Copyright (C) 2020 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 + . */ + +#include + +/* In dynamically linked programs, this variable is initialized in + __libc_early_init (as false for inner libcs). */ +#ifdef SHARED +char __libc_single_threaded; +#else +char __libc_single_threaded = 1; +#endif diff --git a/misc/sys/single_threaded.h b/misc/sys/single_threaded.h new file mode 100644 index 0000000..648fc2e --- /dev/null +++ b/misc/sys/single_threaded.h @@ -0,0 +1,33 @@ +/* Support for single-thread optimizations. + Copyright (C) 2020 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 + . */ + +#ifndef _SYS_SINGLE_THREADED_H +#define _SYS_SINGLE_THREADED_H + +#include + +__BEGIN_DECLS + +/* If this variable is non-zero, then the current thread is the only + thread in the process image. If it is zero, the process might be + multi-threaded. */ +extern char __libc_single_threaded; + +__END_DECLS + +#endif /* _SYS_SINGLE_THREADED_H */ diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index f348a6f..e05013e 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -35,6 +35,7 @@ #include #include #include "libioP.h" +#include #include @@ -625,6 +626,10 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr, { STACK_VARIABLES; + /* Avoid a data race in the multi-threaded case. */ + if (__libc_single_threaded) + __libc_single_threaded = 0; + const struct pthread_attr *iattr = (struct pthread_attr *) attr; union pthread_attr_transparent default_attr; bool destroy_default_attr = false; diff --git a/sysdeps/generic/libc.abilist b/sysdeps/generic/libc.abilist index e69de29..8ca9b93 100644 --- a/sysdeps/generic/libc.abilist +++ b/sysdeps/generic/libc.abilist @@ -0,0 +1 @@ +GLIBC_2.32 __libc_single_threaded D 0x1 diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 6400885..ea985b0 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2181,6 +2181,7 @@ GLIBC_2.3.4 setsourcefilter F 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 mach_print F GLIBC_2.32 mremap F GLIBC_2.32 thrd_current F diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index e6e4f08..bb0af75 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2149,6 +2149,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 8358978..d4d1cd4 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2231,6 +2231,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index f7a61fc..d71beaf 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -133,6 +133,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index c84ab6e..e68a492 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -130,6 +130,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index 2fadebd..ed9222b 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2093,6 +2093,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index c28604f..8d1073a 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2052,6 +2052,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 4042d2b..8fb0927 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2218,6 +2218,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index 13a38cb..a3e6e48 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -2084,6 +2084,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 231e41e..cbc6fce 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -134,6 +134,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index b244e2a..7be3214 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2164,6 +2164,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 8c53e8b..51468dd 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2144,6 +2144,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index fa7df5a..61eb992 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2141,6 +2141,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 831251f..e85b64a 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2135,6 +2135,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 6f3c014..72c5433 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2133,6 +2133,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index c3a3931..edd1590 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2141,6 +2141,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index bdc9b41..0f35a63 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2135,6 +2135,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index d8573f6..5a4f50b 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2182,6 +2182,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 77309e8..3de2243 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -2191,6 +2191,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 84da744..abf8fa5 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -2224,6 +2224,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 219316b..c82911c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2054,6 +2054,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index 05c9999..f64c315 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2279,6 +2279,7 @@ GLIBC_2.32 __isoc99_vsscanfieee128 F GLIBC_2.32 __isoc99_vswscanfieee128 F GLIBC_2.32 __isoc99_vwscanfieee128 F GLIBC_2.32 __isoc99_wscanfieee128 F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __obstack_printf_chkieee128 F GLIBC_2.32 __obstack_printfieee128 F GLIBC_2.32 __obstack_vprintf_chkieee128 F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index 22db101..991e361 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2111,6 +2111,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 256ce37..76d859a 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -2189,6 +2189,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 5d63043..a4c5b38 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2090,6 +2090,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index bff6c48..3df8bbe 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2059,6 +2059,7 @@ GLIBC_2.30 twalk_r F GLIBC_2.31 msgctl F GLIBC_2.31 semctl F GLIBC_2.31 shmctl F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index e55f46a..ade2fc9 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2056,6 +2056,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 96e76c7..0dea9b4 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -2180,6 +2180,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index e6bfb39..32f86b9 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2107,6 +2107,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 168ca03..90f3c1d 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2065,6 +2065,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 82a5089..8dbe6d3 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2162,6 +2162,7 @@ GLIBC_2.30 getdents64 F GLIBC_2.30 gettid F GLIBC_2.30 tgkill F GLIBC_2.30 twalk_r F +GLIBC_2.32 __libc_single_threaded D 0x1 GLIBC_2.32 __rseq_abi T 0x20 GLIBC_2.32 pthread_attr_getsigmask_np F GLIBC_2.32 pthread_attr_setaffinity_np F