about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* hurd: Fix missing __pthread_get_cleanup_stack symbolSamuel Thibault2018-06-162-3/+1
| | | | | | | | | | | | | | | | | | | Rework 57e1651557e8 ("hurd: Avoid PLT ref for __pthread_get_cleanup_stack") to keep the __pthread_get_cleanup_stack symbol. * htl/pt-cleanup.c (__pthread_get_cleanup_stack): Rename to ___pthread_get_cleanup_stack. (__pthread_get_cleanup_stack): Remove hidden def, add alias. * htl/pt-exit.c (__pthread_exit): Use ___pthread_get_cleanup_stack instead of __pthread_get_cleanup_stack. * sysdeps/htl/pthread-functions.h [libpthread] (__pthread_get_cleanup_stack): Remove hidden proto. * sysdeps/htl/pthreadP.h (___pthread_get_cleanup_stack): Add prototype. * sysdeps/htl/pthreadP.h (___pthread_get_cleanup_stack): Add hidden attribute. * htl/pt-join.c (__pthread_get_cleanup_stack): Define to ___pthread_get_cleanup_stack.
* hurd: Whitelist PLT refs which are difficult to avoidSamuel Thibault2018-06-161-0/+8
| | | | | * sysdeps/mach/hurd/localplt.data (siglongjmp, longjmp, __libc_lseek64, _IO_funlockfile): Whitelist PLT references.
* hurd: Avoid PLT references to syscallsSamuel Thibault2018-06-161-6/+14
| | | | | | | * mach/Makefile ($(mach-syscalls:%=$(objpfx))): Add hidden definition. * sysdeps/mach/include/mach/mach_traps.h (__mach_reply_port, __mach_thread_self, __mach_task_self, __mach_host_self, __swtch, __swtch_pri, __thread_switch, __evc_wait): Add hidden prototypes.
* hurd: Avoid PLT ref to __mach_msgSamuel Thibault2018-06-161-0/+1
| | | | | | * sysdeps/mach/include/mach.h (__mach_msg): Add hidden prototype. * mach/msg.c: Include <mach.h>. (__mach_msg): Add hidden definition.
* hurd: Avoid PLT references to shortcutsSamuel Thibault2018-06-162-0/+14
| | | | | | | * sysdeps/mach/include/mach-shortcuts-hidden.h: New file. * mach/shortcut.awk: Make syscall stubs include <mach-shortcuts-hidden.h> and add hidden definition. * sysdeps/mach/include/mach.h: Include <mach-shortcuts-hidden.h>.
* hurd: Avoid missing PLT ref from ld.so requirementSamuel Thibault2018-06-161-1/+1
| | | | * sysdeps/mach/hurd/localplt.data (ld.so): Make ref to __open optional.
* hurd: Avoid PLT ref for __pthread_get_cleanup_stackSamuel Thibault2018-06-162-1/+3
| | | | | | | | | | | | * htl/pt-cleanup.c (___pthread_get_cleanup_stack): Rename to __pthread_get_cleanup_stack. (__pthread_get_cleanup_stack): Remove alias, add hidden def. * htl/pt-exit.c (__pthread_exit): Use __pthread_get_cleanup_stack instead of ___pthread_get_cleanup_stack. * sysdeps/htl/pthread-functions.h [libpthread] (__pthread_get_cleanup_stack): Add hidden proto. * sysdeps/htl/pthreadP.h (___pthread_get_cleanup_stack): Remove prototype.
* hurd: Detect 32bit overflow in value returned by lseekSamuel Thibault2018-06-161-1/+11
| | | | | | * sysdeps/mach/hurd/lseek.c: Include <errno.h>. * sysdeps/mach/hurd/lseek.c (__libc_lseek): Check that the value returned by __lseek64 can fit off_t, return EOVERFLOW otherwise.
* hurd: avoid PLT ref between sendfile and sendfile64Samuel Thibault2018-06-162-3/+4
| | | | | | | | * include/sys/sendfile.h (__sendfile64): Declare hidden prototype. * sysdeps/mach/hurd/sendfile.c (sendfile): Call __sendfile64 instead of sendfile. * sysdeps/mach/hurd/sendfile64.c (sendfile64): Rename to __sendfile64. (sendfile64): New strong alias.
* hurd: Fix htl link failureSamuel Thibault2018-06-141-2/+2
| | | | | | | | | | 126b3ec370f0 ("hurd: Avoid PLTs for __mach_thread_self and __mach_reply_port") made mach traps hidden, but htl actually uses two of them. Re-expose them for now. Exposing them properly will be more involved since their definition is generated. * sysdeps/mach/include/mach/mach_traps.h (__mach_thread_self, __mach_task_self): Remove attribute_hidden.
* aarch64: Use an ifunc/VDSO to implement gettimeofday in shared glibc.Steve Ellcey2018-06-141-0/+71
| | | | | | | | | | | | | | | | | | This patch uses an ifunc to implement gettimeofday in the shared libc. This is faster compared to the vsyscall mechanism that has to check a global pointer, demangle it and call it indirectly when the VDSO is present. Resolving the gettimeofday symbol directly to the VDSO code is safe because there are no failures that the libc has to handle by setting errno like in a generic vsyscall (the only failure when the VDSO code falls back to a syscall is EFAULT, but passing an invalid pointer is undefined behaviour so returning -EFAULT is fine). If the kernel supports the VDSO interface we use it for extern calls, otherwise the old vsyscall method is used which falls back to a syscall. The static version of gettimeofday continues to use a syscall, libc.so internal calls use the old vsyscall method. * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c: New file.
* hurd: Avoid a PLT referenceSamuel Thibault2018-06-141-6/+1
| | | | | * sysdeps/mach/hurd/i386/____longjmp_chk.S (____longjmp_chk): Do not use PLT to call _hurd_self_sigstate.
* hurd: Avoid PLTs for __mach_thread_self and __mach_reply_portSamuel Thibault2018-06-141-0/+13
| | | | | | | | * mach/mach/mach_traps.h (__mach_reply_port, __mach_thread_self, __mach_task_self, __mach_host_self, __swtch, __swtch_pri, __thread_switch, __evc_wait): Move declarations to... * sysdeps/mach/include/mach/mach_traps.h: ... new file, and add attribute_hidden.
* hurd: Avoid PLTs for _hurd_port_locked_get/setSamuel Thibault2018-06-141-0/+9
| | | | * sysdeps/hurd/include/hurd/port.h: New file.
* hurd: update localplt.dataSamuel Thibault2018-06-141-2/+3
| | | | | | | after 329ea513b451 ("Avoid cancellable I/O primitives in ld.so.") * sysdeps/mach/hurd/localplt.data (ld.so): Add __open64, rename __libc_read and __libc_write to __read and __write.
* hurd: xfail missing abilist for libmachuser and libhurduserSamuel Thibault2018-06-131-0/+8
| | | | | | | They need more work to implement, see bug 23286. * sysdeps/mach/hurd/i386/Makefile (test-xfail-check-abi-libhurduser, test-xfail-check-abi-libmachuser): Add.
* aarch64: add HXT Phecda core memory operation ifuncsHongbo Zhang2018-06-125-5/+10
| | | | | | | | | | | | | | | | | | | | Phecda is HXT semiconductor's CPU core, this patch adds memory operation ifuncs for it: sharing the same optimized implementation with Qualcomm's Falkor core. 2018-06-07 Minfeng Kang <minfeng.kang@hxt-semitech.com> Hongbo Zhang <hongbo.zhang@linaro.org> * sysdeps/aarch64/multiarch/memcpy.c (libc_ifunc): reuse __memcpy_falkor for phecda core. * sysdeps/aarch64/multiarch/memmove.c (libc_ifunc): reuse __memmove_falkor for phecda core. * sysdeps/aarch64/multiarch/memset.c (libc_ifunc): reuse __memset_falkor for phecda core. * sysdeps/unix/sysv/linux/aarch64/cpu-features.c: add MIDR entry for phecda core. * sysdeps/unix/sysv/linux/aarch64/cpu-features.h (IS_PHECDA): add macro to identify phecda core.
* Avoid cancellable I/O primitives in ld.so.Zack Weinberg2018-06-1235-246/+530
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Neither the <dlfcn.h> entry points, nor lazy symbol resolution, nor initial shared library load-up, are cancellation points, so ld.so should exclusively use I/O primitives that are not cancellable. We currently achieve this by having the cancellation hooks compile as no-ops when IS_IN(rtld); this patch changes to using exclusively _nocancel primitives in the source code instead, which makes the intent clearer and significantly reduces the amount of code compiled under IS_IN(rtld) as well as IS_IN(libc) -- in particular, elf/Makefile no longer thinks we require a copy of unwind.c in rtld-libc.a. (The older mechanism is preserved as a backstop.) The bulk of the change is splitting up the files that define the _nocancel I/O functions, so they don't also define the variants that *are* cancellation points; after which, the existing logic for picking out the bits of libc that need to be recompiled as part of ld.so Just Works. I did this for all of the _nocancel functions, not just the ones used by ld.so, for consistency. fcntl was a little tricky because it's only a cancellation point for certain opcodes (F_SETLKW(64), which can block), and the existing __fcntl_nocancel wasn't applying the FCNTL_ADJUST_CMD hook, which strikes me as asking for trouble, especially as the only nontrivial definition of FCNTL_ADJUST_CMD (for powerpc64) changes F_*LK* opcodes. To fix this, fcntl_common moves to fcntl_nocancel.c along with __fcntl_nocancel, and changes its name to the extern (but hidden) symbol __fcntl_nocancel_adjusted, so that regular fcntl can continue calling it. __fcntl_nocancel now applies FCNTL_ADJUST_CMD; so that both both fcntl.c and fcntl_nocancel.c can see it, the only nontrivial definition moves from sysdeps/u/s/l/powerpc/powerpc64/fcntl.c to .../powerpc64/sysdep.h and becomes entirely a macro, instead of a macro that calls an inline function. The nptl version of libpthread also changes a little, because its "compat-routines" formerly included files that defined all the _nocancel functions it uses; instead of continuing to duplicate them, I exported the relevant ones from libc.so as GLIBC_PRIVATE. Since the Linux fcntl.c calls a function defined by fcntl_nocancel.c, it can no longer be used from libpthread.so; instead, introduce a custom forwarder, pt-fcntl.c, and export __libc_fcntl from libc.so as GLIBC_PRIVATE. The nios2-linux ABI doesn't include a copy of vfork() in libpthread, and it was handling that by manipulating libpthread-routines in .../linux/nios2/Makefile; it is cleaner to do what other such ports do, and have a pt-vfork.S that defines no symbols. Right now, it appears that Hurd does not implement _nocancel I/O, so sysdeps/generic/not-cancel.h will forward everything back to the regular functions. This changed the names of some of the functions that sysdeps/mach/hurd/dl-sysdep.c needs to interpose. * elf/dl-load.c, elf/dl-misc.c, elf/dl-profile.c, elf/rtld.c * sysdeps/unix/sysv/linux/dl-sysdep.c Include not-cancel.h. Use __close_nocancel instead of __close, __open64_nocancel instead of __open, __read_nocancel instead of __libc_read, and __write_nocancel instead of __libc_write. * csu/check_fds.c (check_one_fd) * sysdeps/posix/fdopendir.c (__fdopendir) * sysdeps/posix/opendir.c (__alloc_dir): Use __fcntl_nocancel instead of __fcntl and/or __libc_fcntl. * sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np) * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np) * sysdeps/unix/sysv/linux/i386/smp.h (is_smp_system): Use __open64_nocancel instead of __open_nocancel. * sysdeps/unix/sysv/linux/not-cancel.h: Move all of the hidden_proto declarations to the end and issue them if either IS_IN(libc) or IS_IN(rtld). * sysdeps/unix/sysv/linux/Makefile [subdir=io] (sysdep_routines): Add close_nocancel, fcntl_nocancel, nanosleep_nocancel, open_nocancel, open64_nocancel, openat_nocancel, pause_nocancel, read_nocancel, waitpid_nocancel, write_nocancel. * io/Versions [GLIBC_PRIVATE]: Add __libc_fcntl, __fcntl_nocancel, __open64_nocancel, __write_nocancel. * posix/Versions: Add __nanosleep_nocancel, __pause_nocancel. * nptl/pt-fcntl.c: New file. * nptl/Makefile (pthread-compat-wrappers): Remove fcntl. (libpthread-routines): Add pt-fcntl. * include/fcntl.h (__fcntl_nocancel_adjusted): New function. (__libc_fcntl): Remove attribute_hidden. * sysdeps/unix/sysv/linux/fcntl.c (__libc_fcntl): Call __fcntl_nocancel_adjusted, not fcntl_common. (__fcntl_nocancel): Move to new file fcntl_nocancel.c. (fcntl_common): Rename to __fcntl_nocancel_adjusted; also move to fcntl_nocancel.c. * sysdeps/unix/sysv/linux/fcntl_nocancel.c: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c: Remove file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Define FCNTL_ADJUST_CMD here, as a self-contained macro. * sysdeps/unix/sysv/linux/close.c: Move __close_nocancel to... * sysdeps/unix/sysv/linux/close_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/nanosleep.c: Move __nanosleep_nocancel to... * sysdeps/unix/sysv/linux/nanosleep_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/open.c: Move __open_nocancel to... * sysdeps/unix/sysv/linux/open_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/open64.c: Move __open64_nocancel to... * sysdeps/unix/sysv/linux/open64_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/openat.c: Move __openat_nocancel to... * sysdeps/unix/sysv/linux/openat_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/openat64.c: Move __openat64_nocancel to... * sysdeps/unix/sysv/linux/openat64_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/pause.c: Move __pause_nocancel to... * sysdeps/unix/sysv/linux/pause_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/read.c: Move __read_nocancel to... * sysdeps/unix/sysv/linux/read_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/waitpid.c: Move __waitpid_nocancel to... * sysdeps/unix/sysv/linux/waitpid_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/write.c: Move __write_nocancel to... * sysdeps/unix/sysv/linux/write_nocancel.c: ...this new file. * sysdeps/unix/sysv/linux/nios2/Makefile: Don't override libpthread-routines. * sysdeps/unix/sysv/linux/nios2/pt-vfork.S: New file which defines nothing. * sysdeps/mach/hurd/dl-sysdep.c: Define __read instead of __libc_read, and __write instead of __libc_write. Define __open64 in addition to __open.
* i386: Change offset of __private_ss to 0x30 [BZ #23250]H.J. Lu2018-06-122-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sysdeps/i386/nptl/tls.h has typedef struct { void *tcb; /* Pointer to the TCB. Not necessarily the thread descriptor used by libpthread. */ dtv_t *dtv; void *self; /* Pointer to the thread descriptor. */ int multiple_threads; uintptr_t sysinfo; uintptr_t stack_guard; uintptr_t pointer_guard; int gscope_flag; int __glibc_reserved1; /* Reservation of some values for the TM ABI. */ void *__private_tm[4]; /* GCC split stack support. */ void *__private_ss; } tcbhead_t; The offset of __private_ss is 0x34. But GCC defines /* We steal the last transactional memory word. */ #define TARGET_THREAD_SPLIT_STACK_OFFSET 0x30 and libgcc/config/i386/morestack.S has cmpl %gs:0x30,%eax # See if we have enough space. movl %eax,%gs:0x30 # Save the new stack boundary. movl %eax,%gs:0x30 # Save the new stack boundary. movl %ecx,%gs:0x30 # Save new stack boundary. movl %eax,%gs:0x30 movl %gs:0x30,%eax movl %eax,%gs:0x30 Since update TARGET_THREAD_SPLIT_STACK_OFFSET changes split stack ABI, this patch updates tcbhead_t to match GCC. [BZ #23250] [BZ #10686] * sysdeps/i386/nptl/tls.h (tcbhead_t): Change __private_tm[4] to _private_tm[3] and add __glibc_reserved2. Add _Static_assert of offset of __private_ss == 0x30. * sysdeps/x86_64/nptl/tls.h: Add _Static_assert of offset of __private_ss == 0x40 for ILP32 and == 0x70 for LP64.
* x86: Make strncmp usable from rtldFlorian Weimer2018-06-122-5/+8
| | | | | | | | | Due to the way the conditions were written, the rtld build of strncmp ended up with no definition of the strncmp symbol at all: The implementations were renamed for use within an IFUNC resolver, but the IFUNC resolver itself was missing (because rtld does not use IFUNCs). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Fix ldbl-96 fma (Inf, Inf, finite) (bug 23272).Joseph Myers2018-06-111-8/+6
| | | | | | | | | | | | | | | | | | | As reported in bug 23272, the ldbl-96 implementation of fma (fma for double, in terms of ldbl-96 as the internal arithmetic type, as used on 32-bit x86) is missing some of the special-case handling for non-finite arguments, resulting in incorrect NaN results when the first two arguments are infinities, the third is finite and so the infinities go through the logic for finite arguments. This patch fixes it by handling all cases of non-finite arguments up front, with additional fma tests for the problem cases being added to the testsuite. Tested for x86_64 and x86. [BZ #23272] * sysdeps/ieee754/ldbl-96/s_fma.c (__fma): Start by handling all cases of non-finite arguments. * math/libm-test-fma.inc (fma_test_data): Add more tests.
* The hppa-linux target still requires an executable stack for kernelJohn David Anglin2018-06-101-0/+7
| | | | | | | | syscall restarts and signal returns. Thus, we need to xfail the check-execstack test. [BZ #23174] * sysdeps/unix/sysv/linux/hppa/Makefile: xfail check-execstack.
* posix: Fix posix_spawnp to not execute invalid binaries in non compat mode ↵Adhemerval Zanella2018-06-082-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (BZ#23264) Current posix_spawnp implementation wrongly tries to execute invalid binaries (for instance script without shebang) as a shell script in non compat mode. It was a regression introduced by 9ff72da471a509a8c19791efe469f47fa6977410 when __spawni started to use __execvpe instead of __execve (glibc __execvpe try to execute ENOEXEC as shell script regardless). This patch fixes it by using an internal symbol (__execvpex) with the faulty semantic (since compat mode is handled by spawni.c itself). It was reported by Daniel Drake on libc-help [1]. Checked on x86_64-linux-gnu and i686-linux-gnu. [BZ #23264] * include/unistd.h (__execvpex): New prototype. * posix/Makefile (tests): Add tst-spawn4. (tests-internal): Add tst-spawn4-compat. * posix/execvpe.c (__execvpe_common, __execvpex): New functions. * posix/tst-spawn4-compat.c: New file. * posix/tst-spawn4.c: Likewise. * sysdeps/unix/sysv/linux/spawni.c (__spawni): Do not interpret invalid binaries as shell scripts. * sysdeps/posix/spawni.c (__spawni): Likewise. [1] https://sourceware.org/ml/libc-help/2018-06/msg00012.html
* Mark _init and _fini as hidden [BZ #23145]H.J. Lu2018-06-0819-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _init and _fini are special functions provided by glibc for linker to define DT_INIT and DT_FINI in executable and shared library. They should never be put in dynamic symbol table. This patch marks them as hidden to remove them from dynamic symbol table. Tested with build-many-glibcs.py. [BZ #23145] * elf/Makefile (tests-special): Add $(objpfx)check-initfini.out. ($(all-built-dso:=.dynsym): New target. (common-generated): Add $(all-built-dso:$(common-objpfx)%=%.dynsym). ($(objpfx)check-initfini.out): New target. (generated): Add check-initfini.out. * scripts/check-initfini.awk: New file. * sysdeps/aarch64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/alpha/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/arm/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/hppa/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/i386/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/ia64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/m68k/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/microblaze/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/mips/mips32/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/mips/mips64/n32/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/mips/mips64/n64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/nios2/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/powerpc/powerpc32/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/powerpc/powerpc64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/s390/s390-32/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/s390/s390-64/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/sh/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/sparc/crti.S (_init): Mark as hidden. (_fini): Likewise. * sysdeps/x86_64/crti.S (_init): Mark as hidden. (_fini): Likewise.
* powerpc64le: Fix TFtype in sqrtf128 when using -mabi=ieeelongdoubleTulio Magno Quites Machado Filho2018-06-061-3/+8
| | | | | | | | | | | | | | | | When building with -mlong-double-128 or -mabi=ibmlongdouble, TFtype represents the IBM 128-bit extended floating point type, while KFtype represents the IEEE 128-bit floating point type. The soft float implementation of e_sqrtf128 had to redefine TFtype and TF in order to workaround this issue. However, this behavior changes when -mabi=ieeelongdouble is used and the macros are not necessary. * sysdeps/powerpc/powerpc64/le/fpu/e_sqrtf128.c [__HAVE_FLOAT128_UNLIKE_LDBL] (TFtype, TF): Restrict TFtype and TF redirection to KFtype and KF only when the default long double type is not the IEEE 128-bit floating point type. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* Add AArch64 hwcap values from Linux 4.17.Joseph Myers2018-06-052-2/+6
| | | | | | | | | | | | | | | | | Linux 4.17 adds four new AArch64 hwcap values. This patch adds them to glibc's AArch64 bits/hwcap.h, with corresponding dl-procinfo.c updates. Tested with build-many-glibcs.py for aarch64. * sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_DIT): New macro. (HWCAP_USCAT): Likewise. (HWCAP_ILRCPC): Likewise. (HWCAP_FLAGM): Likewise. * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c (_DL_HWCAP_COUNT): Increase to 28. (_dl_aarch64_cap_flags): Add new flag names.
* Add MAP_FIXED_NOREPLACE from Linux 4.17 to bits/mman.h.Joseph Myers2018-06-0515-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux 4.17 adds MAP_FIXED_NOREPLACE (value 0x100000 on most architectures, 0x200000 on alpha). This patch adds that macro to glibc's bits/mman.h headers. Tested for x86_64. * sysdeps/unix/sysv/linux/aarch64/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): New macro. * sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/arm/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/ia64/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/m68k/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/microblaze/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/mips/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/nios2/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/riscv/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/s390/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/sh/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise. * sysdeps/unix/sysv/linux/x86/bits/mman.h [__USE_MISC] (MAP_FIXED_NOREPLACE): Likewise.
* Update kernel version in syscall-names.list to 4.17.Joseph Myers2018-06-051-2/+2
| | | | | | | | | | | As far as I can tell, Linux 4.17 does not add any new syscalls; this patch updates the version number in syscall-names.list to reflect that it's still current for 4.17. Tested for x86_64-linux-gnu with build-many-glibcs.py. * sysdeps/unix/sysv/linux/syscall-names.list: Update kernel version to 4.17.
* hurd: Fix shmid_ds's shm_segsz field typeSamuel Thibault2018-06-021-1/+1
| | | | | | * bits/shm.h (struct shmid_ds): Make shm_segsz field size_t instead of int. * sysdeps/gnu/bits/shm.h (struct shmid_ds): Likewise.
* x86-64: Optimize strcmp/wcscmp and strncmp/wcsncmp with AVX2Leonardo Sandoval2018-06-0113-2/+1008
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize x86-64 strcmp/wcscmp and strncmp/wcsncmp with AVX2. It uses vector comparison as much as possible. Peak performance observed on a SkyLake machine: 9x, 3x, 2.5x and 5.5x for strcmp, strncmp, wcscmp and wcsncmp, respectively. The larger the comparison length, the more benefit using avx2 functions, except on the strcmp, where peak is observed at length == 32 bytes. Select AVX2 strcmp/wcscmp on AVX2 machines where vzeroupper is preferred and AVX unaligned load is fast. NB: It uses TZCNT instead of BSF since TZCNT produces the same result as BSF for non-zero input. TZCNT is faster than BSF and is executed as BSF if machine doesn't support TZCNT. * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add strcmp-avx2, strncmp-avx2, wcscmp-avx2, wcscmp-sse2, wcsncmp-avx2 and wcsncmp-sse2. * sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Add tests for __strcmp_avx2, __strncmp_avx2, __wcscmp_avx2, __wcsncmp_avx2, __wcscmp_sse2 and __wcsncmp_sse2. * sysdeps/x86_64/multiarch/strcmp.c (OPTIMIZE (avx2)): (IFUNC_SELECTOR): Return OPTIMIZE (avx2) on AVX 2 machines if AVX unaligned load is fast and vzeroupper is preferred. * sysdeps/x86_64/multiarch/strncmp.c: Likewise. * sysdeps/x86_64/multiarch/strcmp-avx2.S: New file. * sysdeps/x86_64/multiarch/strncmp-avx2.S: Likewise. * sysdeps/x86_64/multiarch/wcscmp-avx2.S: Likewise. * sysdeps/x86_64/multiarch/wcscmp-sse2.S: Likewise. * sysdeps/x86_64/multiarch/wcscmp.c: Likewise. * sysdeps/x86_64/multiarch/wcsncmp-avx2.S: Likewise. * sysdeps/x86_64/multiarch/wcsncmp-sse2.c: Likewise. * sysdeps/x86_64/multiarch/wcsncmp.c: Likewise. * sysdeps/x86_64/wcscmp.S (__wcscmp): Add alias only if __wcscmp is undefined.
* math: Update i686 ulps (--disable-multi-arch configuration)Florian Weimer2018-06-011-278/+294
| | | | | | The results are from configuring with --disable-multi-arch, building with “-march=x86-64 -mtune=generic -mfpmath=sse” and running the testsuite on a Haswell-era CPU.
* math: Update i686 ulpsFlorian Weimer2018-06-011-270/+278
| | | | | The results are from building with “-march=x86-64 -mtune=generic -mfpmath=sse” and running the testsuite on a Haswell-era CPU.
* Make powerpc-nofpu __sqrtsf2, __sqrtdf2 compat symbols (bug 18473).Joseph Myers2018-06-014-2/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | powerpc-nofpu libc exports __sqrtsf2 and __sqrtdf2 symbols. The export of these soft-fp symbols is a mistake; they aren't part of the libgcc interface and GCC will never generate code that calls them. This patch makes them into compat symbols (no code built for static libc), moving their sources from the generic soft-fp sources to sysdeps/powerpc/nofpu (the underlying soft-fp FP_SQRT functionality remains of use to implement actual sqrt public interfaces, such as sqrtl / sqrtf128 for which it is used on various platforms, but __sqrt[sdt]f2 are not such interfaces). Tested with build-many-glibcs.py for relevant platforms. [BZ #18473] * soft-fp/sqrttf2.c: Remove file. * soft-fp/sqrtdf2.c: Move to .... * sysdeps/powerpc/nofpu/sqrtdf2.c: ... here. Include <shlib-compat.h>. (__sqrtdf2): Make conditional on [SHLIB_COMPAT (libc, GLIBC_2_3_2, GLIBC_2_28)]. Define as compat symbol. * soft-fp/sqrtsf2.c: Move to .... * sysdeps/powerpc/nofpu/sqrtsf2.c: ... here. Include <shlib-compat.h>. (__sqrtsf2): Make conditional on [SHLIB_COMPAT (libc, GLIBC_2_3_2, GLIBC_2_28)]. Define as compat symbol. * soft-fp/Makefile (gcc-single-routines): Remove sqrtsf2. (gcc-double-routines): Remove sqrtdf2. (gcc-quad-routines): Remove sqrttf2. * sysdeps/nios2/Makefile [$(subdir) = soft-fp] (sysdep_routines): Do not filter out sqrtsf2 and sqrtdf2. * sysdeps/powerpc/nofpu/Makefile [$(subdir) = soft-fp] (sysdep_routines): Add sqrtsf2 and sqrtdf2.
* Remove sysdeps/generic/libcidn.abilistFlorian Weimer2018-06-011-0/+0
| | | | | This file was left behind by the libidn removal in commit 7f9f1ecb710eac4d65bb02785ddf288cac098323.
* Update ulps with "make regen-ulps" on AMD Ryzen 7 1800X.Paul Pluzhnikov2018-05-301-1/+1
| | | | | | | 2018-05-30 Paul Pluzhnikov <ppluzhnikov@google.com> * sysdeps/x86_64/fpu/libm-test-ulps (log_vlen8_avx2): Update for AMD Ryzen 7 1800X.
* powerpc: Add multiarch sqrtf128 for ppc64leRajalakshmi Srinivasaraghavan2018-05-304-0/+107
| | | | | | | This patch creates ifunc for sqrtf128() to make use of new xssqrtqp instruction for POWER9 when --enable-multi-arch and --with-cpu=power8 options are used on power9 system. This is achieved by explicitly adding -mcpu=power9 flag for sqrtf128-power9.
* Remove sysdeps/sparc/sparc64/soft-fp directory.Joseph Myers2018-05-2534-121/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per <https://sourceware.org/ml/libc-alpha/2014-10/msg00369.html>, there should not be separate sysdeps/<arch>/soft-fp directories when those are used by all configurations that use sysdeps/<arch>, and, more generally, should not be sysdeps/foo/Implies files pointing to a subdirectory foo/bar. This patch eliminates the sysdeps/sparc/sparc64/soft-fp directory accordingly, merging its contents into sysdeps/sparc/sparc64. This completes removing the unnecessary <arch>/soft-fp sysdeps directories. sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c is removed rather than moved. It was not in fact used previously - the ldbl-128 version of e_ilogbl.c was used instead - and moving it into sysdeps/sparc/sparc64 results in it being used, but causing a build failure because of FP_DECL_EX declaring an unused variable (as I noted in <https://sourceware.org/ml/libc-alpha/2013-10/msg00457.html> that file doesn't appear to use FP_DECL_EX). Given that the file was previously unused and so presumably not tested recently, removing it is the safe way to avoid this patch changing what actually gets built into glibc (if this file should turn out more efficient than the ldbl-128 e_ilogbl.c, it can always be added back in future with the build failure fixed). Tested with build-many-glibcs.py that installed stripped shared libraries for sparc configurations are unchanged by this patch. * sysdeps/sparc/sparc64/Implies: Remove sparc/sparc64/soft-fp. * sysdeps/sparc/sparc64/Makefile [$(subdir) = soft-fp] (sparc64-quad-routines): New variable. Moved from .... [$(subdir) = soft-fp] (sysdep_routines): Add $(sparc64-quad-routines). Moved from .... [$(subdir) = math] (CPPFLAGS): Add -I../soft-fp/. Moved from .... * sysdeps/sparc/sparc64/soft-fp/Makefile: ... here. Remove file. * sysdeps/sparc/sparc64/Versions (libc): Add GLIBC_2.2 symbols moved from .... * sysdeps/sparc/sparc64/soft-fp/Versions: ... here. Remove file. * sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c: Remove file. * sysdeps/sparc/sparc64/soft-fp/qp_add.c: Move to .... * sysdeps/sparc/sparc64/qp_add.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_cmp.c: Move to .... * sysdeps/sparc/sparc64/qp_cmp.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_cmpe.c: Move to .... * sysdeps/sparc/sparc64/qp_cmpe.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_div.c: Move to .... * sysdeps/sparc/sparc64/qp_div.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c: Move to .... * sysdeps/sparc/sparc64/qp_dtoq.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_feq.c: Move to .... * sysdeps/sparc/sparc64/qp_feq.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_fge.c: Move to .... * sysdeps/sparc/sparc64/qp_fge.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_fgt.c: Move to .... * sysdeps/sparc/sparc64/qp_fgt.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_fle.c: Move to .... * sysdeps/sparc/sparc64/qp_fle.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_flt.c: Move to .... * sysdeps/sparc/sparc64/qp_flt.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_fne.c: Move to .... * sysdeps/sparc/sparc64/qp_fne.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_itoq.c: Move to .... * sysdeps/sparc/sparc64/qp_itoq.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_mul.c: Move to .... * sysdeps/sparc/sparc64/qp_mul.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_neg.S: Move to .... * sysdeps/sparc/sparc64/qp_neg.S: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_qtod.c: Move to .... * sysdeps/sparc/sparc64/qp_qtod.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c: Move to .... * sysdeps/sparc/sparc64/qp_qtoi.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_qtos.c: Move to .... * sysdeps/sparc/sparc64/qp_qtos.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c: Move to .... * sysdeps/sparc/sparc64/qp_qtoui.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c: Move to .... * sysdeps/sparc/sparc64/qp_qtoux.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_qtox.c: Move to .... * sysdeps/sparc/sparc64/qp_qtox.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_sqrt.c: Move to .... * sysdeps/sparc/sparc64/qp_sqrt.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_stoq.c: Move to .... * sysdeps/sparc/sparc64/qp_stoq.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_sub.c: Move to .... * sysdeps/sparc/sparc64/qp_sub.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c: Move to .... * sysdeps/sparc/sparc64/qp_uitoq.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_util.c: Move to .... * sysdeps/sparc/sparc64/qp_util.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c: Move to .... * sysdeps/sparc/sparc64/qp_uxtoq.c: ... here. * sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c: Move to .... * sysdeps/sparc/sparc64/qp_xtoq.c: ... here. * sysdeps/sparc/sparc64/soft-fp/sfp-machine.h: Move to .... * sysdeps/sparc/sparc64/sfp-machine.h: ... here.
* Remove sysdeps/sparc/sparc32/soft-fp directory.Joseph Myers2018-05-2533-38/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per <https://sourceware.org/ml/libc-alpha/2014-10/msg00369.html>, there should not be separate sysdeps/<arch>/soft-fp directories when those are used by all configurations that use sysdeps/<arch>, and, more generally, should not be sysdeps/foo/Implies files pointing to a subdirectory foo/bar. This patch eliminates the sysdeps/sparc/sparc32/soft-fp directory accordingly, merging its contents into sysdeps/sparc/sparc32. Tested with build-many-glibcs.py that installed stripped shared libraries for sparc configurations are unchanged by this patch. * sysdeps/sparc/sparc32/Implies: Remove sparc/sparc32/soft-fp. * sysdeps/sparc/sparc32/Makefile [$(subdir) = soft-fp] (sparc32-quad-routines): New variable. Moved from .... [$(subdir) = soft-fp] (sysdep_routines): Add $(sparc32-quad-routines). Moved from .... * sysdeps/sparc/sparc32/soft-fp/Makefile: ... here. Remove file. * sysdeps/sparc/sparc32/Versions (libc): Add GLIBC_2.4 symbols moved from .... * sysdeps/sparc/sparc32/soft-fp/Versions: ... here. Remove file. * sysdeps/sparc/sparc32/soft-fp/q_add.c: Move to .... * sysdeps/sparc/sparc32/q_add.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_cmp.c: Move to .... * sysdeps/sparc/sparc32/q_cmp.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_cmpe.c: Move to .... * sysdeps/sparc/sparc32/q_cmpe.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_div.c: Move to .... * sysdeps/sparc/sparc32/q_div.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_dtoq.c: Move to .... * sysdeps/sparc/sparc32/q_dtoq.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_feq.c: Move to .... * sysdeps/sparc/sparc32/q_feq.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_fge.c: Move to .... * sysdeps/sparc/sparc32/q_fge.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_fgt.c: Move to .... * sysdeps/sparc/sparc32/q_fgt.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_fle.c: Move to .... * sysdeps/sparc/sparc32/q_fle.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_flt.c: Move to .... * sysdeps/sparc/sparc32/q_flt.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_fne.c: Move to .... * sysdeps/sparc/sparc32/q_fne.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_itoq.c: Move to .... * sysdeps/sparc/sparc32/q_itoq.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_lltoq.c: Move to .... * sysdeps/sparc/sparc32/q_lltoq.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_mul.c: Move to .... * sysdeps/sparc/sparc32/q_mul.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_neg.c: Move to .... * sysdeps/sparc/sparc32/q_neg.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_qtod.c: Move to .... * sysdeps/sparc/sparc32/q_qtod.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_qtoi.c: Move to .... * sysdeps/sparc/sparc32/q_qtoi.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_qtoll.c: Move to .... * sysdeps/sparc/sparc32/q_qtoll.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_qtos.c: Move to .... * sysdeps/sparc/sparc32/q_qtos.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_qtou.c: Move to .... * sysdeps/sparc/sparc32/q_qtou.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_qtoull.c: Move to .... * sysdeps/sparc/sparc32/q_qtoull.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_sqrt.c: Move to .... * sysdeps/sparc/sparc32/q_sqrt.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_stoq.c: Move to .... * sysdeps/sparc/sparc32/q_stoq.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_sub.c: Move to .... * sysdeps/sparc/sparc32/q_sub.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_ulltoq.c: Move to .... * sysdeps/sparc/sparc32/q_ulltoq.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_util.c: Move to .... * sysdeps/sparc/sparc32/q_util.c: ... here. * sysdeps/sparc/sparc32/soft-fp/q_utoq.c: Move to .... * sysdeps/sparc/sparc32/q_utoq.c: ... here. * sysdeps/sparc/sparc32/soft-fp/sfp-machine.h: Move to .... * sysdeps/sparc/sparc32/sfp-machine.h: ... here.
* powerpc: Move around math-related ImpliesTulio Magno Quites Machado Filho2018-05-243-0/+10
| | | | | | | | | | | | | | | Currently, powerpc, powerpc64, and powerpc64le imply the same set of subdirectories from sysdeps/ieee754: flt-32, dbl-64, ldbl-128ibm, and ldbl-opt. In preparation for the transition of the long double format - from IBM Extended Precision to IEEE 754 128-bits floating-point - on powerpc64le, this patch splits the shared Implies file into three separate files (one for each of the powerpc architectures), without changing their contents. Future patches will modify powerpc64le. * sysdeps/powerpc/Implies: Removed. Previous contents copied to... * sysdeps/powerpc/powerpc32/Implies-after: ... here. * sysdeps/powerpc/powerpc64/be/Implies-after: ... here. * sysdeps/powerpc/powerpc64/le/Implies-before: ... and here.
* Remove sysdeps/powerpc/soft-fp directory.Joseph Myers2018-05-243-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per <https://sourceware.org/ml/libc-alpha/2014-10/msg00369.html>, there should not be separate sysdeps/<arch>/soft-fp directories when those are used by all configurations that use sysdeps/<arch>, and, more generally, should not be sysdeps/foo/Implies files pointing to a subdirectory foo/bar. sysdeps/powerpc/soft-fp isn't quite such a case, as the Implies files pointing to it are sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies and sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/nofpu/Implies (and indeed there is a different sfp-machine.h used for powerpc64le). However, the same principle applies: there is no need for this directory because sfp-machine.h, the only file in it, can most naturally go in sysdeps/powerpc/nofpu, which is used by exactly the same configurations (and there is a close dependence between the files there and the sfp-machine.h implementation). This patch eliminates the sysdeps/powerpc/soft-fp directory accordingly. Tested with build-many-glibcs.py that installed stripped shared libraries for powerpc configurations are unchanged by this patch. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies: Remove powerpc/soft-fp. * sysdeps/unix/sysv/linux/powerpc/powerpc32/e500/nofpu/Implies: Likewise. * sysdeps/powerpc/soft-fp/sfp-machine.h: Move to .... * sysdeps/powerpc/nofpu/sfp-machine.h: ... here.
* Remove sysdeps/sh/soft-fp directory.Joseph Myers2018-05-232-1/+0
| | | | | | | | | | | | | | | | As per <https://sourceware.org/ml/libc-alpha/2014-10/msg00369.html>, there should not be separate sysdeps/<arch>/soft-fp directories when those are used by all configurations that use sysdeps/<arch>, and, more generally, should not be sysdeps/foo/Implies files pointing to a subdirectory foo/bar. This patch eliminates the sysdeps/sh/soft-fp directory accordingly, merging its contents into sysdeps/sh. Tested with build-many-glibcs.py that installed stripped shared libraries for sh configurations are unchanged by this patch. * sysdeps/sh/Implies: Remove sh/soft-fp. * sysdeps/sh/soft-fp/sfp-machine.h: Move to .... * sysdeps/sh/sfp-machine.h: ... here.
* x86-64: Skip zero length in __mem[pcpy|move|set]_ermsH.J. Lu2018-05-232-0/+11
| | | | | | | | | | | | | This patch skips zero length in __mempcpy_erms, __memmove_erms and __memset_erms. Tested on x86-64. * sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S (__mempcpy_erms): Skip zero length. (__memmove_erms): Likewise. * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S (__memset_erms): Likewise.
* Remove sysdeps/alpha/soft-fp directory.Joseph Myers2018-05-2320-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per <https://sourceware.org/ml/libc-alpha/2014-10/msg00369.html>, there should not be separate sysdeps/<arch>/soft-fp directories when those are used by all configurations that use sysdeps/<arch>, and, more generally, should not be sysdeps/foo/Implies files pointing to a subdirectory foo/bar. This patch eliminates the sysdeps/alpha/soft-fp directory accordingly, merging its contents into sysdeps/alpha. Tested with build-many-glibcs.py that installed stripped shared libraries for alpha-linux-gnu are unchanged by this patch. * sysdeps/alpha/Implies: Remove alpha/soft-fp. * sysdeps/alpha/Makefile [$(subdir) = soft-fp] (sysdep_routines): Add functions moved from .... [$(subdir) = math] (CPPFLAGS): Add -I../soft-fp. Moved from .... * sysdeps/alpha/soft-fp/Makefile: ... here. Remove file. * sysdeps/alpha/Versions (libc): Add GLIBC_2.3.4 symbols moved from .... * sysdeps/alpha/soft-fp/Versions: ... here. Remove file. * sysdeps/alpha/soft-fp/e_sqrtl.c: Move to .... * sysdeps/alpha/e_sqrtl.c: ... here. * sysdeps/alpha/soft-fp/local-soft-fp.h: Move to .... * sysdeps/alpha/local-soft-fp.h: ... here. * sysdeps/alpha/soft-fp/ots_add.c: Move to .... * sysdeps/alpha/ots_add.c: ... here. * sysdeps/alpha/soft-fp/ots_cmp.c: Move to .... * sysdeps/alpha/ots_cmp.c: ... here. * sysdeps/alpha/soft-fp/ots_cmpe.c: Move to .... * sysdeps/alpha/ots_cmpe.c: ... here. * sysdeps/alpha/soft-fp/ots_cvtqux.c: Move to .... * sysdeps/alpha/ots_cvtqux.c: ... here. * sysdeps/alpha/soft-fp/ots_cvtqx.c: Move to .... * sysdeps/alpha/ots_cvtqx.c: ... here. * sysdeps/alpha/soft-fp/ots_cvttx.c: Move to .... * sysdeps/alpha/ots_cvttx.c: ... here. * sysdeps/alpha/soft-fp/ots_cvtxq.c: Move to .... * sysdeps/alpha/ots_cvtxq.c: ... here. * sysdeps/alpha/soft-fp/ots_cvtxt.c: Move to .... * sysdeps/alpha/ots_cvtxt.c: ... here. * sysdeps/alpha/soft-fp/ots_div.c: Move to .... * sysdeps/alpha/ots_div.c: ... here. * sysdeps/alpha/soft-fp/ots_mul.c: Move to .... * sysdeps/alpha/ots_mul.c: ... here. * sysdeps/alpha/soft-fp/ots_nintxq.c: Move to .... * sysdeps/alpha/ots_nintxq.c: ... here. * sysdeps/alpha/soft-fp/ots_sub.c: Move to .... * sysdeps/alpha/ots_sub.c: ... here. * sysdeps/alpha/soft-fp/sfp-machine.h: Move to .... * sysdeps/alpha/sfp-machine.h: ... here.
* Switch IDNA implementation to libidn2 [BZ #19728] [BZ #19729] [BZ #22247]Florian Weimer2018-05-234-77/+21
| | | | | This provides an implementation of the IDNA2008 standard and fixes CVE-2016-6261, CVE-2016-6263, CVE-2017-14062.
* Don't write beyond destination in __mempcpy_avx512_no_vzeroupper (bug 23196)Andreas Schwab2018-05-231-2/+3
| | | | | When compiled as mempcpy, the return value is the end of the destination buffer, thus it cannot be used to refer to the start of it.
* Remove sysdeps/aarch64/soft-fp directory.Joseph Myers2018-05-225-4/+4
| | | | | | | | | | | | | | | | | | | | | | As per <https://sourceware.org/ml/libc-alpha/2014-10/msg00369.html>, there should not be separate sysdeps/<arch>/soft-fp directories when those are used by all configurations that use sysdeps/<arch>, and, more generally, should not be sysdeps/foo/Implies files pointing to a subdirectory foo/bar. This patch eliminates the sysdeps/aarch64/soft-fp directory accordingly, merging its contents into sysdeps/aarch64. Tested with build-many-glibcs.py that installed stripped shared libraries for aarch64 configurations are unchanged by this patch. * sysdeps/aarch64/Implies: Remove aarch64/soft-fp. * sysdeps/aarch64/Makefile [$(subdir) = math] (CPPFLAGS): Add -I../soft-fp. Moved from .... * sysdeps/aarch64/soft-fp/Makefile: ... here. Remove file. * sysdeps/aarch64/soft-fp/e_sqrtl.c: Move to .... * sysdeps/aarch64/e_sqrtl.c: ... here. * sysdeps/aarch64/soft-fp/sfp-machine.h: Move to .... * sysdeps/aarch64/sfp-machine.h: ... here.
* Fix i686-linux-gnu build with GCC mainline.Joseph Myers2018-05-222-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Building with recent GCC mainline for i686-linux-gnu is failing with: ../sysdeps/ieee754/flt-32/k_rem_pio2f.c: In function '__kernel_rem_pio2f': ../sysdeps/ieee754/flt-32/k_rem_pio2f.c:186:28: error: 'fq[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] fv = math_narrow_eval (fq[0]-fv); ^ and ../sysdeps/ieee754/dbl-64/k_rem_pio2.c: In function '__kernel_rem_pio2': ../sysdeps/ieee754/dbl-64/k_rem_pio2.c:333:32: error: 'fq[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] fv = math_narrow_eval (fq[0] - fv); ^ These are similar to -Warray-bounds cases for which the DIAG_* macros are already used in those files: the array element is in fact always initialized, but the reasoning that it is depends on another array not having been all zero at an earlier point, which depends on the functions not being called with zero arguments. Thus, this patch uses DIAG_* to disable -Wmaybe-uninitialized for this code. (The warning may be i686-specific because of math_narrow_eval somehow perturbing what the compiler does with this code enough to cause the warning. I don't know why it doesn't appear for i686-gnu.) Tested with build-many-glibcs.py that this fixes the i686 build in this configuration. * sysdeps/ieee754/dbl-64/k_rem_pio2.c (__kernel_rem_pio2): Ignore -Wmaybe-uninitialized around access to fq[0]. * sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f): Likewise.
* Make llseek a compat symbol (bug 18471).Joseph Myers2018-05-224-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The llseek function name is an obsolete, Linux-specific, unprototyped name for lseek64 with a link-time warning. This patch completes the obsoletion of this function name by making it into a compat symbol, not available for newly linked programs and not included in the ABI for new ports. When a compat symbol is defined in syscalls.list, the code for that function is not built at all for static linking unless some non-compat symbol for that function is also defined with an explicit symbol version, so an explicit symbol version for lseek64 is added to the MIPS n32 syscalls.list. The case in make-syscalls.sh that handles such explicit non-compat symbol versions then needs to be changed to use weak_alias instead of strong_alias when the syscall is built outside of libc, to avoid linknamespace failures from a strong lseek64 symbol in static libpthread. The x32 llseek.S was as far as I could tell already unused (nothing builds an llseek.* source file, at least since the lseek / lseek64 / llseek consolidation), so is removed in this patch as well. Tested for x86_64 and x86, and with build-many-glibcs.py. [BZ #18471] * sysdeps/unix/make-syscalls.sh (emit_weak_aliases): Use weak aliases for non-libc case of versioned symbols. * sysdeps/unix/sysv/linux/lseek64.c: Include <shlib-compat.h>. (llseek): Define as compat symbol if [SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_28)], not as weak alias with link warning. * sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list (llseek): Make into a compat symbol, disabled for minimum symbol version GLIBC_2.28 and later. * sysdeps/unix/sysv/linux/x86_64/x32/llseek.S: Remove file.
* i386: Drop -mpreferred-stack-boundary=4Florian Weimer2018-05-222-43/+1
| | | | | The flag was a left-over from when the -mpreferred-stack-boundary=2 flag was removed in commit db290cf59207aff09d1794e666e2854a93775f32.
* x86-64: Check Prefer_FSRM in ifunc-memmove.hH.J. Lu2018-05-213-1/+6
| | | | | | | | | | | | | Although the REP MOVSB implementations of memmove, memcpy and mempcpy aren't used by the current processors, this patch adds Prefer_FSRM check in ifunc-memmove.h so that they can be used in the future. * sysdeps/x86/cpu-features.h (bit_arch_Prefer_FSRM): New. (index_arch_Prefer_FSRM): Likewise. * sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)): Also check Prefer_FSRM. * sysdeps/x86_64/multiarch/ifunc-memmove.h (IFUNC_SELECTOR): Also return OPTIMIZE (erms) for Prefer_FSRM.