Commit Graph

23292 Commits

Author SHA1 Message Date
Adhemerval Zanella 17cc27d5b7 nptl: Remove tst-cancel-wrappers test and related macros
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.
2019-01-03 18:38:08 -02:00
Szabolcs Nagy 7d7af8f17d AArch64: Update dl-procinfo.c with new HWCAP
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.
2019-01-03 17:58:17 +00:00
Adhemerval Zanella 805334b26c posix: Clear close-on-exec for posix_spawn adddup2 (BZ#23640)
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
2019-01-03 14:38:01 -02:00
Zack Weinberg 03992356e6
Use C99-compliant scanf under _GNU_SOURCE with modern compilers.
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.
2019-01-03 11:12:39 -05:00
Adhemerval Zanella 6f343c1f33 termios: Consolidate termios.h
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella 51f4beb081 termios: Add powerpc termios-misc
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella f69c5cb2a5 termios: Remove Linux _IOT_termios
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella 3aa4a07ec1 termios: Consolidate tcflow symbolic constants
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella 22679ddf10 termios: Consolidate local mode definitions
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella 72eb6ecc7e termios: Consolidate control mode definitions
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella 9c5d0d02c1 termios: Consolidate Baud Rate Selection definitions (BZ#23783)
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella 7b83201888 termios: Consolidate Output Modes definitions
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella 3127003e75 termios: Consolidate Input Modes definitions.
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella 48c1dd9632 termios: Consolidate termios c_cc symbolic constants
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella e5a50db36e termios: Consolidate struct termios
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.
2019-01-03 09:32:12 -02:00
Adhemerval Zanella 8083afa55d termios: Define TIOCSER_TEMT with __USE_MISC (BZ#17783)
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.
2019-01-03 09:32:12 -02:00
PanderMusubi 4d7d7dc6fe bs_BA: Fix a small typo in comment (bug 24011).
[BZ #24011]
	* localedata/locales/bs_BA (LC_TELEPHONE): Fix a typo in comment.
2019-01-02 23:50:49 +01:00
Joseph Myers 8e291a293b Update powerpc-nofpu libm-test-ulps.
* sysdeps/powerpc/nofpu/libm-test-ulps: Update.
2019-01-02 22:38:47 +00:00
Samuel Thibault 55137f7dd9 hurd: advertise *_setpshared as not supported
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.
2019-01-02 22:21:34 +01:00
Joseph Myers acb55dcb89 Update Linux kernel version in tst-mman-consts.py.
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.
2019-01-02 18:35:50 +00:00
Joseph Myers 2ce09e0187 Update MIPS libm-test-ulps.
* sysdeps/mips/mips32/libm-test-ulps: Update.
	* sysdeps/mips/mips64/libm-test-ulps: Likewise.
2019-01-02 17:25:33 +00:00
Aurelien Jarno fe20bb1d60 ARM: fix kernel assisted atomics with GCC 8 (bug 24034)
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.
2019-01-02 18:21:18 +01:00
Gabriel F. T. Gomes 2d9837c1fb Set behavior of sprintf-like functions with overlapping source and destination
According to ISO C99, passing the same buffer as source and destination
to sprintf, snprintf, vsprintf, or vsnprintf has undefined behavior.
Until the commit

  commit 4e2f43f842
  Author: Zack Weinberg <zackw@panix.com>
  Date:   Wed Mar 7 14:32:03 2018 -0500

      Use PRINTF_FORTIFY instead of _IO_FLAGS2_FORTIFY (bug 11319)

a call to sprintf or vsprintf with overlapping buffers, for instance
vsprintf (buf, "%sTEXT", buf), would append `TEXT' into buf, while a
call to snprintf or vsnprintf would override the contents of buf.
After the aforementioned commit, the behavior of sprintf and vsprintf
changed (so that they also override the contents of buf).

This patch reverts this behavioral change, because it will likely break
applications that rely on the previous behavior, even though it is
undefined by ISO C.  As noted by Szabolcs Nagy, this is used in SPEC2017
507.cactuBSSN_r/src/PUGH/PughUtils.c:

  sprintf(mess,"  Size:");
  for (i=0;i<dim+1;i++)
  {
      sprintf(mess,"%s %d",mess,pughGH->GFExtras[dim]->nsize[i]);
  }

More important to notice is the fact that the overwriting of the
destination buffer is not the only behavior affected by the refactoring.
Before the refactoring, sprintf and vsprintf would use _IO_str_jumps,
whereas __sprintf_chk and __vsprintf_chk would use _IO_str_chk_jumps.
After the refactoring, all use _IO_str_chk_jumps, which would make
sprintf and vsprintf report buffer overflows and terminate the program.
This patch also reverts this behavior, by installing the appropriate
jump table for each *sprintf functions.

Apart from reverting the changes, this patch adds a test case that has
the old behavior hardcoded, so that regressions are noticed if something
else unintentionally changes the behavior.

Tested for powerpc64le.
2019-01-02 13:53:52 -02:00
Florian Weimer d5c6df0b0e Fix ChangeLog entry 2019-01-02 16:44:33 +01:00
Florian Weimer 8c1aafc1f3 intl: Do not return NULL on asprintf failure in gettext [BZ #24018]
Fixes commit 9695dd0c93 ("DCIGETTEXT:
Use getcwd, asprintf to construct absolute pathname").
2019-01-02 16:26:58 +01:00
Florian Weimer 66081e383c nptl/tst-audit-threads: Switch to <support/test-driver.c>
This is a new test, so it should use the test driver in the support
subdirectory.
2019-01-02 16:09:26 +01:00
Joseph Myers 6ef3d22558 Add IPV6_MULTICAST_ALL from Linux 4.20 to bits/in.h.
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.
2019-01-01 02:03:24 +00:00
Joseph Myers e3d4e292f5 Add PACKET_IGNORE_OUTGOING from Linux 4.20 to netpacket/packet.h.
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.
2019-01-01 02:02:35 +00:00
Joseph Myers f45077974a Add HWCAP_SSBS from Linux 4.20 to AArch64 bits/hwcap.h.
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.
2019-01-01 02:01:43 +00:00
Joseph Myers 47ad5e1a2a Update syscall-names.list for Linux 4.20.
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.
2019-01-01 02:01:02 +00:00
Joseph Myers 7628a1b05a Update miscellaneous files from upstream sources.
This patch updates some miscellaneous files from their upstream
sources (thereby bringing in copyright date updates for some of those
files).

Tested for x86_64, including "make pdf".

	* manual/texinfo.tex: Update to version 2018-12-28.17 with
	trailing whitespace removed.
	* scripts/config.guess: Update to version 2019-01-01.
	* scripts/config.sub: Update to version 2019-01-01.
	* scripts/move-if-change: Update from gnulib.
2019-01-01 00:52:59 +00:00
Joseph Myers c9123888d8 Update copyright dates not handled by scripts/update-copyrights.
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.
2019-01-01 00:15:13 +00:00
Joseph Myers 04277e02d7 Update copyright dates with scripts/update-copyrights.
* 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.
2019-01-01 00:11:28 +00:00
Joseph Myers e740e5b1f0 Update timezone code from tzcode 2018i.
This patch updates files coming from tzcode to the versions in tzcode
2018i.  No changes elsewhere in glibc were needed.

Tested for x86_64.

	* timezone/zdump.c: Update from tzcode 2018i.
	* timezone/zic.c: Likewise.
2018-12-31 23:51:15 +00:00
Paul Eggert 9b7f98b345 regex: improve Gnulib port to AIX
From the glibc point of view, this removes duplicate macro
definitions and is obviously safe.
From the Gnulib point of view, this pacifies xlc 12.01 on AIX 7.1.
* posix/regex_internal.h:
(__attribute__, __attribute_warn_unused_result__):
Remove; already defined elsewhere.
2018-12-31 15:09:32 -08:00
Florian Weimer b50dd3bc8c malloc: Always call memcpy in _int_realloc [BZ #24027]
This commit removes the custom memcpy implementation from _int_realloc
for small chunk sizes.  The ncopies variable has the wrong type, and
an integer wraparound could cause the existing code to copy too few
elements (leaving the new memory region mostly uninitialized).
Therefore, removing this code fixes bug 24027.
2018-12-31 22:09:37 +01:00
H.J. Lu 0b9c84906f riscv: Use __has_include__ to include <asm/syscalls.h> [BZ #24022]
<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.
2018-12-31 09:26:56 -08:00
Joseph Myers 01047fa6d0 Use Linux 4.20 in build-many-glibcs.py.
* scripts/build-many-glibcs.py (Context.checkout): Default Linux
	version to 4.20.
2018-12-31 13:07:21 +00:00
Justus Winter 065957a370 hurd: Handle "pid" magical lookup retry
* hurd/lookup-retry: Include <unistd.h>.
	(__hurd_file_name_lookup_retry): Keep a ref on last result in `lastdir'.
	Release it on return.  Handle "pid" magical lookup retry.
2018-12-28 22:32:12 +01:00
Rafal Luzynski 989182c40a Multiple locales: Use the correct 12-hour time formats (bug 10496).
It has been discovered that some locales use the 12-hour time formats but
do not use any AM/PM indicator thus making the time ambiguous.  This
commit adds "%p" wherever it was missing.  In some cases it has been
identified that a locale should use 24-hour time format rather than
12-hour.  All time formats come from CLDR but this commit introduces as
few changes as possible (for example, it tries not to change the time zone
display).  For the locales which are not supported by CLDR the consistency
with similar locales (which means the same language or the same country)
has been preserved: if the time formats were the same before the change
then they are still the same after the change.

The time format updates can be roughly summarized as follows:

* Most of the locales of Djibouti, Eritrea, and Ethiopia now use
"%l:%M:%S %p".
* Most of the locales of India and some surrounding countries (Bangladesh,
Nepal etc.) now use "%I:%M:%S %p %Z".
* Most of the Arabic locales now use "%Z %I:%M:%S %p".
* Ge'ez language (Eritrea and Ethiopia) now uses "%l:%M:%S፡%p" (note the
consistent use of Ethiopic wordspace character).
* Tamil (India) now uses "%p %I:%M:%S %Z".
* Chinese (Hong Kong) t_fmt now uses "%p %I<U6642>%M<U5206>%S<U79D2> %Z".
* Additionally, the following locales have been switched from 12-hour time
formats to 24-hour, according to CLDR: Arabic (Morocco), Maltese, Somali
(Kenya), and Tamil (Sri Lanka).
* Finally, the Bulgarian, Czech, and Slovak locales used 24-hour time
format correctly but their t_fmt_ampm field was not empty containing
12-hour time format which was incorrect so it is now replaced with an
empty string.

	[BZ #10496]
	* localedata/locales/aa_DJ (t_fmt): Set to "%l:%M:%S %p".
	(t_fmt_ampm): Likewise.
	* localedata/locales/aa_ER (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/aa_ER@saaho (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/aa_ET (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/am_ET (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/byn_ER (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/om_ET (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/sid_ET (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/so_DJ (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/so_ET (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/so_SO (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/ti_ER (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/ti_ET (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/tig_ER (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/wal_ET (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.

	* localedata/locales/anp_IN (t_fmt): Set to "%I:%M:%S %p %Z".
	* localedata/locales/ar_IN (t_fmt): Likewise.
	* localedata/locales/bhb_IN (t_fmt): Likewise.
	* localedata/locales/bho_IN (t_fmt): Likewise.
	* localedata/locales/bi_VU (t_fmt): Likewise.
	* localedata/locales/bn_BD (t_fmt): Likewise.
	* localedata/locales/bn_IN (t_fmt): Likewise.
	* localedata/locales/brx_IN (t_fmt): Likewise.
	* localedata/locales/doi_IN (t_fmt): Likewise.
	* localedata/locales/en_HK (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.
	* localedata/locales/en_IN (t_fmt): Likewise.
	* localedata/locales/en_PH (t_fmt): Likewise.
	* localedata/locales/gu_IN (t_fmt): Likewise.
	* localedata/locales/hi_IN (t_fmt): Likewise.
	* localedata/locales/hif_FJ (t_fmt): Likewise.
	* localedata/locales/hne_IN (t_fmt): Likewise.
	* localedata/locales/kn_IN (t_fmt): Likewise.
	* localedata/locales/kok_IN (t_fmt): Likewise.
	* localedata/locales/ks_IN (t_fmt): Likewise.
	* localedata/locales/ks_IN@devanagari (t_fmt): Likewise.
	* localedata/locales/mag_IN (t_fmt): Likewise.
	* localedata/locales/mai_IN (t_fmt): Likewise.
	* localedata/locales/mjw_IN (t_fmt): Likewise.
	* localedata/locales/ml_IN (t_fmt): Likewise.
	* localedata/locales/mni_IN (t_fmt): Likewise.
	* localedata/locales/mr_IN (t_fmt): Likewise.
	* localedata/locales/ms_MY (t_fmt): Likewise.
	* localedata/locales/pa_IN (t_fmt): Likewise.
	* localedata/locales/raj_IN (t_fmt): Likewise.
	* localedata/locales/sa_IN (t_fmt): Likewise.
	* localedata/locales/sat_IN (t_fmt): Likewise.
	* localedata/locales/sd_IN (t_fmt): Likewise.
	* localedata/locales/sd_IN@devanagari (t_fmt): Likewise.
	* localedata/locales/tcy_IN (t_fmt): Likewise.
	* localedata/locales/the_NP (t_fmt): Likewise.
	* localedata/locales/to_TO (t_fmt): Likewise.
	* localedata/locales/ur_IN (t_fmt): Likewise.

	* localedata/locales/hif_FJ (d_t_fmt): Set to
	"%A %d %b %Y %I:%M:%S %p".
	(date_fmt): Add, set to "%A %d %b %Y %I:%M:%S %p %Z".

	* localedata/locales/ar_AE (t_fmt): Set to "%Z %I:%M:%S %p".
	* localedata/locales/ar_BH (t_fmt): Likewise.
	* localedata/locales/ar_DZ (t_fmt): Likewise.
	* localedata/locales/ar_EG (t_fmt): Likewise.
	* localedata/locales/ar_IQ (t_fmt): Likewise.
	* localedata/locales/ar_JO (t_fmt): Likewise.
	* localedata/locales/ar_KW (t_fmt): Likewise.
	* localedata/locales/ar_LB (t_fmt): Likewise.
	* localedata/locales/ar_LY (t_fmt): Likewise.
	* localedata/locales/ar_OM (t_fmt): Likewise.
	* localedata/locales/ar_QA (t_fmt): Likewise.
	* localedata/locales/ar_SD (t_fmt): Likewise.
	* localedata/locales/ar_SS (t_fmt): Likewise.
	* localedata/locales/ar_SY (t_fmt): Likewise.
	* localedata/locales/ar_TN (t_fmt): Likewise.
	* localedata/locales/ar_YE (t_fmt): Likewise.

	* localedata/locales/gez_ER (t_fmt): Set to "%l:%M:%S<U1361>%p".
	(t_fmt_ampm): Likewise.
	* localedata/locales/gez_ET (t_fmt): Likewise.
	(t_fmt_ampm): Likewise.

	* localedata/locales/ta_IN (t_fmt): Set to "%p %I:%M:%S %Z".
	(t_fmt_ampm): Likewise.
	(d_t_fmt): Set to "%A %d %B %Y %p %I:%M:%S %Z".

	* localedata/locales/zh_HK (t_fmt):
	Set to "%p %I<U6642>%M<U5206>%S<U79D2> %Z".

	* localedata/locales/ar_MA (t_fmt_ampm): Set to "" (empty string)
	because this locale does not use the 12-hour clock.
	(t_fmt): Set to "%Z %H:%M:%S".
	(d_t_fmt): Set to "%d %b, %Y %Z %H:%M:%S".

	* localedata/locales/mt_MT (t_fmt_ampm): Set to "" (empty string)
	because this locale does not use the 12-hour clock.
	(t_fmt): Set to "%H:%M:%S %Z".
	(d_t_fmt): Set to "%A, %d ta %b, %Y %H:%M:%S %Z".

	* localedata/locales/so_KE (t_fmt_ampm): Set to "" (empty string)
	because this locale does not use the 12-hour clock.
	(t_fmt): Set to "%T".
	(d_t_fmt): Set to "%A, %B %e, %Y %X %Z".
	(date_fmt): Set to "%A, %B %e, %X %Z %Y".

	* localedata/locales/ta_LK (t_fmt_ampm): Set to "" (empty string)
	because this locale does not use the 12-hour clock.
	(t_fmt): Set to "%H:%M:%S %Z".
	(d_t_fmt): Set to "%A %d %B %Y %H:%M:%S %Z".

	* localedata/locales/bg_BG (t_fmt_ampm): Set to "" (empty string)
	because this locale does not use the 12-hour clock.
	* localedata/locales/cs_CZ (t_fmt_ampm): Likewise.
	* localedata/locales/sk_SK (t_fmt_ampm): Likewise.
2018-12-28 21:56:18 +01:00
Rafal Luzynski 27841a7d5a sq_AL: Use the correct date and time formats (bug 10496, 23724).
Albanian locale uses the 12-hour clock but some time formats did not
use any AM/PM indicator making the time ambiguous.  This commit adds
"%p" wherever it was missing.

It also sets the correct date format because the old "%Y-%b-%d" produced
rather weird results like "2018-Sht-28".

All time formats come from CLDR but as few changes have been introduced
by this commit as possible.  Some articles from MSDN and other available
online sources have been also taken into account.

	[BZ #10496]
	[BZ #23724]
	* localedata/locales/sq_AL (t_fmt): Set to "%I:%M:%S.%p %Z".
	(t_fmt_ampm): Likewise.
	(d_t_fmt): Set to "%a %-d %b %Y %I:%M:%S.%p".
	(date_fmt): Add, set to "%a %-d %b %Y %I:%M:%S.%p %Z".
	(d_fmt): Set to "%-d.%-m.%y".
2018-12-28 21:45:27 +01:00
Adhemerval Zanella 0253580a75 Replace check_mul_overflow_size_t with __builtin_mul_overflow
Checked on x86_64-linux-gnu and i686-linux-gnu.

	* malloc/alloc_buffer_alloc_array.c (__libc_alloc_buffer_alloc_array):
	Use __builtin_mul_overflow in place of check_mul_overflow_size_t.
	* malloc/dynarray_emplace_enlarge.c (__libc_dynarray_emplace_enlarge):
	Likewise.
	* malloc/dynarray_resize.c (__libc_dynarray_resize): Likewise.
	* malloc/reallocarray.c (__libc_reallocarray): Likewise.
	* malloc/malloc-internal.h (check_mul_overflow_size_t): Remove
	function.
	* support/blob_repeat.c (check_mul_overflow_size_t,
	(minimum_stride_size, support_blob_repeat_allocate): Likewise.
2018-12-28 15:39:45 -02:00
Aurelien Jarno 09104e5ba4 Update Alpha libm-test-ulps
Changelog:
	* sysdeps/alpha/fpu/libm-test-ulps: Regenerated.
2018-12-28 10:50:00 +01:00
Paul Eggert c0feb731d5 regex: simplify Gnulib port
This simplifies the code, by removing stuff intended for porting
to Gnulib but no longer needed there.
* posix/regcomp.c [!_LIBC]: No need to put #ifdef _LIBC around
uses of libc_hidden_def, weak_alias.
* posix/regcomp.c, posix/regexec.c: Use __restrict rather than
_Restrict_ except for public-facing headers.
* posix/regex_internal.h (attribute_hidden) [!_LIBC]:
Remove; already defined elsewhere.
* posix/regex.c, posix/regex_internal.h:
Use __GNUC_PREREQ instead of rolling our own.
* posix/regex_internal.h (__GNUC_PREREQ): Remove duplicate defn.
2018-12-27 11:17:06 -08:00
Wilco Dijkstra 5289f1f56b Improve bench-strlen
The current bench-strlen compares against a slow byte-oriented strlen which
is not useful given it's too easy to beat.  Remove it and compare against the
generic C strlen version and memchr.

	* benchtests/bench-strlen.c (generic_strlen): New function.
	(memchr_strlen): New function.
2018-12-27 14:56:23 +00:00
H.J. Lu ba4b8fab20 x86-64: Remove s_sincosf-sse2.S
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.
2018-12-26 06:58:31 -08:00
H.J. Lu 9412979a43 Regenerate sysdeps/x86_64/fpu/libm-test-ulps
* sysdeps/x86_64/fpu/libm-test-ulps: Regenerated.
2018-12-26 06:57:30 -08:00
H.J. Lu 8700a7851b x86-64: Vectorize sincosf_poly and update s_sincosf-fma.c
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>.
2018-12-26 06:56:13 -08:00
Joseph Myers 57b3ff8e1a Update nios2, sparc32 localplt.data for difftime changes (bug 24023).
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.
2018-12-21 19:02:23 +00:00
Wilco Dijkstra 90d3320d7f Refactor string benchtests
Refactor string benchtests by moving duplicated defines into
bench-string.h.

	* benchtests/bench-memchr.c: Cleanup defines.
	* benchtests/bench-memcmp.c: Likewise.
	* benchtests/bench-memset.c: Likewise.
	* benchtests/bench-memset-large.c: Likewise.
	* benchtests/bench-memset-walk.c: Likewise.
	* benchtests/bench-stpcpy.c: Likewise.
	* benchtests/bench-stpncpy.c: Likewise.
	* benchtests/bench-strcat.c: Likewise.
	* benchtests/bench-strchr.c: Likewise.
	* benchtests/bench-strcmp.c: Likewise.
	* benchtests/bench-strcpy.c: Likewise.
	* benchtests/bench-strcspn.c: Likewise.
	* benchtests/bench-string.h: Likewise.
	* benchtests/bench-strlen.c: Likewise.
	* benchtests/bench-strncat.c: Likewise.
	* benchtests/bench-strncmp.c: Likewise.
	* benchtests/bench-strncpy.c: Likewise.
	* benchtests/bench-strnlen.c: Likewise.
	* benchtests/bench-strpbrk.c: Likewise.
	* benchtests/bench-strrchr.c: Likewise.
	* benchtests/bench-strspn.c: Likewise.
2018-12-21 18:52:40 +00:00
Joseph Myers 5d025ea617 Update longlong.h.
This patch updates longlong.h from GCC.  There were no local changes
in glibc (the previous version was identical to the r232143 GCC
version, apart from copyright dates which had been updated in both
places), so this patch makes it identical to the version in GCC again.

Tested for x86_64 and x86.  Also tested with build-many-glibcs.py for
its RISC-V configurations, as the glibc architecture with the most
substantial changes in longlong.h in this patch.

	* stdlib/longlong.h: Update from GCC.
2018-12-21 18:45:03 +00:00
Joseph Myers 192963be49 Require GCC 5 or later to build glibc (bug 23993).
We know that building glibc with GCC 4.9 is broken on various
platforms (bug 23993).  As it's more than a year since we last
increased the minimum GCC version to build glibc, this patch changes
the requirement to be GCC 5 or later (indeed, based on 4.9 having been
required for building 2.26, it would be consistent in terms of timing
to require GCC 6 or later from the 2.30 release onwards).  It
deliberately just updates the configure test and corresponding
documentation, leaving removal of no-longer-needed __GNUC_PREREQ tests
for a separate patch.

In the NEWS entry, the requirement for a newer GCC version for
powerpc64le is reiterated (as in the entry for the 4.9 requirement in
2.26) to avoid suggesting the version requirement there has gone down.
(If that version goes up further as part of support for binary128 long
double, of course the wording would change at that time.)

Tested for x86_64.

	[BZ #23993]
	* configure.ac (libc_cv_compiler_ok): Require GCC 5 or later.
	* configure: Regenerated.
	* manual/install.texi (Tools for Compilation): Update minimum GCC
	version.
	* INSTALL: Regenerated.
2018-12-21 17:53:40 +00:00
Istvan Kurucsai c0e82f1173 malloc: Check the alignment of mmapped chunks before unmapping.
* malloc/malloc.c (munmap_chunk): Verify chunk alignment.
2018-12-21 00:15:28 -05:00
Istvan Kurucsai ebe544bf6e malloc: Add more integrity checks to mremap_chunk.
* malloc/malloc.c (mremap_chunk): Additional checks.
2018-12-20 23:31:37 -05:00
Mao Han 5f72b00591 Add C-SKY port
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.
2018-12-21 09:48:04 +08:00
Albert ARIBAUD (3ADEV) ac253355ba Y2038: make __difftime compatible with 64-bit time
Provide a 64-bit-time version of __difftime (but do not assume
__time64_t is a signed int so that Gnulib can reuse the code)
and make the 32-bit version a wrapper of it.

Current difftime expects two time_t arguments and returns a
double. To preserve source-code compatibility, its 64-bit-time
equivalent expects two __time64_t arguments but still returns
a double.

This patch was tested by running 'make check' on branch
master then applying this patch and its two predecessors and
running 'make check' again, and checking that both 'make check'
yield identical results. This was done on x86_64-linux-gnu and
i686-linux-gnu.

This patch was also functionally tested with an ad hoc userland
C program which checks the result of difftime for various pairs
of 32-bit and, for 64-bit builds, of 64-bit time_t values too.
The program was built and run against a glibc with and without
the patch, and the results compared to ensure the patch does
not change the behavior of difftime.

* include/time.h (__difftime64): Add.
* time/difftime.c (subtract): convert to 64-bit time.
* time/difftime.c (__difftime64): Add.
* time/difftime.c (__difftime): Wrap around __difftime64.
2018-12-20 22:16:55 +01:00
H.J. Lu ab4169313c manual/examples: Remove redundant "if not"
Replace "if not, if not," with "if not,".

	* manual/examples/add.c: Remove redundant "if not".
	* manual/examples/argp-ex1.c: Likewise.
	* manual/examples/argp-ex2.c: Likewise.
	* manual/examples/argp-ex3.c: Likewise.
	* manual/examples/argp-ex4.c: Likewise.
	* manual/examples/atexit.c: Likewise.
	* manual/examples/db.c: Likewise.
	* manual/examples/dir.c: Likewise.
	* manual/examples/dir2.c: Likewise.
	* manual/examples/execinfo.c: Likewise.
	* manual/examples/filecli.c: Likewise.
	* manual/examples/filesrv.c: Likewise.
	* manual/examples/fmtmsgexpl.c: Likewise.
	* manual/examples/genpass.c: Likewise.
	* manual/examples/inetcli.c: Likewise.
	* manual/examples/inetsrv.c: Likewise.
	* manual/examples/isockad.c: Likewise.
	* manual/examples/longopt.c: Likewise.
	* manual/examples/memopen.c: Likewise.
	* manual/examples/memstrm.c: Likewise.
	* manual/examples/mkdirent.c: Likewise.
	* manual/examples/mkfsock.c: Likewise.
	* manual/examples/mkisock.c: Likewise.
	* manual/examples/mygetpass.c: Likewise.
	* manual/examples/pipe.c: Likewise.
	* manual/examples/popen.c: Likewise.
	* manual/examples/rprintf.c: Likewise.
	* manual/examples/search.c: Likewise.
	* manual/examples/select.c: Likewise.
	* manual/examples/setjmp.c: Likewise.
	* manual/examples/sigh1.c: Likewise.
	* manual/examples/sigusr.c: Likewise.
	* manual/examples/stpcpy.c: Likewise.
	* manual/examples/strdupa.c: Likewise.
	* manual/examples/strftim.c: Likewise.
	* manual/examples/subopt.c: Likewise.
	* manual/examples/swapcontext.c: Likewise.
	* manual/examples/termios.c: Likewise.
	* manual/examples/testopt.c: Likewise.
	* manual/examples/testpass.c: Likewise.
	* manual/examples/timeval_subtract.c: Likewise.
2018-12-20 07:53:57 -08:00
Joseph Myers da75c1b180 Remove x86 mathinline.h.
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.
2018-12-19 22:55:32 +00:00
Joseph Myers 515f463f52 Remove x86 mathinline.h sinh, cosh, tanh inlines.
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.
2018-12-19 21:48:03 +00:00
Tulio Magno Quites Machado Filho 1616d034b6 Print cache size and geometry auxv types on LD_SHOW_AUXV=1
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>
2018-12-19 19:08:02 -02:00
Andreas Schwab 61595e3d36 nscd: avoid assertion failure during persistent db check
nscd should not abort when it finds inconsistencies in the persistent db.
2018-12-19 11:44:28 +01:00
Samuel Thibault bbb7dc8475 hurd: Fix 64bit fcntl lock implementation
* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Test against 64bit `cmd'
	values in the 64bit value cases.
2018-12-19 02:17:22 +01:00
Adhemerval Zanella dfa6216f24 Fix BZ number for 43a45c2d82 2018-12-18 20:24:48 -02:00
Albert ARIBAUD (3ADEV) c4c2836ada Y2038: add function __ctime64_r
Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

	* include/time.h
	(__ctime64_r): Add.
	* time/ctime_r.c
	(__ctime64_r): Add.
	[__TIMESIZE != 64] (__ctime_r): Turn into a wrapper.
2018-12-18 23:13:55 +01:00
Albert ARIBAUD (3ADEV) 7755e50411 Y2038: add function __ctime64
Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

	* include/time.h
	(__ctime64): Add.
	* time/gmtime.c
	(__ctime64): Add.
	[__TIMESIZE != 64] (ctime): Turn into a wrapper.
2018-12-18 23:13:24 +01:00
Albert ARIBAUD (3ADEV) a1d346ce0d Y2038: add function __gmtime64_r
Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

	* include/time.h
	(__gmtime64_r): Add.
	* time/gmtime.c
	(__gmtime64_r): Add.
	[__TIMESIZE != 64] (__gmtime): Turn into a wrapper.
2018-12-18 23:12:30 +01:00
Albert ARIBAUD (3ADEV) 131db8b0c8 Y2038: add function __gmtime64
Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

	* include/time.h
	(__gmtime64): Add.
	* time/gmtime.c
	(__gmtime64): Add.
	[__TIMESIZE != 64] (__gmtime): Turn into a wrapper.
2018-12-18 23:11:40 +01:00
Albert ARIBAUD (3ADEV) 64c2277d2e Y2038: add function __localtime64_r
Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

	* include/time.h
	(__localtime64_r): Add.
	* time/localtime.c
	(__localtime64_r): Add.
	[__TIMESIZE != 64] (__localtime_r): Turn into a wrapper.
2018-12-18 23:11:08 +01:00
Adhemerval Zanella 64dd7a1630 s390: Use generic kernel_sigaction.h
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.
2018-12-18 19:52:23 -02:00
Adhemerval Zanella 8b1d5da566 ia64: Remove kernel_sigaction.h
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.
2018-12-18 19:52:23 -02:00
Adhemerval Zanella f9eabb197f hppa: Remove kernel_sigaction.h
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.
2018-12-18 19:52:23 -02:00
Adhemerval Zanella 56b98bf1fb alpha: Use Linux generic sigaction implementation
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.
2018-12-18 19:52:21 -02:00
Adhemerval Zanella 43a45c2d82 m68k: Fix sigaction kernel definition (BZ #23960)
Commit b4a5d26d88 (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.
2018-12-18 16:45:10 -02:00
Joseph Myers 646ce7e0be Remove __ASSUME_ST_INO_64_BIT.
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.
2018-12-18 13:35:39 +00:00
Stefan Liebler 80190d2b0e S390: Cleanup ifunc-resolve.h.
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.
2018-12-18 13:57:25 +01:00
Stefan Liebler 12f0dcb8da S390: Refactor gconv_simple ifunc handling.
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.
2018-12-18 13:57:25 +01:00
Stefan Liebler 25654a8c74 S390: Refactor wmemcmp ifunc handling.
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.
2018-12-18 13:57:25 +01:00
Stefan Liebler d2a7436c1c S390: Refactor wmemset ifunc handling.
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.
2018-12-18 13:57:24 +01:00
Stefan Liebler c62534ae52 S390: Refactor wmemchr ifunc handling.
The ifunc handling for wmemchr 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 wmemchr variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wmemchr variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wmemchr.
	* sysdeps/s390/multiarch/wmemchr-c.c: Move to ...
	* sysdeps/s390/wmemchr-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wmemchr-vx.S: Move to ...
	* sysdeps/s390/wmemchr-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wmemchr.c: Move to ...
	* sysdeps/s390/wmemchr.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wmemchr.h: New file.
2018-12-18 13:57:24 +01:00
Stefan Liebler 79b44cf611 S390: Refactor wcscspn ifunc handling.
The ifunc handling for wcscspn 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcscspn variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcscspn variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcscspn.
	* sysdeps/s390/multiarch/wcscspn-c.c: Move to ...
	* sysdeps/s390/wcscspn-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcscspn-vx.S: Move to ...
	* sysdeps/s390/wcscspn-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcscspn.c: Move to ...
	* sysdeps/s390/wcscspn.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcscspn.h: New file.
2018-12-18 13:57:23 +01:00
Stefan Liebler 8e87c1f6d4 S390: Refactor wcspbrk ifunc handling.
The ifunc handling for wcspbrk 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 wcspbrk variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcspbrk variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcspbrk.
	* sysdeps/s390/multiarch/wcspbrk-c.c: Move to ...
	* sysdeps/s390/wcspbrk-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcspbrk-vx.S: Move to ...
	* sysdeps/s390/wcspbrk-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcspbrk.c: Move to ...
	* sysdeps/s390/wcspbrk.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcspbrk.h: New file.
2018-12-18 13:57:23 +01:00
Stefan Liebler 8507e83190 S390: Refactor wcsspn ifunc handling.
The ifunc handling for wcsspn 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 wcsspn variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcsspn variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcsspn.
	* sysdeps/s390/multiarch/wcsspn-c.c: Move to ...
	* sysdeps/s390/wcsspn-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsspn-vx.S: Move to ...
	* sysdeps/s390/wcsspn-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsspn.c: Move to ...
	* sysdeps/s390/wcsspn.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcsspn.h: New file.
2018-12-18 13:57:23 +01:00
Stefan Liebler 4753713aae S390: Refactor wcsrchr ifunc handling.
The ifunc handling for wcsrchr 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcsrchr variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcsrchr variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcsrchr.
	* sysdeps/s390/multiarch/wcsrchr-c.c: Move to ...
	* sysdeps/s390/wcsrchr-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsrchr-vx.S: Move to ...
	* sysdeps/s390/wcsrchr-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsrchr.c: Move to ...
	* sysdeps/s390/wcsrchr.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcsrchr.h: New file.
2018-12-18 13:57:22 +01:00
Stefan Liebler c09c1b6f01 S390: Refactor wcschrnul ifunc handling.
The ifunc handling for wcschrnul 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcschrnul variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcschrnul variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcschrnul.
	* sysdeps/s390/multiarch/wcschrnul-c.c: Move to ...
	* sysdeps/s390/wcschrnul-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcschrnul-vx.S: Move to ...
	* sysdeps/s390/wcschrnul-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcschrnul.c: Move to ...
	* sysdeps/s390/wcschrnul.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcschrnul.h: New file.
2018-12-18 13:57:22 +01:00
Stefan Liebler cf3ccc31a3 S390: Refactor wcschr ifunc handling.
The ifunc handling for wcschr 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 wcschr variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcschr variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcschr.
	* sysdeps/s390/multiarch/wcschr-c.c: Move to ...
	* sysdeps/s390/wcschr-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcschr-vx.S: Move to ...
	* sysdeps/s390/wcschr-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcschr.c: Move to ...
	* sysdeps/s390/wcschr.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcschr.h: New file.
2018-12-18 13:57:22 +01:00
Stefan Liebler e9873e1d47 S390: Refactor wcsncmp ifunc handling.
The ifunc handling for wcsncmp 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 wcsncmp variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcsncmp variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcsncmp.
	* sysdeps/s390/multiarch/wcsncmp-c.c: Move to ...
	* sysdeps/s390/wcsncmp-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsncmp-vx.S: Move to ...
	* sysdeps/s390/wcsncmp-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsncmp.c: Move to ...
	* sysdeps/s390/wcsncmp.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcsncmp.h: New file.
2018-12-18 13:57:21 +01:00
Stefan Liebler 3459e23dd4 S390: Refactor wcscmp ifunc handling.
The ifunc handling for wcscmp 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcscmp variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcscmp variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcscmp.
	* sysdeps/s390/multiarch/wcscmp-c.c: Move to ...
	* sysdeps/s390/wcscmp-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcscmp-vx.S: Move to ...
	* sysdeps/s390/wcscmp-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcscmp.c: Move to ...
	* sysdeps/s390/wcscmp.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcscmp.h: New file.
2018-12-18 13:57:21 +01:00
Stefan Liebler 814a76e1bc S390: Refactor wcsncat ifunc handling.
The ifunc handling for wcsncat 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcsncat variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcsncat variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcsncat.
	* sysdeps/s390/multiarch/wcsncat-c.c: Move to ...
	* sysdeps/s390/wcsncat-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsncat-vx.S: Move to ...
	* sysdeps/s390/wcsncat-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsncat.c: Move to ...
	* sysdeps/s390/wcsncat.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcsncat.h: New file.
2018-12-18 13:57:20 +01:00
Stefan Liebler 3389cae427 S390: Refactor wcscat ifunc handling.
The ifunc handling for wcscat 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcscat variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcscat variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcscat.
	* sysdeps/s390/multiarch/wcscat-c.c: Move to ...
	* sysdeps/s390/wcscat-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcscat-vx.S: Move to ...
	* sysdeps/s390/wcscat-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcscat.c: Move to ...
	* sysdeps/s390/wcscat.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcscat.h: New file.
2018-12-18 13:57:20 +01:00
Stefan Liebler c3081bcbd9 S390: Refactor wcpncpy ifunc handling.
The ifunc handling for wcpncpy 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcpncpy variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcpncpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcpncpy.
	* sysdeps/s390/multiarch/wcpncpy-c.c: Move to ...
	* sysdeps/s390/wcpncpy-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcpncpy-vx.S: Move to ...
	* sysdeps/s390/wcpncpy-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcpncpy.c: Move to ...
	* sysdeps/s390/wcpncpy.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcpncpy.h: New file.
2018-12-18 13:57:19 +01:00
Stefan Liebler 0966dd8689 S390: Refactor wcsncpy ifunc handling.
The ifunc handling for wcsncpy 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcsncpy variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcsncpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcsncpy.
	* sysdeps/s390/multiarch/wcsncpy-c.c: Move to ...
	* sysdeps/s390/wcsncpy-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsncpy-vx.S: Move to ...
	* sysdeps/s390/wcsncpy-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsncpy.c: Move to ...
	* sysdeps/s390/wcsncpy.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcsncpy.h: New file.
2018-12-18 13:57:19 +01:00
Stefan Liebler 0582e42845 S390: Refactor wcpcpy ifunc handling.
The ifunc handling for wcpcpy 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcpcpy variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcpcpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcpcpy.
	* sysdeps/s390/multiarch/wcpcpy-c.c: Move to ...
	* sysdeps/s390/wcpcpy-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcpcpy-vx.S: Move to ...
	* sysdeps/s390/wcpcpy-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcpcpy.c: Move to ...
	* sysdeps/s390/wcpcpy.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcpcpy.h: New file.
2018-12-18 13:57:19 +01:00
Stefan Liebler 804f2e5c73 S390: Refactor wcscpy ifunc handling.
The ifunc handling for wcscpy 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcscpy variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcscpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcscpy.
	* sysdeps/s390/multiarch/wcscpy-c.c: Move to ...
	* sysdeps/s390/wcscpy-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcscpy-vx.S: Move to ...
	* sysdeps/s390/wcscpy-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcscpy.c: Move to ...
	* sysdeps/s390/wcscpy.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcscpy.h: New file.
2018-12-18 13:57:18 +01:00
Stefan Liebler c7e7cd266e S390: Refactor wcsnlen ifunc handling.
The ifunc handling for wcsnlen 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 wcsnlen variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcsnlen variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcsnlen.
	* sysdeps/s390/multiarch/wcsnlen-c.c: Move to ...
	* sysdeps/s390/wcsnlen-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsnlen-vx.S: Move to ...
	* sysdeps/s390/wcsnlen-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcsnlen.c: Move to ...
	* sysdeps/s390/wcsnlen.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcsnlen.h: New file.
2018-12-18 13:57:18 +01:00
Stefan Liebler 2e02d0b7a9 S390: Refactor wcslen ifunc handling.
The ifunc handling for wcslen 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.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove wcslen variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add wcslen variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for wcslen.
	* sysdeps/s390/multiarch/wcslen-c.c: Move to ...
	* sysdeps/s390/wcslen-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcslen-vx.S: Move to ...
	* sysdeps/s390/wcslen-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/wcslen.c: Move to ...
	* sysdeps/s390/wcslen.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-wcslen.h: New file.
2018-12-18 13:57:17 +01:00
Stefan Liebler 89bfcbdf9d S390: Refactor memrchr ifunc handling.
The ifunc handling for memrchr 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 memrchr variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add memrchr variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for memrchr.
	* sysdeps/s390/multiarch/memrchr-c.c: Move to ...
	* sysdeps/s390/memrchr-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/memrchr-vx.S: Move to ...
	* sysdeps/s390/memrchr-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/memrchr.c: Move to ...
	* sysdeps/s390/memrchr.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-memrchr.h: New file.
2018-12-18 13:57:17 +01:00
Stefan Liebler 196655ba54 S390: Refactor memccpy ifunc handling.
The ifunc handling for memccpy 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 memccpy variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add memccpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for memccpy.
	* sysdeps/s390/multiarch/memccpy-c.c: Move to ...
	* sysdeps/s390/memccpy-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/memccpy-vx.S: Move to ...
	* sysdeps/s390/memccpy-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/memccpy.c: Move to ...
	* sysdeps/s390/memccpy.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-memccpy.h: New file.
2018-12-18 13:57:16 +01:00
Stefan Liebler 4c7b3cec11 S390: Refactor rawmemchr ifunc handling.
The ifunc handling for rawmemchr 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove rawmemchr variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add rawmemchr variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for rawmemchr.
	* sysdeps/s390/multiarch/rawmemchr-c.c: Move to ...
	* sysdeps/s390/rawmemchr-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/rawmemchr-vx.S: Move to ...
	* sysdeps/s390/rawmemchr-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/rawmemchr.c: Move to ...
	* sysdeps/s390/rawmemchr.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-rawmemchr.h: New file.
2018-12-18 13:57:16 +01:00
Stefan Liebler 581a051c2e S390: Refactor memchr ifunc handling.
The ifunc handling for memchr 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.
Glibc internal calls will then also use the "newer" ifunc variant.

Note: The fallback s390-32/s390-64 ifunc variants with srst instruction
are now moved to the unified memchr-z900.S file which can be used for
31/64bit. The s390-32/s390-64 files multiarch/memchr.c and memchr.S
are deleted.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove memchr variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add memchr variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for memchr.
	* sysdeps/s390/multiarch/memchr-vx.S: Move to ...
	* sysdeps/s390/memchr-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/memchr.c: Move to ...
	* sysdeps/s390/memchr.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-memchr.h: New file.
	* sysdeps/s390/s390-64/memchr.S: Move to ...
	* sysdeps/s390/memchr-z900.S: ... here and adjust to be usable
	for 31/64bit and ifunc handling.
	* sysdeps/s390/s390-32/multiarch/memchr.c: Delete file.
	* sysdeps/s390/s390-64/multiarch/memchr.c: Likewise.
	* sysdeps/s390/s390-32/memchr.S: Likewise.
2018-12-18 13:57:16 +01:00
Stefan Liebler 5d2ec20a99 S390: Refactor strcspn ifunc handling.
The ifunc handling for strcspn 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strcspn variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strcspn variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strcspn.
	* sysdeps/s390/multiarch/strcspn-c.c: Move to ...
	* sysdeps/s390/strcspn-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strcspn-vx.S: Move to ...
	* sysdeps/s390/strcspn-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strcspn.c: Move to ...
	* sysdeps/s390/strcspn.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strcspn.h: New file.
2018-12-18 13:57:15 +01:00
Stefan Liebler 572cca93fa S390: Refactor strpbrk ifunc handling.
The ifunc handling for strpbrk 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strpbrk variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strpbrk variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strpbrk.
	* sysdeps/s390/multiarch/strpbrk-c.c: Move to ...
	* sysdeps/s390/strpbrk-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strpbrk-vx.S: Move to ...
	* sysdeps/s390/strpbrk-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strpbrk.c: Move to ...
	* sysdeps/s390/strpbrk.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strpbrk.h: New file.
2018-12-18 13:57:15 +01:00
Stefan Liebler 483fc56978 S390: Refactor strspn ifunc handling.
The ifunc handling for strspn 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strspn variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strspn variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strspn.
	* sysdeps/s390/multiarch/strspn-c.c: Move to ...
	* sysdeps/s390/strspn-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strspn-vx.S: Move to ...
	* sysdeps/s390/strspn-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strspn.c: Move to ...
	* sysdeps/s390/strspn.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strspn.h: New file.
2018-12-18 13:57:15 +01:00
Stefan Liebler 26ea876087 S390: Refactor strrchr ifunc handling.
The ifunc handling for strrchr 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strrchr variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strrchr variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strrchr.
	* sysdeps/s390/multiarch/strrchr-c.c: Move to ...
	* sysdeps/s390/strrchr-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strrchr-vx.S: Move to ...
	* sysdeps/s390/strrchr-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strrchr.c: Move to ...
	* sysdeps/s390/strrchr.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strrchr.h: New file.
2018-12-18 13:57:14 +01:00
Stefan Liebler a1361e6561 S390: Refactor strchrnul ifunc handling.
The ifunc handling for strchrnul 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 strchrnul variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strchrnul variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strchrnul.
	* sysdeps/s390/multiarch/strchrnul-c.c: Move to ...
	* sysdeps/s390/strchrnul-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strchrnul-vx.S: Move to ...
	* sysdeps/s390/strchrnul-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strchrnul.c: Move to ...
	* sysdeps/s390/strchrnul.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strchrnul.h: New file.
2018-12-18 13:57:14 +01:00
Stefan Liebler 32f12653d4 S390: Refactor strchr ifunc handling.
The ifunc handling for strchr 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strchr variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strchr variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strchr.
	* sysdeps/s390/multiarch/strchr-c.c: Move to ...
	* sysdeps/s390/strchr-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strchr-vx.S: Move to ...
	* sysdeps/s390/strchr-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strchr.c: Move to ...
	* sysdeps/s390/strchr.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strchr.h: New file.
2018-12-18 13:57:14 +01:00
Stefan Liebler 316b884219 S390: Refactor strncmp ifunc handling.
The ifunc handling for strncmp 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strncmp variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strncmp variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strncmp.
	* sysdeps/s390/multiarch/strncmp-c.c: Move to ...
	* sysdeps/s390/strncmp-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strncmp-vx.S: Move to ...
	* sysdeps/s390/strncmp-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strncmp.c: Move to ...
	* sysdeps/s390/strncmp.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strncmp.h: New file.
2018-12-18 13:57:13 +01:00
Stefan Liebler cdab85fe33 S390: Refactor strcmp ifunc handling.
The ifunc handling for strcmp 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.
Glibc internal calls will then also use the "newer" ifunc variant.

Note: The fallback s390-32/s390-64 ifunc variants with clst instruction
are now moved to the unified strcmp-z900.S file which can be used for
31/64bit. The s390-32/s390-64 files multiarch/strcmp.c and strcmp.S
are deleted.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strcmp variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strcmp variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strcmp.
	* sysdeps/s390/multiarch/strcmp-vx.S: Move to ...
	* sysdeps/s390/strcmp-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strcmp.c: Move to ...
	* sysdeps/s390/strcmp.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strcmp.h: New file.
	* sysdeps/s390/s390-64/strcmp.S: Move to ...
	* sysdeps/s390/strcmp-z900.S: ... here and adjust to be usable
	for 31/64bit and ifunc handling.
	* sysdeps/s390/s390-32/multiarch/strcmp.c: Delete file.
	* sysdeps/s390/s390-64/multiarch/strcmp.c: Likewise.
	* sysdeps/s390/s390-32/strcmp.S: Likewise.
2018-12-18 13:57:13 +01:00
Stefan Liebler b935335155 S390: Refactor strncat ifunc handling.
The ifunc handling for strncat 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strncat variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strncat variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strncat.
	* sysdeps/s390/multiarch/strncat-c.c: Move to ...
	* sysdeps/s390/strncat-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strncat-vx.S: Move to ...
	* sysdeps/s390/strncat-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strncat.c: Move to ...
	* sysdeps/s390/strncat.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strncat.h: New file.
2018-12-18 13:57:12 +01:00
Stefan Liebler 8e5a0afbbf S390: Refactor strcat ifunc handling.
The ifunc handling for strcat 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strcat variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strcat variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strcat.
	* sysdeps/s390/multiarch/strcat-c.c: Move to ...
	* sysdeps/s390/strcat-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strcat-vx.S: Move to ...
	* sysdeps/s390/strcat-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strcat.c: Move to ...
	* sysdeps/s390/strcat.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strcat.h: New file.
2018-12-18 13:57:12 +01:00
Stefan Liebler 25218822bd S390: Refactor stpncpy ifunc handling.
The ifunc handling for stpncpy 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove stpncpy variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add stpncpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for stpncpy.
	* sysdeps/s390/multiarch/stpncpy-c.c: Move to ...
	* sysdeps/s390/stpncpy-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/stpncpy-vx.S: Move to ...
	* sysdeps/s390/stpncpy-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/stpncpy.c: Move to ...
	* sysdeps/s390/stpncpy.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-stpncpy.h: New file.
2018-12-18 13:57:11 +01:00
Stefan Liebler d1bdbf3809 S390: Refactor strncpy ifunc handling.
The ifunc handling for strncpy 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.
Glibc internal calls will then also use the "newer" ifunc variant.

Note: The fallback s390-32/s390-64 ifunc variants are now moved to
the strncpy-z900.S files. The s390-32/s390-64 files multiarch/strncpy.c
and strncpy.S are deleted.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strncpy variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strncpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strncpy.
	* sysdeps/s390/multiarch/strncpy-vx.S: Move to ...
	* sysdeps/s390/strncpy-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strncpy.c: Move to ...
	* sysdeps/s390/strncpy.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strncpy.h: New file.
	* sysdeps/s390/s390-64/strncpy.S: Move to ...
	* sysdeps/s390/s390-64/strncpy-z900.S: ... here
	and adjust ifunc handling.
	* sysdeps/s390/s390-32/strncpy.S: Move to ...
	* sysdeps/s390/s390-32/strncpy-z900.S: ... here
	and adjust ifunc handling.
	* sysdeps/s390/s390-32/multiarch/strncpy.c: Delete file.
	* sysdeps/s390/s390-64/multiarch/strncpy.c: Likewise.
2018-12-18 13:57:11 +01:00
Stefan Liebler 970449311d S390: Refactor stpcpy ifunc handling.
The ifunc handling for stpcpy 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove stpcpy variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add stpcpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for stpcpy.
	* sysdeps/s390/multiarch/stpcpy-c.c: Move to ...
	* sysdeps/s390/stpcpy-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/stpcpy-vx.S: Move to ...
	* sysdeps/s390/stpcpy-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/stpcpy.c: Move to ...
	* sysdeps/s390/stpcpy.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-stpcpy.h: New file.
2018-12-18 13:57:11 +01:00
Stefan Liebler 914a4e0557 S390: Refactor strcpy ifunc handling.
The ifunc handling for strcpy 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.
Glibc internal calls will then also use the "newer" ifunc variant.

Note: The fallback s390-32/s390-64 ifunc variants with mvst instruction
are now moved to the unified strcpy-z900.S file which can be used for
31/64bit. The s390-32/s390-64 files multiarch/strcpy.c and strcpy.S
are deleted.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strcpy variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strcpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strcpy.
	* sysdeps/s390/multiarch/strcpy-vx.S: Move to ...
	* sysdeps/s390/strcpy-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strcpy.c: Move to ...
	* sysdeps/s390/strcpy.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strcpy.h: New file.
	* sysdeps/s390/s390-64/strcpy.S: Move to ...
	* sysdeps/s390/strcpy-z900.S: ... here and adjust to be usable
	for 31/64bit and ifunc handling.
	* sysdeps/s390/s390-32/multiarch/strcpy.c: Delete file.
	* sysdeps/s390/s390-64/multiarch/strcpy.c: Likewise.
	* sysdeps/s390/s390-32/strcpy.S: Likewise.
2018-12-18 13:57:10 +01:00
Stefan Liebler de10e44dda S390: Refactor strnlen ifunc handling.
The ifunc handling for strnlen 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strnlen variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strnlen variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strnlen.
	* sysdeps/s390/multiarch/strnlen-c.c: Move to ...
	* sysdeps/s390/strnlen-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strnlen-vx.S: Move to ...
	* sysdeps/s390/strnlen-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strnlen.c: Move to ...
	* sysdeps/s390/strnlen.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strnlen.h: New file.
2018-12-18 13:57:10 +01:00
Stefan Liebler ff3ca3743a S390: Refactor strlen ifunc handling.
The ifunc handling for strlen 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.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strlen variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strlen variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strlen.
	* sysdeps/s390/multiarch/strlen-c.c: Move to ...
	* sysdeps/s390/strlen-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strlen-vx.S: Move to ...
	* sysdeps/s390/strlen-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strlen.c: Move to ...
	* sysdeps/s390/strlen.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strlen.h: New file.
2018-12-18 13:57:10 +01:00
Stefan Liebler d2c4c403fe S390: Add z13 memmem ifunc variant.
The new vector variant of memmem is using the common code
implementation, but instead of calling the default
mem* functions, the vector variants are called.

ChangeLog:

	* sysdeps/s390/Makefile (sysdep_routines): Add memmem variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Add ifunc variants for memmem.
	* sysdeps/s390/ifunc-memmem.h: New file.
	* sysdeps/s390/memmem.c: Likewise.
	* sysdeps/s390/memmem-c.c: Likewise.
	* sysdeps/s390/memmem-vx.c: Likewise.
2018-12-18 13:57:09 +01:00
Stefan Liebler 8c25dddd2e S390: Add z13 strstr ifunc variant.
The new vector variant of strstr is using the common code
implementation, but instead of calling the default
str* / mem* functions, the vector variants are called.

ChangeLog:

	* sysdeps/s390/Makefile (sysdep_routines): Add strstr variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Add ifunc variants for strstr.
	* sysdeps/s390/ifunc-strstr.h: New file.
	* sysdeps/s390/strstr.c: Likewise.
	* sysdeps/s390/strstr-c.c: Likewise.
	* sysdeps/s390/strstr-vx.c: Likewise.
2018-12-18 13:57:09 +01:00
Stefan Liebler cdd927d98c S390: Add z13 memmove ifunc variant.
This patch introduces a z13 specific ifunc variant for memmove.
As the common code implementation, it checks if we can copy from
the beginning to the end - with z196 memcpy implementation - or
if we have to copy from the end to the beginning.
The latter case is done by using vector load/store instructions.

If vector instructions are not available, the common-code is
used as fallback.  Therefore it is implemented in memmove-c with
a different name.
Furthermore the ifunc logic decides if we need the common-code
implementation at all.  If vector instructions are supported
due to the minimum architecture level set we can skip the
common-code ifunc variant.

ChangeLog:

	* sysdeps/s390/Makefile (sysdep_routines): Add memmove-c.
	* sysdeps/s390/ifunc-memcpy.h (HAVE_MEMMOVE_IFUNC,
	HAVE_MEMMOVE_IFUNC_AND_VX_SUPPORT, MEMMOVE_DEFAULT,
	HAVE_MEMMOVE_C, MEMMOVE_C,  HAVE_MEMMOVE_Z13, MEMMOVE_Z13):
	New defines.
	* sysdeps/s390/memcpy-z900.S: Add z13 memmove implementation.
	* sysdeps/s390/memmove-c.c: New file.
	* sysdeps/s390/memmove.c: Likewise.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Add ifunc variants for memmove.
2018-12-18 13:57:08 +01:00
Stefan Liebler 2ee1bc57ab S390: Add configure check to detect z13 as mininum architecture level set.
Add a configure check for z13 in the same way as done for z196.

ChangeLog:

	* config.h.in (HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT): New undefine.
	* sysdeps/s390/configure.ac: Add check for z13 support.
	* sysdeps/s390/configure: Regenerated.
2018-12-18 13:57:08 +01:00
Stefan Liebler d097d97626 S390: Use memcpy for forward cases in memmove.
The s390/s390x memcpy implementations are safe to be
used by memmove.  Starting with this commit, memmove is
using memcpy for the forward cases on s390.

ChangeLog:

	* sysdeps/s390/memcopy.h: New file.
2018-12-18 13:57:07 +01:00
Stefan Liebler e099aab060 S390: Remove s390 specific implementation of bcopy.
Nowadays gcc is automatically replacing a call to bcopy
with a call to memmove.  Thus only old binaries will call
the s390 specific bcopy implementation.

The s390 specific implementation is using an own
implementation for memcpy in the forward case and is
relying on memmove in the backward case.

After removing the s390 specific bcopy, the common code
bcopy is used.  It just performs a tail call to memmove.

ChangeLog:
	* sysdeps/s390/s390-32/bcopy.S: Remove.
	* sysdeps/s390/s390-64/bcopy.S: Likewise.
2018-12-18 13:57:07 +01:00
Stefan Liebler 18eb862d45 S390: Refactor memcpy/mempcpy ifunc handling.
This patch moves all ifunc variants for memcpy/mempcpy
to sysdeps/s390/memcpy-z900.S. The configure-check/preprocessor logic
in sysdeps/s390/ifunc-memcpy.h decides if ifunc is needed at all
and which ifunc variants should be available.
E.g. if the compiler/assembler already supports z196 by default,
the older ifunc variants are not included.
If we only need the newest ifunc variant,
then we can skip ifunc at all.

Therefore the ifunc-resolvers and __libc_ifunc_impl_list are adjusted
in order to handle only the available ifunc variants.

ChangeLog:

	* sysdeps/s390/ifunc-memcpy.h: New File.
	* sysdeps/s390/memcpy.S: Move to ...
	* sysdeps/s390/memcpy-z900.S ... here.
	Move implementations from memcpy-s390x.s to here.
	* sysdeps/s390/multiarch/memcpy-s390x.S: Delete File.
	* sysdeps/s390/multiarch/Makefile (sysdep_routines):
	Remove memcpy/mempcpy variants.
	* sysdeps/s390/Makefile (sysdep_routines):
	Add memcpy/mempcpy variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Adjust ifunc variants for
	memcpy and mempcpy.
	* sysdeps/s390/multiarch/memcpy.c: Move ifunc resolver
	to ...
	* sysdeps/s390/memcpy.c: ... here.
	Adjust ifunc variants for memcpy.
	* sysdeps/s390/multiarch/mempcpy.c: Move to ...
	* sysdeps/s390/mempcpy.c: ... here.
	Adjust ifunc variants for mempcpy.
	* sysdeps/s390/mempcpy.S: Delete file.
2018-12-18 13:57:06 +01:00
Stefan Liebler df3eb8de31 S390: Unify 31/64bit memcpy.
The implementation of memcpy/mempcpy for s390-32 (31bit)
and s390-64 (64bit) is nearly the same.
This patch unifies it for maintability reasons.

__mem[p]cpy_z10 and __mem[p]cpy_z196 differs between 31 and 64bit:
-31bit needs .machinemode "zarch_nohighgprs" and llgfr   %r4,%r4
-lr vs lgr; lgr can be also used on 31bit as this ifunc variant
is only called if we are on a zarch machine.

__mem[p]cpy_default differs between 31 and 64bit:
-Some 31bit vs 64bit instructions (e.g. ltr vs ltgr.
Solved with 31/64 specific instruction macros).
-The address of mvc instruction is setup in different ways
(larl vs bras). Solved with #if defined __s390x__.

__memcpy_mvcle differs between 31 and 64bit:
-lr vs lgr; ahi vs aghi;
Solved with 31/64bit specific instruction macros.

Otherwise 31/64bit implementation has the same structure of the code.

ChangeLog:

	* sysdeps/s390/s390-64/memcpy.S: Move to ...
	* sysdeps/s390/memcpy.S: ... here.
	Adjust to be usable for 31/64bit.
	* sysdeps/s390/s390-32/memcpy.S: Delete File.
	* sysdeps/s390/multiarch/Makefile (sysdep_routines): Add memcpy.
	* sysdeps/s390/s390-32/multiarch/Makefile: Delete file.
	* sysdeps/s390/s390-64/multiarch/Makefile: Likewise.
	* sysdeps/s390/s390-64/multiarch/memcpy-s390x.S: Move to ...
	* sysdeps/s390/multiarch/memcpy-s390x.S: ... here.
	Adjust to be usable for 31/64bit.
	* sysdeps/s390/s390-32/multiarch/memcpy-s390.S: Delete File.
	* sysdeps/s390/s390-64/multiarch/memcpy.c: Move to ...
	* sysdeps/s390/multiarch/memcpy.c: ... here.
	* sysdeps/s390/s390-32/multiarch/memcpy.c: Delete File.
2018-12-18 13:57:06 +01:00
Stefan Liebler b7e024a838 S390: Refactor memcmp ifunc handling.
This patch moves all ifunc variants for memcmp
to sysdeps/s390/memcmp-z900.S. The configure-check/preprocessor logic
in sysdeps/s390/ifunc-memcmp.h decides if ifunc is needed at all
and which ifunc variants should be available.
E.g. if the compiler/assembler already supports z196 by default,
the older ifunc variants are not included.
If we only need the newest ifunc variant,
then we can skip ifunc at all.

Therefore the ifunc-resolvers and __libc_ifunc_impl_list are adjusted
in order to handle only the available ifunc variants.

ChangeLog:

	* sysdeps/s390/ifunc-memcmp.h: New File.
	* sysdeps/s390/memcmp.S: Move to ...
	* sysdeps/s390/memcmp-z900.S ... here.
	Move implementations from memcmp-s390x.s to here.
	* sysdeps/s390/multiarch/memcmp-s390x.S: Delete File.
	* sysdeps/s390/multiarch/Makefile (sysdep_routines):
	Remove memcmp variants.
	* sysdeps/s390/Makefile (sysdep_routines):
	Add memcmp variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Adjust ifunc variants for
	memcmp.
	* sysdeps/s390/multiarch/memcmp.c: Move ifunc resolver
	to ...
	* sysdeps/s390/memcmp.c: ... here.
	Adjust ifunc variants for memcmp.
2018-12-18 13:57:05 +01:00
Stefan Liebler 6c6b8c7470 S390: Unify 31/64bit memcmp.
The implementation of memcmp for s390-32 (31bit) and
s390-64 (64bit) is nearly the same.
This patch unifies it for maintability reasons.

__memcmp_z10 and __memcmp_z196 differs between 31 and 64bit:
-31bit needs .machinemode "zarch_nohighgprs" and llgfr   %r4,%r4
-lr vs lgr and some other instructions:
But lgr and co can be also used on 31bit as this ifunc variant
is only called if we are on a zarch machine.

__memcmp_default differs between 31 and 64bit:
-Some 31bit vs 64bit instructions (e.g. ltr vs ltgr.
Solved with 31/64 specific instruction macros).
-The address of mvc instruction is setup in different ways
(larl vs bras). Solved with #if defined __s390x__.

Otherwise 31/64bit implementation has the same structure of the code.

ChangeLog:

	* sysdeps/s390/s390-64/memcmp.S: Move to ...
	* sysdeps/s390/memcmp.S: ... here.
	Adjust to be usable for 31/64bit.
	* sysdeps/s390/s390-32/memcmp.S: Delete File.
	* sysdeps/s390/multiarch/Makefile (sysdep_routines): Add memcmp.
	* sysdeps/s390/s390-32/multiarch/Makefile (sysdep_routines):
	Remove memcmp.
	* sysdeps/s390/s390-64/multiarch/Makefile: Likewise.
	* sysdeps/s390/s390-64/multiarch/memcmp-s390x.S: Move to ...
	* sysdeps/s390/multiarch/memcmp-s390x.S: ... here.
	Adjust to be usable for 31/64bit.
	* sysdeps/s390/s390-32/multiarch/memcmp-s390.S: Delete File.
	* sysdeps/s390/s390-64/multiarch/memcmp.c: Move to ...
	* sysdeps/s390/multiarch/memcmp.c: ... here.
	* sysdeps/s390/s390-32/multiarch/memcmp.c: Delete File.
2018-12-18 13:57:05 +01:00
Stefan Liebler 07be392807 S390: Implement bzero with memset.
This patch removes the bzero s390 implementation with mvcle and
adds entry points for bzero in memset ifunc variants.
Therefore an ifunc resolver is implemented for bzero, too.

ChangeLog:

	* sysdeps/s390/s390-32/bzero.S: Delete file.
	* sysdeps/s390/s390-64/bzero.S: Likewise.
	* sysdeps/s390/Makefile (sysdep_routines): Add bzero.
	* sysdeps/s390/bzero.c: New file.
	* sysdeps/s390/memset-z900.S: Add bzero entry points.
	* sysdeps/s390/ifunc-memset.h: Add bzero function macros.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Add bzero ifunc variants.
2018-12-18 13:57:05 +01:00
Stefan Liebler 712a254a97 S390: Refactor memset ifunc handling.
This patch moves all ifunc variants for memset
to sysdeps/s390/memset-z900.S. The configure-check/preprocessor logic
in sysdeps/s390/ifunc-memset.h decides if ifunc is needed at all
and which ifunc variants should be available.
E.g. if the compiler/assembler already supports z196 by default,
the older ifunc variants are not included.
If we only need the newest ifunc variant,
then we can skip ifunc at all.

Therefore the ifunc-resolvers and __libc_ifunc_impl_list are adjusted
in order to handle only the available ifunc variants.

ChangeLog:

	* sysdeps/s390/ifunc-memset.h: New File.
	* sysdeps/s390/memset.S: Move to ...
	* sysdeps/s390/memset-z900.S ... here.
	Move implementations from memset-s390x.s to here.
	* sysdeps/s390/multiarch/memset-s390x.S: Delete File.
	* sysdeps/s390/multiarch/Makefile (sysdep_routines):
	Remove memset variants.
	* sysdeps/s390/Makefile (sysdep_routines):
	Add memset variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Adjust ifunc variants for
	memset.
	* sysdeps/s390/multiarch/memset.c: Move ifunc resolver
	to ...
	* sysdeps/s390/memset.c: ... here.
	Adjust ifunc variants for memset.
2018-12-18 13:57:04 +01:00
Stefan Liebler 5f1743d118 S390: Unify 31/64bit memset.
The implementation of memset for s390-32 (31bit) and
s390-64 (64bit) is nearly the same.
This patch unifies it for maintability reasons.

__memset_z10 and __memset_z196 differs between 31 and 64bit:
-31bit needs .machinemode "zarch_nohighgprs" and llgfr   %r4,%r4
-lr vs lgr and some other instructions:
But lgr and co can be also used on 31bit as this ifunc variant
is only called if we are on a zarch machine.

__memset_default differs between 31 and 64bit:
-Some 31bit vs 64bit instructions (e.g. ltr vs ltgr.
Solved with 31/64 specific instruction macros).
-The address of mvc instruction is setup in different ways
(larl vs bras). Solved with #if defined __s390x__.

Otherwise 31/64bit implementation has the same structure of the code.

ChangeLog:

	* sysdeps/s390/s390-64/memset.S: Move to ...
	* sysdeps/s390/memset.S: ... here.
	Adjust to be usable for 31/64bit.
	* sysdeps/s390/s390-32/memset.S: Delete File.
	* sysdeps/s390/multiarch/Makefile (sysdep_routines): Add memset.
	* sysdeps/s390/s390-32/multiarch/Makefile (sysdep_routines):
	Remove memset.
	* sysdeps/s390/s390-64/multiarch/Makefile: Likewise.
	* sysdeps/s390/s390-64/multiarch/memset-s390x.S: Move to ...
	* sysdeps/s390/multiarch/memset-s390x.S: ... here.
	Adjust to be usable for 31/64bit.
	* sysdeps/s390/s390-32/multiarch/memset-s390.S: Delete File.
	* sysdeps/s390/s390-64/multiarch/memset.c: Move to ...
	* sysdeps/s390/multiarch/memset.c: ... here.
	* sysdeps/s390/s390-32/multiarch/memset.c: Delete File.
2018-12-18 13:57:04 +01:00
Stefan Liebler e8023f2685 S390: Use hwcap instead of dl_hwcap in ifunc-resolvers.
The renaming of hwcap arguments in ifunc-resolvers is needed
in order to prepare for further commits which refactors
ifunc handling for memset, memcmp, and memcpy.  Now you are able
to use s390_libc_ifunc_init which stores the stfle bits
within the expression for an ifunc-resolver generated by
s390_libc_ifunc_expr.

ChangeLog:

	* sysdeps/s390/multiarch/ifunc-resolve.h
	(s390_libc_ifunc_init, s390_libc_ifunc,
	s390_vx_libc_ifunc2_redirected): Use hwcap instead of dl_hwcap.
2018-12-18 13:57:03 +01:00
Stefan Liebler b8686c0d70 S390: Add configure check to detect z10 as mininum architecture level set.
Add a configure check for z10 in the same way as done for z196.

ChangeLog:

	* config.h.in (HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT): New undefine.
	* sysdeps/s390/configure.ac: Add check for z10 support.
	* sysdeps/s390/configure: Regenerated.
2018-12-18 13:57:03 +01:00
H.J. Lu cd815050e5 x86: Merge i386/x86_64 atomic-machine.h
Merge i386 and x86_64 atomic-machine.h to x86 atomic-machine.h.

Tested on i686 and x86_64 as well as with build-many-glibcs.py.

	* sysdeps/i386/atomic-machine.h: Merged with ...
	* sysdeps/x86_64/atomic-machine.h: To ...
	* sysdeps/x86/atomic-machine.h: This.  New file.
2018-12-18 04:25:26 -08:00
Florian Weimer 053c52b177 locale: Rewrite locale/gen-translit.pl in Python
This commit does not change the generated output file.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-12-18 11:36:29 +01:00
Florian Weimer 40e6c1ec1f localedata: Remove executable bit from localedata/locales/bi_VU [BZ #23995] 2018-12-18 10:56:21 +01:00
Albert ARIBAUD (3ADEV) bfb79db4c3 Fix __TIMERSIZE and @theglibcadj typos
Fix following typos in parent commit:
- ChangeLog: __TIMERSIZE should be __TIMESIZE
- manual/maint.texi: @theglibcadj should be @glibcadj
2018-12-18 10:47:26 +01:00
Albert ARIBAUD (3ADEV) 6e15f3e26b Y2038: add function __localtime64
Tested with 'make check' on x86_64-linux-gnu and i686-linux.gnu.

	* include/time.h
	(__localtime64): Add.
	* manual/maint.texi: Document Y2038 symbol handling.
	* time/localtime.c
	(__localtime64): Add.
	[__TIMERSIZE != 64] (__localtime): Turn into a wrapper.
2018-12-17 22:56:15 +01:00
Joseph Myers 551e81d9e3 Do not clobber r12 for ia64 syscalls.
GCC mainline now gives errors for an asm that clobbers the stack
pointer.  According to
<https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html> GCC
previously ignored such a clobber; thus, this patch removes it from
the clobbers for ia64 syscalls.

Tested with build-many-glibcs.py for ia64-linux-gnu.

	* sysdeps/unix/sysv/linux/ia64/sysdep.h (ASM_CLOBBERS_6_COMMON):
	Do not clobber r12.
2018-12-17 18:31:50 +00:00
Joseph Myers df648905e7 Add test that MAP_* constants agree with kernel.
Continuing the process of building up and using Python infrastructure
for extracting and using values in headers, this patch adds a test
that MAP_* constants from sys/mman.h agree with those in the Linux
kernel headers.  (Other sys/mman.h constants could be added to the
test separately.)

This set of constants has grown over time, so the generic code is
enhanced to allow saying extra constants are OK on either side of the
comparison (where the caller sets those parameters based on the Linux
kernel headers version, compared with the version the headers were
last updated from).  Although the test is a custom Python file, my
intention is to move in future to a single Python script for such
tests and text files it takes as inputs, once there are enough
examples to provide a guide to the common cases in such tests (I'd
like to end up with most or all such sets of constants copied from
kernel headers having such tests, and likewise for structure layouts
from the kernel).

The Makefile code is essentially the same as for tst-signal-numbers,
but I didn't try to find an object file to depend on to represent the
dependency on the headers used by the test (the conform/ tests don't
try to represent such header dependencies at all, for example).

Tested with build-many-glibcs.py, and also for x86_64 with older
kernel headers.

	* scripts/glibcextract.py (compare_macro_consts): Take parameters
	to allow extra macros from first or second sources.
	* sysdeps/unix/sysv/linux/tst-mman-consts.py: New file.
	* sysdeps/unix/sysv/linux/Makefile [$(subdir) = misc]
	(tests-special): Add $(objpfx)tst-mman-consts.out.
	($(objpfx)tst-mman-consts.out): New makefile target.
2018-12-17 18:29:36 +00:00
Mao Han 6bbfc5c09f Add statx conditionals for wordsize-32 *xstat.c
Linux kernel have remove stat64 family from default syscall set, new
implementations with statx is needed when __ARCH_WANT_STAT64 is not
define. This patch add conditionals for relevant functions, using statx
system call to get information and then copy to the return buf, ref to
include/linux/fs.h from linux kernel.

	* sysdeps/unix/sysv/linux/Makefile: Add statx_cp.c.
	* sysdeps/unix/sysv/linux/fxstat64.c: Add conditionals for kernel
	without stat64 system call support.
	* sysdeps/unix/sysv/linux/fxstatat64.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/fxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/lxstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/xstat.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/xstat64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/statx_cp.c: New file.
	* sysdeps/unix/sysv/linux/statx_cp.c: Likewise.
	* sysdeps/unix/sysv/linux/statx_cp.h: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/statx_cp.c: Likewise.
2018-12-17 09:20:02 +08:00
Paul Eggert ef202e530c regex: fix storage-exhaustion error
[BZ #18040]
* posix/regexec.c (get_subexp):
Do not continue if storage is exhausted.
2018-12-16 07:08:29 -08:00
Assaf Gordon 077caf61d8 regex: fix heap-use-after-free error
[BZ #18040]
Problem reported by Saito Takaaki <tails.saito@gmail.com> in
https://debbugs.gnu.org/32592
Call stack get_subexp->get_subexp_sub->clean_state_log_if_needed may
call extend_buffers which reallocates the re_string_t internal buffer.
Local variable 'buf' was not updated in such case, resulting in
use-after-free.
* posix/regexec.c (get_subexp): Update 'buf' after call to
get_subexp_sub.
2018-12-16 07:08:29 -08:00
Florian Weimer 0c1719e65b support: Do not require overflow builtin in support/blob_repeat.c
It is only available in GCC 5 and later.

Tested-by: Romain Naour <romain.naour@gmail.com>
2018-12-15 18:58:56 +01:00
Joseph Myers 033a2c0a20 Remove x86 mathinline.h asinh, acosh, atanh inlines.
Continuing the removal of bits/mathinline.h inlines that would better
be done by the compiler, this patch removes x86 inlines for asinh,
acosh and atanh functions (only for fast-math, non-SSE 32-bit x86).
I've filed <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88502> for
adding such inlines as an optimization in GCC.

Tested for x86_64 and x86.

	* sysdeps/x86/fpu/bits/mathinline.h (asinh): Remove inline
	definition.
	(acosh): Likewise.
	(atanh): Likewise.
2018-12-14 22:35:57 +00:00
Florian Weimer e361dc043d manual: Document thread/task IDs for Linux
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-12-14 21:11:09 +01:00
Gabriel F. T. Gomes bd51ff5ed0 Add tests for the long double version of ecvt and fcvt
The test case misc/tst-efgcvt.c only tests the double variants of the
Old-fashioned System V number-to-string functions: ecvt, fcvt, and their
re-entrant counterparts.  With a few macros, the code can be reused for
the long double versions of these functions.  A future patch will reuse
it again for IEEE long double on powerpc64le.

Tested for powerpc and powerpc64le.
2018-12-14 11:38:07 -02:00
Stefan Liebler 268bb71e47 Add missing libnss_testX.so requirement for tst-nss-test3.
Sometimes tst-nss-test3 fails with:
error: test-container.c:386: unable to open .../nss/libnss_test1.so for reading

The test tst-nss-test3 which runs in a container needs
libnss_test[12].so. (see e.g. tst-nss-test3.script).
Before this test was moved from tests to tests-container variable,
the requirement was met.  Thus this patch adds this requirement
also for tests in tests-container.

ChangeLog:

	* nss/Makefile (tst-nss-test3.out): New rule.
2018-12-14 09:50:53 +01:00
Joseph Myers db6df070cf Do not clobber sp in _hurd_stack_setup.
GCC mainline now gives errors for an asm that clobbers the stack
pointer.  According to
<https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html> GCC
previously ignored such a clobber; thus, this patch removes it from
_hurd_stack_setup.

Tested with build-many-glibcs.py for i686-gnu.

	* sysdeps/mach/hurd/i386/init-first.c (_hurd_stack_setup): Do not
	clobber sp.
2018-12-13 22:36:33 +00:00
Carlos O'Donell ade8b817fe x86: Add Hygon Dhyana support.
This patch fix Hygon Dhyana processor CPU Vendor ID detection
problem in glibc sysdep module, current glibc codes doesn't
recognize Dhyana CPU Vendor ID("HygonGenuine") and set kind to
arch_kind_other, which result to incorrect zero value for
__cache_sysconf() syscall. As Hygon Dhyana share most
architecture feature as AMD Family 17h, this patch add Hygon CPU
Vendor ID check and setup kind to arch_kind_amd and reuse AMD
code path, which lead to correct return value in
__cache_sysconf() syscall. we run the glibc test suite for both
Hygon Dhyana and AMD EPYC and found no failure case.

Background:
Chengdu Haiguang IC Design Co., Ltd (Hygon) is a Joint Venture
between AMD and Haiguang Information Technology Co.,Ltd., aims at
providing high performance x86 processor for China server market.
Its first generation processor codename is Dhyana, which
originates from AMD technology and shares most of the
architecture with AMD's family 17h, but with different CPU Vendor
ID("HygonGenuine")/Family series number(Family 18h).

Related Hygon kernel patch can be found on
http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn

Signed-off-by: fanjinke <fanjinke@hygon.cn>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-12-13 09:25:20 -05:00
Andreas Schwab f21e8f8ca4 Fix rwlock stall with PREFER_WRITER_NONRECURSIVE_NP (bug 23861)
In the read lock function (__pthread_rwlock_rdlock_full) there was a
code path which would fail to reload __readers while waiting for
PTHREAD_RWLOCK_RWAITING to change. This failure to reload __readers
into a local value meant that various conditionals used the old value
of __readers and with only two threads left it could result in an
indefinite stall of one of the readers (waiting for PTHREAD_RWLOCK_RWAITING
to go to zero, but it never would).
2018-12-13 12:22:30 +01:00
Andreas Schwab 3d265911c2 Reindent nptl/pthread_rwlock_common.c 2018-12-13 12:21:41 +01:00
Joseph Myers bf8ae8c09a Remove x86 mathinline.h hypot inline.
Continuing the removal of bits/mathinline.h inlines that would better
be done by the compiler, this patch removes an x86 inline for hypot
functions (only for fast-math, only for non-SSE 32-bit x86).  I've
filed <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88474> for adding
such an inline as an optimization in GCC.

Tested for x86_64 and x86.

	* sysdeps/x86/fpu/bits/mathinline.h (hypot): Remove inline
	definition.
2018-12-12 22:33:06 +00:00