summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* x86: Use default libc_fe* implementation for float128azanella/x86-libc_feAdhemerval Zanella2020-04-201-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | 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 rounding mode is used by soft-fp (libgcc and glibc), so that must be set for float128 computations. For x86_64 it uses SSE mode, while for i386 is uses x87. However for exception generation both 387 and SSE exception might be generated even for x86_64. The FP_EX_DIVZERO, FP_EX_DIVZERO, and FP_EX_INEXACT uses SSE while FP_EX_DENORM, FP_EX_OVERFLOW, and FP_EX_UNDERFLOW uses x87. For i686 it depends whether libgcc was built for SSE math (where it follows x86_64 behaviour) or x87 math (which uses only x87 mode). In any case use generic routines to handle float128 since it handles both modes. It allows to use libc_fe* macros on float128 implementation for x86_64. Checked on x86_64-linux-gnu.
* Use libc_fe* macros in k_standardl.c.Stefan Liebler via Libc-alpha2020-04-201-2/+3
|
* Use libc_fe* macros in ldbl-128/e_expl.c.Stefan Liebler via Libc-alpha2020-04-201-3/+5
|
* Use libc_fe* macros in ldbl-128/s_fmal.c.Stefan Liebler via Libc-alpha2020-04-203-15/+32
|
* Use libc_fe* macros in ldbl-128/s_nearbyintl.c.Stefan Liebler via Libc-alpha2020-04-203-4/+19
|
* Revert "x86_64: Add SSE sfp-exceptions"Adhemerval Zanella2020-04-202-60/+1
| | | | | | | | | | | The __sfp_handle_exceptions is not fully correct regarding raising exceptions, since there is no direct way to raise only FP_EX_OVERFLOW nor FP_EX_UNDERFLOW for SSE mode. Both libgcc and feraiseexcept rely on x87 mode to accomplish it. This reverts commit 460ee50de054396cc9791ff4cfdc2f5029fb923d. Checked on x86_64.
* provide y2038 safe socket constants for default/asm-generic ABIVineet Gupta2020-04-191-2/+14
| | | | | | | These will be used by upcoming RV32 and ARC ports and any future ports. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
* x86_64: Add SSE sfp-exceptionsAdhemerval Zanella2020-04-172-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove __NO_MATH_INLINESAdhemerval Zanella2020-04-176-26/+3
| | | | | | With fenvinline.h removal the flag is not used anymore. Checked on x86_64-linux-gnu.
* i686: Add INTERNAL_SYSCALL_NCS 6 argument supportAdhemerval Zanella2020-04-171-30/+49
| | | | | | | | It is required for i686 BZ#12683 support when building with -Os or -fno-omit-frame-pointer on some gcc versions. It is not used on current code. Check on i686-linux-gnu.
* Reset converter state after second wchar_t output (Bug 25734)Carlos O'Donell2020-04-153-4/+176
| | | | | | | | | | | | | An input BIG5-HKSCS character may be converted into at most 2 wchar_t characters. After outputting the second whcar_t character (which was saved in the converter state) we must reset the state. If we fail to reset the state we will be stuck continually copying that character to the output even if we have further input to consider. We add a new test case that covers the 4 BIG5-HKSCS characters that may become 2 wchar_t characters. Reviewed-by: Tom Honermann <tom@honermann.net>
* Fix typo in posix/tst-fnmatch.input (Bug 25790)Carlos O'Donell2020-04-151-1/+1
| | | | Reported-by: Michael Builov <mbuilov@gmail.com>
* Linux: Remove <sys/sysctl.h> and the sysctl functionFlorian Weimer2020-04-1514-277/+51
| | | | | | | | | | | | | | | Linux 5.5 remove the system call in commit 61a47c1ad3a4dc6882f01ebdc88138ac62d0df03 ("Linux: Remove <sys/sysctl.h>"). Therefore, the compat function is just a stub that sets ENOSYS. Due to SHLIB_COMPAT, new ports will not add the sysctl function anymore automatically. x32 already lacks the sysctl function, so an empty sysctl.c file is used to suppress it. Otherwise, a new compat symbol would be added. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* 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>