about summary refs log tree commit diff
path: root/sysdeps/unix
Commit message (Collapse)AuthorAgeFilesLines
* nptl: Move Linux createthread to nptlAdhemerval Zanella2021-05-271-153/+0
| | | | | | git mv -f sysdeps/unix/sysv/linux/createthread.c nptl/createthread.c No functional change.
* aarch64: Added optimized memcpy and memmove for A64FXNaohiro Tamura2021-05-272-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch optimizes the performance of memcpy/memmove for A64FX [1] which implements ARMv8-A SVE and has L1 64KB cache per core and L2 8MB cache per NUMA node. The performance optimization makes use of Scalable Vector Register with several techniques such as loop unrolling, memory access alignment, cache zero fill, and software pipelining. SVE assembler code for memcpy/memmove is implemented as Vector Length Agnostic code so theoretically it can be run on any SOC which supports ARMv8-A SVE standard. We confirmed that all testcases have been passed by running 'make check' and 'make xcheck' not only on A64FX but also on ThunderX2. And also we confirmed that the SVE 512 bit vector register performance is roughly 4 times better than Advanced SIMD 128 bit register and 8 times better than scalar 64 bit register by running 'make bench'. [1] https://github.com/fujitsu/A64FX Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com> Reviewed-by: Szabolcs Nagy <Szabolcs.Nagy@arm.com>
* aarch64: Added Vector Length Set test helper scriptNaohiro Tamura2021-05-261-0/+82
| | | | | | | | | | | | | | | | | | | This patch is a test helper script to change Vector Length for child process. This script can be used as test-wrapper for 'make check'. Usage examples: ~/build$ make check subdirs=string \ test-wrapper='~/glibc/sysdeps/unix/sysv/linux/aarch64/vltest.py 16' ~/build$ ~/glibc/sysdeps/unix/sysv/linux/aarch64/vltest.py 16 \ make test t=string/test-memcpy ~/build$ ~/glibc/sysdeps/unix/sysv/linux/aarch64/vltest.py 32 \ ./debugglibc.sh string/test-memmove ~/build$ ~/glibc/sysdeps/unix/sysv/linux/aarch64/vltest.py 64 \ ./testrun.sh string/test-memset
* Linux: Remove remaining references to $(shared-thread-library)Florian Weimer2021-05-252-7/+0
| | | | | | | 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>
* nptl: Remove remaining code from libpthreadFlorian Weimer2021-05-2135-68/+26
| | | | | | | | | 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>
* nptl: Move pthread_create, thrd_create into libcFlorian Weimer2021-05-2161-66/+173
| | | | | | | | | | | | | | | | | | | 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>
* linux: Fix clock_getres fallbackAdhemerval Zanella2021-05-181-1/+1
| | | | | | | | The tst-timespec_getres (e5ac7bd679de5) triggers an issue on 32-bit architecture on Linux older than 5.1, where the fallback syscall is used. Checked on powerpc-linux-gnu.
* Add C2X timespec_getresJoseph Myers2021-05-1734-0/+83
| | | | | | | | | | | | | | | | | | | ISO C2X adds a timespec_getres function alongside the C11 timespec_get, with functionality similar to that of POSIX clock_getres (including allowing a NULL pointer to be passed to the function). Implement this function for glibc, similarly to the implementation of timespec_get. This includes a basic test like that of timespec_get, but no documentation in the manual, given that TIME_UTC and timespec_get aren't documented in the manual at all. The handling of 64-bit time follows that in timespec_get; people maintaining patch series for 64-bit time will need to update them accordingly (to export __timespec_getres64, redirect calls in time.h and run the test for _TIME_BITS=64). Tested for x86_64 and x86, and (previous version; only testcase differs) with build-many-glibcs.py.
* nptl: Move pthread_sigqueue into libcFlorian Weimer2021-05-1761-29/+83
| | | | | | | | 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>
* nptl: Move pthread_setschedprio into libcFlorian Weimer2021-05-1761-29/+80
| | | | | | | | 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>
* nptl: Move pthread_setname_np into libcFlorian Weimer2021-05-1761-29/+83
| | | | | | | | | 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>
* nptl: Move pthread_setaffinity_np into libcFlorian Weimer2021-05-1761-45/+99
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_getname_np into libcFlorian Weimer2021-05-1761-29/+64
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_getcpuclockid into libcFlorian Weimer2021-05-1761-29/+70
| | | | | | | | | | | | | 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>
* nptl: Replace pthread_getcpuclockid with Linux implementationFlorian Weimer2021-05-171-42/+0
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_getattr_default_np into libcFlorian Weimer2021-05-1761-29/+86
| | | | | | | | | | | 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>
* powerpc: Remove _dl_var_initFlorian Weimer2021-05-174-122/+10
| | | | | | | | | The generic __rtld_static_init code handles GLRO (dl_pagesize), GLRO (dl_auxv), GLRO (dl_hwcap), GLRO (dl_hwcap2). GLRO (dl_cache_line_size) is handled in an __rtld_static_init_arch override. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* mips: Remove _dl_var_initFlorian Weimer2021-05-174-100/+0
| | | | | | The generic __rtld_static_init code handles GLRO (dl_pagesize). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* m68k: Remove _dl_var_initFlorian Weimer2021-05-174-122/+0
| | | | | | The generic __rtld_static_init code handles GLRO (dl_pagesize). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* ia64: Remove _dl_var_initFlorian Weimer2021-05-174-102/+0
| | | | | | | The generic __rtld_static_init code handles GLRO (dl_pagesize) and GLRO (dl_clktck). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* arc: Remove _dl_var_initFlorian Weimer2021-05-174-129/+0
| | | | | | The generic __rtld_static_init code handles GLRO (dl_pagesize). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* aarch64: Remove _dl_var_initFlorian Weimer2021-05-174-130/+0
| | | | | | The generic __rtld_static_init code handles GLRO (dl_pagesize). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* linux/check_native: Always close socket on returnSiddhesh Poyarekar2021-05-121-12/+11
| | | | | | The error paths of __check_native would leave the socket FD open on return, resulting in an FD leak. Rework function exit paths so that the fd is always closed on return.
* nptl: Move pthread_getconcurrency, pthread_setconcurrency into libcFlorian Weimer2021-05-1161-58/+128
| | | | | | | | 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>
* nptl: Move pthread_cancel into libcFlorian Weimer2021-05-1161-29/+64
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move __pthread_register_cancel_defer, ↵Florian Weimer2021-05-1161-58/+128
| | | | | | | | __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>
* nptl: Move __pthread_register_cancel, __pthread_unregister_cancel to libcFlorian Weimer2021-05-1161-58/+128
| | | | | | | | | 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>
* nptl: Move pthread_attr_setstacksize into libcFlorian Weimer2021-05-1165-45/+106
| | | | | | | | | | 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>
* nptl: Move pthread_attr_setstackaddr into libcFlorian Weimer2021-05-1161-29/+64
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_setstack into libcFlorian Weimer2021-05-1161-37/+75
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_setguardsize into libcFlorian Weimer2021-05-1161-29/+64
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getstacksize into libcFlorian Weimer2021-05-1161-29/+64
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getstackaddr into libcFlorian Weimer2021-05-1161-29/+64
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getstack into libcFlorian Weimer2021-05-1161-29/+64
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getguardsize into libcFlorian Weimer2021-05-1161-29/+64
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getaffinity_np into libcFlorian Weimer2021-05-1161-45/+83
| | | | | | The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move thread join functions into libcFlorian Weimer2021-05-1161-145/+347
| | | | | | | | | | | 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>
* nptl: Move pthread_detach, thrd_detach into libcFlorian Weimer2021-05-1161-58/+128
| | | | | | The symbols were moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_setattr_default_np into libcFlorian Weimer2021-05-1161-29/+64
| | | | | | | | | | | 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>
* nptl: Replace pthread_sigqueue implementation with Linux oneFlorian Weimer2021-05-111-71/+0
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* linux: Move funlockfile/_IO_funlockfile into libcAdhemerval Zanella2021-05-1029-58/+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.
* linux: Move ftrylockfile/_IO_ftrylockfile into libcAdhemerval Zanella2021-05-1029-58/+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.
* linux: Move flockfile/_IO_flockfile into libcAdhemerval Zanella2021-05-1029-58/+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.
* Add PTRACE_SYSEMU and PT_SYSEMU_SINGLESTEP from Linux 5.12 for s390Joseph Myers2021-05-101-0/+10
| | | | | | | | Linux 5.12 adds the constants PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP for s390. Add these to glibc. Tested with build-many-glibcs.py for s390-linux-gnu and s390x-linux-gnu.
* nptl: Move changing of stack permissions into ld.soFlorian Weimer2021-05-102-8/+74
| | | | | | | | | All the stack lists are now in _rtld_global, so it is possible to change stack permissions directly from there, instead of calling into libpthread to do the change. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Linux: Simplify and fix the definition of SINGLE_THREAD_PFlorian Weimer2021-05-101-29/+7
| | | | | | | | | | | | | | Always use __libc_multiple_threads if beneficial, and do not assume the the dynamic loader is single-threaded. This assumption could become incorrect by accident once more code is moved from libpthread into it. The previous commit introducing the NO_SYSCALL_CANCEL_CHECKING macro enables this change. Do not hint to the compiler that multi-threaded programs are unlikely (which is not quite true anymore). Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Linux: Explicitly disable cancellation checking in the dynamic loaderFlorian Weimer2021-05-101-2/+9
| | | | | | | | | | | | | Historically, SINGLE_THREAD_P is defined to 1 in the dynamic loader. This has the side effect of disabling cancellation points. In order to enable future use of SINGLE_THREAD_P for single-thread optimizations in the dynamic loader (which becomes important once more code is moved from libpthread), introduce a new NO_SYSCALL_CANCEL_CHECKING macro which is always 1 for IS_IN (rtld), indepdently of the actual SINGLE_THREAD_P value. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Export __libc_multiple_threads from libc as an internal symbolFlorian Weimer2021-05-101-1/+5
| | | | | | | | This allows the elimination of the __libc_multiple_threads_ptr variable in libpthread and its initialization procedure. Tested-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: implement ttyname as a wrapper around ttyname_r.Érico Nogueira2021-05-072-159/+13
| | | | | | | | | | | | | Big win in binary size and avoids duplicating the logic in multiple places. On x86_64, dropped from 1883206 to 1881790, a 1416 byte decrease. Also changed logic to track if ttyname_buf has been allocated by checking if it's NULL instead of tracking buflen as an additional variable. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* linux: use fd_to_filename instead of _fitoa_word in ttyname_r.Érico Nogueira2021-05-071-5/+3
| | | | | | | | | Simplifies the logic and makes intent clearer, while at the same time decreasing binary size. On x86_64, dropped from 1883270 to 1883206, a 64 byte decrease. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>