about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* i386: Remove bogus THREAD_ATOMIC_* macrosAdhemerval Zanella2019-01-031-37/+0
| | | | | | | | | | | | | | | | | | | | The x86 defines optimized THREAD_ATOMIC_* macros where reference always the current thread instead of the one indicated by input 'descr' argument. It work as long the input is the self thread pointer, however it generates wrong code if the semantic is to set a bit atomicialy from another thread. This is not an issue for current GLIBC usage, however the new cancellation code expects that some synchronization code to atomically set bits from different threads. If some usage indeed proves to be a hotspot we can add an extra macro with a more descriptive name (THREAD_ATOMIC_BIT_SET_SELF for instance) where i386 might optimize it. Checked on i686-linux-gnu. * sysdeps/i686/nptl/tls.h (THREAD_ATOMIC_CMPXCHG_VAL, THREAD_ATOMIC_AND, THREAD_ATOMIC_BIT_SET): Remove macros.
* x86_64: Remove wrong THREAD_ATOMIC_* macrosAdhemerval Zanella2019-01-031-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The x86 defines optimized THREAD_ATOMIC_* macros where reference always the current thread instead of the one indicated by input 'descr' argument. It work as long the input is the self thread pointer, however it generates wrong code if the semantic is to set a bit atomicialy from another thread. This is not an issue for current GLIBC usage, however the new cancellation code expects that some synchronization code to atomically set bits from different threads. The generic code generates an additional load to reference to TLS segment, for instance the code: THREAD_ATOMIC_BIT_SET (THREAD_SELF, cancelhandling, CANCELED_BIT); Compiles to: lock;orl $4, %fs:776 Where with patch changes it now compiles to: mov %fs:16,%rax lock;orl $4, 776(%rax) If some usage indeed proves to be a hotspot we can add an extra macro with a more descriptive name (THREAD_ATOMIC_BIT_SET_SELF for instance) where x86_64 might optimize it. Checked on x86_64-linux-gnu. * sysdeps/x86_64/nptl/tls.h (THREAD_ATOMIC_CMPXCHG_VAL, THREAD_ATOMIC_AND, THREAD_ATOMIC_BIT_SET): Remove macros.
* nptl: Remove tst-cancel-wrappers test and related macrosAdhemerval Zanella2019-01-038-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With upcoming BZ#12683 fix, syscall cancellation is not more handled by {libc,pthread,librt}_{enable,disable}_asynccancel symbols. This renders both LIBC_CANCEL_HANDLED and empty declaration and tst-cancel-wrappers.sh unrequired. This patch removes both the macro and the nptl test. Checked on x86_64-linux-gnu. * io/creat.c (LIBC_CANCEL_HANDLED): Remove macro. * io/ppoll.c (LIBC_CANCEL_HANDLED): Likewise. * misc/pselect.c (LIBC_CANCEL_HANDLED): Likewise. * nptl/pthreadP.h (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/generic/sysdep-cancel.h (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/mach/hurd/sysdep-cancel.h (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/posix/pause.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/posix/sigpause.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/creat.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/creat64.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/sigwait.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c (LIBC_CANCEL_HANDLED): Likewise. * nptl/Makefile [$(run-built-tests) = yes] (tests-special): Remove tst-cancel-wrappers.sh. (generated): Remove tst-cancel-wrappers.out. (tst-cancel-wrappers.out): Remove rule. * nptl/tst-cancel-wrappers.sh: Remove file.
* AArch64: Update dl-procinfo.c with new HWCAPSzabolcs Nagy2019-01-032-3/+4
| | | | | | | | bits/hwcap.h should be updated together with dl-procinfo.c. * sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h: Add comment. * sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c (_DL_HWCAP_COUNT): Update.
* posix: Clear close-on-exec for posix_spawn adddup2 (BZ#23640)Adhemerval Zanella2019-01-032-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group issue #411 [1] proposes that posix_spawn file action posix_spawn_file_actions_adddup2 resets the close-on-exec when source and destination refer to same file descriptor. It solves the issue on multi-thread applications which uses close-on-exec as default, and want to hand-chose specifically file descriptor to purposefully inherited into a child process. Current approach to achieve this scenario is to use two adddup2 file actions and a temporary file description which do not conflict with any other, coupled with a close file action to avoid leaking the temporary file descriptor. This approach, besides being complex, may fail with EMFILE/ENFILE file descriptor exaustion. This can be more easily accomplished with an in-place removal of FD_CLOEXEC. Although the resulting adddup2 semantic is slight different than dup2 (equal file descriptors should be handled as no-op), the proposed possible solution are either more complex (fcntl action which a limited set of operations) or results in unrequired operations (dup3 which also returns EINVAL for same file descriptor). Checked on aarch64-linux-gnu. [BZ #23640] * posix/tst-spawn.c (do_prepare, handle_restart, do_test): Add posix_spawn_file_actions_adddup2 test to check O_CLOCEXEC reset. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Add close-on-exec reset for adddup2 file action. * sysdeps/posix/spawni.c (__spawni_child): Likewise. [1] http://austingroupbugs.net/view.php?id=411
* Use C99-compliant scanf under _GNU_SOURCE with modern compilers.Zack Weinberg2019-01-0314-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only difference between noncompliant and C99-compliant scanf is that the former accepts the archaic GNU extension '%as' (also %aS and %a[...]) meaning to allocate space for the input string with malloc. This extension conflicts with C99's use of %a as a format _type_ meaning to read a floating-point number; POSIX.1-2008 standardized equivalent functionality using the modifier letter 'm' instead (%ms, %mS, %m[...]). The extension was already disabled in most conformance modes: specifically, any mode that doesn't involve _GNU_SOURCE and _does_ involve either strict conformance to C99 or loose conformance to both C99 and POSIX.1-2001 would get the C99-compliant scanf. With compilers new enough to use -std=gnu11 instead of -std=gnu89, or equivalent, that includes the default mode. With this patch, we now provide C99-compliant scanf in all configurations except when _GNU_SOURCE is defined *and* __STDC_VERSION__ or __cplusplus (whichever is relevant) indicates C89/C++98. This leaves the old scanf available under e.g. -std=c89 -D_GNU_SOURCE, but removes it from e.g. -std=gnu11 -D_GNU_SOURCE (it was already not present under -std=gnu11 without -D_GNU_SOURCE) and from -std=gnu89 without -D_GNU_SOURCE. There needs to be an internal override so we can compile the noncompliant scanf itself. This is the same problem we had when we removed 'gets' from _GNU_SOURCE and it's dealt with the same way: there's a new __GLIBC_USE symbol, DEPRECATED_SCANF, which defaults to off under the appropriate conditions for external code, but can be overridden by individual files within stdio. We also run into problems with PLT bypass for internal uses of sscanf, because libc_hidden_proto uses __REDIRECT and so does the logic in stdio.h for choosing which implementation of scanf to use; __REDIRECT isn't transitive, so include/stdio.h needs to bridge the gap with a macro. As far as I can tell, sscanf is the only function in this family that's internally called by unrelated code. Finally, there are several tests in stdio-common that use the extension. bug21.c is a regression test for a crash; it still exercises the relevant code when changed to use %ms instead of %as. scanf14.c through scanf17.c are more complicated since they are actually testing the subtleties of the extension - under what circumstances is 'a' treated as a modifier letter, etc. I changed all of them to use %ms instead of %as as well, but duplicated scanf14.c and scanf16.c as scanf14a.c and scanf16a.c. These still use %as and are compiled with -std=gnu89 to access the old extension. A bunch of diagnostic overrides and manual workarounds for the old stdio.h behavior become unnecessary. Yay! * include/features.h (__GLIBC_USE_DEPRECATED_SCANF): New __GLIBC_USE parameter. Only use deprecated scanf when __USE_GNU is defined and __STDC_VERSION__ is less than 199901L or __cplusplus is less than 201103L, whichever is relevant for the language being compiled. * libio/stdio.h, libio/bits/stdio-ldbl.h: Decide whether to redirect scanf, fscanf, sscanf, vscanf, vfscanf, and vsscanf to their __isoc99_ variants based only on __GLIBC_USE (DEPRECATED_SCANF). * wcsmbs/wchar.h: wcsmbs/bits/wchar-ldbl.h: Likewise for wscanf, fwscanf, swscanf, vwscanf, vfwscanf, and vswscanf. * libio/iovsscanf.c * libio/fwscanf.c * libio/iovswscanf.c * libio/swscanf.c * libio/vscanf.c * libio/vwscanf.c * libio/wscanf.c * stdio-common/fscanf.c * stdio-common/scanf.c * stdio-common/vfscanf.c * stdio-common/vfwscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-compat.c * sysdeps/ieee754/ldbl-opt/nldbl-fscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-fwscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-scanf.c * sysdeps/ieee754/ldbl-opt/nldbl-sscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-swscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-vfscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-vfwscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-vscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-vsscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-vswscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-vwscanf.c * sysdeps/ieee754/ldbl-opt/nldbl-wscanf.c: Override __GLIBC_USE_DEPRECATED_SCANF to 1. * stdio-common/sscanf.c: Likewise. Remove ldbl_hidden_def for __sscanf. * stdio-common/isoc99_sscanf.c: Add libc_hidden_def for __isoc99_sscanf. * include/stdio.h: Provide libc_hidden_proto for __isoc99_sscanf, not sscanf. [!__GLIBC_USE (DEPRECATED_SCANF)]: Define sscanf as __isoc99_scanf with a preprocessor macro. * stdio-common/bug21.c, stdio-common/scanf14.c: Use %ms instead of %as, %mS instead of %aS, %m[] instead of %a[]; remove DIAG_IGNORE_NEEDS_COMMENT for -Wformat. * stdio-common/scanf16.c: Likewise. Add __attribute__ ((format (scanf))) to xscanf, xfscanf, xsscanf. * stdio-common/scanf14a.c: New copy of scanf14.c which still uses %as, %aS, %a[]. Remove DIAG_IGNORE_NEEDS_COMMENT for -Wformat. * stdio-common/scanf16a.c: New copy of scanf16.c which still uses %as, %aS, %a[]. Add __attribute__ ((format (scanf))) to xscanf, xfscanf, xsscanf. * stdio-common/scanf15.c, stdio-common/scanf17.c: No need to override feature selection macros or provide definitions of u_char etc. * stdio-common/Makefile (tests): Add scanf14a and scanf16a. (CFLAGS-scanf15.c, CFLAGS-scanf17.c): Remove. (CFLAGS-scanf14a.c, CFLAGS-scanf16a.c): New. Compile these files with -std=gnu89.
* termios: Consolidate termios.hAdhemerval Zanella2019-01-038-295/+26
| | | | | | | | | | | | | | | | | This patch consolidates the Linux termios.h by removing the arch-specific one. No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add bits/termios-misc.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Remove file. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios-misc.h: New file. * sysdeps/unix/sysv/linux/bits/termios.h: Include termios-misc.h.
* termios: Add powerpc termios-miscAdhemerval Zanella2019-01-033-50/+74
| | | | | | | | | | | | | | | | | | | PowerPC termios.h header contains additional BSD terminal mode definitions (sgttyb, tchars, ltchars, and associated TIOCPKT_* symbolic constants). This patch moves all powerpc termios specific definition to its own header. No semantic change is expected, checked on a build against a powerpc64le-linux-gnu build. * sysdeps/unix/sysv/linux/powerpc/bits/termios-misc.h: New file. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_MISC] (struct sgtty, struct tchars, struct ltchars, TIOCPKT_DATA, TIOCPKT_FLUSHREAD, TIOCPKT_FLUSHWRITE, TIOCPKT_STOP, TIOCPKT_START, TIOCPKT_NOSTOP, TIOCPKT_DOSTOP, _VINTR, _VQUIT, _VERASE, _VKILL, _VEOF, _VMIN, _VEOL, _VTIME, _VEOL2, _VSWTC): Move to termios-misc.h. * sysdeps/unix/sysv/linux/powerpc/Makefile [$subdir == misc] (sysdep_headers): Add termios-misc.h.
* termios: Remove Linux _IOT_termiosAdhemerval Zanella2019-01-033-9/+0
| | | | | | | | | | | It is used only on hurd. No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/bits/termios.h (_IOT_termios): Remove. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
* termios: Consolidate tcflow symbolic constantsAdhemerval Zanella2019-01-038-23/+58
| | | | | | | | | | | | | | | | | | | | | This patch consolidates the termios symbolic constants for use with tcflow in its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (currently only mips). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-tcflow.h. * sysdeps/unix/sysv/linux/bits/termios-tcflow.h: New file. * sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (TCSANOW, TCSADRAIN, TCSAFLUSH): Move to termios-tcflow.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
* termios: Consolidate local mode definitionsAdhemerval Zanella2019-01-0310-120/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the termios symbolic constants used for local mode with c_lflag member on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha, mips, and powerpc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-c_lflag.h. * sysdeps/unix/sysv/linux/bits/termios-c_lflag.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_lflag.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios-c_lflag.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_lflag.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (ISIG, ISCANON, ECHO, ECHOE, ECHOK, ECHONL, NOFLSH, TOSTOP, IEXTEN): Move to termios-c_lflag.h. [__USE_MISC || (__USE_XOPEN && !__USE_XOPEN2K)] (XCASE): Likewise. [__USE_MISC] (ECHOCTL, ECHOPRT, ECHOKE, FLUSHO, PENDIN, EXTPROC): Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
* termios: Consolidate control mode definitionsAdhemerval Zanella2019-01-039-60/+110
| | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the termios symbolic constants used for output mode with c_cflag memver on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha and powerpc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-c_cflag.h. * sysdeps/unix/sysv/linux/bits/termios-c_cflag.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (CSIZE, CS5, CS6, CS7, CS8, CSTOPB, CREAD, PARENB, PARODD, HUPCL, CLOCAL): Move to termios-c_cflag.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
* termios: Consolidate Baud Rate Selection definitions (BZ#23783)Adhemerval Zanella2019-01-0310-131/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the termios symbolic constants used for baud rates selection used along with speed_t on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha and powerpc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. [BZ #23783] * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-baud.h. * sysdeps/unix/sysv/linux/bits/termios-baud.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-baud.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-baud.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios-baud.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios.h (B57600, B115200, B230400, B460800, B500000, B576000, B921600, B1000000, B1152000, B1500000, B2000000, B2500000, B3000000, B3500000, B4000000, __MAX_BAUD): Move to termios-baud.h. [__USE_MISC] (CBAUD, CBAUDEX): Likewise. * sysdeps/unix/sysv/linux/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
* termios: Consolidate Output Modes definitionsAdhemerval Zanella2019-01-0310-211/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the termios symbolic constants used for ouput modes with c_oflag member on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha, powerpc, and sparc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add termios-c_oflag.h. * sysdeps/unix/sysv/linux/bits/termios-c_oflag.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_oflag.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_oflag.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios-c_oflag.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (OPOST, OLCUC, ONLCR, OCRNL, ONOCR, ONLRET, OFILL, OFDEL, VTDLY, VT0, VT1): Move to termios-c_oflag.h. [__USE_MISC || __USE_XOPEN] (NLDLY, NL0, NL1, CRDLY, CR0, CR1, CR2, CR3, TABDLY, TAB0, TAB1, TAB2, TAB3, BSDLY, BS0, BS1, FFDLY, FF0, FFR1): Likewise. [USE_MISC] (XTABS): Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h Likewise.
* termios: Consolidate Input Modes definitions.Adhemerval Zanella2019-01-039-86/+123
| | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the termios symbolic constants used for input modes with c_iflag member on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha and powerpc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdeps_headers): Add termios-c_iflag.h. * sysdeps/unix/sysv/linux/bits/termios-c_iflag.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_iflag.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_iflag.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (IGNBRK, BRKINT, IGNPAR, PARMRK, INPCK, ISTRIP, INLCR, IGNCR, ICRNL, IXON, IXOFF, IXANY, IUCLC, IMAXBEL, IUTF8): Move to termios-c_iflag.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
* termios: Consolidate termios c_cc symbolic constantsAdhemerval Zanella2019-01-0311-103/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the termios symbolic constants used as subscript for the array c_cc on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha, mips64, sparc64, and powerpc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdeps_headers): Add termios-cc.h. * sysdeps/unix/sysv/linux/bits/termios-c_cc.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_cc.h: New file. * sysdeps/unix/sysv/linux/mips/bits/termios-c_cc.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cc.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios-c_cc.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (VINTR, VQUIT, VERASE, VKILL, VEOF, VTIME, VMIN, VSWTC, VSTART, VSTOP, VSUSP, VEOL, VREPRINT, VDISCARD, VWERASE, VLNEXT, VEOLF2): Move to termios-cc.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise.
* termios: Consolidate struct termiosAdhemerval Zanella2019-01-0316-76/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the struct termios definition on its own header and adds arch-defined ones for ABIs that deviate from generic implementation. They are: - alpha which has a slight different layout than generic one (c_cc field is defined prior c_line). - sparc and mips which do not have the c_ispeed/c_ospeed fields. No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/alpha/bits/termios-struct.h: New file. * sysdeps/unix/sysv/linux/bits/termios-struct.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios-struct.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios-struct.h: Likewise. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-struct.h. * sysdeps/unix/sysv/linux/bits/termios.h (struct termios): Move to termios-struct.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/kernel_termios.h (_HAVE_C_ISPEED, _HAVE_C_OSPEED): Define. * sysdeps/unix/sysv/linux/mips/kernel_termios.h (_HAVE_C_ISPEED, _HAVE_C_OSPEED): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel_termios.h (_HAVE_C_ISPEED, _HAVE_C_OSPEED): Likewise. * sysdeps/unix/sysv/linux/speed.c [_HAVE_STRUCT_TERMIOS_C_OSPEED] (cfsetospeed): Check for define value instead of existence. [_HAVE_STRUCT_TERMIOS_C_ISPEED] (cfsetispeed): Likewise. * sysdeps/unix/sysv/linux/tcgetattr.c [_HAVE_STRUCT_TERMIOS_C_ISPEED && _HAVE_C_ISPEED] (__tcgetattr): Likewise. * sysdeps/unix/sysv/linux/tcsetattr.c [_HAVE_STRUCT_TERMIOS_C_ISPEED && _HAVE_C_ISPEED] (__tcsetattr): Likewise.
* termios: Define TIOCSER_TEMT with __USE_MISC (BZ#17783)Adhemerval Zanella2019-01-033-3/+10
| | | | | | | | | | | | | | | | | | This patch defines TIOCSER_TEMT on all architectures using the __USE_MISC guards similar to BZ#17782 fix. Latest Linux UAPI defines TIOCSER_TEMT with the same value for all architectures, so it is safe to use the value as default for all ABIs. Checked on x86_64linux-gnu and build against sparc64-linux-gnu and powerpc64le-linux-gnu. [BZ #17783] * sysdeps/unix/sysv/linux/bits/termios.h [__USE_MISC] (TIOCSER_TEMT): Define. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_MISC] (TIOCSER_TEMT): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_MISC] (TEOCSER_TEMT): Likewise.
* Update powerpc-nofpu libm-test-ulps.Joseph Myers2019-01-021-44/+44
| | | | * sysdeps/powerpc/nofpu/libm-test-ulps: Update.
* hurd: advertise *_setpshared as not supportedSamuel Thibault2019-01-025-0/+5
| | | | | | | | | | | | | | | | The functions themselves return 0, but initializing a mutex/etc with . pshared set to 1 will fail anyway . * sysdeps/htl/pt-barrierattr-setpshared.c (pthread_barrierattr_setpshared): Add stub warning. * sysdeps/htl/pt-condattr-setpshared.c (pthread_condattr_setpshared): Likewise. * sysdeps/htl/pt-mutexattr-setpshared.c (pthread_mutexattr_setpshared): Likewise. * sysdeps/htl/pt-rwlockattr-setpshared.c (pthread_rwlockattr_setpshared): Likewise. * sysdeps/mach/hurd/htl/pt-mutexattr-setpshared.c (pthread_mutexattr_setpshared): Likewise.
* Update Linux kernel version in tst-mman-consts.py.Joseph Myers2019-01-021-1/+1
| | | | | | | | | | | | | | | This patch updates the Linux kernel version in tst-mman-consts.py to 4.20 (meaning that's the version for which glibc is expected to have the same constants as the kernel, up to the exceptions listed in the test). (Once we have more such tests sharing common infrastructure, I expect the kernel version will be something set in the infrastructure shared by all such tests, rather than something needing updating separately for each test for each new kernel version.) Tested with build-many-glibcs.py. * sysdeps/unix/sysv/linux/tst-mman-consts.py (main): Expect constants to match with Linux 4.20.
* Update MIPS libm-test-ulps.Joseph Myers2019-01-022-88/+88
| | | | | * sysdeps/mips/mips32/libm-test-ulps: Update. * sysdeps/mips/mips64/libm-test-ulps: Likewise.
* ARM: fix kernel assisted atomics with GCC 8 (bug 24034)Aurelien Jarno2019-01-021-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pre-ARMv7 CPUs are missing atomic compare and exchange and/or barrier instructions. Therefore those are implemented using kernel assistance, calling a kernel function at a specific address, and passing the arguments in the r0 to r4 registers. This is done by specifying registers for local variables. The a_ptr variable is placed in the r2 register and declared with __typeof (mem). According to the GCC documentation on local register variables, if mem is a constant pointer, the compiler may substitute the variable with its initializer in asm statements, which may cause the corresponding operand to appear in a different register. This happens in __libc_start_main with the pointer to the thread counter for static binaries (but not the shared ones): # ifdef SHARED unsigned int *ptr = __libc_pthread_functions.ptr_nthreads; # ifdef PTR_DEMANGLE PTR_DEMANGLE (ptr); # endif # else extern unsigned int __nptl_nthreads __attribute ((weak)); unsigned int *const ptr = &__nptl_nthreads; # endif This causes static binaries using threads to crash when the GNU libc is built with GCC 8 and most notably tst-cancel21-static. To fix that, use the same trick than for the volatile qualifier, defining a_ptr as a union. Changelog: [BZ #24034] * sysdeps/unix/sysv/linux/arm/atomic-machine.h (__arm_assisted_compare_and_exchange_val_32_acq): Use uint32_t rather than __typeof (...) for the a_ptr variable.
* Add IPV6_MULTICAST_ALL from Linux 4.20 to bits/in.h.Joseph Myers2019-01-011-0/+1
| | | | | | | | | | This patch adds the IPV6_MULTICAST_ALL constant from Linux 4.20 to bits/in.h. Tested for x86_64. * sysdeps/unix/sysv/linux/bits/in.h (IPV6_MULTICAST_ALL): New macro.
* Add PACKET_IGNORE_OUTGOING from Linux 4.20 to netpacket/packet.h.Joseph Myers2019-01-011-0/+1
| | | | | | | | | | This patch adds the PACKET_IGNORE_OUTGOING constant from Linux 4.20 to netpacket/packet.h. Tested for x86_64. * sysdeps/unix/sysv/linux/netpacket/packet.h (PACKET_IGNORE_OUTGOING): New macro.
* Add HWCAP_SSBS from Linux 4.20 to AArch64 bits/hwcap.h.Joseph Myers2019-01-011-0/+1
| | | | | | | | | | This patch adds the HWCAP_SSBS constant from Linux 4.20 to the AArch64 bits/hwcap.h. Tested with build-many-glibcs.py for aarch64-linux-gnu. * sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_SSBS): New macro.
* Update syscall-names.list for Linux 4.20.Joseph Myers2019-01-011-2/+3
| | | | | | | | | | | | | This patch updates sysdeps/unix/sysv/linux/syscall-names.list for Linux 4.20. Although there are no new syscalls, the riscv_flush_icache syscall has moved to asm/unistd.h (previously in asm/syscalls.h) and so now needs to be added to the list. Tested with build-many-glibcs.py. * sysdeps/unix/sysv/linux/syscall-names.list: Update kernel version to 4.20. (riscv_flush_icache): New syscall.
* Update copyright dates not handled by scripts/update-copyrights.Joseph Myers2019-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've updated copyright dates in glibc for 2019. This is the patch for the changes not generated by scripts/update-copyrights and subsequent build / regeneration of generated files. Please remember to include 2019 in the dates for any new files added in future (which means updating any existing uncommitted patches you have that add new files to use the new copyright dates in them). * NEWS: Update copyright dates. * catgets/gencat.c (print_version): Likewise. * csu/version.c (banner): Likewise. * debug/catchsegv.sh: Likewise. * debug/pcprofiledump.c (print_version): Likewise. * debug/xtrace.sh (do_version): Likewise. * elf/ldconfig.c (print_version): Likewise. * elf/ldd.bash.in: Likewise. * elf/pldd.c (print_version): Likewise. * elf/sotruss.sh: Likewise. * elf/sprof.c (print_version): Likewise. * iconv/iconv_prog.c (print_version): Likewise. * iconv/iconvconfig.c (print_version): Likewise. * locale/programs/locale.c (print_version): Likewise. * locale/programs/localedef.c (print_version): Likewise. * login/programs/pt_chown.c (print_version): Likewise. * malloc/memusage.sh (do_version): Likewise. * malloc/memusagestat.c (print_version): Likewise. * malloc/mtrace.pl: Likewise. * manual/libc.texinfo: Likewise. * nptl/version.c (banner): Likewise. * nscd/nscd.c (print_version): Likewise. * nss/getent.c (print_version): Likewise. * nss/makedb.c (print_version): Likewise. * posix/getconf.c (main): Likewise. * scripts/test-installation.pl: Likewise. * sysdeps/unix/sysv/linux/lddlibc4.c (main): Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-015983-5984/+5983
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* riscv: Use __has_include__ to include <asm/syscalls.h> [BZ #24022]H.J. Lu2018-12-311-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <asm/syscalls.h> has been removed by commit 27f8899d6002e11a6e2d995e29b8deab5aa9cc25 Author: David Abdurachmanov <david.abdurachmanov@gmail.com> Date: Thu Nov 8 20:02:39 2018 +0100 riscv: add asm/unistd.h UAPI header Marcin Juszkiewicz reported issues while generating syscall table for riscv using 4.20-rc1. The patch refactors our unistd.h files to match some other architectures. - Add asm/unistd.h UAPI header, which has __ARCH_WANT_NEW_STAT only for 64-bit - Remove asm/syscalls.h UAPI header and merge to asm/unistd.h - Adjust kernel asm/unistd.h So now asm/unistd.h UAPI header should show all syscalls for riscv. <asm/syscalls.h> may be restored by Subject: [PATCH] riscv: restore asm/syscalls.h UAPI header Date: Tue, 11 Dec 2018 09:09:35 +0100 UAPI header asm/syscalls.h was merged into UAPI asm/unistd.h header, which did resolve issue with missing syscalls macros resulting in glibc (2.28) build failure. It also broke glibc in a different way: asm/syscalls.h is being used by glibc. I noticed this while doing Fedora 30/Rawhide mass rebuild. The patch returns asm/syscalls.h header and incl. it into asm/unistd.h. I plan to send a patch to glibc to use asm/unistd.h instead of asm/syscalls.h In the meantime, we use __has_include__, which was added to GCC 5, to check if <asm/syscalls.h> exists before including it. Tested with build-many-glibcs.py for riscv against kernel 4.19.12 and 4.20-rc7. [BZ #24022] * sysdeps/unix/sysv/linux/riscv/flush-icache.c: Check if <asm/syscalls.h> exists with __has_include__ before including it.
* Update Alpha libm-test-ulpsAurelien Jarno2018-12-281-40/+48
| | | | | Changelog: * sysdeps/alpha/fpu/libm-test-ulps: Regenerated.
* x86-64: Remove s_sincosf-sse2.SH.J. Lu2018-12-263-568/+2
| | | | | | | | | | | | | | The current s_sincosf.c is faster than s_sincosf-sse2.S. On Broadwell with FMA disabled, bench-sincosf shows: Before After Improvement max 154.032 114.517 34% min 6.25 5.609 11% mean 14.8728 12.8589 15% * sysdeps/x86_64/fpu/s_sincosf.S: Removed. * sysdeps/x86_64/fpu/multiarch/s_sincosf-sse2.S: Likewise. * sysdeps/x86_64/fpu/multiarch/s_sincosf-sse2.c: New file.
* Regenerate sysdeps/x86_64/fpu/libm-test-ulpsH.J. Lu2018-12-261-0/+6
| | | | * sysdeps/x86_64/fpu/libm-test-ulps: Regenerated.
* x86-64: Vectorize sincosf_poly and update s_sincosf-fma.cH.J. Lu2018-12-265-340/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add <sincosf_poly.h> and include it in s_sincosf.h to allow vectorized sincosf_poly. Add x86 sincosf_poly.h to vectorize sincosf_poly. On Broadwell, bench-sincosf shows: Before After Improvement max 160.273 114.198 40% min 6.25 5.625 11% mean 13.0325 10.6462 22% Vectorized sincosf_poly shows Before After Improvement max 138.653 114.198 21% min 5.004 5.625 -11% mean 11.5934 10.6462 9% Tested on x86-64 and i686 as well as with build-many-glibcs.py. * sysdeps/ieee754/flt-32/s_sincosf.h: Include <sincosf_poly.h>. (sincos_t, sincosf_poly, sinf_poly): Moved to ... * sysdeps/ieee754/flt-32/sincosf_poly.h: Here. New file. * sysdeps/x86/fpu/s_sincosf_data.c: New file. * sysdeps/x86/fpu/sincosf_poly.h: Likewise. * sysdeps/x86_64/fpu/multiarch/s_sincosf-fma.c: Just include <sysdeps/ieee754/flt-32/s_sincosf.c>.
* Update nios2, sparc32 localplt.data for difftime changes (bug 24023).Joseph Myers2018-12-212-0/+3
| | | | | | | | | | | | | | | | | | | | | | The recent difftime changes introduced localplt test failures on nios2 and sparc32, two configurations where some soft-fp functions are defined in / exported from libc.so, and where the difftime changes affected the particular set of floating-point operations used in libc.so. This patch adds those functions to localplt.data, alongside other such functions already there. (In the sparc32 case, and more generally on any platform where long double is a software floating-point type, it would probably be more efficient to avoid using long double at all in difftime, but that's a pre-existing issue.) Tested with build-many-glibcs.py for its nios2 and sparcv9 configurations. [BZ #24023] * sysdeps/unix/sysv/linux/nios2/localplt.data: Allow __floatundidf PLT reference in libc.so. * sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data: Allow _Q_lltoq and _Q_qtod PLT references in libc.so.
* Add C-SKY portMao Han2018-12-21121-0/+12652
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch add two abi combinations support for C-SKY ABIV2: soft-float little endian, hard float little endian. C-SKY ABI manual and architecture user guide are available from: https://github.com/c-sky/csky-doc * config.h.in (CSKYABI, CSKY_HARD_FLOAT): New Define. * scripts/build-many-glibcs.py: Add C-SKY targets. * sysdeps/csky/Implies: New file. * sysdeps/csky/Makefile: Likewise. * sysdeps/csky/abiv2/__longjmp.S: Likewise. * sysdeps/csky/abiv2/csky-mcount.S: Likewise. * sysdeps/csky/abiv2/dl-trampoline.S: Likewise. * sysdeps/csky/abiv2/memcmp.S: Likewise. * sysdeps/csky/abiv2/memcpy.S: Likewise. * sysdeps/csky/abiv2/memmove.S: Likewise. * sysdeps/csky/abiv2/memset.S: Likewise. * sysdeps/csky/abiv2/setjmp.S: Likewise. * sysdeps/csky/abiv2/start.S: Likewise. * sysdeps/csky/abiv2/strcmp.S: Likewise. * sysdeps/csky/abiv2/strcpy.S: Likewise. * sysdeps/csky/abiv2/strlen.S: Likewise. * sysdeps/csky/abiv2/tls-macros.h: Likewise. * sysdeps/csky/abort-instr.h: Likewise. * sysdeps/csky/atomic-machine.h: Likewise. * sysdeps/csky/bits/endian.h: Likewise. * sysdeps/csky/bits/fenv.h: Likewise. * sysdeps/csky/bits/link.h: Likewise. * sysdeps/csky/bits/setjmp.h: Likewise. * sysdeps/csky/bsd-_setjmp.S: Likewise. * sysdeps/csky/bsd-setjmp.S: Likewise. * sysdeps/csky/configure: Likewise. * sysdeps/csky/configure.ac: Likewise. * sysdeps/csky/dl-machine.h: Likewise. * sysdeps/csky/dl-procinfo.c: Likewise. * sysdeps/csky/dl-procinfo.h: Likewise. * sysdeps/csky/dl-sysdep.h: Likewise. * sysdeps/csky/dl-tls.h: Likewise. * sysdeps/csky/fpu/fclrexcpt.c: Likewise. * sysdeps/csky/fpu/fedisblxcpt.c: Likewise. * sysdeps/csky/fpu/feenablxcpt.c: Likewise. * sysdeps/csky/fpu/fegetenv.c: Likewise. * sysdeps/csky/fpu/fegetexcept.c: Likewise. * sysdeps/csky/fpu/fegetmode.c: Likewise. * sysdeps/csky/fpu/fegetround.c: Likewise. * sysdeps/csky/fpu/feholdexcpt.c: Likewise. * sysdeps/csky/fpu/fenv_libc.h: Likewise. * sysdeps/csky/fpu/fenv_private.h: Likewise. * sysdeps/csky/fpu/fesetenv.c: Likewise. * sysdeps/csky/fpu/fesetexcept.c: Likewise. * sysdeps/csky/fpu/fesetmode.c: Likewise. * sysdeps/csky/fpu/fesetround.c: Likewise. * sysdeps/csky/fpu/feupdateenv.c: Likewise. * sysdeps/csky/fpu/fgetexcptflg.c: Likewise. * sysdeps/csky/fpu/fix-fp-int-convert-overflow.h: Likewise. * sysdeps/csky/fpu/fraiseexcpt.c: Likewise. * sysdeps/csky/fpu/fsetexcptflg.c: Likewise. * sysdeps/csky/fpu/ftestexcept.c: Likewise. * sysdeps/csky/fpu/libm-test-ulps: Likewise. * sysdeps/csky/fpu/libm-test-ulps-name: Likewise. * sysdeps/csky/fpu_control.h: Likewise. * sysdeps/csky/gccframe.h: Likewise. * sysdeps/csky/jmpbuf-unwind.h: Likewise. * sysdeps/csky/ldsodefs.h: Likewise. * sysdeps/csky/libc-tls.c: Likewise. * sysdeps/csky/linkmap.h: Likewise. * sysdeps/csky/machine-gmon.h: Likewise. * sysdeps/csky/memusage.h: Likewise. * sysdeps/csky/nofpu/Implies: Likewise. * sysdeps/csky/nofpu/libm-test-ulps: Likewise. * sysdeps/csky/nofpu/libm-test-ulps-name: Likewise. * sysdeps/csky/nptl/Makefile: Likewise. * sysdeps/csky/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/csky/nptl/bits/semaphore.h: Likewise. * sysdeps/csky/nptl/pthread-offsets.h: Likewise. * sysdeps/csky/nptl/pthreaddef.h: Likewise. * sysdeps/csky/nptl/tcb-offsets.sym: Likewise. * sysdeps/csky/nptl/tls.h: Likewise. * sysdeps/csky/preconfigure: Likewise. * sysdeps/csky/sfp-machine.h: Likewise. * sysdeps/csky/sotruss-lib.c: Likewise. * sysdeps/csky/stackinfo.h: Likewise. * sysdeps/csky/sysdep.h: Likewise. * sysdeps/csky/tininess.h: Likewise. * sysdeps/csky/tst-audit.h: Likewise. * sysdeps/unix/sysv/linux/csky/Implies: Likewise. * sysdeps/unix/sysv/linux/csky/Makefile: Likewise. * sysdeps/unix/sysv/linux/csky/Versions: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/____longjmp_chk.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/clone.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/getcontext.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/swapcontext.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/syscall.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym: Likewise. * sysdeps/unix/sysv/linux/csky/bits/procfs.h: Likewise. * sysdeps/unix/sysv/linux/csky/bits/shmlba.h: Likewise. * sysdeps/unix/sysv/linux/csky/c++-types.data: Likewise. * sysdeps/unix/sysv/linux/csky/configure: Likewise. * sysdeps/unix/sysv/linux/csky/configure.ac: Likewise. * sysdeps/unix/sysv/linux/csky/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/csky/jmp_buf-macros.h: Likewise. * sysdeps/unix/sysv/linux/csky/kernel-features.h: Likewise. * sysdeps/unix/sysv/linux/csky/ld.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/ldconfig.h: Likewise. * sysdeps/unix/sysv/linux/csky/libBrokenLocale.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libanl.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libcrypt.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libdl.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libresolv.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/librt.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libthread_db.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/libutil.abilist: Likewise. * sysdeps/unix/sysv/linux/csky/localplt.data: Likewise. * sysdeps/unix/sysv/linux/csky/makecontext.c: Likewise. * sysdeps/unix/sysv/linux/csky/profil-counter.h: Likewise. * sysdeps/unix/sysv/linux/csky/pt-vfork.S: Likewise. * sysdeps/unix/sysv/linux/csky/register-dump.h: Likewise. * sysdeps/unix/sysv/linux/csky/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/csky/sigcontextinfo.h: Likewise. * sysdeps/unix/sysv/linux/csky/sys/cachectl.h: Likewise. * sysdeps/unix/sysv/linux/csky/sys/ucontext.h: Likewise. * sysdeps/unix/sysv/linux/csky/sys/user.h: Likewise. * sysdeps/unix/sysv/linux/csky/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/csky/sysdep.h: Likewise.
* Remove x86 mathinline.h.Joseph Myers2018-12-192-295/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | After previous cleanups, the only code in the x86 bits/mathinline.h that is relevant with current compilers is the inline of __ieee754_atan2l that is conditional on __LIBC_INTERNAL_MATH_INLINES (i.e. for when libm itself is being built). This inline is something that does belong in glibc not GCC, since __ieee754_atan2l is a purely internal function name. This patch moves that inline to a new sysdeps/x86/fpu/math_private.h, removing the bits/mathinline.h header. Note that previously the inline was only for non-SSE 32-bit x86. That condition does not make sense, however, for a long double function; if it's not inlined, exactly the same x87 instruction will end up getting used by the out-of-line function, for both 32-bit and 64-bit. So that condition is not retained in the new version. Tested for x86_64 and x86. As expected, installed stripped shared libraries are unchanged for 32-bit x86, but installed stripped libm.so is changed for x86_64 because calls to __ieee754_atan2l start being inlined where previously they were out of line calls. (The same change to start inlining the function would presumably also apply for 32-bit built with -mfpmath=sse, but that's not a configuration I've tested.) * sysdeps/x86/fpu/math_private.h: New file. * sysdeps/x86/fpu/bits/mathinline.h: Remove.
* Remove x86 mathinline.h sinh, cosh, tanh inlines.Joseph Myers2018-12-191-16/+0
| | | | | | | | | | | | | | | | | | | | | | Continuing the removal of bits/mathinline.h inlines that would better be done by the compiler, this patch removes x86 inlines for sinh, cosh and tanh functions (inlines only previously present for fast-math, non-SSE 32-bit x86). I've filed <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88556> for adding such inlines as an optimization in GCC. I believe the only remaining part of the x86 bits/mathinline.h that does anything useful with current compilers after this patch is the __LIBC_INTERNAL_MATH_INLINES inline of __ieee754_atan2l; I intend to remove the whole header and move that inline to a sysdeps math_private.h header in a subsequent patch. Tested for x86_64 and x86. * sysdeps/x86/fpu/bits/mathinline.h (sinh): Remove inline definition. (cosh): Likewise. (tanh): Likewise.
* Print cache size and geometry auxv types on LD_SHOW_AUXV=1Tulio Magno Quites Machado Filho2018-12-191-2/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and AT_L3_CACHEGEOMETRY when LD_SHOW_AUXV=1. AT_L*_CACHESIZE is printed as decimal and represent the number of bytes of the cache. AT_L*_CACHEGEOMETRY is treated in order to specify the cache line size and its associativity. Example output from a POWER8: AT_L1I_CACHESIZE: 32768 AT_L1I_CACHEGEOMETRY: 128B line size, 8-way set associative AT_L1D_CACHESIZE: 65536 AT_L1D_CACHEGEOMETRY: 128B line size, 8-way set associative AT_L2_CACHESIZE: 524288 AT_L2_CACHEGEOMETRY: 128B line size, 8-way set associative AT_L3_CACHESIZE: 8388608 AT_L3_CACHEGEOMETRY: 128B line size, 8-way set associative Some of the new types are longer than the previous ones, requiring to increase the indentation in order to keep the values aligned. * elf/dl-sysdep.c (auxvars): Add AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE and AT_L3_CACHEGEOMETRY. Fix indentation when printing the other fields. (_dl_show_auxv): Give a special treatment to AT_L1I_CACHEGEOMETRY, AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY and AT_L3_CACHEGEOMETRY. * sysdeps/powerpc/dl-procinfo.h (cache_geometry): New function. (_dl_procinfo): Fix indentation when printing AT_HWCAP and AT_HWCAP2. Add support for AT_L1I_CACHEGEOMETRY, AT_L1D_CACHEGEOMETRY, AT_L2_CACHEGEOMETRY and AT_L3_CACHEGEOMETRY. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* hurd: Fix 64bit fcntl lock implementationSamuel Thibault2018-12-191-3/+3
| | | | | * sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Test against 64bit `cmd' values in the 64bit value cases.
* s390: Use generic kernel_sigaction.hAdhemerval Zanella2018-12-181-26/+3
| | | | | | | | | S390 kernel sigaction is the same as the Linux generic one. Checked with a s390-linux-gnu and s390x-linux-gnu build. * sysdeps/unix/sysv/linux/s390/kernel_sigaction.h: Use Linux generic kernel_sigction definition.
* ia64: Remove kernel_sigaction.hAdhemerval Zanella2018-12-181-7/+0
| | | | | | | | | IA64 kernel_sigaction.h definition is the sama as the Linux generic one. Checked on ia64-linux-gnu. * sysdeps/unix/sysv/linux/ia64/kernel_sigaction.h: Remove file.
* hppa: Remove kernel_sigaction.hAdhemerval Zanella2018-12-181-18/+0
| | | | | | | | | HPPA kernel_sigaction.h definition is the sama as the Linux generic one and old_kernel_sigaction is not used. Checked on hppa-linux-gnu. * sysdeps/unix/sysv/linux/hppa/kernel_sigaction.h: Remove file.
* alpha: Use Linux generic sigaction implementationAdhemerval Zanella2018-12-188-115/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alpha rt_sigaction syscall uses a slight different kernel ABI than generic one: arch/alpha/kernel/signal.c 90 SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act, 91 struct sigaction __user *, oact, 92 size_t, sigsetsize, void __user *, restorer) Similar as sparc, the syscall expects a restorer function. However different than sparc, alpha defines the restorer as the 5th argument (sparc defines as the 4th). This patch removes the arch-specific alpha sigaction implementation, adapt the Linux generic one to different restore placements (through STUB macro), and make alpha use the Linux generic kernel_sigaction definition. Checked on alpha-linux-gnu and x86_64-linux-gnu (for sanity). * sysdeps/unix/sysv/linux/alpha/Makefile: Update comment about __syscall_rt_sigaction. * sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h (kernel_sigaction): Use Linux generic defintion. (STUB): Define. (__syscall_rt_sigreturn, __syscall_sigreturn): Add prototype. * sysdeps/unix/sysv/linux/alpha/rt_sigaction.S (__syscall_rt_sigaction): Remove implementation. (__syscall_sigreturn, __syscall_rt_sigreturn): Define as global and hidden. * sysdeps/unix/sysv/linux/alpha/sigaction.c: Remove file. * sysdeps/unix/sysv/linux/alpha/sysdep.h (INLINE_SYSCALL, INTERNAL_SYSCALL): Remove definitions. * sysdeps/unix/sysv/linux/sigaction.c: Define STUB to accept both the action and signal set size. * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (STUB): Redefine. * sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c (STUB): Likewise.
* m68k: Fix sigaction kernel definition (BZ #23960)Adhemerval Zanella2018-12-187-34/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b4a5d26d883 (linux: Consolidate sigaction implementation) added a wrong kernel_sigaction definition for m68k, meant for __NR_sigaction instead of __NR_rt_sigaction as used on generic Linux sigaction implementation. This patch fixes it by using the Linux generic definition meant for the RT kernel ABI. Checked the signal tests on emulated m68-linux-gnu (Aranym). It fixes the faulty signal/tst-sigaction and man works as expected. Adhemerval Zanella <adhemerval.zanella@linaro.org> James Clarke <jrtc27@jrtc27.com> [BZ #23960] * sysdeps/unix/sysv/linux/kernel_sigaction.h (HAS_SA_RESTORER): Define if SA_RESTORER is defined. (kernel_sigaction): Define sa_restorer if HAS_SA_RESTORER is defined. (SET_SA_RESTORER, RESET_SA_RESTORER): Define iff the macro are not already defined. * sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h (SA_RESTORER, kernel_sigaction, SET_SA_RESTORER, RESET_SA_RESTORER): Remove definitions. (HAS_SA_RESTORER): Define. * sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h (SA_RESTORER, SET_SA_RESTORER, RESET_SA_RESTORER): Remove definition. (HAS_SA_RESTORER): Define. * sysdeps/unix/sysv/linux/nios2/kernel_sigaction.h: Include generic kernel_sigaction after define SET_SA_RESTORER and RESET_SA_RESTORER. * sysdeps/unix/sysv/linux/powerpc/kernel_sigaction.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
* Remove __ASSUME_ST_INO_64_BIT.Joseph Myers2018-12-187-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel-features.h has a macro __ASSUME_ST_INO_64_BIT, with a comment "However, SH is lame, and still does not have a 64-bit inode field.". The macro is, in fact, defined to 0 by Alpha as well as SH. The Alpha case is, however, trivially useless: none of the files that test __ASSUME_ST_INO_64_BIT are built for Alpha (which gained kernel support for stat64 syscalls, with a 64-bit st_ino field, in Linux 2.6.4; the define to 0 for Alpha in glibc predates that). The SH kernel gained support for a 64-bit st_ino in struct stat64 in commit 760bcb1deec13c50e20399c84cb6a8ea41cc2820 ("sh: Fix fstatat64() syscall."), which is in Linux 2.6.22 and later. So the redefinition of __ASSUME_ST_INO_64_BIT to 0 is of no use for SH either; three of the files testing it do so immediately after a stat64-family syscall has been used, which will always have set the 64-bit st_ino correctly (in addition to the 32-bit __st_ino), while the relevant code __xstat32_conv executes only after such a syscall in the function calling __xstat32_conv. Thus this patch removes __ASSUME_ST_INO_64_BIT and code testing it. Removing the useless [!__ASSUME_ST_INO_64_BIT] code in __xstat32_conv renders the [_HAVE_STAT64___ST_INO] and [!_HAVE_STAT64___ST_INO] cases around it identical, so that conditional is also removed. Tested compilation with build-many-glibcs.py for its Alpha and SH configurations; also ran the glibc testsuite for x86_64 and x86. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_ST_INO_64_BIT): Remove macro definition. * sysdeps/unix/sysv/linux/alpha/kernel-features.h (__ASSUME_ST_INO_64_BIT): Do not undefine and define. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_ST_INO_64_BIT): Likewise. * sysdeps/unix/sysv/linux/fxstat64.c: Do not include <kernel-features.h>. (___fxstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]: Remove conditional code. * sysdeps/unix/sysv/linux/lxstat64.c: Do not include <kernel-features.h>. (___lxstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]: Remove conditional code. * sysdeps/unix/sysv/linux/xstat64.c: Do not include <kernel-features.h>. (___xstat64) [_HAVE_STAT64___ST_INO && !__ASSUME_ST_INO_64_BIT]: Remove conditional code. * sysdeps/unix/sysv/linux/xstatconv.c: Do not include <kernel-features.h>. (__xstat32_conv) [_HAVE_STAT64___ST_INO]: Remove conditional code. [!_HAVE_STAT64___ST_INO]: Make code unconditional.
* S390: Cleanup ifunc-resolve.h.Stefan Liebler2018-12-186-41/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ifunc macros s390_vx_libc* are no longer used and can be removed as all users are now relying on s390_libc_ifunc_expr. The same applies to s390_libc_ifunc. The macro s390_libc_ifunc_init is now renamed to s390_libc_ifunc_expr_stfle_init and the users are adjusted accordingly. ChangeLog: * sysdeps/s390/multiarch/ifunc-resolve.h (s390_vx_libc_ifunc, s390_vx_libc_ifunc_redirected, s390_vx_libc_ifunc2, s390_vx_libc_ifunc_init, s390_vx_libc_ifunc2_redirected, s390_libc_ifunc): Delete macro definition. (s390_libc_ifunc_init): Rename to s390_libc_ifunc_expr_stfle_init. * sysdeps/s390/bzero: Use s390_libc_ifunc_expr_stfle_init instead of s390_libc_ifunc_init. * sysdeps/s390/memcmp.c: Likewise. * sysdeps/s390/memcpy.c: Likewise. * sysdeps/s390/mempcpy.c: Likewise. * sysdeps/s390/memset.c: Likewise.
* S390: Refactor gconv_simple ifunc handling.Stefan Liebler2018-12-181-11/+12
| | | | | | | | | | | | | | | The ifunc handling for various __gconv_transform_* functions which are using IFUNC on s390x are adjusted in order to omit ifunc if the minimum architecture level already supports newer CPUs by default. Instead those functions are just an alias to the vector variants. Furthermore the ifunc-macro s390_libc_ifunc_expr is now used instead of s390_vx_libc_ifunc. ChangeLog: * sysdeps/s390/multiarch/gconv_simple.c (ICONV_VX_IFUNC): Define macro dependent on HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT.
* S390: Refactor wmemcmp ifunc handling.Stefan Liebler2018-12-187-29/+96
| | | | | | | | | | | | | | | | | | | | | The ifunc handling for wmemcmp is adjusted in order to omit ifunc variants if those will never be used as the minimum architecture level already supports newer CPUs by default. ChangeLog: * sysdeps/s390/multiarch/Makefile (sysdep_routines): Remove wmemcmp variants. * sysdeps/s390/Makefile (sysdep_routines): Add wmemcmp variants. * sysdeps/s390/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Refactor ifunc handling for wmemcmp. * sysdeps/s390/multiarch/wmemcmp-c.c: Move to ... * sysdeps/s390/wmemcmp-c.c: ... here and adjust ifunc handling. * sysdeps/s390/multiarch/wmemcmp-vx.S: Move to ... * sysdeps/s390/wmemcmp-vx.S: ... here and adjust ifunc handling. * sysdeps/s390/multiarch/wmemcmp.c: Move to ... * sysdeps/s390/wmemcmp.c: ... here and adjust ifunc handling. * sysdeps/s390/ifunc-wmemcmp.h: New file.
* S390: Refactor wmemset ifunc handling.Stefan Liebler2018-12-187-32/+126
| | | | | | | | | | | | | | | | | | | | | | | The ifunc handling for wmemset is adjusted in order to omit ifunc if the minimum architecture level already supports newer CPUs by default. Unfortunately the c ifunc variant can't be omitted at all as it is used by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned. Glibc internal calls will use the "newer" ifunc variant. ChangeLog: * sysdeps/s390/multiarch/Makefile (sysdep_routines): Remove wmemset variants. * sysdeps/s390/Makefile (sysdep_routines): Add wmemset variants. * sysdeps/s390/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Refactor ifunc handling for wmemset. * sysdeps/s390/multiarch/wmemset-c.c: Move to ... * sysdeps/s390/wmemset-c.c: ... here and adjust ifunc handling. * sysdeps/s390/multiarch/wmemset-vx.S: Move to ... * sysdeps/s390/wmemset-vx.S: ... here and adjust ifunc handling. * sysdeps/s390/multiarch/wmemset.c: Move to ... * sysdeps/s390/wmemset.c: ... here and adjust ifunc handling. * sysdeps/s390/ifunc-wmemset.h: New file.