about summary refs log tree commit diff
path: root/sysdeps/nptl
Commit message (Collapse)AuthorAgeFilesLines
* nptl: Add missing cancellation flags on futex_internal and pselect32Adhemerval Zanella2020-10-071-0/+1
| | | | | | | It fixes the tst-cancelx{4,5} and tst-cancel24-{static} regression on some platforms (arm and sparc32). Checked on arm-linux-gnueabihf and sparcv9-linux-gnu.
* Fix GCC 11 -Warray-parameter warning for __sigsetjmp (bug 26647)Joseph Myers2020-10-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes part of bug 26647 (-Werror=array-parameter error building with GCC 11 because of __sigsetjmp being declared using an array parameter in one header and a pointer parameter in another). The fix is to split the struct __jmp_buf_tag definition out to a separate bits/types/ header so it can be included in pthread.h, so that pthread.h can declare __sigsetjmp with the type contents visible, so can use an array (as in setjmp.h) rather than a pointer in the declaration. Note that several other build failures with GCC 11 remain. This does not fix the jmp_buf-related -Wstringop-overflow errors (also discussed in bug 26647), or -Warray-parameter errors for other functions (bug 26686), or -Warray-bounds errors (bug 26687). Tested, with older compilers, natively for x86_64 and with build-many-glibc.py for aarch64-linux-gnu. Tested with build-many-glibcs.py with GCC mainline for aarch64-linux-gnu that this gets past the -Warray-parameter issue for __sigsetjmp (with the next build failure being the other one discussed in bug 26647).
* Y2038: nptl: Provide futex_abstimed_wait64 supporting 64 bit timeLukasz Majewski2020-10-042-0/+76
| | | | | | | | | | | | | | | | | | This is the helper function, which uses struct __timespec64 to provide 64 bit absolute time to futex syscalls. The aim of this function is to move convoluted pre-processor macro code from sysdeps/nptl/lowlevellock-futex.h to C function in futex-internal.c The futex_abstimed_wait64 function has been put into a separate file on the purpose - to avoid issues apparent on the m68k architecture related to small number of available registers (there is not enough registers to put all necessary arguments in them if the above function would be added to futex-internal.h with __always_inline attribute). Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* nptl: futex: Move __NR_futex_time64 alias to beginning of futex-internal.hLukasz Majewski2020-09-301-4/+4
| | | | | | | | This alias macro shall be moved to the beginning of the futex-internal.h to be easily reused by other functions, which would support 64 bit time. Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Provide proper spelling for 32 bit version of futex_abstimed_waitLukasz Majewski2020-09-301-6/+6
| | | | | | | This change provides proper spelling of 32 bit __futex_abstimed_wait_cancelable32 function Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* nptl: Fix __futex_abstimed_wait_cancellable32Adhemerval Zanella2020-09-281-4/+10
| | | | | | | | Similar to 64-bit time __futex_abstimed_wait_cancellable64, it should check for overflow and convert to 32-bit timespec iff timeout is not NULL. It fixes some regression on i686-linux-gnu running on a 4.15 kernel.
* nptl: futex: Provide correct indentation for part of ↵Lukasz Majewski2020-09-091-3/+3
| | | | | | | __futex_abstimed_wait_cancelable64 By mistake the if for calling __futex_abstimed_wait_cancellable32 was misaligned with the rest of the function body.
* y2038: nptl: Convert pthread_cond_{clock|timed}wait to support 64 bit timeLukasz Majewski2020-09-023-1/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pthread_cond_clockwait and pthread_cond_timedwait have been converted to support 64 bit time. This change introduces new futex_abstimed_wait_cancelable64 function in ./sysdeps/nptl/futex-helpers.c, which uses futex_time64 where possible and tries to replace low-level preprocessor macros from lowlevellock-futex.h The pthread_cond_{clock|timed}wait only accepts absolute time. Moreover, there is no need to check for NULL passed as *abstime pointer as __pthread_cond_wait_common() always passes non-NULL struct __timespec64 pointer to futex_abstimed_wait_cancellable64(). For systems with __TIMESIZE != 64 && __WORDSIZE == 32: - Conversions between 64 bit time to 32 bit are necessary - Redirection to __pthread_cond_{clock|timed}wait64 will provide support for 64 bit time The futex_abstimed_wait_cancelable64 function has been put into a separate file on the purpose - to avoid issues apparent on the m68k architecture related to small number of available registers (there is not enough registers to put all necessary arguments in them if the above function would be added to futex-internal.h with __always_inline attribute). In fact - new function - namely __futex_abstimed_wait_cancellable32 is used to reduce number of needed registers (as some in-register values are stored on the stack when function call is made). Build tests: ./src/scripts/build-many-glibcs.py glibcs Run-time tests: - Run specific tests on ARM/x86 32bit systems (qemu): https://github.com/lmajewski/meta-y2038 and run tests: https://github.com/lmajewski/y2038-tests/commits/master Above tests were performed with Y2038 redirection applied as well as without to test the proper usage of both __pthread_cond_{clock|timed}wait64 and __pthread_cond_{clock|timed}wait. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: nptl: Convert pthread_{clock|timed}join_np to support 64 bit timeLukasz Majewski2020-08-131-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pthread_clockjoin_np and pthread_timedjoin_np have been converted to support 64 bit time. This change introduces new futex_timed_wait_cancel64 function in ./sysdeps/nptl/futex-internal.h, which uses futex_time64 where possible and tries to replace low-level preprocessor macros from lowlevellock-futex.h The pthread_{timed|clock}join_np only accept absolute time. Moreover, there is no need to check for NULL passed as *abstime pointer as clockwait_tid() always passes struct __timespec64. For systems with __TIMESIZE != 64 && __WORDSIZE == 32: - Conversions between 64 bit time to 32 bit are necessary - Redirection to __pthread_{clock|timed}join_np64 will provide support for 64 bit time Build tests: ./src/scripts/build-many-glibcs.py glibcs Run-time tests: - Run specific tests on ARM/x86 32bit systems (qemu): https://github.com/lmajewski/meta-y2038 and run tests: https://github.com/lmajewski/y2038-tests/commits/master Above tests were performed with Y2038 redirection applied as well as without to test the proper usage of both __pthread_{timed|clock}join_np64 and __pthread_{timed|clock}join_np. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_npFlorian Weimer2020-06-022-0/+18
| | | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Make pthread_attr_t dynamically extensibleFlorian Weimer2020-06-021-3/+13
| | | | | | | This introduces the function __pthread_attr_extension to allocate the extension space, which is freed by pthread_attr_destroy. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Add __pthread_attr_copy for copying pthread_attr_t objectsFlorian Weimer2020-05-201-0/+7
| | | | | | | | Also add the private type union pthread_attr_transparent, to reduce the amount of casting that is required. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Linux: set_robust_list syscall number is always availableFlorian Weimer2020-03-031-6/+4
| | | | | | | Due to the built-in tables, __NR_set_robust_list is always defined (although it may not be available at run time). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move pthread_setschedparam implementation into libcFlorian Weimer2020-02-201-2/+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-4/+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>
* linux: Remove INTERNAL_SYSCALL_DECLAdhemerval Zanella2020-02-141-5/+4
| | | | | | | | | | | 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.
* nptl: update default pthread-offsets.hAndreas Schwab2020-02-101-16/+6
| | | | | Remove unused definitions, and correct __PTHREAD_RWLOCK_FLAGS_OFFSET for __WORDSIZE == 64.
* C11 threads: Move implementation to sysdeps/pthreadSamuel Thibault2020-02-092-204/+2
| | | | | | | so it gets shared by nptl and htl. Also add htl versions of thrd_current and thrd_yield. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Move nptl-specific types to separate headerSamuel Thibault2020-02-092-8/+15
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Avoid using PTHREAD_MUTEX_DEFAULT in macro definition [BZ #25271]Florian Weimer2020-01-301-1/+1
| | | | | | | | | | | | | | | | | | | Commit 1c3f9acf1f1f75faa7a28bf39af64afd ("nptl: Add struct_mutex.h") replaced a zero constant with the identifier PTHREAD_MUTEX_DEFAULT in the macro PTHREAD_MUTEX_INITIALIZER. However, that constant is not available in ISO C11 mode: In file included from /usr/include/bits/thread-shared-types.h:74, from /usr/include/bits/pthreadtypes.h:23, from /usr/include/pthread.h:26, from bug25271.c:1: bug25271.c:3:21: error: ‘PTHREAD_MUTEX_DEFAULT’ undeclared here (not in a function) 3 | pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; | ^~~~~~~~~~~~~~~~~~~~~~~~~ This commit change the constant to the equivalent PTHREAD_MUTEX_TIMED_NP, which is in the POSIX extension namespace and thus always available.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-0133-33/+33
|
* nptl: Fix __PTHREAD_MUTEX_INITIALIZER for !__PTHREAD_MUTEX_HAVE_PREVAdhemerval Zanella2019-11-261-1/+1
| | | | | | | | The nptl: Add struct_mutex.h added a wrong initializer for architectures that uses the generic struct_mutex.h. Checked on sparcv9-linux-gnu (where I noted the issue with the nptl/tst-initializers1*).
* nptl: Add default pthread-offsets.hAdhemerval Zanella2019-11-261-0/+26
| | | | | | | | | | This patch adds a default pthread-offsets.h based on default thread definitions from struct_mutex.h and struct_rwlock.h. The idea is to simplify new ports inclusion. Checked with a build on affected abis. Change-Id: I7785a9581e651feb80d1413b9e03b5ac0452668a
* nptl: Add default pthreadtypes-arch.hAdhemerval Zanella2019-11-261-0/+45
| | | | | | | | | | | | | | | | | | | | | | | This patch adds a default pthreadtypes-arch.h, the idea is to simpify new ports inclusion and an override is required only if the architecture adds some arch-specific extensions or requirement. The default values on the new generic header are based on current architecture define value and they are not optimal compared to current code requirements as below. - On 64 bits __SIZEOF_PTHREAD_BARRIER_T is defined as 32 while is sizeof (struct pthread_barrier) is 20 bytes. - On 32 bits __SIZEOF_PTHREAD_ATTR_T is defined as 36 while sizeof (struct pthread_attr) is 32. The default values are not changed so the generic header could be used by some architectures. Checked with a build on affected abis. Change-Id: Ie0cd586258a2650f715c1af0c9fe4e7063b0409a
* nptl: Add struct_rwlock.hAdhemerval Zanella2019-11-263-28/+78
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new generic __pthread_rwlock_arch_t definition meant to be used by new ports. Its layout mimics the current usage on some 64 bits ports and it allows some ports to use the generic definition. The arch __pthread_rwlock_arch_t definition is moved from pthreadtypes-arch.h to another arch-specific header (struct_rwlock.h). Also the static intialization macro for pthread_rwlock_t is set to use an arch defined on (__PTHREAD_RWLOCK_INITIALIZER) which simplifies its implementation. The default pthread_rwlock_t layout differs from current ports with: 1. Internal layout is the same for 32 bits and 64 bits. 2. Internal flag is an unsigned short so it should not required additional padding to align for word boundary (if it is the case for the ABI). Checked with a build on affected abis. Change-Id: I776a6a986c23199929d28a3dcd30272db21cd1d0
* nptl: Add struct_mutex.hAdhemerval Zanella2019-11-263-133/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current way of defining the common mutex definition for POSIX and C11 on pthreadtypes-arch.h (added by commit 06be6368da16104be5) is not really the best options for newer ports. It requires define some misleading flags that should be always defined as 0 (__PTHREAD_COMPAT_PADDING_MID and __PTHREAD_COMPAT_PADDING_END), it exposes options used solely for linuxthreads compat mode (__PTHREAD_MUTEX_USE_UNION and __PTHREAD_MUTEX_NUSERS_AFTER_KIND), and requires newer ports to explicit define them (adding more boilerplate code). This patch adds a new default __pthread_mutex_s definition meant to be used by newer ports. Its layout mimics the current usage on both 32 and 64 bits ports and it allows most ports to use the generic definition. Only ports that use some arch-specific definition (such as hardware lock-elision or linuxthreads compat) requires specific headers. For 32 bit, the generic definitions mimic the other 32-bit ports of using an union to define the fields uses on adaptive and robust mutexes (thus not allowing both usage at same time) and by using a single linked-list for robust mutexes. Both decisions seemed to follow what recent ports have done and make the resulting pthread_mutex_t/mtx_t object smaller. Also the static intialization macro for pthread_mutex_t is set to use a macro __PTHREAD_MUTEX_INITIALIZER where the architecture can redefine in its struct_mutex.h if it requires additional fields to be initialized. Checked with a build on affected abis. Change-Id: I30a22c3e3497805fd6e52994c5925897cffcfe13
* nptl: Remove rwlock elision definitionsAdhemerval Zanella2019-11-261-3/+3
| | | | | | | | | | The new rwlock implementation added by cc25c8b4c1196 (2.25) removed support for lock-elision. This patch removes remaining the arch-specific unused definitions. Checked with a build against all affected ABIs. Change-Id: I5dec8af50e3cd56d7351c52ceff4aa3771b53cd6
* nptl: Fix niggles with pthread_clockjoin_npMike Crowe2019-11-041-1/+1
| | | | | | | | | | | | | | | | | | | Joseph Myers spotted[1] that 69ca4b54c151cec42ccca5e05790efc1a8206b47 added pthread_clockjoin_np to sysdeps/nptl/pthread.h but not to its hppa-specific equivalent sysdeps/unix/sysv/linux/hppa/pthread.h. Rafal Luzynski spotted[2] typos in the NEWS entry and manual updates too. Florian Weimer spotted[3] that the clockid parameter was not using a reserved identifier in pthread.h. [1] https://sourceware.org/ml/libc-alpha/2019-11/msg00016.html [2] https://sourceware.org/ml/libc-alpha/2019-11/msg00019.html [3] https://sourceware.org/ml/libc-alpha/2019-11/msg00022.html Reviewed-by: Joseph Myers <joseph@codesourcery.com> Reviewed-by: Rafal Luzynski <digitalfreak@lingonborough.com> Reviewed-by: Florian Weimer <fw@deneb.enyo.de>
* nptl: Add pthread_clockjoin_npMike Crowe2019-11-011-0/+11
| | | | | | | | | | | 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>
* Refactor PI mutexes internal definitionsAdhemerval Zanella2019-10-312-0/+95
| | | | | | | | | | This patch adds the generic futex_lock_pi and futex_unlock_pi to wrap around the syscall machinery required to issue the syscall calls. It simplifies a bit the futex code required to implement PI mutexes. No function changes, checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Replace non cancellable pause/nanosleep with futexAdhemerval Zanella2019-10-311-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | To help y2038 work avoid duplicate all the logic of nanosleep on non cancellable version, the patch replace it with a new futex operation, lll_timedwait. The changes are: - Add a expected value for __lll_clocklock_wait, so it can be used to wait for generic values. - Remove its internal atomic operation and move the logic to __lll_clocklock. It makes __lll_clocklock_wait even more generic and __lll_clocklock slight faster on fast-path (since it won't require a function call anymore). - Add lll_timedwait, which uses __lll_clocklock_wait, to replace both __pause_nocancel and __nanosleep_nocancel. It also allows remove the sparc32 __lll_clocklock_wait implementation (since it is similar to the generic one). Checked on x86_64-linux-gnu, sparcv9-linux-gnu, and i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Consolidate lowlevellock-futex.hAdhemerval Zanella2019-10-311-37/+128
| | | | | | | | | | NPTL is already Linux specific, there is no need to parametrize low level lock futex operations and add a sysdep Linux specific implementation. This patch moves the relevant Linux code to nptl one. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Consolidate futex-internal.hAdhemerval Zanella2019-10-311-15/+196
| | | | | | | | | | NPTL is already Linux specific, there is no need to parametrize futex operations and add a sysdep Linux specific implementation. This patch moves the relevant Linux code to nptl one. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: SIGCANCEL, SIGTIMER, SIGSETXID are always definedFlorian Weimer2019-10-181-24/+5
| | | | | | | | | | | All nptl targets have these signal definitions nowadays. This changes also replaces the nptl-generic version of pthread_sigmask with the Linux version. Tested on x86_64-linux-gnu and i686-linux-gnu. Built with build-many-glibcs.py. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Move pthread_attr_setschedparam implementation into libcFlorian Weimer2019-10-071-2/+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-2/+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>
* Split up endian.h to minimize exposure of BYTE_ORDER.Alistair Francis2019-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With only two exceptions (sys/types.h and sys/param.h, both of which historically might have defined BYTE_ORDER) the public headers that include <endian.h> only want to be able to test __BYTE_ORDER against __*_ENDIAN. This patch creates a new bits/endian.h that can be included by any header that wants to be able to test __BYTE_ORDER and/or __FLOAT_WORD_ORDER against the __*_ENDIAN constants, or needs __LONG_LONG_PAIR. It only defines macros in the implementation namespace. The existing bits/endian.h (which could not be included independently of endian.h, and only defines __BYTE_ORDER and maybe __FLOAT_WORD_ORDER) is renamed to bits/endianness.h. I also took the opportunity to canonicalize the form of this header, which we are stuck with having one copy of per architecture. Since they are so short, this means git doesn’t understand that they were renamed from existing headers, sigh. endian.h itself is a nonstandard header and its only remaining use from a standard header is guarded by __USE_MISC, so I dropped the __USE_MISC conditionals from around all of the public-namespace things it defines. (This means, an application that requests strict library conformance but includes endian.h will still see the definition of BYTE_ORDER.) A few changes to specific bits/endian(ness).h variants deserve mention: - sysdeps/unix/sysv/linux/ia64/bits/endian.h is moved to sysdeps/ia64/bits/endianness.h. If I remember correctly, ia64 did have selectable endianness, but we have assembly code in sysdeps/ia64 that assumes it’s little-endian, so there is no reason to treat the ia64 endianness.h as linux-specific. - The C-SKY port does not fully support big-endian mode, the compile will error out if __CSKYBE__ is defined. - The PowerPC port had extra logic in its bits/endian.h to detect a broken compiler, which strikes me as unnecessary, so I removed it. - The only files that defined __FLOAT_WORD_ORDER always defined it to the same value as __BYTE_ORDER, so I removed those definitions. The SH bits/endian(ness).h had comments inconsistent with the actual setting of __FLOAT_WORD_ORDER, which I also removed. - I *removed* copyright boilerplate from the few bits/endian(ness).h headers that had it; these files record a single fact in a fashion dictated by an external spec, so I do not think they are copyrightable. As long as I was changing every copy of ieee754.h in the tree, I noticed that only the MIPS variant includes float.h, because it uses LDBL_MANT_DIG to decide among three different versions of ieee854_long_double. This patch makes it not include float.h when GCC’s intrinsic __LDBL_MANT_DIG__ is available. * string/endian.h: Unconditionally define LITTLE_ENDIAN, BIG_ENDIAN, PDP_ENDIAN, and BYTE_ORDER. Condition byteswapping macros only on !__ASSEMBLER__. Move the definitions of __BIG_ENDIAN, __LITTLE_ENDIAN, __PDP_ENDIAN, __FLOAT_WORD_ORDER, and __LONG_LONG_PAIR to... * string/bits/endian.h: ...this new file, which includes the renamed header bits/endianness.h for the definition of __BYTE_ORDER and possibly __FLOAT_WORD_ORDER. * string/Makefile: Install bits/endianness.h. * include/bits/endian.h: New wrapper. * bits/endian.h: Rename to bits/endianness.h. Add multiple-include guard. Rewrite the comment explaining what the machine-specific variants of this file should do. * sysdeps/unix/sysv/linux/ia64/bits/endian.h: Move to sysdeps/ia64. * sysdeps/aarch64/bits/endian.h * sysdeps/alpha/bits/endian.h * sysdeps/arm/bits/endian.h * sysdeps/csky/bits/endian.h * sysdeps/hppa/bits/endian.h * sysdeps/ia64/bits/endian.h * sysdeps/m68k/bits/endian.h * sysdeps/microblaze/bits/endian.h * sysdeps/mips/bits/endian.h * sysdeps/nios2/bits/endian.h * sysdeps/powerpc/bits/endian.h * sysdeps/riscv/bits/endian.h * sysdeps/s390/bits/endian.h * sysdeps/sh/bits/endian.h * sysdeps/sparc/bits/endian.h * sysdeps/x86/bits/endian.h: Rename to endianness.h; canonicalize form of file; remove redundant definitions of __FLOAT_WORD_ORDER. * sysdeps/powerpc/bits/endianness.h: Remove logic to check for broken compilers. * ctype/ctype.h * sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h * sysdeps/arm/nptl/bits/pthreadtypes-arch.h * sysdeps/csky/nptl/bits/pthreadtypes-arch.h * sysdeps/ia64/ieee754.h * sysdeps/ieee754/ieee754.h * sysdeps/ieee754/ldbl-128/ieee754.h * sysdeps/ieee754/ldbl-128ibm/ieee754.h * sysdeps/m68k/nptl/bits/pthreadtypes-arch.h * sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h * sysdeps/mips/ieee754/ieee754.h * sysdeps/mips/nptl/bits/pthreadtypes-arch.h * sysdeps/nios2/nptl/bits/pthreadtypes-arch.h * sysdeps/nptl/pthread.h * sysdeps/riscv/nptl/bits/pthreadtypes-arch.h * sysdeps/sh/nptl/bits/pthreadtypes-arch.h * sysdeps/sparc/sparc32/ieee754.h * sysdeps/unix/sysv/linux/generic/bits/stat.h * sysdeps/unix/sysv/linux/generic/bits/statfs.h * sysdeps/unix/sysv/linux/sys/acct.h * wctype/bits/wctype-wchar.h: Include bits/endian.h, not endian.h. * sysdeps/unix/sysv/linux/hppa/pthread.h: Don’t include endian.h. * sysdeps/mips/ieee754/ieee754.h: Use __LDBL_MANT_DIG__ in ifdefs, instead of LDBL_MANT_DIG. Only include float.h when __LDBL_MANT_DIG__ is not predefined, in which case define __LDBL_MANT_DIG__ to equal LDBL_MANT_DIG.
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-0730-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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>