summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Use libc_fe* macros in k_standardl.cazanella/sfp-exceptionsStefan Liebler via Libc-alpha2020-04-171-2/+3
|
* Use libc_fe* macros in ldbl-128/e_expl.cStefan Liebler via Libc-alpha2020-04-171-3/+5
| | | | | The calls to feholdexcept, fesetround and fesetenv are replaced by the libc_fe* macros.
* Use libc_fe* macros in ldbl-128/s_fmal.cStefan Liebler via Libc-alpha2020-04-173-15/+32
| | | | | The calls to feholdexcept, fesetround, feupdateenv, fetestexcept are replaced by the libc_fe* macros as it is also done in dbl-64/s_fma.c.
* Use libc_fe* macros in ldbl-128/s_nearbyintl.cStefan Liebler via Libc-alpha2020-04-173-4/+19
| | | | | | The calls to feholdexcept and fesetenv are replaced by the libc_fe* macros as it is also done in nearbyintf and nearbyint.
* x86_64: Add SSE sfp-exceptionsAdhemerval Zanella2020-04-162-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | The exported x86_64 fenv.h functions operate on both i387 and SSE (since they should work on both float, double, and long double) while the internal libc_fe* set either SSE (float, double, and float128) or i387 (long double). The libgcc __sfp_handle_exceptions (used on float128 implementation), however, will set either SEE or i387 exception depending of the exception to raise. This broke the internal assumption of float128 where only SSE operations will be used. This patch reimplements the libgcc __sfp_handle_exceptions to use only SSE operations and sets libgcc to use it instead of its own implementation. And I think we should fix libgcc in a similar manner, since checking on config/i386/64/sfp-machine.h it already only supports SSE rounding mode and x86_64 ABI also expectes float128 to use SSE registers [1] (although it is not clear on how future implementation might implement it). Checked on x86_64-linux-gnu. [1] https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI
* posix: Add wait4 test caseAlistair Francis2020-04-142-1/+211
| | | | Add a wait4 test case based on the waitid test case.
* linux: wait4: Fix incorrect return value comparisonAlistair Francis2020-04-141-10/+9
| | | | | | | | | | Patch 600f00b "linux: Use long time_t for wait4/getrusage" introduced two bugs: - The usage32 struct was set if the wait4 syscall had an error. - For 32-bit systems the usage struct was set even if it was specified as NULL. This patch fixes the two issues.
* hurd: add mach_print functionSamuel Thibault2020-04-142-0/+4
| | | | | * mach/Versions (GLIBC_2.32): Add mach_print. * sysdeps/mach/hurd/i386/libc.abilist (GLIBC_2.32): Add mach_print.
* x32: Properly pass long to syscall [BZ #25810]H.J. Lu2020-04-132-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | X32 has 32-bit long and pointer with 64-bit off_t. Since x32 psABI requires that pointers passed in registers must be zero-extended to 64bit, x32 can share many syscall interfaces with LP64. When a LP64 syscall with long and unsigned long arguments is used for x32, these arguments must be properly extended to 64-bit. Otherwise if the upper 32 bits of the register have undefined value, such a syscall will be rejected by kernel. Enforce zero-extension for pointers and array system call arguments. For integer types, extend to int64_t (the full register) using a regular cast, resulting in zero or sign extension based on the signedness of the original type. For void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); we now generate 0: 41 f7 c1 ff 0f 00 00 test $0xfff,%r9d 7: 75 1f jne 28 <__mmap64+0x28> 9: 48 63 d2 movslq %edx,%rdx c: 89 f6 mov %esi,%esi e: 4d 63 c0 movslq %r8d,%r8 11: 4c 63 d1 movslq %ecx,%r10 14: b8 09 00 00 40 mov $0x40000009,%eax 19: 0f 05 syscall That is 1. addr is unchanged. 2. length is zero-extend to 64 bits. 3. prot is sign-extend to 64 bits. 4. flags is sign-extend to 64 bits. 5. fd is sign-extend to 64 bits. 6. offset is unchanged. For int arguments, since kernel uses only the lower 32 bits and ignores the upper 32 bits in 64-bit registers, these work correctly. Tested on x86-64 and x32. There are no code changes on x86-64.
* Add GRND_INSECURE from Linux 5.6 to sys/random.hJoseph Myers2020-04-092-0/+4
| | | | | | | | | | This patch adds the GRND_INSECURE constant from Linux 5.6 to glibc's sys/random.h. This is also added to the documentation. The constant acts as a no-op for the Hurd implementation (as that doesn't check whether the flags are known), which is semantically fine, while older Linux kernels reject unknown flags with an EINVAL error. Tested for x86_64.
* Update kernel version to 5.6 in tst-mman-consts.py.Joseph Myers2020-04-091-1/+1
| | | | | | | | This patch updates the kernel version in the test tst-mman-consts.py to 5.6. (There are no new constants covered by this test in 5.6 that need any other header changes.) Tested with build-many-glibcs.py.
* Update mips libm-test-ulpsAdhemerval Zanella2020-04-082-54/+56
|
* Update alpha libm-test-ulpsAdhemerval Zanella2020-04-081-27/+28
|
* Update ia64 libm-test-ulpsAdhemerval Zanella2020-04-081-15/+17
|
* Update sparc libm-test-ulpsAdhemerval Zanella2020-04-081-27/+28
|
* Update arm libm-test-ulpsAdhemerval Zanella2020-04-081-27/+28
|
* Update aarch64 libm-test-ulpsAdhemerval Zanella2020-04-081-15/+16
|
* Updates to the shn_MM locale [BZ #25532]kokoye20072020-04-081-69/+62
|
* powerpc: Update ULPs and xfail more ibm128 outputsTulio Magno Quites Machado Filho2020-04-074-56/+58
| | | | | | | There are 2 new input values that require to be marked as xfail-rounding:ibm128-libgcc as they're known to fail because of libgcc issues with different rounding modes. Otherwise, the other tests just need an increase in ULP.
* i386: Remove build support for GCC older than GCC 6H.J. Lu2020-04-073-52/+4
| | | | | | | | | Since GCC 6.2 or later is required to build glibc, remove build support for GCC older than GCC 6. Testd with GCC 6.4 and GCC 9.3. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* oc_FR locale: Fix spelling of April (bug 25639)Rafał Lużyński2020-04-071-2/+2
| | | | | | Confirmed by CLDR and a native speaker: "abril" is more often used even if "abrial" is also correct. Both nominative (alt_mon) and genitive (mon) cases are updated.
* Update hppa libm-test-ulpsJohn David Anglin2020-04-061-27/+27
|
* y2038: linux: Provide __mq_timedreceive_time64 implementationLukasz Majewski2020-04-062-4/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides new __mq_timedreceive_time64 explicit 64 bit function for receiving messages with absolute timeout. Moreover, a 32 bit version - __mq_timedreceive has been refactored to internally use __mq_timedreceive_time64. The __mq_timedreceive is now supposed to be used on systems still supporting 32 bit time (__TIMESIZE != 64) - hence the necessary conversion to 64 bit struct __timespec64 from struct timespec. The new mq_timedsend_time64 syscall available from Linux 5.1+ has been used, when applicable. As this wrapper function is also used internally in the glibc, to e.g. provide mq_receive implementation, an explicit check for abs_timeout being NULL has been added due to conversions between struct timespec and struct __timespec64. Before this change the Linux kernel handled this NULL pointer. 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 Linux kernel, headers and minimal kernel version for glibc build test matrix: - Linux v5.1 (with mq_timedreceive_time64) and glibc built with v5.1 as minimal kernel version (--enable-kernel="5.1.0") The __ASSUME_TIME64_SYSCALLS flag defined. - Linux v5.1 and default minimal kernel version The __ASSUME_TIME64_SYSCALLS not defined, but kernel supports mq_timedreceive_time64 syscall. - Linux v4.19 (no mq_timedreceive_time64 support) with default minimal kernel version for contemporary glibc (3.2.0) This kernel doesn't support mq_timedreceive_time64 syscall, so the fallback to mq_timedreceive is tested. Above tests were performed with Y2038 redirection applied as well as without (so the __TIMESIZE != 64 execution path is checked as well). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: linux: Provide __mq_timedsend_time64 implementationLukasz Majewski2020-04-062-3/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides new __mq_timedsend_time64 explicit 64 bit function for sending messages with absolute timeout. Moreover, a 32 bit version - __mq_timedsend has been refactored to internally use __mq_timedsend_time64. The __mq_timedsend is now supposed to be used on systems still supporting 32 bit time (__TIMESIZE != 64) - hence the necessary conversion to 64 bit struct __timespec64 from struct timespec. The new __mq_timedsend_time64 syscall available from Linux 5.1+ has been used, when applicable. As this wrapper function is also used internally in the glibc, to e.g. provide mq_send implementation, an explicit check for abs_timeout being NULL has been added due to conversions between struct timespec and struct __timespec64. Before this change the Linux kernel handled this NULL pointer. 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 Linux kernel, headers and minimal kernel version for glibc build test matrix: - Linux v5.1 (with mq_timedsend_time64) and glibc built with v5.1 as a minimal kernel version (--enable-kernel="5.1.0") The __ASSUME_TIME64_SYSCALLS flag defined. - Linux v5.1 and default minimal kernel version The __ASSUME_TIME64_SYSCALLS not defined, but kernel supports mq_timedsend_time64 syscall. - Linux v4.19 (no mq_timedsend_time64 support) with default minimal kernel version for contemporary glibc (3.2.0) This kernel doesn't support mq_timedsend_time64 syscall, so the fallback to mq_timedsend is tested. Above tests were performed with Y2038 redirection applied as well as without (so the __TIMESIZE != 64 execution path is checked as well). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* y2038: include: Move struct __timespec64 definition to a separate fileLukasz Majewski2020-04-062-23/+28
| | | | | | | | | | | | | | The struct __timespec64's definition has been moved from ./include/time.h to ./include/struct___timespec64.h. This change would prevent from polluting other glibc namespaces (when headers are modified to support 64 bit time on architectures with __WORDSIZE==32). Now it is possible to just include definition of this particular structure when needed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* malloc: ensure set_max_fast never stores zero [BZ #25733]DJ Delorie2020-04-061-1/+1
| | | | | | | | | | | | | | | | | | | The code for set_max_fast() stores an "impossibly small value" instead of zero, when the parameter is zero. However, for small values of the parameter (ex: 1 or 2) the computation results in a zero being stored anyway. This patch checks for the parameter being small enough for the computation to result in zero instead, so that a zero is never stored. key values which result in zero being stored: x86-64: 1..7 (or other 64-bit) i686: 1..11 armhfp: 1..3 (or other 32-bit) Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* powerpc64le: enforce non-specific long double in .gnu.attributes sectionPaul E. Murphy2020-04-062-1/+56
| | | | | | | | | | | | | | | | | | | | | | | We turn off this feature to avoid polluting our shared libary with a specific value. However, static libgcc is not under our control, and has enabled this for ibm128 routines. This pollutes the resulting shared libraries with it. Attach a post-linking hook to replace this section with one crafted as hard-float + indeterminate ldbl. This allows IEEE ldbl users to avoid having to disable the gnu attributes feature which should protect them from linking ibm ldbl libraries using the gnu attributes feature. Currently, this only replaces libc and libm which support both ldbl formats and rely on application code to explicitly determine which is to be used. Strictly speaking, the section could be deleted with minimal lost value. However correctly set attributes could prove useful for some future change, and similarly missing attributes. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* powerpc64le: workaround ieee long double / _Float128 stdc++ bugPaul E. Murphy2020-04-061-0/+11
| | | | | | | | | | -mabi=ieeelongdouble triggers the stdc++ libraries _Float128 support, which then breaks if algorithm is included. For now, explicitly disable _Float128 for such tests. I have opened up GCC BZ 94080 to track this. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* powerpc64le: Enforce -mabi=ibmlongdouble when -mfloat128 usedPaul E. Murphy2020-04-062-43/+53
| | | | | | | | | | | | | | | | | | I have observed a bug on 7.4.0 whereby __mulkc3 calls are swapped with __multc3 depending on ABI selection. For the sake of being overly cautious, build all _Float128 files with ibm128 to workaround these compilers. This has been noted in GCC BZ 84914, and will not be fixed for GCC 7. Likewise, non-math files built with _Float128 are assumed to have ibm long double. Explicilty preserve this assumption. Finally, add some bootstrapping code to avoid applying these options until IEEE long double is enabled as they require GCC 7 and above. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* powerpc64le/multiarch: don't generate strong aliases for fmaf128-ppc64Paul E. Murphy2020-04-061-0/+2
| | | | | This prevents generating a second alias for __fmaieee128 when compiling with ldouble == ieee128 redirects.
* ldbl-128ibm: simplify iscanonical.hPaul E. Murphy2020-04-061-8/+2
| | | | | | | | | | | | | The test for enabling _Float128 or IEEE 128 long double can be greatly simplified knowing that there is no ibm128, thus we require no special cases, and everything is canonical. This reverts the changes to ldbl-128ibm iscanonical.h from commit 8dbfea3a2094798a52cebddde01d255483f49665 and extends the check for __NO_LONG_DOUBLE_MATH to include a check for float128 redirects to long double. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* i386: Disable check_consistency for GCC 5 and above [BZ #25788]H.J. Lu2020-04-061-2/+3
| | | | | | | check_consistency should be disabled for GCC 5 and above since there is no fixed PIC register in GCC 5 and above. Check __GNUC_PREREQ (5,0) instead OPTIMIZE_FOR_GCC_5 since OPTIMIZE_FOR_GCC_5 is false with -fno-omit-frame-pointer.
* Add IPPROTO_ETHERNET and IPPROTO_MPTCP from Linux 5.6 to netinet/in.h.Joseph Myers2020-04-031-0/+4
| | | | | | | This patch adds the IPPROTO_ETHERNET and IPPROTO_MPTCP constants from Linux 5.6 to glibc's netinet/in.h. Tested for x86_64.
* Update syscall lists for Linux 5.6.Joseph Myers2020-04-0324-2/+54
| | | | | | | 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.
* elf: Implement DT_AUDIT, DT_DEPAUDIT support [BZ #24943]Florian Weimer2020-04-039-4/+277
| | | | | | | binutils ld has supported --audit, --depaudit for a long time, only support in glibc has been missing. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* elf: Simplify handling of lists of audit stringsFlorian Weimer2020-04-031-117/+112
| | | | | | | | | | | | | | | | All list elements are colon-separated strings, and there is a hard upper limit for the number of audit modules, so it is possible to pre-allocate a fixed-size array of strings to which the LD_AUDIT environment variable and --audit arguments are added. Also eliminate the global variables for the audit list because the list is only needed briefly during startup. There is a slight behavior change: All duplicate LD_AUDIT environment variables are now processed, not just the last one as before. However, such environment vectors are invalid anyway. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* support: Change xgetline to return 0 on EOFFlorian Weimer2020-04-033-10/+19
| | | | | | | | | | | | | | | The advantage is that the buffer will always contain the number of characters as returned from the function, which allows one to use a sequence like /* No more audit module output. */ line_length = xgetline (&buffer, &buffer_length, fp); TEST_COMPARE_BLOB ("", 0, buffer, line_length); to check for an expected EOF, while also reporting any unexpected extra data encountered. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* nptl: Remove x86_64 cancellation assembly implementations [BZ #25765]Adhemerval Zanella2020-04-034-153/+0
| | | | | | | | | All cancellable syscalls are done by C implementations, so there is no no need to use a specialized implementation to optimize register usage. It fixes BZ #25765. Checked on x86_64-linux-gnu.
* aarch64: update bits/hwcap.hSzabolcs Nagy2020-04-031-0/+18
| | | | | Up to date with Linux 5.6. dl-procinfo.c is not updated because HWCAP2 bits are not handled specially in glibc.
* Add tests for Safe-LinkingEyal Itkin2020-04-032-0/+180
| | | | | | | | | | | | | | | Adding the test "tst-safe-linking" for testing that Safe-Linking works as expected. The test checks these 3 main flows: * tcache protection * fastbin protection * malloc_consolidate() correctness As there is a random chance of 1/16 that of the alignment will remain correct, the test checks each flow up to 10 times, using different random values for the pointer corruption. As a result, the chance for a false failure of a given tested flow is 2**(-40), thus highly unlikely. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* S390: Regenerate ULPs.Stefan Liebler2020-04-031-15/+19
| | | | | | Updates needed after recent commit a9d42c09a327540a99f2eac25a98fd2ad6d0b540 math: Add inputs that yield larger errors for float type (x86_64)
* sysv/alpha: Use generic __timeval32 and helpersAlistair Francis2020-04-0210-162/+67
| | | | | | | | Now there is a generic __timeval32 and helpers we can use them for Alpha instead of the Alpha specific ones. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* linux: Use long time_t for wait4/getrusageAlistair Francis2020-04-025-3/+164
| | | | | | | | | | | | | | The Linux kernel expects rusage to use a 32-bit time_t, even on archs with a 64-bit time_t (like RV32). To address this let's convert rusage to/from 32-bit and 64-bit to ensure the kernel always gets a 32-bit time_t. While we are converting these functions let's also convert them to be the y2038 safe versions. This means there is a *64 function that is called by a backwards compatible wrapper. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* resource: Add a __rusage64 structAlistair Francis2020-04-021-0/+110
| | | | | | | Add a __rusage64 struct which always uses a 64-bit time_t. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* linux: Use long time_t __getitimer/__setitimerAlistair Francis2020-04-025-2/+197
| | | | | | | | | | | | | | The Linux kernel expects itimerval to use a 32-bit time_t, even on archs with a 64-bit time_t (like RV32). To address this let's convert itimerval to/from 32-bit and 64-bit to ensure the kernel always gets a 32-bit time_t. While we are converting these functions let's also convert them to be the y2038 safe versions. This means there is a *64 function that is called by a backwards compatible wrapper. Tested-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* sysv: Define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64Alistair Francis2020-04-026-0/+32
| | | | | | | | | | | | | | | | | | | On y2038 safe 32-bit systems the Linux kernel expects itimerval and rusage to use a 32-bit time_t, even though the other time_t's are 64-bit. There are currently no plans to make 64-bit time_t versions of these structs. There are also other occurrences where the time passed to the kernel via timeval doesn't match the wordsize. To handle these cases let's define a new macro __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64. This macro specifies if the kernel's old_timeval matches the new timeval64. This should be 1 for 64-bit architectures except for Alpha's osf syscalls. The define should be 0 for 32-bit architectures and Alpha's osf syscalls. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* math: Add inputs that yield larger errors for float type (x86_64)Paul Zimmermann2020-03-3115-59/+388
| | | | | | | | | | | The corner cases included were generated using exhaustive search for all float/binary32 values on x86_64 (comparing to MPFR for correct rounding to nearest). For the j0/j1/y0 functions, only cases with ulp error <= 9 were included. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Fix alignment bug in Safe-LinkingEyal Itkin2020-03-311-11/+11
| | | | | | | | | | | | Alignment checks should be performed on the user's buffer and NOT on the mchunkptr as was done before. This caused bugs in 32 bit versions, because: 2*sizeof(t) != MALLOC_ALIGNMENT. As the tcache works on users' buffers it uses the aligned_OK() check, and the rest work on mchunkptr and therefore check using misaligned_chunk(). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Typo fixes and CR cleanup in Safe-LinkingEyal Itkin2020-03-311-15/+15
| | | | | | | | Removed unneeded '\' chars from end of lines and fixed some indentation issues that were introduced in the original Safe-Linking patch. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Use Linux 5.6 and GMP 6.2.0 in build-many-glibcs.py.Joseph Myers2020-03-311-2/+2
| | | | | | | | This patch makes build-many-glibcs.py use the current versions of Linux (5.6) and GMP (6.2.0). Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).