aboutsummaryrefslogtreecommitdiff
path: root/nptl
AgeCommit message (Collapse)AuthorFilesLines
2021-06-02Add missing symbols to Version filesFlorian Weimer1-0/+8
Some symbols have explicit versioned_symbol or compat_symbol markers in the sources, but no corresponding entry in the Versions files. This presently works because the local: * directive is only applied to the base version. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-27nptl: Add pthread_attr_setaffinity_np failure testAdhemerval Zanella2-0/+60
It checks whether an invalid affinity mask does return an error, similar to what sysdeps/pthread/tst-bad-schedattr.c does for pthread_attr_setschedparam. Checked on x86_64-linux-gnu.
2021-05-27nptl: Move createthread to pthread_createAdhemerval Zanella2-166/+115
The 'create_thread' function is moved to pthread_create.c. It removes the START_THREAD_DEFN and START_THREAD_SELF macros and make the lock usage more clear (no need to cross-reference multiple files). No functional change.
2021-05-27nptl: Move Linux createthread to nptlAdhemerval Zanella1-8/+116
git mv -f sysdeps/unix/sysv/linux/createthread.c nptl/createthread.c No functional change.
2021-05-27nptl: Install SIGSETXID handler with SA_ONSTACK [BZ #27914]Florian Weimer1-2/+5
The signal is sent to all threads, some of which may have switched to very small stacks. If they have also installed an alternate signal stack, SA_ONSTACK makes this work. The Go runtime needs this: runtime: C.setuid/C.setgid smashes Go stack <https://github.com/golang/go/issues/9400> Doing this for SIGCANCEL is less obviously beneficial and needs further testing. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-05-25Linux: Remove remaining references to $(shared-thread-library)Florian Weimer1-14/+7
Since the variable expands to nothing under Linux, it is no longer necessary to clutter the makefiles with it. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-25nptl: Do not install libpthread.so and do not link tests with itFlorian Weimer1-24/+5
Keep installing libpthread.a, so that -lpthread works. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-21nptl: Remove remaining code from libpthreadFlorian Weimer7-195/+11
Only the placeholder compatibility symbols are left now. The __errno_location symbol was removed (moved) using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-21nptl: Move pthread_create, thrd_create into libcFlorian Weimer6-26/+38
The symbols were moved using scripts/move-symbol-to-libc.py. The libpthread placeholder symbols need some changes because some symbol versions have gone away completely. But __errno_location@@GLIBC_2.0 still exists, so the GLIBC_2.0 version is still there. The internal __pthread_create symbol now points to the correct function, so the sysdeps/nptl/thrd_create.c override is no longer necessary. There was an issue how the hidden alias of pthread_getattr_default_np was defined, so this commit cleans up that aspects and removes the GLIBC_PRIVATE export altogether. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-21nptl: Move semi-public __pthread_get_minstack symbol into libcFlorian Weimer5-20/+23
No abilist updates here because it is a GLIBC_PRIVATE symbol. It's also necessary to move nptl_version into pthread_create, so that it still ends up in static binaries. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-21nptl: Eliminate the __static_tls_size, __static_tls_align_m1 variablesFlorian Weimer4-59/+27
Use the __nptl_tls_static_size_for_stack inline function instead, and the GLRO (dl_tls_static_align) value directly. The computation of GLRO (dl_tls_static_align) in _dl_determine_tlsoffset ensures that the alignment is at least TLS_TCB_ALIGN, which at least STACK_ALIGN (see allocate_stack). Therefore, the additional rounding-up step is removed. ALso move the initialization of the default stack size from __pthread_initialize_minimal_internal to __pthread_early_init. This introduces an extra system call during single-threaded startup, but this simplifies the initialization sequence. No locking is needed around the writes to __default_pthread_attr because the process is single-threaded at this point. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-21nptl: Perform signal initialization upon pthread_createFlorian Weimer5-88/+131
Install signal handlers and unblock signals before pthread_create creates the first thread. create_thread in sysdeps/unix/sysv/linux/createthread.c can send SIGCANCEL to the current thread, so the SIGCANCEL handler is currently needed even if pthread_cancel is never called. (The way timer_create uses SIGCANCEL does not need a signal handler; both SIG_DFL and SIG_IGN dispositions should work.) Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-21nptl: Remove unused __libc_pthread_init functionFlorian Weimer2-36/+0
Fixes commit 732139dabeda7ecce0d56200bc176251e759ccde ("Linux: Move __reclaim_stacks into the fork implementation in libc").
2021-05-19nptl: Add missing __pthread_cond_wait alias in static buildsFlorian Weimer1-0/+3
Fixes commit cf3fff1c195f859ba949a7ad86d4fca70bd99740 ("nptl: Move cnd_wait into libc"). Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
2021-05-17nptl: Move pthread_sigqueue into libcFlorian Weimer4-5/+19
The symbol was moved using scripts/move-symbol-to-libc.py. The GLIBC_2.11 version is now empty, so add a placeholder symbol. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-17nptl: Move pthread_setschedprio into libcFlorian Weimer4-6/+19
The symbol was moved using scripts/move-symbol-to-libc.py. The GLIBC_2.3.4 version is now empty, so add a placeholder symbol. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-17nptl: Move pthread_setname_np into libcFlorian Weimer4-4/+21
The symbol was moved using scripts/move-symbol-to-libc.py. Add __libpthread_version_placeholder@@GLIBC_2.12 for the targets that need it. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-17nptl: Move pthread_setaffinity_np into libcFlorian Weimer4-6/+16
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-17nptl: Move pthread_getname_np into libcFlorian Weimer3-6/+13
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-17nptl: Move pthread_getcpuclockid into libcFlorian Weimer4-7/+23
The symbol was moved using scripts/move-symbol-to-libc.py. __libpthread_version_placeholder@@GLIBC_2.2 is needed by this change; the Versions entry for GLIBC_2.2 in libpthread had leftover symbols due to an error in a previous conflict resolution. The condition for the placeholder symbol is complicated because some architectures have earlier symbols at the GLIBC_2.2 symbol versions, so the placeholder is not required there (yet). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-17nptl: Replace pthread_getcpuclockid with Linux implementationFlorian Weimer1-18/+6
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-17nptl: Move pthread_getattr_default_np into libcFlorian Weimer5-6/+26
The symbol was moved using scripts/move-symbol-to-libc.py. A new placeholder symbol __libpthread_version_placeholder@GLIBC_2.18 is needed to keep the GLIBC_2.18 symbol version in libpthread. The __pthread_getattr_default_np@@GLIBC_PRIVATE export is used from pthread_create. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-17nptl: Move __nptl_create_event, __nptl_death_event into libcFlorian Weimer4-5/+7
In libthread_db, use the exported GLIBC_PRIVATE symbols directly instead of relying on _thread_db_* variables in libpthread (which used to be created by the DB_FUNCTION macros). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-17nptl: Move __nptl_initial_report_events into ld.so/startup codeFlorian Weimer3-12/+6
The initialization of the report_events TCB field is now performed in __tls_init_tp instead of __pthread_initialize_minimal_internal (in libpthread). The events interface is difficult to test because GDB stopped using it in 2015. The td_thr_get_info change to ignore lookup issues is enough to support GDB with this change. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-14nptl: Fix tst-pthread-gdb-attach for ptrace_scope equal 1Adhemerval Zanella1-17/+39
This is similar to the fix for elf/tst-pldd (2f9046fb059e94fe25): it checks ptrace_scope value (values higher than 2 are too restrictive to allow the test to run) and it rearranges the spawned processes to make the target process the gdb child. Checked on x86_64-linux-gnu with ptrace_scope set to 1.
2021-05-11nptl: Move pthread_getconcurrency, pthread_setconcurrency into libcFlorian Weimer4-8/+24
The symbols were moved using scripts/move-symbol-to-libc.py, in one commit due to their dependency on the internal __concurrency_level variable. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_cancel into libcFlorian Weimer4-4/+8
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move __pthread_register_cancel_defer, ↵Florian Weimer3-6/+21
__pthread_unregister_cancel_restore to libc The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move __pthread_register_cancel, __pthread_unregister_cancel to libcFlorian Weimer4-19/+26
The symbols were moved using scripts/move-symbol-to-libc.py. Also clean up some unwinder linking leftover in the same spot in nptl/pthreadP.h. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_attr_setstacksize into libcFlorian Weimer3-11/+19
The symbol was moved using scripts/move-symbol-to-libc.py. It is necessary to arrange for a __libpthread_version_placeholder@GLIBC_2.6 on some of the powerpc targets. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_attr_setstackaddr into libcFlorian Weimer3-4/+10
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_attr_setstack into libcFlorian Weimer3-15/+21
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_attr_setguardsize into libcFlorian Weimer3-4/+11
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_attr_getstacksize into libcFlorian Weimer3-4/+10
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_attr_getstackaddr into libcFlorian Weimer3-4/+10
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_attr_getstack into libcFlorian Weimer3-4/+10
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_attr_getguardsize into libcFlorian Weimer3-4/+11
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_attr_getaffinity_np into libcFlorian Weimer3-5/+10
The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move thread join functions into libcFlorian Weimer8-31/+77
The symbols pthread_clockjoin_np, pthread_join, pthread_timedjoin_np, pthread_tryjoin_np, thrd_join were moved using scripts/move-symbol-to-libc.py. Moving the symbols at the same time avoids the need for temporary exports. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_detach, thrd_detach into libcFlorian Weimer4-6/+17
The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move __free_tcb into libcFlorian Weimer7-29/+52
Under the name __nptl_free_tcb. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move stack cache management, __libpthread_freeres into libcFlorian Weimer9-153/+202
This replaces the FREE_P macro with the __nptl_stack_in_use inline function. stack_list_del is renamed to __nptl_stack_list_del, stack_list_add to __nptl_stack_list_add, __deallocate_stack to __nptl_deallocate_stack, free_stacks to __nptl_free_stacks. It is convenient to move __libpthread_freeres into libc at the same time. This removes the temporary __default_pthread_attr_freeres export and restores full freeres coverage for __default_pthread_attr. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Move pthread_setattr_default_np into libcFlorian Weimer4-6/+16
The symbol was moved using scripts/move-symbol-to-libc.py. The export of __default_pthread_attr_freeres is temporary. There is a minor regression in freeres coverage because in the dynamic case, __default_pthread_attr_freeres is no longer called if libpthread is not linked in. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Remove always-disabled debugging supportFlorian Weimer3-75/+5
This removes the DEBUGGING_P macro and the __pthread_debug variable. The __find_in_stack_list function is now unused and deleted as well. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-11nptl: Replace pthread_sigqueue implementation with Linux oneFlorian Weimer1-4/+38
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-05-10linux: Move funlockfile/_IO_funlockfile into libcAdhemerval Zanella1-1/+0
The nptl version is used as default, since now with symbol always present the single-thread optimization is tricky. Hurd is not change, it is used it own lock scheme (which call _cthreads_funlockfile). Checked on x86_64-linux-gnu.
2021-05-10linux: Move ftrylockfile/_IO_ftrylockfile into libcAdhemerval Zanella1-1/+0
The nptl version is used as default, since now with symbol always present the single-thread optimization is tricky. Hurd is not change, it is used it own lock scheme (which call _cthreads_ftrylockfile). Checked on x86_64-linux-gnu.
2021-05-10linux: Move flockfile/_IO_flockfile into libcAdhemerval Zanella1-2/+0
The nptl version is used as default, since now with symbol always present the single-thread optimization is tricky. Hurd is not change, it is used it own lock scheme (which call _cthreads_flockfile). Checked on x86_64-linux-gnu.
2021-05-10Linux: Move __reclaim_stacks into the fork implementation in libcFlorian Weimer4-119/+0
As a result, __libc_pthread_init is no longer needed. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-05-10nptl: Move __default_pthread_attr, __default_pthread_attr_lock into libcFlorian Weimer4-6/+14
The GLIBC_PRIVATE exports for these symbols are expected to be temporary. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>