summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/mips/mips32
Commit message (Collapse)AuthorAgeFilesLines
* Update syscall lists for Linux 5.6.Joseph Myers2020-04-031-0/+2
| | | | | | | Linux 5.6 has new openat2 and pidfd_getfd syscalls. This patch adds them to syscall-names.list and regenerates the arch-syscall.h files. Tested with build-many-glibcs.py.
* nptl: Move pthread_setschedparam implementation into libcFlorian Weimer2020-02-201-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_getschedparam implementation into libcFlorian Weimer2020-02-201-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_cond_init implementation into libcFlorian Weimer2020-02-201-2/+0
| | | | | | | | | | | It is necessary to export __pthread_cond_init from libc because the C11 condition variable needs it and is still left in libpthread. This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_cond_destroy implementation into libcFlorian Weimer2020-02-201-2/+0
| | | | | | | | | | | It is necessary to export __pthread_cond_destroy from libc because the C11 condition variable needs it and is still left in libpthread. This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_condattr_init implementation into libcFlorian Weimer2020-02-201-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_condattr_destroy implementation into libcFlorian Weimer2020-02-201-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_setscope implementation into libcFlorian Weimer2020-02-201-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getscope implementation into libcFlorian Weimer2020-02-201-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_setschedpolicy implementation into libcFlorian Weimer2020-02-201-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getschedpolicy implementation into libcFlorian Weimer2020-02-201-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* ld.so: Do not export free/calloc/malloc/realloc functions [BZ #25486]Florian Weimer2020-02-151-4/+0
| | | | | | | | | | | | | | | | | | | Exporting functions and relying on symbol interposition from libc.so makes the choice of implementation dependent on DT_NEEDED order, which is not what some compiler drivers expect. This commit replaces one magic mechanism (symbol interposition) with another one (preprocessor-/compiler-based redirection). This makes the hand-over from the minimal malloc to the full malloc more explicit. Removing the ABI symbols is backwards-compatible because libc.so is always in scope, and the dynamic loader will find the malloc-related symbols there since commit f0b2132b35248c1f4a80f62a2c38cddcc802aa8c ("ld.so: Support moving versioned symbols between sonames [BZ #24741]"). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* linux: Remove INTERNAL_SYSCALL_DECLAdhemerval Zanella2020-02-141-5/+5
| | | | | | | | | | | With all Linux ABIs using the expected Linux kABI to indicate syscalls errors, the INTERNAL_SYSCALL_DECL is an empty declaration on all ports. This patch removes the 'err' argument on INTERNAL_SYSCALL* macro and remove the INTERNAL_SYSCALL_DECL usage. Checked with a build against all affected ABIs.
* linux: Consolidate INLINE_SYSCALLAdhemerval Zanella2020-02-141-28/+1
| | | | | | | | | | | With all Linux ABIs using the expected Linux kABI to indicate syscalls errors, there is no need to replicate the INLINE_SYSCALL. The generic Linux sysdep.h includes errno.h even for !__ASSEMBLER__, which is ok now and it allows cleanup some archaic code that assume otherwise. Checked with a build against all affected ABIs.
* mips: Use Linux kABI for syscall returnAdhemerval Zanella2020-02-141-20/+12
| | | | | | | | | | | | | It changes the mips INTERNAL_SYSCALL* and internal_syscall* macros to return a negative value instead of the 'a3' register value on then 'err' macro argument. The macro INTERNAL_SYSCALL_DECL is no longer required, and the INTERNAL_SYSCALL_ERROR_P macro follows the other Linux kABIs. The redefinition of INTERNAL_VSYSCALL_CALL is also no longer required. Checked on mips64-linux-gnu, mips64n32-linux-gnu, and mips-linux-gnu.
* mips: Fix argument passing for inlined syscalls on Linux [BZ #25523]WANG Xuerui2020-02-121-10/+20
| | | | | | | | | | | | | | According to [gcc documentation][1], temporary variables must be used for the desired content to not be call-clobbered. Fix the Linux inline syscall templates by adding temporary variables, much like what x86 did before (commit 381a0c26d73e0f074c962e0ab53b99a6c327066d). Tested with gcc 9.2.0, both cross-compiled and natively on Loongson 3A4000. [1]: https://gcc.gnu.org/onlinedocs/gcc/Local-Register-Variables.html
* mips: Use 'long int' and 'long long int' in linux syscall codeWANG Xuerui2020-02-1210-118/+128
| | | | Style fixes only, no functional change.
* Linux: Add tables with system call numbersFlorian Weimer2020-01-021-0/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new tables are currently only used for consistency checks with the installed kernel headers and the architecture-independent system call names table. They are based on Linux 5.4. The goal is to use these architecture-specific tables to ensure that system call wrappers are available irrespective of the version of the installed kernel headers. The tables are formatted in the form of C header files so that they can be used directly in an #include directive, without external preprocessing. (External preprocessing of a plain table file would introduce cross-subdirectory dependency issues.) However, the intent is that they can still be treated as tables and can be processed by simple tools. The irregular system call names on 32-bit arm add a complication. The <fixup-asm-unistd.h> header is introduced to work around that, and the system calls are listed under regular names in the <arch-syscall.h> file. A make target, update-syscalls-list, is added to patch the glibc sources with data from the current kernel headers. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-0111-11/+11
|
* nptl: Move waitpid implementation to libcAdhemerval Zanella2019-12-191-1/+0
| | | | Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.
* nptl: Move wait implementation to libcAdhemerval Zanella2019-12-191-2/+0
| | | | Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.
* mips: Do not include hi and lo in __SYSCALL_CLOBBERS for R6Dragan Mladjenovic2019-12-161-2/+7
| | | | | | | | | | | | | | | | | | | GCC 10 (PR 91233) won't silently allow registers that are not architecturally available to be present in the clobber list anymore, resulting in build failure for mips*r6 targets in form of: ... .../sysdep.h:146:2: error: the register ‘lo’ cannot be clobbered in ‘asm’ for the current target 146 | __asm__ volatile ( \ | ^~~~~~~ This is because base R6 ISA doesn't define hi and lo registers w/o DSP extension. This patch provides the alternative definitions of __SYSCALL_CLOBBERS for r6 targets that won't include those registers. * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (__SYSCALL_CLOBBERS): Exclude hi and lo from the clobber list for __mips_isa_rev >= 6. * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (__SYSCALL_CLOBBERS): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (__SYSCALL_CLOBBERS): Likewise.
* nptl: Add more missing placeholder abi symbol from nanosleep moveAdhemerval Zanella2019-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | This patch adds the missing __libpthread_version_placeholder for GLIBC_2.2.6 version from the nanosleep implementation move from libpthread to libc (79a547b162). It also fixes the wrong compat symbol definitions added by changing back the version used on vfork check and remove the __libpthread_version_placeholder added on some ABI (4f4bb489e0dd). The __libpthread_version_placeholder is also refactored to make it simpler to add new compat_symbols by adding a new macro compat_symbol_unique which uses the compiler extension __COUNTER__ to generate unique strong alias to be used with compat_symbol. Checked with a updated-abi on the all affected abis of the nanosleep move. Change-Id: I347a4dbdc931bb42b359456932dd1e17aa4d4078
* nptl: Add missing placeholder abi symbol from nanosleep moveAdhemerval Zanella2019-11-071-0/+1
| | | | | | Adds the __libpthread_version_placeholder symbol with the same version of nanosleep/__nanosleep that was removed by 79a547b162657b3f and that is not provided by other symbols.
* nptl: Move nanosleep implementation to libcAdhemerval Zanella2019-11-061-2/+0
| | | | | | | | | Checked on x86_64-linux-gnu and powerpc64le-linux-gnu. I also checked the libpthread.so .gnu.version_d entries for every ABI affected and all of them contains the required versions (including for architectures which exports __nanosleep with a different version). Reviewed-by: Florian Weimer <fweimer@redhat.com>
* nptl: Add pthread_clockjoin_npMike Crowe2019-11-011-0/+1
| | | | | | | | | | | Introduce pthread_clockjoin_np as a version of pthread_timedjoin_np that accepts a clockid_t parameter to indicate which clock the timeout should be measured against. This mirrors the recently-added POSIX-proposed "clock" wait functions. Checked on x86_64-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_setschedparam implementation into libcFlorian Weimer2019-10-071-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getschedparam implementation into libcFlorian Weimer2019-10-071-1/+0
| | | | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_setinheritsched implementation into libc.Florian Weimer2019-10-041-1/+0
| | | | | | This is part of the libpthread removal project: <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>
* mips: Consolidate INTERNAL_VSYSCALL_CALLAdhemerval Zanella2019-09-171-12/+0
| | | | | | | | | | | | | | | | | This patch consolidates the mips, mips64, and mips64-n32 INTERNAL_VSYSCALL_CALL on a single implementation. No semantic changes. I checked against a build for mips-linux-gnu, mips64-linux-gnu, and mips64-n32-linux-gnu. * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (INTERNAL_VSYSCALL_CALL): Remove. * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (INTERNAL_VSYSCALL_CALL): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (INTERNAL_VSYSCALL_CALL): Likewise. * sysdeps/unix/sysv/linux/mips/sysdep.h (INTERNAL_VSYSCALL_CALL): New macro.
* Remove PREPARE_VERSION and PREPARE_VERSION_KNOWAdhemerval Zanella2019-09-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the PREPARE_VERSION and PREPARE_VERSION_KNOW macro and uses a static inline function instead, get_vdso_symbol. Each architecture that supports vDSO must define the Linux version and its hash for symbol resolution (VDSO_NAME and VDSO_HASH macro respectively). It also organizes the HAVE_*_VSYSCALL for mips, powerpc, and s390 to define them on a common header. The idea is to require less code to configure and enable vDSO support for newer ports. No semantic changes are expected. Checked with a build against all affected architectures. * sysdeps/unix/make-syscalls.sh: Make vDSO call use get_vdso_symbol. * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c (__gettimeofday): Use get_vdso_symbol instead of _dl_vdso_vsym. * sysdeps/unix/sysv/linux/powerpc/time.c (time): Likewise. * sysdeps/unix/sysv/linux/riscv/flush-icache.c (__lookup_riscv_flush_icache): Likewise. * sysdeps/unix/sysv/linux/x86/gettimeofday.c (__gettimeofday): Likewise. * sysdeps/unix/sysv/linux/x86/time.c (time): Likewise. * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c: Likewise. * sysdeps/unix/sysv/linux/aarch64/init-first.c: Likewise. * sysdeps/unix/sysv/linux/arm/init-first.c: Likewise. * sysdeps/unix/sysv/linux/i386/init-first.c: Likewise. * sysdeps/unix/sysv/linux/mips/init-first.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/init-first.c: Likewise. * sysdeps/unix/sysv/linux/riscv/init-first.c: Likewise. * sysdeps/unix/sysv/linux/sparc/init-first.c: Likewise. * sysdeps/unix/sysv/linux/s390/init-first.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/init-first.c: Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep.h (VDSO_NAME, VDSO_HASH): Define. * sysdeps/unix/sysv/linux/arm/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/riscv/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/sparc/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.h (VDSO_NAME, VDSO_HASH): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Remove definition. * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (HAVE_CLOCK_GETRES_VSYSCALL, HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL, HAVE_GETCPU_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (HAVE_CLOCK_GETRES_VSYSCALL, HAVE_CLOCK_GETTIME_VSYSCALL, HAVE_GETTIMEOFDAY_VSYSCALL, HAVE_GETCPU_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/mips/sysdep.h: New file. * sysdeps/unix/sysv/linux/powerpc/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/dl-vdso.h (PREPARE_VERSION, PREPARE_VERSION_KNOWN, VDSO_NAME_LINUX_2_6, VDSO_HASH_LINUX_2_6, VDSO_NAME_LINUX_2_6_15, VDSO_HASH_LINUX_2_6_15, VDSO_NAME_LINUX_2_6_29, VDSO_HASH_LINUX_2_6_29, VDSO_NAME_LINUX_4_15, VDSO_HASH_LINUX_4_15): Remove defines. (get_vdso_symbol): New function.
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-0711-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* Finish move of clock_* functions to libc. [BZ #24959]Zack Weinberg2019-09-043-5/+10
| | | | | | | | | | | | | | | | In glibc 2.17, the functions clock_getcpuclockid, clock_getres, clock_gettime, clock_nanosleep, and clock_settime were moved from librt.so to libc.so, leaving compatibility stubs behind. Now that the dynamic linker no longer insists on finding versioned symbols in the same library that originally defined them, we do not need the stubs anymore, and this means we don't need GLIBC_PRIVATE __-prefix aliases for most of the functions anymore either. (clock_gettime still needs one.) For ports added before 2.17, libc.so needs to provide two symbol versions for each, the default at GLIBC_2.17 plus a compat version matching what librt had. While I'm at it, move the clock_*.c files and their tests from rt/ to time/.
* nptl: Move pthread_attr_getinheritsched implementation into libcFlorian Weimer2019-08-301-1/+0
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_setdetachstate implementation into libcFlorian Weimer2019-08-281-1/+0
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_getdetachstate implementation into libcFlorian Weimer2019-08-161-1/+0
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_attr_init implementation into libcFlorian Weimer2019-08-151-2/+0
| | | | | Both the original GLIB_2.0 version and the current GLIBC_2.1 version need to be moved.
* Make totalorder and totalordermag functions take pointer arguments.Joseph Myers2019-08-151-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The resolution of C floating-point Clarification Request 25 <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2397.htm#dr_25> is that the totalorder and totalordermag functions should take pointer arguments, and this has been adopted in C2X (with const added; note that the integration of this change into C2X is present in the C standard git repository but postdates the most recent public PDF draft). This patch updates glibc accordingly. As a defect resolution, the API is changed unconditionally rather than supporting any sort of TS 18661-1 mode for compilation with the old version of the API. There are compat symbols for existing binaries that pass floating-point arguments directly. As a consequence of changing to pointer arguments, there are no longer type-generic macros in tgmath.h for these functions. Because of the fairly complicated logic for creating libm function aliases and determining the set of aliases to create in a given glibc configuration, rather than duplicating all that in individual source files to create the versioned and compat symbols, the source files for the various versions of totalorder functions are set up to redefine weak_alias before using libm_alias_* macros to create the symbols required. In turn, this requires creating a separate alias for each symbol version pointing to the same implementation (see binutils bug <https://sourceware.org/bugzilla/show_bug.cgi?id=23840>), which is done automatically using __COUNTER__. (As I noted in <https://sourceware.org/ml/libc-alpha/2018-10/msg00631.html>, it might well make sense for glibc's symbol versioning macros to do that alias creation with __COUNTER__ themselves, which would somewhat simplify the logic in the totalorder source files.) It is of course desirable to test the compat symbols. I did this with the generic libm-test machinery, but didn't wish to duplicate the actual tables of test inputs and outputs, and thought it risky to attempt to have a single object file refer to both default and compat versions of the same function in order to test them together. Thus, I created libm-test-compat_totalorder.inc and libm-test-compat_totalordermag.inc which include the generated .c files (with the processed version of those tables of inputs) from the non-compat tests, and added appropriate dependencies. I think this provides sufficient test coverage for the compat symbols without also needing to make the special ldbl-96 and ldbl-128ibm tests (of peculiarities relating to the representations of those formats that can't be covered in the generic tests) run for the compat symbols. Tests of compat symbols need to be internal tests, meaning _ISOMAC is not defined. Making some libm-test tests into internal tests showed up two other issues. GCC diagnoses duplicate macro definitions of __STDC_* macros, including __STDC_WANT_IEC_60559_TYPES_EXT__; I added an appropriate conditional and filed <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91451> for this issue. On ia64, include/setjmp.h ends up getting included indirectly from libm-symbols.h, resulting in conflicting definitions of the STR macro (also defined in libm-test-driver.c); I renamed the macros in include/setjmp.h. (It's arguable that we should have common internal headers used everywhere for stringizing and concatenation macros.) Tested for x86_64 and x86, and with build-many-glibcs.py. * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN] (totalorder): Take pointer arguments. [__GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN] (totalordermag): Likewise. * manual/arith.texi (totalorder): Likewise. (totalorderf): Likewise. (totalorderl): Likewise. (totalorderfN): Likewise. (totalorderfNx): Likewise. (totalordermag): Likewise. (totalordermagf): Likewise. (totalordermagl): Likewise. (totalordermagfN): Likewise. (totalordermagfNx): Likewise. * math/tgmath.h (__TGMATH_BINARY_REAL_RET_ONLY): Remove macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (totalorder): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (totalordermag): Likewise. * math/Versions (GLIBC_2.31): Add totalorder, totalorderf, totalorderl, totalordermag, totalordermagf, totalordermagl, totalorderf32, totalorderf64, totalorderf32x, totalordermagf32, totalordermagf64, totalordermagf32x, totalorderf64x, totalordermagf64x, totalorderf128 and totalordermagf128. * math/Makefile (libm-test-funcs-noauto): Add compat_totalorder and compat_totalordermag. (libm-test-funcs-compat): New variable. (libm-tests-compat): Likewise. (tests): Do not include compat tests. (tests-internal): Add compat tests. ($(foreach t,$(libm-tests-base), $(objpfx)$(t)-compat_totalorder.o)): Depend on $(objpfx)libm-test-totalorder.c. ($(foreach t,$(libm-tests-base), $(objpfx)$(t)-compat_totalordermag.o): Depend on $(objpfx)libm-test-totalordermag.c. (tgmath3-macros): Remove totalorder and totalordermag. * math/libm-test-compat_totalorder.inc: New file. * math/libm-test-compat_totalordermag.inc: Likewise. * math/libm-test-driver.c (struct test_ff_i_data): Update comment. (RUN_TEST_fpfp_b): New macro. (RUN_TEST_LOOP_fpfp_b): Likewise. * math/libm-test-totalorder.inc (totalorder_test_data): Use TEST_fpfp_b. (totalorder_test): Condition on [!COMPAT_TEST]. (do_test): Likewise. * math/libm-test-totalordermag.inc (totalordermag_test_data): Use TEST_fpfp_b. (totalordermag_test): Condition on [!COMPAT_TEST]. (do_test): Likewise. * math/gen-tgmath-tests.py (Tests.add_all_tests): Remove totalorder and totalordermag. * math/test-tgmath.c (NCALLS): Change to 132. (F(compile_test)): Do not call totalorder or totalordermag. (F(totalorder)): Remove. (F(totalordermag)): Likewise. * include/float.h (__STDC_WANT_IEC_60559_TYPES_EXT__): Do not define if [__STDC_WANT_IEC_60559_TYPES_EXT__]. * include/setjmp.h [!_ISOMAC] (STR_HELPER): Rename to SJSTR_HELPER. [!_ISOMAC] (STR): Rename to SJSTR. Update call to STR_HELPER. [!_ISOMAC] (TEST_SIZE): Update call to STR. [!_ISOMAC] (TEST_ALIGN): Likewise. [!_ISOMAC] (TEST_OFFSET): Likewise. * sysdeps/ieee754/dbl-64/s_totalorder.c: Include <shlib-compat.h> and <first-versions.h>. (__totalorder): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/dbl-64/s_totalordermag.c: Include <shlib-compat.h> and <first-versions.h>. (__totalordermag): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/dbl-64/wordsize-64/s_totalorder.c: Include <shlib-compat.h> and <first-versions.h>. (__totalorder): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/dbl-64/wordsize-64/s_totalordermag.c: Include <shlib-compat.h> and <first-versions.h>. (__totalordermag): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/float128/float128_private.h (__totalorder_compatl): New macro. (__totalordermag_compatl): Likewise. * sysdeps/ieee754/flt-32/s_totalorderf.c: Include <shlib-compat.h> and <first-versions.h>. (__totalorderf): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/flt-32/s_totalordermagf.c: Include <shlib-compat.h> and <first-versions.h>. (__totalordermagf): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/ldbl-128/s_totalorderl.c: Include <shlib-compat.h> and <first-versions.h>. (__totalorderl): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/ldbl-128/s_totalordermagl.c: Include <shlib-compat.h> and <first-versions.h>. (__totalordermagl): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/ldbl-128ibm/s_totalorderl.c: Include <shlib-compat.h>. (__totalorderl): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/ldbl-128ibm/s_totalordermagl.c: Include <shlib-compat.h>. (__totalordermagl): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/ldbl-96/s_totalorderl.c: Include <shlib-compat.h> and <first-versions.h>. (__totalorderl): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/ldbl-96/s_totalordermagl.c: Include <shlib-compat.h> and <first-versions.h>. (__totalordermagl): Take pointer arguments. Add symbol versions and compat symbols. * sysdeps/ieee754/ldbl-opt/nldbl-totalorder.c (totalorderl): Take pointer arguments. * sysdeps/ieee754/ldbl-opt/nldbl-totalordermag.c (totalordermagl): Likewise. * sysdeps/ieee754/ldbl-128ibm/test-totalorderl-ldbl-128ibm.c (do_test): Update calls to totalorderl and totalordermagl. * sysdeps/ieee754/ldbl-96/test-totalorderl-ldbl-96.c (do_test): Update calls to totalorderl and totalordermagl. * sysdeps/mach/hurd/i386/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* nptl: Remove pthread_self compatibility symbol from libpthreadFlorian Weimer2019-08-151-1/+0
| | | | | The symbol is no longer needed because since glibc 2.30, the dynamic loader continues searching for the symbol in libc.
* nptl: Move pthread_attr_destroy implementation into libcFlorian Weimer2019-08-151-1/+0
|
* nptl: Move pthread_equal implementation into libcFlorian Weimer2019-08-151-1/+0
|
* linux: Enable vDSO for static linking as default (BZ#19767)Adhemerval Zanella2019-08-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch assumes static vDSO is supported as default, it is now supported on all current architectures that support vDSO. It allows removing both ALWAYS_USE_VSYSCALL define, which an architecture requires to explicit define and USE_VSYSCALL (which defines vDSO only for shared or if architecture defines ALWAYS_USE_VSYSCALL). Checked with a build against all affected ABIs. [BZ #19767] * sysdeps/unix/sysv/linux/aarch64/sysdep.h (ALWAYS_USE_VSYSCALL): Remove definition. * sysdeps/unix/sysv/linux/arm/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/riscv/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.h (ALWAYS_USE_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/x86/libc-vdso.h: Remove #if USE_VSYSCALL. * sysdeps/unix/sysv/linux/sysdep-vdso.h: Likewise. * sysdeps/unix/sysv/linux/sysdep.h (ALWAYS_USE_VSYSCALL, USE_VSYSCALL): Remove defitions.
* nptl: Add POSIX-proposed pthread_mutex_clocklockMike Crowe2019-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add POSIX-proposed pthread_mutex_clocklock function that works like pthread_mutex_timedlock but takes a clockid parameter to measure the abstime parameter against. * sysdeps/nptl/pthread.h: Add pthread_mutex_clocklock. * nptl/DESIGN-systemtap-probes.txt: Likewise. * nptl/pthread_mutex_timedlock.c (__pthread_mutex_clocklock_common): Rename from __pthread_mutex_timedlock and add clockid parameter. Pass this parameter to lll_clocklock and lll_clocklock_elision in place of CLOCK_REALTIME. (__pthread_mutex_clocklock): New function to add LIBC_PROBE and validate clockid parameter before calling __pthread_mutex_clocklock_common. (__pthread_mutex_timedlock): New implementation to add LIBC_PROBE and calls __pthread_mutex_clocklock_common passing CLOCK_REALTIME as the clockid. * nptl/Makefile: Add tst-mutex11.c. * nptl/tst-abstime.c (th): Add tests for pthread_mutex_clocklock. * nptl/tst-mutex11.c: New tests for passing invalid and unsupported clockid parameters to pthread_mutex_clocklock. * nptl/tst-mutex5.c (do_test_clock): Rename from do_test and take clockid parameter to indicate which clock to be used. Call pthread_mutex_timedlock or pthread_mutex_clocklock as appropriate. (do_test): Call do_test_clock to separately test pthread_mutex_timedlock, pthread_mutex_clocklock(CLOCK_REALTIME) and pthread_mutex_clocklock(CLOCK_MONOTONIC). * nptl/tst-mutex9.c: Likewise. * nptl/Versions (GLIBC_2.30): Add pthread_mutex_clocklock. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30): Likewise. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add POSIX-proposed pthread_rwlock_clockrdlock & pthread_rwlock_clockwrlockMike Crowe2019-07-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add: int pthread_rwlock_clockrdlock (pthread_rwlock_t *rwlock, clockid_t clockid, const struct timespec *abstime) and: int pthread_rwlock_clockwrlock (pthread_rwlock_t *rwlock, clockid_t clockid, const struct timespec *abstime) which behave like pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock respectively, except they always measure abstime against the supplied clockid. The functions currently support CLOCK_REALTIME and CLOCK_MONOTONIC and return EINVAL if any other clock is specified. * sysdeps/nptl/pthread.h: Add pthread_rwlock_clockrdlock and pthread_wrlock_clockwrlock. * nptl/Makefile: Build pthread_rwlock_clockrdlock.c and pthread_rwlock_clockwrlock.c. * nptl/pthread_rwlock_clockrdlock.c: Implement pthread_rwlock_clockrdlock. * nptl/pthread_rwlock_clockwrlock.c: Implement pthread_rwlock_clockwrlock. * nptl/pthread_rwlock_common.c (__pthread_rwlock_rdlock_full): Add clockid parameter and verify that it indicates a supported clock on entry so that we fail even if it doesn't end up being used. Pass that clock on to futex_abstimed_wait when necessary. (__pthread_rwlock_wrlock_full): Likewise. * nptl/pthread_rwlock_rdlock.c: (__pthread_rwlock_rdlock): Pass CLOCK_REALTIME to __pthread_rwlock_rdlock_full even though it won't be used because there's no timeout. * nptl/pthread_rwlock_wrlock.c (__pthread_rwlock_wrlock): Pass CLOCK_REALTIME to __pthread_rwlock_wrlock_full even though it won't be used because there is no timeout. * nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock): Pass CLOCK_REALTIME to __pthread_rwlock_rdlock_full since abstime uses that clock. * nptl/pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock): Pass CLOCK_REALTIME to __pthread_rwlock_wrlock_full since abstime uses that clock. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30): Likewise. * nptl/tst-abstime.c (th): Add pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock timeout tests to match the existing pthread_rwlock_timedrdloock and pthread_rwlock_timedwrlock tests. * nptl/tst-rwlock14.c (do_test): Likewise. * nptl/tst-rwlock6.c Invent verbose_printf macro, and use for ancillary output throughout. (tf): Accept thread_args structure so that rwlock, a clockid and function name can be passed to the thread. (do_test_clock): Rename from do_test. Accept clockid parameter to specify test clock. Use the magic clockid value of CLOCK_USE_TIMEDLOCK to indicate that pthread_rwlock_timedrdlock and pthread_rwlock_timedwrlock should be tested, otherwise pass the specified clockid to pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock. Use xpthread_create and xpthread_join. (do_test): Call do_test_clock to test each clockid in turn. * nptl/tst-rwlock7.c: Likewise. * nptl/tst-rwlock9.c (writer_thread, reader_thread): Accept thread_args structure so that the (now int) thread number, the clockid and the function name can be passed to the thread. (do_test_clock): Renamed from do_test. Pass the necessary thread_args when creating the reader and writer threads. Use xpthread_create and xpthread_join. (do_test): Call do_test_clock to test each clockid in turn. * manual/threads.texi: Add documentation for pthread_rwlock_clockrdlock and pthread_rwlock_clockwrclock. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add POSIX-proposed pthread_cond_clockwaitMike Crowe2019-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add: int pthread_cond_clockwait (pthread_cond_t *cond, pthread_mutex_t *mutex, clockid_t clockid, const struct timespec *abstime) which behaves just like pthread_cond_timedwait except it always measures abstime against the supplied clockid. Currently supports CLOCK_REALTIME and CLOCK_MONOTONIC and returns EINVAL if any other clock is specified. Includes feedback from many others. This function was originally proposed[1] as pthread_cond_timedwaitonclock_np, but The Austin Group preferred the new name. * nptl/Makefile: Add tst-cond26 and tst-cond27 * nptl/Versions (GLIBC_2.30): Add pthread_cond_clockwait * sysdeps/nptl/pthread.h: Likewise * nptl/forward.c: Add __pthread_cond_clockwait * nptl/forward.c: Likewise * nptl/pthreadP.h: Likewise * sysdeps/nptl/pthread-functions.h: Likewise * nptl/pthread_cond_wait.c (__pthread_cond_wait_common): Add clockid parameter and comment describing why we don't need to check its value. Use that value when calling futex_abstimed_wait_cancelable rather than reading the clock from the flags. (__pthread_cond_wait): Pass unused clockid parameter. (__pthread_cond_timedwait): Read clock from flags and pass it to __pthread_cond_wait_common. (__pthread_cond_clockwait): Add new function with weak alias from pthread_cond_clockwait. * sysdeps/mach/hurd/i386/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist * (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): * Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30): Likewise. * nptl/tst-cond11.c (run_test): Support testing pthread_cond_clockwait too by using a special magic CLOCK_USE_ATTR_CLOCK value to determine whether to call pthread_cond_timedwait or pthread_cond_clockwait. (do_test): Pass CLOCK_USE_ATTR_CLOCK for existing tests, and add new tests using all combinations of CLOCK_MONOTONIC and CLOCK_REALTIME. * ntpl/tst-cond26.c: New test for passing unsupported and * invalid clocks to pthread_cond_clockwait. * nptl/tst-cond27.c: Add test similar to tst-cond5.c, but using struct timespec and pthread_cond_clockwait. * manual/threads.texi: Document pthread_cond_clockwait. The * comment was provided by Carlos O'Donell. [1] https://sourceware.org/ml/libc-alpha/2015-07/msg00193.html Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Add POSIX-proposed sem_clockwaitMike Crowe2019-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add: int sem_clockwait (sem_t *sem, clockid_t clock, const struct timespec *abstime) which behaves just like sem_timedwait, but measures abstime against the specified clock. Currently supports CLOCK_REALTIME and CLOCK_MONOTONIC and sets errno == EINVAL if any other clock is specified. * nptl/sem_waitcommon.c (do_futex_wait, __new_sem_wait_slow): Add clockid parameters to indicate the clock which abstime should be measured against. * nptl/sem_timedwait.c (sem_timedwait), nptl/sem_wait.c (__new_sem_wait): Pass CLOCK_REALTIME as clockid to __new_sem_wait_slow. * nptl/sem_clockwait.c: New file to implement sem_clockwait based on sem_timedwait.c. * nptl/Makefile: Add sem_clockwait.c source file. Add CFLAGS for sem_clockwait.c to match those used for sem_timedwait.c. * sysdeps/pthread/semaphore.h: Add sem_clockwait. * nptl/Versions (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30): Likewise. * nptl/tst-sem17.c: Add new test for passing invalid clock to sem_clockwait. * nptl/tst-sem13.c, nptl/tst-sem5.c: Modify existing sem_timedwait tests to also test sem_clockwait. * manual/threads.texi: Document sem_clockwait. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Remove vfork IFUNC-based forwarder from libpthread [BZ #20188]Florian Weimer2019-07-021-2/+0
| | | | | | | | | | | | | | | | | | | | | With commit f0b2132b35248c1f4a80f62a2c38cddcc802aa8c ("ld.so: Support moving versioned symbols between sonames [BZ #24741]"), the dynamic linker will find the definition of vfork in libc and binds a vfork reference to that symbol, even if the soname in the version reference says that the symbol should be located in libpthread. As a result, the forwarder (whether it's IFUNC-based or a duplicate of the libc implementation) is no longer necessary. On older architectures, a placeholder symbol is required, to make sure that the GLIBC_2.1.2 symbol version does not go away, or is turned in to a weak symbol definition by the link editor. (The symbol version needs to preserved so that the symbol coverage check in elf/dl-version.c does not fail for old binaries.) mips32 is an outlier: It defined __vfork@@GLIBC_2.2, but the baseline is GLIBC_2.0. Since there are other @@GLIBC_2.2 symbols, the placeholder symbol is not needed there.
* Linux: Add getdents64 system callFlorian Weimer2019-06-072-0/+2
| | | | | | | | | | | No 32-bit system call wrapper is added because the interface is problematic because it cannot deal with 64-bit inode numbers and 64-bit directory hashes. A future commit will deprecate the undocumented getdirentries and getdirentries64 functions. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Linux: Add the tgkill functionFlorian Weimer2019-05-142-0/+2
| | | | | | | | | The tgkill function is sometimes used in crash handlers. <bits/signal_ext.h> follows the same approach as <bits/unistd_ext.h> (which was added for the gettid system call wrapper). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* misc: Add twalk_r functionFlorian Weimer2019-05-022-0/+2
| | | | | | | | | The twalk function is very difficult to use in a multi-threaded program because there is no way to pass external state to the iterator function. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>