about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* Do not violate mutex destruction requirements.Torvald Riegel2015-12-235-13/+44
| | | | | | | | | | | | | | | | | | POSIX and C++11 require that a thread can destroy a mutex if no other thread owns the mutex, is blocked on the mutex, or will try to acquire it in the future. After destroying the mutex, it can reuse or unmap the underlying memory. Thus, we must not access a mutex' memory after releasing it. Currently, we can load the private flag after releasing the mutex, which is fixed by this patch. See https://sourceware.org/bugzilla/show_bug.cgi?id=13690 for more background. We need to call futex_wake on the lock after releasing it, however. This is by design, and can lead to spurious wake-ups on unrelated futex words (e.g., when the mutex memory is reused for another mutex). This behavior is documented in the glibc-internal futex API and in recent drafts of the Linux kernel's futex documentation (see the draft_futex branch of git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git).
* malloc: Update comment for list_lockFlorian Weimer2015-12-232-3/+8
|
* powerpc: Export __parse_hwcap_and_convert_at_platform to libc.a.Carlos Eduardo Seo2015-12-222-0/+13
| | | | | | | | | Commit 67385a01d229751569b6aac067ffdcd813a15d7a added a new feature for powerpc, where we store HWCAP/Platform bits in the TCB. In the dynamic linking case, we use the versioned symbol '__parse_hwcap_and_convert_at_platform' to verify if this feature is available. However, the same symbol was not exported to libc.a, making it not possible for GCC to check for it prior to link time.
* powerpc: Add basic support for POWER9 sans hwcap.Carlos Eduardo Seo2015-12-2210-2/+30
| | | | This patch adds the minimum changes for supporting the POWER9 processor.
* Harmonize generic stdio-lock support with nptlSamuel Thibault2015-12-222-5/+34
| | | | | | | | | | | | | | This fixes build when _IO_funlockfile is a macro, fixes build where _IO_acquire_lock_clear_flags2 is used, and fixes unlocking on unexpected stack unwind. * sysdeps/generic/stdio-lock.h [__EXCEPTIONS] (_IO_acquire_lock, _IO_release_lock ): Use cleanup attribute on new _IO_acquire_lock_file variable instead of assuming that _IO_release_lock will be called. [!__EXCEPTIONS] (_IO_acquire_lock): Define to non-existing _IO_acquire_lock_needs_exceptions_enabled. (_IO_acquire_lock_clear_flags2): New macro.
* powerpc: Regenerate libm-test-ulpsAdhemerval Zanella2015-12-222-169/+203
| | | | * sysdeps/powerpc/fpu/libm-test-ulps: Regenerated.
* malloc: Fix list_lock/arena lock deadlock [BZ #19182]Florian Weimer2015-12-213-18/+73
| | | | | | | | | | | | | | | | | | * malloc/arena.c (list_lock): Document lock ordering requirements. (free_list_lock): New lock. (ptmalloc_lock_all): Comment on free_list_lock. (ptmalloc_unlock_all2): Reinitialize free_list_lock. (detach_arena): Update comment. free_list_lock is now needed. (_int_new_arena): Use free_list_lock around detach_arena call. Acquire arena lock after list_lock. Add comment, including FIXME about incorrect synchronization. (get_free_list): Switch to free_list_lock. (reused_arena): Acquire free_list_lock around detach_arena call and attached threads counter update. Add two FIXMEs about incorrect synchronization. (arena_thread_freeres): Switch to free_list_lock. * malloc/malloc.c (struct malloc_state): Update comments to mention free_list_lock.
* Consolidate sincos computation for 2.426265 < |x| < 105414350Siddhesh Poyarekar2015-12-213-281/+132
| | | | | | | Like the previous change, exploit the fact that computation for sin and cos is identical except that it is apart by a quadrant. Also remove csloww, csloww1 and csloww2 since they can easily be expressed in terms of sloww, sloww1 and sloww2.
* Consolidate sin and cos code for 105414350 <|x|< 281474976710656Siddhesh Poyarekar2015-12-213-146/+124
| | | | | | The sin and cos computation for this range of input is identical except for a difference in quadrants by 1. Exploit that fact and the common argument reduction to reduce computations for sincos.
* Consolidate range reduction in sincos for x > 281474976710656Siddhesh Poyarekar2015-12-213-2/+66
| | | | | | Range reduction needs to be done only once for sin and cos, so copy over all of the relevant functions (__sin, __cos, reduce_and_compute) and consolidate common code.
* Fix up ChangeLogSiddhesh Poyarekar2015-12-211-3/+3
|
* i386: move ULPs to i686/multiarch and regenerate new ones for i386Aurelien Jarno2015-12-203-56/+2252
| | | | | | | | | | | | | The i386 ULPs are actually the i686/multiarch ones. The i686/multiarch float ULPs are more precise as the SSE2 version (when available) uses double for the cosf and sinf functions. On the other hand the higher precision of the x86 FPU improves the precision for a few other math functions. * sysdeps/i386/fpu/libm-test-ulps: Move to .... * sysdeps/i386/i686/multiarch/fpu/libm-test-ulps: ...here. * sysdeps/i386/fpu/libm-test-ulps: Regenerate.
* Added memset optimized with AVX512 for KNL hardware.Andrew Senkevich2015-12-198-4/+244
| | | | | | | | | | | | | | | It shows improvement up to 28% over AVX2 memset (performance results attached at <https://sourceware.org/ml/libc-alpha/2015-12/msg00052.html>). * sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S: New file. * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Added new file. * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Added new tests. * sysdeps/x86_64/multiarch/memset.S: Added new IFUNC branch. * sysdeps/x86_64/multiarch/memset_chk.S: Likewise. * sysdeps/x86/cpu-features.h (bit_Prefer_No_VZEROUPPER, index_Prefer_No_VZEROUPPER): New. * sysdeps/x86/cpu-features.c (init_cpu_features): Set the Prefer_No_VZEROUPPER for Knights Landing.
* Remove unused variable in math/atest-exp2.c.Torvald Riegel2015-12-182-5/+4
|
* Fix SYSCALL_CANCEL for empty argumetnsAdhemerval Zanella2015-12-172-8/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the SYSCALL_CANCEL macro for usage with zero argument number (for instance SYSCALL_CANCEL (pause)) using a similar approach used for SOCKETCALL_CANCEL. GLIBC build still does not hit this issue still since SYSCALL_CANCEL is not currently being used for zero arguments calls. Tested on i386, x86_64, powerpc64le, aarch64. * sysdeps/unix/sysdep.h (SYSCALL_CANCEL): Fix macro for zero argument syscalls. (__SYSCALL0): New macro. (__SYSCALL1): Likewise. (__SYSCALL2): Likewise. (__SYSCALL3): Likewise. (__SYSCALL4): Likewise. (__SYSCALL5): Likewise. (__SYSCALL6): Likewise. (__SYSCALL7): Likewise. (__SYSCALL_CONCAT_X): Likewise. (__SYSCALL_CONCAT): Likewise. (__SYSCALL_DIST): Likewise. (__SYSCALL_CALL): Likewise.
* Provide x32 timesH.J. Lu2015-12-172-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since times returns 64-bit clock_t on x32, we need to provide x32 times by redefining INTERNAL_SYSCALL_NCS and INTERNAL_SYSCALL_ERROR_P with 64-bit return type for syscall. All system calls returning 64-bit integer, which are lseek, time and times, must be handled specially for x32. lseek is handled by x32 lseek.S and time doesn't check syscall return. times is the only missed one. Before this patch, there are 0000000 <__times>: 0: b8 64 00 00 40 mov $0x40000064,%eax 5: 0f 05 syscall 7: 48 63 d0 movslq %eax,%rdx ^^^^^^^^^^ Incorrect signed extension a: 48 83 fa f2 cmp $0xfffffffffffffff2,%rdx e: 75 07 jne 17 <__times+0x17> 10: 3d 00 f0 ff ff cmp $0xfffff000,%eax ^^^^^^^^^^^^^^^^^^^^^ 32-bit compare 15: 77 11 ja 28 <__times+0x28> 17: 48 83 fa ff cmp $0xffffffffffffffff,%rdx 1b: b8 00 00 00 00 mov $0x0,%eax 20: 48 0f 45 c2 cmovne %rdx,%rax 24: c3 retq After this patch, there are 00000000 <__times>: 0: b8 64 00 00 40 mov $0x40000064,%eax 5: 0f 05 syscall 7: 48 83 f8 f2 cmp $0xfffffffffffffff2,%rax b: 75 08 jne 15 <__times+0x15> d: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 13: 77 13 ja 28 <__times+0x28> 15: 48 83 f8 ff cmp $0xffffffffffffffff,%rax 19: ba 00 00 00 00 mov $0x0,%edx 1e: 48 0f 44 c2 cmove %rdx,%rax 22: c3 retq The incorrect signed extension and 32-bit compare are gone. [BZ #19363] * sysdeps/unix/sysv/linux/x86_64/x32/times.c: New file.
* Fix POWER7 logb results for negative subnormals (bug 19375)Adhemerval Zanella2015-12-172-0/+6
| | | | | | | | | | | | | | | | The optimized POWER7 logb implementation does not use the absolute value of the word extracted from the input to apply the leading 0-bits builtin (to ignore the float sign). This patch fixes it by clearing the signal bit in the resulting word. It fixes the subnormal tests failures when running on POWER7 ou newer chip. Tested on powerpc64le (POWER8). [BZ# 19375] * sysdeps/powerpc/power7/fpu/s_logb.c (__logb): Fix return for negative subnormals.
* Add REGISTERS_CLOBBERED_BY_SYSCALL for x86-64H.J. Lu2015-12-162-2/+12
| | | | | | | | | | | X86-64 system calls use a different calling convention, which clobbers CC, %r11 an %rcx registers. Define REGISTERS_CLOBBERED_BY_SYSCALL for x86-64 inline asm statements. * sysdeps/unix/sysv/linux/x86_64/sysdep.h (REGISTERS_CLOBBERED_BY_SYSCALL): New. (INTERNAL_SYSCALL_NCS): Use it. (INTERNAL_SYSCALL_NCS_TYPES): Likewise.
* malloc: Fix attached thread reference count handling [BZ #19243]Florian Weimer2015-12-164-5/+239
| | | | | | | | | | | | | | | | reused_arena can increase the attached thread count of arenas on the free list. This means that the assertion that the reference count is zero is incorrect. In this case, the reference count initialization is incorrect as well and could cause arenas to be put on the free list too early (while they still have attached threads). * malloc/arena.c (get_free_list): Remove assert and adjust reference count handling. Add comment about reused_arena interaction. (reused_arena): Add comments abount get_free_list interaction. * malloc/tst-malloc-thread-exit.c: New file. * malloc/Makefile (tests): Add tst-malloc-thread-exit. (tst-malloc-thread-exit): Link against libpthread.
* Add missing ChangeLog entriesH.J. Lu2015-12-151-0/+9
|
* Add Prefer_MAP_32BIT_EXEC to map executable pages with MAP_32BIT hjl/32bit/masterH.J. Lu2015-12-154-0/+124
| | | | | | | | | | | | | | | | | | | | | According to Silvermont software optimization guide, for 64-bit applications, branch prediction performance can be negatively impacted when the target of a branch is more than 4GB away from the branch. Add the Prefer_MAP_32BIT_EXEC bit so that mmap will try to map executable pages with MAP_32BIT first. NB: MAP_32BIT will map to lower 2GB, not lower 4GB, address. Prefer_MAP_32BIT_EXEC reduces bits available for address space layout randomization (ASLR), which is always disabled for SUID programs and can only be enabled by setting environment variable, LD_PREFER_MAP_32BIT_EXEC. On Fedora 23, this patch speeds up GCC 5 testsuite by 3% on Silvermont. [BZ #19367] * sysdeps/unix/sysv/linux/wordsize-64/mmap.c: New file. * sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/mmap.c: Likewise. * sysdeps/x86/cpu-features.h (bit_Prefer_MAP_32BIT_EXEC): New. (index_Prefer_MAP_32BIT_EXEC): Likewise.
* Enable Silvermont optimizations for Knights LandingH.J. Lu2015-12-152-0/+8
| | | | | | | | Knights Landing processor is based on Silvermont. This patch enables Silvermont optimizations for Knights Landing. * sysdeps/x86/cpu-features.c (init_cpu_features): Enable Silvermont optimizations for Knights Landing.
* Don't emit invalid extra shift character at block boundary by iconv (bug 17197)Andreas Schwab2015-12-158-6/+116
|
* Fix aliasing violation in tst-rec-dlopenFlorian Weimer2015-12-152-1/+6
|
* Make obsolete syscall wrappers into compat symbols (bug 18472).Joseph Myers2015-12-148-48/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various Linux kernel syscalls have become obsolete over time. Specifically, the following are obsolete in all kernel versions supported by glibc, are not present for architectures more recently added to the kernel, and as such, the wrapper functions for them should be compat symbols, not in static libc and not available for new links with shared libc. * bdflush: in Linux 2.6, does nothing if present. * create_module get_kernel_syms query_module: Linux 2.4 module interface, syscalls not present in Linux 2.6. * uselib: part of the mechanism for loading a.out shared libraries, irrelevant with ELF. This patch adds support for syscalls.list to list syscall aliases of the form NAME@VERSION:OBSOLETED, with SHLIB_COMPAT conditionals being generated for such aliases. Those five syscalls are then made into compat symbols (obsoleted in glibc 2.23, so future ports won't have these symbols at all), with the header <sys/kdaemon.h> declaring bdflush being removed. When we move to 3.2 as minimum kernel version, the same can be done for nfsservctl (removed in Linux 3.1) as well. Tested for x86_64 and x86 (testsuite, as well as checking that the symbols in question indeed become compat symbols, that they are indeed omitted from static libc, and that the generated SHLIB_COMPAT conditionals look right). [BZ #18472] * sysdeps/unix/Makefile ($(objpfx)stub-syscalls.c): Handle entries for the form NAME@VERSION:OBSOLETED and generate SHLIB_COMPAT conditionals for them. * sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Likewise. * sysdeps/unix/sysv/linux/sys/kdaemon.h: Remove file. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Remove sys/kdaemon.h. * sysdeps/unix/sysv/linux/syscalls.list (bdflush): Make into compat-only syscall, obsoleted in glibc 2.23. (create_module): Likewise. (get_kernel_syms): Likewise. (query_module): Likewise. (uselib): Likewise. * manual/sysinfo.texi (System Parameters): Do not mention bdflush.
* Cleanup ARM ioperm implementationAurelien Jarno2015-12-122-9/+11
| | | | | Since GLIBC requires a minimum 2.6.32 kernel, the patch cleanups the ARM ioperm by removing pre-2.4.23 kernel support.
* Fix indentation.Steve Ellcey2015-12-112-1/+8
| | | | | * sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f): Fix indentation.
* Fix indentation.Steve Ellcey2015-12-112-1/+5
| | | | * stdio-common/vfscanf.c (_IO_vfscanf_internal): Fix indentation.
* Fix indentation.Steve Ellcey2015-12-112-2/+6
| | | | * stdlib/strtol_l.c (__strtol_l): Fix indentation.
* Automate LC_CTYPE generation for tr_TR, update to Unicode 8.0.0 (bug 18491).Joseph Myers2015-12-115-1032/+1838
| | | | | | | | | | | | | | | | | | | | This patch makes the automation of Unicode LC_CTYPE generation also support generating the modified LC_CTYPE used for Turkish (where case conversions of 'i' and 'I' differ from ASCII conventions), so allowing that to be more readily kept in sync for future Unicode updates. The patch includes the locale update generated by the scripts. Tested for x86_64. [BZ #18491] * unicode-gen/unicode_utils.py (to_upper_turkish): New function. (to_lower_turkish): Likewise. * unicode-gen/gen_unicode_ctype.py (output_tables): Support producing output with Turkish case conversions. (--turkish): New command-line option. * unicode-gen/Makefile (GENERATED): Add tr_TR. (tr_TR): New rule. * locales/tr_TR: Regenerate LC_CTYPE.
* grantpt: trust the kernel about pty group and permission modeAurelien Jarno2015-12-102-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to POSIX the grantpt() function does the following: The grantpt() function shall change the mode and ownership of the slave pseudo-terminal device associated with its master pseudo-terminal counterpart. The fildes argument is a file descriptor that refers to a master pseudo-terminal device. The user ID of the slave shall be set to the real UID of the calling process and the group ID shall be set to an unspecified group ID. The permission mode of the slave pseudo-terminal shall be set to readable and writable by the owner, and writable by the group. Historically the GNU libc has been responsible to setup the permission mode to 0620 and the group to 'tty' usually number 5, using the pt_chown helper, badly known for its security issues. With the creation of the devpts filesytem in the Linux kernel, this responsibility has been moved to the Linux kernel. The system is responsible to mount the devpts filesystem in /dev/pts with the options gid=5 and mode=0620. In that case the GNU libc has nothing to do and pt_chown is not need anymore. So far so good. The problem is that by default the devpts filesystem is shared between all mounts, and that contrary to other filesystem, the mount options are honored at the second mount, including for the default mount options. Given it corresponds to mode=0600 without gid parameter (that is the filesystem GID of the creating process), it's common to see systems where the devpts filesystem is mounted using these options. It is enough to run a "mount -t devpts devpts /mychroot/dev/pts" to come into this situation, and it's unfortunately wrongly used in a lot of scripts dealing with chroots, or for creating virtual machines images. When this happens the GNU libc tries to fix the group and permission mode of the pty nodes, and given it fails to do so for non-root users, grantpt() almost always fail. It means users are not able to open new terminals. This patch changes grantpt() to not enforce this anymore, while still enforcing minimum security measures to the permission mode. Therefore the responsibility to follow POSIX is now shared at the system level, i.e. kernel + system scripts + GNU libc. It stops trying to change the group, and makes the pty node readable and writable by the owner, and writable by the group only when originally writable and when the group is the tty one. As a result, on a system wrongly mounted with gid=0 and mode=0600, the pty nodes won't be accessible by the tty group, but the grantpt() function will succeed and users will have a working system. The system is not fully POSIX compliant (which might be an admin choice to default to "mesg n" mode), but the GNU libc is not to blame here, as without the pt_chown helper it can't do anything. With this patch there should not be any reason left to build the GNU libc with the --enable-pt_chown configure option on a GNU/Linux system.
* Split large string section; add truncation advicePaul Eggert2015-12-107-227/+263
| | | | | | | | | | | | * manual/examples/strncat.c: Remove. This example was misleading, as the code would have undefined behavior if "hello" was longer than SIZE. Anyway, the manual shouldn't encourage strncpy+strncat for this sort of thing. * manual/string.texi (Copying Strings and Arrays): Split into three sections Copying Strings and Arrays, Concatenating Strings, and Truncating Strings, as this section was way too long. All cross-referenced changed. Add advice about string-truncation functions. Remove misleading strncat example.
* Document best practice for disconnected NSS modules.Carlos O'Donell2015-12-102-0/+12
| | | | | | | | NSS modules which can run in disconnected modes should return NSS_STATUS_NOTFOUND and SUCCESS in order to follow best practice for such modules and ensure user applications can have these modules configured without causing problems if the data sources are not connected.
* Update to Unicode 8.0.0.Mike FABIAN2015-12-1017-1363/+5986
| | | | | | Update __STDC_ISO_10646__ to 201505L for Unicode 8.0.0. Update character encoding, ctype, and transliteration tables. New scripts autogenerate transliteration tables.
* Update da, nb, nn, and sv locales (Bug 89)Mike FABIAN2015-12-094-3/+67
| | | | Add transliteration rules for da, nb, nn, and sv locales.
* Update transliteration support to Unicode 7.0.0.Carlos O'Donell2015-12-0918-713/+3928
| | | | | The transliteration files are now autogenerated from upstream Unicode data.
* Regenerate locale/C-translit.h.Carlos O'Donell2015-12-092-629/+633
|
* Generic updates to transliterations.Mike FABIAN2015-12-094-7/+479
| | | | | | | | | | | | | | | - Remove duplicate transliterations for U+0152 and U+0153 from C-translit.h.in. - Change Ö U+00D6 LATIN CAPITAL LETTER O WITH STROKE → O (instead of → OE) - Change ö U+00F6 LATIN SMALL LETTER O WITH STROKE → o (instead of → oe) - Add ₹ U+20B9 INDIAN RUPEE SIGN → INR - Add ₫ U+20AB DONG SIGN → Dong (in addition to "₫ → Đồng") - Add many others from http://unicode.org/cldr/trac/browser/trunk/common/transforms/Latin-ASCII.xml - Add some more currency signs suggested by Marko Myllynen - Add another patch with more characters by Marko Myllynen
* Fix ldbl-128ibm logl inaccuracy near 1 (bug 19351).Joseph Myers2015-12-092-1/+6
| | | | | | | | | | | | | | | The ldbl-128ibm implementation of logl is inaccurate for arguments near 1, because when deciding whether to bypass a series expansion for log(1+z), where z = x-1, it compares the square of z rather than z itself with an epsilon value. This patch fixes that comparison, so eliminating the test failures for inaccuracy of logl in such cases. Tested for powerpc. [BZ #19351] * sysdeps/ieee754/ldbl-128ibm/e_logl.c (__ieee754_logl): When expanding log(1+z), compare z rather than its square with epsilon to determine when to avoid evaluating the expansion.
* Fix ldbl-128ibm sinhl spurious overflows (bug 19350).Joseph Myers2015-12-092-1/+5
| | | | | | | | | | | | | | The ldbl-128ibm implementation of sinhl uses a slightly too small overflow threshold (similar to bug 16407 for coshl). This patch fixes it to use a safe threshold (so that values whose high part is above the value compared with definitely result in an overflow in all rounding modes). Tested for powerpc. [BZ #19350] * sysdeps/ieee754/ldbl-128ibm/e_sinhl.c (__ieee754_sinhl): Increase overflow threshold.
* Fix ldbl-128ibm tanhl inaccuracy for small arguments (bug 19349).Joseph Myers2015-12-092-1/+5
| | | | | | | | | | | | | | | The ldbl-128ibm implementation of tanhl is inaccurate for small arguments, because it returns x*(1+x) (maybe in an attempt to raise "inexact") when x itself would be the accurate return value but multiplying by 1+x introduces large errors. This patch fixes it to return x in that case (when the mathematical result is x plus a negligible remainder on the order of x^3) to avoid those errors. Tested for powerpc. [BZ #19349] * sysdeps/ieee754/ldbl-128ibm/s_tanhl.c (__tanhl): Return argument when small.
* Use direct socket syscalls for new kernels on i386, m68k, microblaze, sh.Joseph Myers2015-12-095-0/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have __ASSUME_* macros for direct socket syscalls to use them instead of socketcall when they can be assumed to be available on socketcall architectures, this patch defines those macros when appropriate for i386, m68k, microblaze and sh (for 4.3, 4.3, all supported kernels and 2.6.37, respectively; the only use of socketcall support on microblaze is it allows accept4 and sendmmsg to be supported on a wider range of kernel versions). David, it seems that 32-bit SPARC is the only architecture supported by glibc that still lacks these direct syscalls. It would be good to get them added to the SPARC kernel so we can eventually eliminate socketcall support in glibc (and thereby just use entries in sysdeps/unix/syscalls.list for most of these functions) when we can assume new-enough kernels. Tested for i386 (testsuite, and that installed shared libraries are unchanged by this patch - not using a new enough kernel, so this doesn't actually test much, but the i386 and m68k code is essentially the same as that already in use for s390). * sysdeps/unix/sysv/linux/i386/kernel-features.h [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SOCKET_SYSCALL): New macro. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SOCKETPAIR_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_BIND_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_CONNECT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_LISTEN_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_ACCEPT4_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_GETSOCKOPT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SETSOCKOPT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_GETSOCKNAME_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_GETPEERNAME_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SENDTO_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SENDTO_FOR_SEND_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SENDMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_RECVFROM_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_RECVFROM_FOR_RECV_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_RECVMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SHUTDOWN_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/m68k/kernel-features.h [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_RECVMMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SENDMMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SOCKET_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SOCKETPAIR_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_BIND_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_CONNECT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_LISTEN_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_ACCEPT4_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_GETSOCKOPT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SETSOCKOPT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_GETSOCKNAME_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_GETPEERNAME_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SENDTO_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SENDTO_FOR_SEND_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SENDMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_RECVFROM_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_RECVFROM_FOR_RECV_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_RECVMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SHUTDOWN_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_SOCKET_SYSCALL): Likewise. (__ASSUME_BIND_SYSCALL): Likewise. (__ASSUME_CONNECT_SYSCALL): Likewise. (__ASSUME_LISTEN_SYSCALL): Likewise. (__ASSUME_ACCEPT_SYSCALL): Likewise. (__ASSUME_GETSOCKNAME_SYSCALL): Likewise. (__ASSUME_GETPEERNAME_SYSCALL): Likewise. (__ASSUME_SOCKETPAIR_SYSCALL): Likewise. (__ASSUME_SEND_SYSCALL): Likewise. (__ASSUME_SENDTO_SYSCALL): Likewise. (__ASSUME_RECV_SYSCALL): Likewise. (__ASSUME_RECVFROM_SYSCALL): Likewise. (__ASSUME_SHUTDOWN_SYSCALL): Likewise. (__ASSUME_GETSOCKOPT_SYSCALL): Likewise. (__ASSUME_SETSOCKOPT_SYSCALL): Likewise. (__ASSUME_SENDMSG_SYSCALL): Likewise. (__ASSUME_RECVMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_SOCKET_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_BIND_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_CONNECT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_LISTEN_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_ACCEPT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_GETSOCKNAME_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_GETPEERNAME_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_SOCKETPAIR_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_SEND_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_SENDTO_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_RECV_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_RECVFROM_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_SHUTDOWN_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_GETSOCKOPT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_SETSOCKOPT_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_SENDMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020625] (__ASSUME_RECVMSG_SYSCALL): Likewise.
* mips: fix testsuite build for O32 FPXX ABI on pre-R2 CPUAurelien Jarno2015-12-094-0/+54
| | | | | | | | | | | | | | | | | | | | | | | On MIPS when the toolchain is using the O32 FPXX ABI, the testsuite fails to build for pre-R2 CPU. It assumes that it is possible to use the -mfp64 option to build tst-abi-fp64amod and tst-abi-fp64mod, while this requires a CPU which supports the mfhc1 and mthc1 instructions, ie at least a R2 CPU: error: '-mgp32' and '-mfp64' can only be combined if the target supports the mfhc1 and mthc1 instructions The same way it assumes that it is possible to use the -modd-spreg option to build tst-abi-fpxxomod and tst-abi-fp64mod, while this requires at least a R1 CPU: warning: the 'mips2' architecture does not support odd single-precision registers This patches changes that by checking the usability of -mfp64 and -modd-spreg options in configure, and disable those tests when they can not be used.
* Fix grantpt basename namespace bugAurelien Jarno2015-12-092-1/+6
| | | | | | | Commit cf06a4e3 removed test-xfail-POSIX2008/unistd.h/linknamespace, but left one basename namespace issue in grantpt. However this issue is not visible with the default configuration buy only when configure is passed the --enable-pt_chown option.
* benchtests: ffs and ffsll are string functions, not mathSiddhesh Poyarekar2015-12-092-16/+25
| | | | | | | The ffs and ffsll functions were listed as math functions when they are actually defined in strings.h and string.h respectively. Shuffle around the Makefile variables a bit and make a separate space for ffs and ffsll.
* benchtests: Add inputs from sin and cos to sincosSiddhesh Poyarekar2015-12-092-0/+5107
| | | | | | | The sincos benchmark has only about a dozen inputs that don't measure the impact of changes to various passes. Since much of the code properties are inherited from sin and cos, copy those inputs in to get more comprehensive coverage.
* Utilize x86_64 vector math functions w/o -fopenmp.Andrew Senkevich2015-12-072-0/+11
| | | | | | | | | This patch allows to use x86_64 vector math functions with GCC 6.* without OpenMP SIMD constructs. For additional details please visit <https://sourceware.org/glibc/wiki/libmvec#Example_2>. * sysdeps/x86/fpu/bits/math-vector.h: W/o -fopenmp declare vector math functions with GCC 6.* __attribute__ ((__simd__)).
* Fix typo in strncat, wcsncat manual entriesPaul Eggert2015-12-042-4/+13
| | | | | | * manual/string.texi (Copying and Concatenation): Fix typos in sample implementations of strncat and wcsncat, by having them use the old value of the destination length, not the new one.
* Fix nan functions handling of payload strings (bug 16961, bug 16962).Joseph Myers2015-12-049-25/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nan, nanf and nanl functions handle payload strings by doing e.g.: if (tagp[0] != '\0') { char buf[6 + strlen (tagp)]; sprintf (buf, "NAN(%s)", tagp); return strtod (buf, NULL); } This is an unbounded stack allocation based on the length of the argument. Furthermore, if the argument starts with an n-char-sequence followed by ')', that n-char-sequence is wrongly treated as significant for determining the payload of the resulting NaN, when ISO C says the call should be equivalent to strtod ("NAN", NULL), without being affected by that initial n-char-sequence. This patch fixes both those problems by using the __strtod_nan etc. functions recently factored out of strtod etc. for that purpose, with those functions being exported from libc at version GLIBC_PRIVATE. Tested for x86_64, x86, mips64 and powerpc. [BZ #16961] [BZ #16962] * math/s_nan.c (__nan): Use __strtod_nan instead of constructing a string on the stack for strtod. * math/s_nanf.c (__nanf): Use __strtof_nan instead of constructing a string on the stack for strtof. * math/s_nanl.c (__nanl): Use __strtold_nan instead of constructing a string on the stack for strtold. * stdlib/Versions (libc): Add __strtof_nan, __strtod_nan and __strtold_nan to GLIBC_PRIVATE. * math/test-nan-overflow.c: New file. * math/test-nan-payload.c: Likewise. * math/Makefile (tests): Add test-nan-overflow and test-nan-payload.
* Revert "tst-res_hconf_reorder: Set RESOLV_REORDER environment variable"Florian Weimer2015-12-042-8/+0
| | | | | | | This reverts commit 731a713b72e1281d58b3304738f04efb7bfca8b7. This change is unnecessary because the Makefile already sets up the environment for the test.