Commit Graph

225 Commits

Author SHA1 Message Date
Florian Weimer 3a3fb75572 posix: New function posix_spawn_file_actions_addfchdir_np [BZ #17405]
Along with posix_spawn_file_actions_addchdir,
posix_spawn_file_actions_addfchdir is the subject of a change proposal
for POSIX: <http://austingroupbugs.net/view.php?id=1208>
2018-12-07 16:04:05 +01:00
Szabolcs Nagy a502c5294b Remove the error handling wrapper from pow
Introduce new pow symbol version that doesn't do SVID compatible error
handling.  The standard errno and fp exception based error handling is
inline in the new code and does not have significant overhead.

The wrapper is disabled for sysdeps/ieee754/dbl-64 by using empty
w_pow.c and enabled for targets with their own pow implementation or
ifunc dispatch on __ieee754_pow by including math/w_pow.c.

The compatibility symbol version still uses the wrapper with SVID error
handling around the new code.  There is no new symbol version nor
compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv).

On targets where previously powl was an alias of pow, now it points to
the compatibility symbol with the wrapper, because it still need the
SVID compatible error handling.  This affects NO_LONG_DOUBLE (e.g. arm)
and LONG_DOUBLE_COMPAT (e.g. alpha) targets as well.

The __pow_finite symbol is now an alias of pow.  Both __pow_finite and
pow set errno and thus not const functions.

The ia64 asm is changed so the compat and new symbol versions map to the
same address.

On x86_64 #include <math.h> was added before macro definitions that
may affect that header.

Tested with build-many-glibcs.py.

	* math/Versions (GLIBC_2.29): Add pow.
	* math/w_pow_compat.c (__pow_compat): Change to versioned compat
	symbol.
	* math/w_pow.c: New file.
	* sysdeps/i386/fpu/w_pow.c: New file.
	* sysdeps/ia64/fpu/e_pow.S: Add versioned symbols.
	* sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Rename to __pow
	and add necessary aliases.
	* sysdeps/ieee754/dbl-64/w_pow.c: New file.
	* sysdeps/m68k/m680x0/fpu/w_pow.c: New file.
	* sysdeps/mach/hurd/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Update.
	* sysdeps/x86_64/fpu/multiarch/e_pow-fma.c (__ieee754_pow): Rename to
	__pow.
	* sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c (__ieee754_pow): Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_pow.c (__ieee754_pow): Likewise.
	* sysdeps/x86_64/fpu/multiarch/w_pow.c: New file.
2018-11-21 09:58:36 +00:00
Szabolcs Nagy 718d6542f2 Remove the error handling wrapper from log2
Introduce new log2 symbol version that doesn't do SVID compatible error
handling.  The standard errno and fp exception based error handling is
inline in the new code and does not have significant overhead.

The wrapper is disabled for sysdeps/ieee754/dbl-64 by using empty
w_log2.c and enabled for targets with their own log2 implementation by
including math/w_log2.c.

The compatibility symbol version still uses the wrapper with SVID error
handling around the new code.  There is no new symbol version nor
compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv).

On targets where previously log2l was an alias of log2, now it points to
the compatibility symbol with the wrapper, because it still need the
SVID compatible error handling.  This affects NO_LONG_DOUBLE (e.g. arm)
and LONG_DOUBLE_COMPAT (e.g. alpha) targets as well.

The __log2_finite symbol is now an alias of log2.  Both __log2_finite
and log2 set errno and thus not const functions.

The ia64 asm is changed so the compat and new symbol versions map to the
same address.

Tested with build-many-glibcs.py.

	* math/Versions (GLIBC_2.29): Add log2.
	* math/w_log2_compat.c (__log2_compat): Change to versioned compat
	symbol.
	* math/w_log2.c: New file.
	* sysdeps/i386/fpu/w_log2.c: New file.
	* sysdeps/ia64/fpu/e_log2.S: Add versioned symbols.
	* sysdeps/ieee754/dbl-64/e_log2.c (__ieee754_log2): Rename to __log2
	and add necessary aliases.
	* sysdeps/ieee754/dbl-64/w_log2.c: New file.
	* sysdeps/m68k/m680x0/fpu/w_log2.c: New file.
	* sysdeps/mach/hurd/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Update.
2018-11-21 09:57:21 +00:00
Szabolcs Nagy f29b7c492d Remove the error handling wrapper from log
Introduce new log symbol version that doesn't do SVID compatible error
handling.  The standard errno and fp exception based error handling is
inline in the new code and does not have significant overhead.

The wrapper is disabled for sysdeps/ieee754/dbl-64 by using empty
w_log.c and enabled for targets with their own log implementation by
including math/w_log.c.

The compatibility symbol version still uses the wrapper with SVID error
handling around the new code.  There is no new symbol version nor
compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv).

On targets where previously logl was an alias of log, now it points to
the compatibility symbol with the wrapper, because it still need the
SVID compatible error handling.  This affects NO_LONG_DOUBLE (e.g. arm)
and LONG_DOUBLE_COMPAT (e.g. alpha) targets as well.

The __log_finite symbol is now an alias of log.  Both __log_finite and
log set errno and thus not const functions.

The ia64 asm is changed so the compat and new symbol versions map to the
same address.

On x86_64 #include <math.h> was added before macro definitions that may
affect that header.

Tested with build-many-glibcs.py.

	* math/Versions (GLIBC_2.29): Add log.
	* math/w_log_compat.c (__log_compat): Change to versioned compat
	symbol.
	* math/w_log.c: New file.
	* sysdeps/i386/fpu/w_log.c: New file.
	* sysdeps/ia64/fpu/e_log.S: Update.
	* sysdeps/ieee754/dbl-64/e_log.c (__ieee754_log): Rename to __log
	and add necessary aliases.
	* sysdeps/ieee754/dbl-64/w_log.c: New file.
	* sysdeps/m68k/m680x0/fpu/w_log.c: New file.
	* sysdeps/mach/hurd/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Update.
	* sysdeps/x86_64/fpu/multiarch/e_log-avx.c (__ieee754_log): Rename to
	__log.
	* sysdeps/x86_64/fpu/multiarch/e_log-fma.c (__ieee754_log): Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_log-fma4.c (__ieee754_log): Likewise.
	* sysdeps/x86_64/fpu/multiarch/e_log.c (__ieee754_log): Likewise.
	* sysdeps/x86_64/fpu/multiarch/w_log.c: New file.
2018-11-21 09:56:27 +00:00
Szabolcs Nagy c20a10561a Remove the error handling wrapper from exp and exp2
Introduce new exp and exp2 symbol version that don't do SVID compatible
error handling.  The standard errno and fp exception based error handling
is inline in the new code and does not have significant overhead.

The double precision wrappers are disabled for sysdeps/ieee754/dbl-64
by using empty w_exp.c and w_exp2.c files, the math/w_exp.c and
math/w_exp2.c files use the wrapper template and can be included by
targets that have their own exp and exp2 implementations or use ifunc
on the glibc internal __ieee754_exp symbol.

The compatibility symbol versions still use the wrapper with SVID error
handling around the new code.  There is no new symbol version nor
compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv).

On targets where previously expl and exp2l were aliases of exp and exp2,
now they point to the compatibility symbols with the wrapper, because
they still need the SVID compatible error handling.  This affects
NO_LONG_DOUBLE (e.g arm) and LONG_DOUBLE_COMPAT (e.g. alpha) targets
as well.

The _finite symbols are now aliases of the standard symbols (they have
no performance advantage anymore).  Both the standard symbols and
_finite symbols set errno and thus not const functions.

The ia64 asm is changed so the compat and new symbol versions map to the
same address.

On x86_64 #include <math.h> was added before macro definitions that may
affect that header (the new macro name is __exp instead of __ieee754_exp
which breaks some math.h macros).

Tested with build-many-glibcs.py.

	* math/Versions (GLIBC_2.29): Add exp and exp2.
	* math/w_exp2_compat.c (__exp2_compat): Change to versioned compat
	symbol, handle NO_LONG_DOUBLE and LONG_DOUBLE_COMPAT explicitly.
	* math/w_exp_compat.c (__exp_compat): Likewise.
	* math/w_exp.c: New file.
	* math/w_exp2.c: New file.
	* sysdeps/i386/fpu/w_exp.c: New file.
	* sysdeps/i386/fpu/w_exp2.c: New file.
	* sysdeps/ia64/fpu/e_exp.S: Add versioned symbols.
	* sysdeps/ia64/fpu/e_exp2.S: Likewise.
	* sysdeps/ieee754/dbl-64/e_exp.c (__ieee754_exp): Rename to __exp
	and add necessary aliases.
	* sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Rename to __exp2
	and add necessary aliases.
	* sysdeps/ieee754/dbl-64/w_exp.c: New file.
	* sysdeps/ieee754/dbl-64/w_exp2.c: New file.
	* sysdeps/m68k/m680x0/fpu/w_exp.c: New file.
	* sysdeps/m68k/m680x0/fpu/w_exp2.c: New file.
	* sysdeps/mach/hurd/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Update.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Update.
	* sysdeps/x86_64/fpu/multiarch/e_exp-avx.c (__exp1): Remove.
	(__ieee754_exp): Rename to __exp.
	* sysdeps/x86_64/fpu/multiarch/e_exp-fma.c (__exp1): Remove.
	(__ieee754_exp): Rename to __exp.
	* sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c (__exp1): Remove.
	(__ieee754_exp): Rename to __exp.
	* sysdeps/x86_64/fpu/multiarch/e_exp.c (__ieee754_exp): Rename to
	__exp.
	* sysdeps/x86_64/fpu/multiarch/w_exp.c: New file.
2018-11-21 09:55:02 +00:00
Florian Weimer 4a938cb273 posix: New function posix_spawn_file_actions_addchdir_np [BZ #17405] 2018-11-06 16:08:12 +01:00
Adhemerval Zanella c6dd669bed nptl: Add abilist symbols for C11 threads
This patch adds the required abilist symbols for C11 thread support.

Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu,
arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu,
microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu,
powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu,
and x86_64-linux-gnu).

Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu,
arm-linux-gnueabhf, and powerpc64le-linux-gnu.

	[BZ #14092]
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist [GLIBC_2.28]
	(thrd_current, thrd_equal, thrd_sleep, thrd_yield): Add C11 thread
	symbols.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libpthread.abilist [[GLIBC_2.28]
	(call_once, cnd_broadcast, cnd_destroy, cnd_init, cnd_signal,
	cnd_timedwait, cnd_wait, mtx_destroy, mtx_init, mtx_lock,
	mtx_timedlock, mtx_trylock, mtx_unlokc, thrd_create, thrd_detach,
	thrd_exit, thrd_join, tss_create, tss_delete, tss_get, tss_set):
	Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libpthread.abilist: Likewise.
	ikewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist:
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist: Likewise.
2018-07-24 14:07:18 -03:00
Florian Weimer fd70af4552 Add the statx function 2018-07-10 16:14:45 +02:00
Florian Weimer d6da5cb6a8 Add renameat2 function [BZ #17662]
The implementation falls back to renameat if renameat2 is not available
in the kernel (or in the kernel headers) and the flags argument is zero.
Without kernel support, a non-zero argument returns EINVAL, not ENOSYS.
This mirrors what the kernel does for invalid renameat2 flags.
2018-07-05 19:00:10 +02:00
Adhemerval Zanella 06ab719d30 Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251)
This patch fixes the OFD ("file private") locks for architectures that
support non-LFS flock definition (__USE_FILE_OFFSET64 not defined). The
issue in this case is both F_OFD_{GETLK,SETLK,SETLKW} and
F_{SET,GET}L{W}K64 expects a flock64 argument and when using old
F_OFD_* flags with a non LFS flock argument the kernel might interpret
the underlying data wrongly.  Kernel idea originally was to avoid using
such flags in non-LFS syscall, but since GLIBC uses fcntl with LFS
semantic as default it is possible to provide the functionality and
avoid the bogus struct kernel passing by adjusting the struct manually
for the required flags.

The idea follows other LFS interfaces that provide two symbols:

  1. A new LFS fcntl64 is added on default ABI with the usual macros to
     select it for FILE_OFFSET_BITS=64.

  2. The Linux non-LFS fcntl use a stack allocated struct flock64 for
     F_OFD_{GETLK,SETLK,SETLKW} copy the results on the user provided
     struct.

  3. Keep a compat symbol with old broken semantic for architectures
     that do not define __OFF_T_MATCHES_OFF64_T.

So for architectures which defines __USE_FILE_OFFSET64, fcntl64 will
aliased to fcntl and no adjustment would be required.  So to actually
use F_OFD_* with LFS support the source must be built with LFS support
(_FILE_OFFSET_BITS=64).

Also F_OFD_SETLKW command is handled a cancellation point, as for
F_SETLKW{64}.

Checked on x86_64-linux-gnu and i686-linux-gnu.

	[BZ #20251]
	* NEWS: Mention fcntl64 addition.
	* csu/check_fds.c: Replace __fcntl_nocancel by __fcntl64_nocancel.
	* login/utmp_file.c: Likewise.
	* sysdeps/posix/fdopendir.c: Likewise.
	* sysdeps/posix/opendir.c: Likewise.
	* sysdeps/unix/pt-fcntl.c: Likewise.
	* include/fcntl.h (__libc_fcntl64, __fcntl64,
	__fcntl64_nocancel_adjusted): New prototype.
	(__fcntl_nocancel_adjusted): Remove prototype.
	* io/Makefile (routines): Add fcntl64.
	(CFLAGS-fcntl64.c): New rule.
	* io/Versions [GLIBC_2.28] (fcntl64): New symbol.
	[GLIBC_PRIVATE] (__libc_fcntl): Rename to __libc_fcntl64.
	* io/fcntl.h (fcntl64): Add prototype and redirect if
	__USE_FILE_OFFSET64 is defined.
	* io/fcntl64.c: New file.
	* manual/llio.text: Add a note for which commands fcntl acts a
	cancellation point.
	* nptl/Makefile (CFLAGS-fcntl64.c): New rule.
	* sysdeps/mach/hurd/fcntl.c: Alias fcntl to fcntl64 symbols.
	* sysdeps/mach/hurd/i386/libc.abilist [GLIBC_2.28] (fcntl, fcntl64):
	New symbols.
	* sysdeps/unix/sysv/linux/fcntl.c (__libc_fcntl): Fix F_GETLK64,
	F_OFD_GETLK, F_SETLK64, F_SETLKW64, F_OFD_SETLK, and F_OFD_SETLKW for
	non-LFS case.
	* sysdeps/unix/sysv/linux/fcntl64.c: New file.
	* sysdeps/unix/sysv/linux/fcntl_nocancel.c (__fcntl_nocancel): Rename
	to __fcntl64_nocancel.
	(__fcntl_nocancel_adjusted): Rename to __fcntl64_nocancel_adjusted.
	* sysdeps/unix/sysv/linux/not-cancel.h (__fcntl_nocancel): Rename
	to __fcntl64_nocancel.
	* sysdeps/unix/sysv/linux/tst-ofdlocks.c: New file.
	* sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c: Likewise.
	* sysdeps/unix/sysv/linux/Makefile (tests): Add tst-ofdlocks.
	(tests-internal): Add tst-ofdlocks-compat.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist [GLIBC_2.28]
	(fcntl64): New symbol.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libc.abilist [GLIBC_2.28] (fcntl,
	fcntl64): Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilis: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
2018-06-26 13:22:53 -03:00
Joseph Myers 632a6cbe44 Add narrowing divide functions.
This patch adds the narrowing divide functions from TS 18661-1 to
glibc's libm: fdiv, fdivl, ddivl, f32divf64, f32divf32x, f32xdivf64
for all configurations; f32divf64x, f32divf128, f64divf64x,
f64divf128, f32xdivf64x, f32xdivf128, f64xdivf128 for configurations
with _Float64x and _Float128; __nldbl_ddivl for ldbl-opt.

The changes are mostly essentially the same as for the other narrowing
functions, so the description of those generally applies to this patch
as well.

Tested for x86_64, x86, mips64 (all three ABIs, both hard and soft
float) and powerpc, and with build-many-glibcs.py.

	* math/Makefile (libm-narrow-fns): Add div.
	(libm-test-funcs-narrow): Likewise.
	* math/Versions (GLIBC_2.28): Add narrowing divide functions.
	* math/bits/mathcalls-narrow.h (div): Use __MATHCALL_NARROW.
	* math/gen-auto-libm-tests.c (test_functions): Add div.
	* math/math-narrow.h (CHECK_NARROW_DIV): New macro.
	(NARROW_DIV_ROUND_TO_ODD): Likewise.
	(NARROW_DIV_TRIVIAL): Likewise.
	* sysdeps/ieee754/float128/float128_private.h (__fdivl): New
	macro.
	(__ddivl): Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fdiv and
	ddiv.
	(CFLAGS-nldbl-ddiv.c): New variable.
	(CFLAGS-nldbl-fdiv.c): Likewise.
	* sysdeps/ieee754/ldbl-opt/Versions (GLIBC_2.28): Add
	__nldbl_ddivl.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__nldbl_ddivl): New
	prototype.
	* manual/arith.texi (Misc FP Arithmetic): Document fdiv, fdivl,
	ddivl, fMdivfN, fMdivfNx, fMxdivfN and fMxdivfNx.
	* math/auto-libm-test-in: Add tests of div.
	* math/auto-libm-test-out-narrow-div: New generated file.
	* math/libm-test-narrow-div.inc: New file.
	* sysdeps/i386/fpu/s_f32xdivf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_f32xdivf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fdiv.c: Likewise.
	* sysdeps/ieee754/float128/s_f32divf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64divf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64xdivf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_ddivl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_f64xdivf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fdivl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_ddivl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fdivl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_ddivl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fdivl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-ddiv.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-fdiv.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_ddivl.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fdiv.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fdivl.c: Likewise.
	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
	* sysdeps/mach/hurd/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2018-05-17 00:40:52 +00:00
Joseph Myers 69a01461ee Add narrowing multiply functions.
This patch adds the narrowing multiply functions from TS 18661-1 to
glibc's libm: fmul, fmull, dmull, f32mulf64, f32mulf32x, f32xmulf64
for all configurations; f32mulf64x, f32mulf128, f64mulf64x,
f64mulf128, f32xmulf64x, f32xmulf128, f64xmulf128 for configurations
with _Float64x and _Float128; __nldbl_dmull for ldbl-opt.

The changes are mostly essentially the same as for the narrowing add
functions, so the description of those generally applies to this patch
as well.  f32xmulf64 for i386 cannot use precision control as used for
add and subtract, because that would result in double rounding for
subnormal results, so that uses round-to-odd with long double
intermediate result instead.  The soft-fp support involves adding a
new FP_TRUNC_COOKED since soft-fp multiplication uses cooked inputs
and outputs.

Tested for x86_64, x86, mips64 (all three ABIs, both hard and soft
float) and powerpc, and with build-many-glibcs.py.

	* math/Makefile (libm-narrow-fns): Add mul.
	(libm-test-funcs-narrow): Likewise.
	* math/Versions (GLIBC_2.28): Add narrowing multiply functions.
	* math/bits/mathcalls-narrow.h (mul): Use __MATHCALL_NARROW.
	* math/gen-auto-libm-tests.c (test_functions): Add mul.
	* math/math-narrow.h (CHECK_NARROW_MUL): New macro.
	(NARROW_MUL_ROUND_TO_ODD): Likewise.
	(NARROW_MUL_TRIVIAL): Likewise.
	* soft-fp/op-common.h (FP_TRUNC_COOKED): Likewise.
	* sysdeps/ieee754/float128/float128_private.h (__fmull): New
	macro.
	(__dmull): Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fmul and
	dmul.
	(CFLAGS-nldbl-dmul.c): New variable.
	(CFLAGS-nldbl-fmul.c): Likewise.
	* sysdeps/ieee754/ldbl-opt/Versions (GLIBC_2.28): Add
	__nldbl_dmull.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__nldbl_dmull): New
	prototype.
	* manual/arith.texi (Misc FP Arithmetic): Document fmul, fmull,
	dmull, fMmulfN, fMmulfNx, fMxmulfN and fMxmulfNx.
	* math/auto-libm-test-in: Add tests of mul.
	* math/auto-libm-test-out-narrow-mul: New generated file.
	* math/libm-test-narrow-mul.inc: New file.
	* sysdeps/i386/fpu/s_f32xmulf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_f32xmulf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fmul.c: Likewise.
	* sysdeps/ieee754/float128/s_f32mulf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64mulf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64xmulf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_dmull.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_f64xmulf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fmull.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_dmull.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fmull.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_dmull.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fmull.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-dmul.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-fmul.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_dmull.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fmul.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fmull.c: Likewise.
	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
	* sysdeps/mach/hurd/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2018-05-16 00:05:28 +00:00
Joseph Myers b289cd9db8 Ignore absolute symbols in ABI tests.
A recent binutils patch
<https://sourceware.org/ml/binutils/2018-04/msg00336.html> stops the
MIPS linker including the _gp_disp absolute symbol in dynamic symbol
tables.

With older binutils, it is included for MIPS o32 (despite the use of
symbol versioning), and this means that all the ABI test baselines for
MIPS o32 include "_gp_disp _gp_disp A".  This symbol is not
meaningfully part of the ABI for shared libraries, since it always has
to be resolved at static link time to the local definition for the
linked object.

All the other absolute symbols in ABI test baselines are the names of
symbol versions.  I don't think the mere existence of a symbol version
with a given name - as opposed to the contents of that version if
nonempty - is part of the ABI either.  Thus, this patch allows the ABI
tests to pass both before and after the binutils change by changing
abilist.awk not to include absolute symbols in its output, and
changing the baselines accordingly.

Tested for x86_64, and with build-many-glibcs.py.

	* scripts/abilist.awk: Ignore absolute symbols.
	* sysdeps/mach/hurd/i386/ld.abilist: Remove absolute symbols.
	* sysdeps/mach/hurd/i386/libBrokenLocale.abilist: Likewise.
	* sysdeps/mach/hurd/i386/libanl.abilist: Likewise.
	* sysdeps/mach/hurd/i386/libc.abilist: Likewise.
	* sysdeps/mach/hurd/i386/libcrypt.abilist: Likewise.
	* sysdeps/mach/hurd/i386/libdl.abilist: Likewise.
	* sysdeps/mach/hurd/i386/libm.abilist: Likewise.
	* sysdeps/mach/hurd/i386/libnsl.abilist: Likewise.
	* sysdeps/mach/hurd/i386/libpthread.abilist: Likewise.
	* sysdeps/mach/hurd/i386/libresolv.abilist: Likewise.
	* sysdeps/mach/hurd/i386/librt.abilist: Likewise.
	* sysdeps/mach/hurd/i386/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libcidn.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libnss_compat.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libnss_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libnss_dns.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libnss_files.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libnss_hesiod.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libnss_nis.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libnss_nisplus.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libresolv.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libthread_db.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libresolv.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/librt-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libthread_db.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libBrokenLocale.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libutil.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/libmvec.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libnsl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libutil.abilist: Likewise.
2018-05-04 15:46:32 +00:00
Adhemerval Zanella af7e376b00 Consolidate alphasort{64} and versionsort{64} implementation
This patch consolidates both alphasort{64} and versionsort{64}
implementation on just the default dirent/alphasort{64}c and
dirent/versionsort{64} respectively.  It changes the logic
to follow the conventions used on other code consolidation:

  * the non-LFS variant is only built for _DIRENT_MATCHES_DIRENT64 being 0.

  * the LFS variant is always built and aliased to getdents for ABIs
    that define _DIRENT_MATCHES_DIRENT64 to 1.

Also on Linux the compat symbol for old non-LFS dirent64 definition
requires a platform-specific scandir64.c.  For powerpc32 and sparcv9
it requires to add specific arch-implementation to override the
generic Linux one because neither ABI exports an compat symbol for
non-LFS alphasort64 and versionsort64 variant.  It is most likely a
bug and it is also not one that can be fixed (in that there would be
existing binaries expecting both meanings of that symbol at its single
existing version, with binaries expecting the new meaning probably much
more common than those expecting the original meaning of that symbol at
that version).

Checked on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu,
sparcv9-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu, and
powerpc64le-linux-gnu.

	* dirent/alphasort.c (alphasort): Build iff _DIRENT_MATCHES_DIRENT64 is
	defined.
	* dirent/versionsort.c (versionsort): Likewise.
	* dirent/alphasort64.c (alphasort64): Build regardless and alias to
	alphasort if _DIRENT_MATCHES_DIRENT64 is defined.
	* dirent/versionsort64.c (versionsort64): Likewise.
	* sysdeps/unix/sysv/linux/i386/alphasort64.c: Remove file.
	* sysdeps/unix/sysv/linux/arm/alphasort64.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/versionsort64.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/alphasort64.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/versionsort64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/alphasort64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/versionsort64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/versionsort64.c: Likewise.
	* sysdeps/unix/sysv/linux/alphasort64.c: New file.
	* sysdeps/unix/sysv/linux/versionsort64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/alphasort64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/versionsort64.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/alphasort64.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/versionsort64.c: Likewise.
2018-04-23 17:35:16 -03:00
Adhemerval Zanella c0123b3b11 Consolidate scandir{at}{64} implementation
This patch consolidates scandir{at}{64} implementation on just
the default dirent/scandir{at}{64}{_r}.c ones.  It changes the logic
to follow the conventions used on other code consolidation:

  * scandir{at} is only built for _DIRENT_MATCHES_DIRENT64 being 0.

  * scandir{at}{64} is always built and aliased to getdents for ABIs
    that define _DIRENT_MATCHES_DIRENT64 to 1.

Also on Linux the compat symbol for old non-LFS dirent64 definition
requires a platform-specific scandir64.c.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu,
sparcv9-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu, and
powerpc64le-linux-gnu.

	* dirent/scandir-tail-common.c: New file.
	* dirent/scandir-tail.c: Use scandir-tail-common.c.
	(__scandir_tail): Build iff _DIRENT_MATCHES_DIRENT64 is not defined.
	* dirent/scandir.c: Use scandir-tail-common.c.
	* dirent/scandirat.c: Likewise.
	* dirent/scandir64-tail.c: Use scandir-tail-common.c.
	* dirent/scandir64.c (scandir64): Always build and alias to scandir
	if _DIRENT_MATCHES_DIRENT64 is defined.
	* dirent/scandirat64.c (scandirat64): Likewise.
	* include/dirent.h (__scandir_tail): Only define iff
	_DIRENT_MATCHES_DIRENT64 is not defined.
	(__scandir64_tail): Define regardless.
	(__scandirat, scandirat64): Remove libc_hidden_proto.
	* sysdeps/unix/sysv/linux/arm/scandir64.c: Remove file.
	* sysdeps/unix/sysv/linux/m68k/scandir64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/scandir64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/scandir64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/scandir64.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/scandir64.c: Likewise.
	* sysdeps/unix/sysv/linux/scandir64.c: New file.
2018-04-20 13:57:12 -03:00
Adhemerval Zanella 298d0e3129 Consolidate Linux getdents{64} implementation
This patch consolidates Linux getdents{64} implementation on just
the default sysdeps/unix/sysv/linux/getdents{64}{_r}.c ones.

Although this symbol is used only internally, the non-LFS version
still need to be build due the non-LFS getdirentries which requires
its semantic.

The non-LFS default implementation now uses the wordsize-32 as base
which uses getdents64 syscall plus adjustment for overflow (it allows
to use the same code for architectures that does not support non-LFS
getdents syscall).  It has two main differences to wordsize-32 one:

  - DIRENT_SET_DP_INO is added to handle alpha requirement to zero
    the padding.

  - alloca is removed by allocating a bounded temporary buffer (it
    increases stack usage by roughly 276 bytes).

The default implementation handle the Linux requirements:

  * getdents is only built for _DIRENT_MATCHES_DIRENT64 being 0.

  * getdents64 is always built and aliased to getdents for ABIs
    that define _DIRENT_MATCHES_DIRENT64 to 1.

  * A compat symbol is added for getdents64 for ABI that used to
    export the old non-LFS version.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu,
sparcv9-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu, and
powerpc64le-linux-gnu.

	* sysdeps/unix/sysv/linux/alpha/getdents.c: Add comments with alpha
	requirements.
	 (_DIRENT_MATCHES_DIRENT64): Undef
	* sysdeps/unix/sysv/linux/alpha/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/getdents64.c: Remove file.
	* sysdeps/unix/sysv/linux/generic/getdents.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c: Likewise.
	* sysdeps/unix/sysv/linux/getdents.c: Simplify implementation by
	use getdents64 syscalls as base.
	* sysdeps/unix/sysv/linux/getdents64.c: Likewise and add compatibility
	symbol if required.
	* sysdeps/unix/sysv/linux/hppa/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/getdents.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c
	(__get_clockfreq_via_proc_openprom): Use __getdents64.
	* sysdeps/unix/sysv/linux/mips/mips64/getdents64.c: New file.
2018-04-19 08:49:52 -03:00
Adhemerval Zanella 942de61a89 Consolidate Linux readdir{64}{_r} implementation
This patch consolidates Linux readdir{64}{_r} implementation on just
the default sysdeps/unix/sysv/linux/readdir{64}{_r}.c ones.  The
default implementation handle the Linux requirements:

  * readdir{_r} is only built for _DIRENT_MATCHES_DIRENT64 being 0.

  * readdir64{_r} is always built and aliased to readdir{_r} for
    ABI that define _DIRENT_MATCHES_DIRENT64.

  * A compat symbol is added for readdir64{_r} for ABI that used to
    export the old non-LFS version.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu,
sparcv9-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu, and
powerpc64le-linux-gnu.

	* sysdeps/posix/readdir.c (__READDIR, __GETDENTS, DIRENTY_TYPE,
	__READDIR_ALIAS): Undefine after usage.
	* sysdeps/posix/readdir_r.c (__READDIR_R, __GETDENTS, DIRENT_TYPE,
	__READDIR_R_ALIAS): Likewise.
	* sysdeps/unix/sysv/linux/arm/readdir64.c: Remove file.
	* sysdeps/unix/sysv/linux/arm/readdir64_r.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/readdir64.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/readdir64_r.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/readdir64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/readdir64_r.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/readdir64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/readdir.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/readdir64.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Likewise.
	* sysdeps/unix/sysv/linux/readdir.c: New file.
	* sysdeps/unix/sysv/linux/readdir_r.c: Likewise.
	* sysdeps/unix/sysv/linux/readdir64.c: Add compat symbol if required.
	* sysdeps/unix/sysv/linux/readdir64_r.c: Likewise.
2018-04-06 17:49:02 -03:00
Joseph Myers 8d3f9e85cf Add narrowing subtract functions.
This patch adds the narrowing subtract functions from TS 18661-1 to
glibc's libm: fsub, fsubl, dsubl, f32subf64, f32subf32x, f32xsubf64
for all configurations; f32subf64x, f32subf128, f64subf64x,
f64subf128, f32xsubf64x, f32xsubf128, f64xsubf128 for configurations
with _Float64x and _Float128; __nldbl_dsubl for ldbl-opt.

The changes are essentially the same as for the narrowing add
functions, so the description of those generally applies to this patch
as well.

Tested for x86_64, x86, mips64 (all three ABIs, both hard and soft
float) and powerpc, and with build-many-glibcs.py.

	* math/Makefile (libm-narrow-fns): Add sub.
	(libm-test-funcs-narrow): Likewise.
	* math/Versions (GLIBC_2.28): Add narrowing subtract functions.
	* math/bits/mathcalls-narrow.h (sub): Use __MATHCALL_NARROW.
	* math/gen-auto-libm-tests.c (test_functions): Add sub.
	* math/math-narrow.h (CHECK_NARROW_SUB): New macro.
	(NARROW_SUB_ROUND_TO_ODD): Likewise.
	(NARROW_SUB_TRIVIAL): Likewise.
	* sysdeps/ieee754/float128/float128_private.h (__fsubl): New
	macro.
	(__dsubl): Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fsub and
	dsub.
	(CFLAGS-nldbl-dsub.c): New variable.
	(CFLAGS-nldbl-fsub.c): Likewise.
	* sysdeps/ieee754/ldbl-opt/Versions (GLIBC_2.28): Add
	__nldbl_dsubl.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__nldbl_dsubl): New
	prototype.
	* manual/arith.texi (Misc FP Arithmetic): Document fsub, fsubl,
	dsubl, fMsubfN, fMsubfNx, fMxsubfN and fMxsubfNx.
	* math/auto-libm-test-in: Add tests of sub.
	* math/auto-libm-test-out-narrow-sub: New generated file.
	* math/libm-test-narrow-sub.inc: New file.
	* sysdeps/i386/fpu/s_f32xsubf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_f32xsubf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fsub.c: Likewise.
	* sysdeps/ieee754/float128/s_f32subf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64subf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64xsubf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_dsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_f64xsubf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_dsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_dsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fsubl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-dsub.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-fsub.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_dsubl.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fsub.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fsubl.c: Likewise.
	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
	* sysdeps/mach/hurd/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2018-03-20 00:34:52 +00:00
Joseph Myers d8742dd82f Add narrowing add functions.
This patch adds the narrowing add functions from TS 18661-1 to glibc's
libm: fadd, faddl, daddl, f32addf64, f32addf32x, f32xaddf64 for all
configurations; f32addf64x, f32addf128, f64addf64x, f64addf128,
f32xaddf64x, f32xaddf128, f64xaddf128 for configurations with
_Float64x and _Float128; __nldbl_daddl for ldbl-opt.  As discussed for
the build infrastructure patch, tgmath.h support is deliberately
deferred, and FP_FAST_* macros are not applicable without optimized
function implementations.

Function implementations are added for all relevant pairs of formats
(including certain cases of a format and itself where more than one
type has that format).  The main implementations use round-to-odd, or
a trivial computation in the case where both formats are the same or
where the wider format is IBM long double (in which case we don't
attempt to be correctly rounding).  The sysdeps/ieee754/soft-fp
implementations use soft-fp, and are used automatically for
configurations without exceptions and rounding modes by virtue of
existing Implies files.  As previously discussed, optimized versions
for particular architectures are possible, but not included.

i386 gets a special version of f32xaddf64 to avoid problems with
double rounding (similar to the existing fdim version), since this
function must round just once without an intermediate rounding to long
double.  (No such special version is needed for any other function,
because the nontrivial functions use round-to-odd, which does the
intermediate computation with the rounding mode set to round-to-zero,
and double rounding is OK except in round-to-nearest mode, so is OK
for that intermediate round-to-zero computation.)  mul and div will
need slightly different special versions for i386 (using round-to-odd
on long double instead of precision control) because of the
possibility of inexact intermediate results in the subnormal range for
double.

To reduce duplication among the different function implementations,
math-narrow.h gets macros CHECK_NARROW_ADD, NARROW_ADD_ROUND_TO_ODD
and NARROW_ADD_TRIVIAL.

In the trivial cases and for any architecture-specific optimized
implementations, the overhead of the errno setting might be
significant, but I think that's best handled through compiler built-in
functions rather than providing separate no-errno versions in glibc
(and likewise there are no __*_finite entry points for these function
provided, __*_finite effectively being no-errno versions at present in
most cases).

Tested for x86_64 and x86, with both GCC 6 and GCC 7.  Tested for
mips64 (all three ABIs, both hard and soft float) and powerpc with GCC
7.  Tested with build-many-glibcs.py with both GCC 6 and GCC 7.

	* math/Makefile (libm-narrow-fns): Add add.
	(libm-test-funcs-narrow): Likewise.
	* math/Versions (GLIBC_2.28): Add narrowing add functions.
	* math/bits/mathcalls-narrow.h (add): Use __MATHCALL_NARROW .
	* math/gen-auto-libm-tests.c (test_functions): Add add.
	* math/math-narrow.h (CHECK_NARROW_ADD): New macro.
	(NARROW_ADD_ROUND_TO_ODD): Likewise.
	(NARROW_ADD_TRIVIAL): Likewise.
	* sysdeps/ieee754/float128/float128_private.h (__faddl): New
	macro.
	(__daddl): Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fadd and
	dadd.
	(CFLAGS-nldbl-dadd.c): New variable.
	(CFLAGS-nldbl-fadd.c): Likewise.
	* sysdeps/ieee754/ldbl-opt/Versions (GLIBC_2.28): Add
	__nldbl_daddl.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__nldbl_daddl): New
	prototype.
	* manual/arith.texi (Misc FP Arithmetic): Document fadd, faddl,
	daddl, fMaddfN, fMaddfNx, fMxaddfN and fMxaddfNx.
	* math/auto-libm-test-in: Add tests of add.
	* math/auto-libm-test-out-narrow-add: New generated file.
	* math/libm-test-narrow-add.inc: New file.
	* sysdeps/i386/fpu/s_f32xaddf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_f32xaddf64.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fadd.c: Likewise.
	* sysdeps/ieee754/float128/s_f32addf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64addf128.c: Likewise.
	* sysdeps/ieee754/float128/s_f64xaddf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_daddl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_f64xaddf128.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_faddl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_daddl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_faddl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_daddl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_faddl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-dadd.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-fadd.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_daddl.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_fadd.c: Likewise.
	* sysdeps/ieee754/soft-fp/s_faddl.c: Likewise.
	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
	* sysdeps/mach/hurd/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2018-02-10 02:08:43 +00:00
Joseph Myers 688903eb3e 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.
2018-01-01 00:32:25 +00:00
Florian Weimer bad7a0c81f copy_file_range: New function to copy file data
The semantics are based on the Linux system call, but a very close
emulation in user space is provided.
2017-12-22 10:55:40 +01:00
Joseph Myers 1f9055ce04 Add _Float32 function aliases.
This patch concludes filling out TS 18661-3 support for different
types by adding *f32 function aliases of float functions to support
_Float32.  As with _Float64 and _Float32x, this is supported for all
glibc configurations.  As with the previous such patches there are
some x86 ulps updates because of inline functions present for float
but not for _Float32.  The patch also has the usual
bits/floatn-common.h update, symbol versions, ABI baselines updates,
test enablement and documentation.

Tested for x86_64 and x86, and with build-many-glibcs.py, with both
GCC 6 and GCC 7.

	* bits/floatn-common.h (__HAVE_FLOAT32): Define to 1.
	* manual/math.texi (Mathematics): Document support for _Float32.
	* math/Makefile (test-types): Add float32.
	* math/Versions (GLIBC_2.27): Add _Float32 functions.
	* stdlib/Versions (GLIBC_2.27): Likewise.
	* wcsmbs/Versions (GLIBC_2.27): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
	* sysdeps/i386/fpu/libm-test-ulps: Likewise.
	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
2017-12-07 00:48:31 +00:00
Joseph Myers 0d93b7fd7c Add _Float64, _Float32x function aliases.
This patch continues filling out TS 18661-3 support by adding *f64 and
*f32x function aliases, supporting _Float64 and _Float32x, as aliases
for double functions.  These types are supported for all glibc
configurations.  The API corresponds exactly to that for _Float128 and
_Float64x.  _Float32 aliases to float functions remain to be added in
subsequent patches to complete this process (then there are a few
miscellaneous functions in TS 18661-3 to implement that aren't simply
versions of existing functions for new types).

The patch enables the feature in bits/floatn-common.h, adds symbol
versions and documentation with updates to ABI baselines, and arranges
for the libm functions for the new types to be tested.  As with the
_Float64x changes there are some x86 ulps updates because of header
inlines not used for the new types (and one other change to the
non-multiarch libm-test-ulps, which I suppose comes from using a
different compiler version / configuration from when it was last
regenerated).

Tested for x86_64 and x86, and with build-many-glibcs.py, with both
GCC 6 and GCC 7.

	* bits/floatn-common.h (__HAVE_FLOAT64): Define to 1.
	(__HAVE_FLOAT32X): Likewise.
	* manual/math.texi (Mathematics): Document support for _Float64
	and _Float32x.
	* math/Makefile (test-types): Add float64 and float32x.
	* math/Versions (GLIBC_2.27): Add _Float64 and _Float32x
	functions.
	* stdlib/Versions (GLIBC_2.27): Likewise.
	* wcsmbs/Versions (GLIBC_2.27): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
	* sysdeps/i386/fpu/libm-test-ulps: Likewise.
	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
2017-12-06 00:58:03 +00:00
Florian Weimer 446d22e91d Linux: Implement interfaces for memory protection keys
This adds system call wrappers for pkey_alloc, pkey_free, pkey_mprotect,
and x86-64 implementations of pkey_get and pkey_set, which abstract over
the PKRU CPU register and hide the actual number of memory protection
keys supported by the CPU.  pkey_mprotect with a -1 key is implemented
using mprotect, so it will work even if the kernel does not support the
pkey_mprotect system call.

The system call wrapers use unsigned int instead of unsigned long for
parameters, so that no special treatment for x32 is needed.  The flags
argument is currently unused, and the access rights bit mask is limited
to two bits by the current PKRU register layout anyway.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-05 15:20:35 +01:00
Stefan Liebler 478593e637 S390: Fix backtrace in vdso functions.
On s390, GDB fails to show the complete backtrace from within vdso functions.
The macro INTERNAL_VSYSCALL_CALL saves the return address in r14 to r10
before branching to the vdso function. The branch-instruction updates r14
in order to let the vdso function return. Then the original address in r14 is
restored from r10. Unfortunately, there are no cfi-rules and GDB fails.

Furthermore the call of the vdso function does not comply with the s390 ABI
as no stack-frame for the vdso-function is generated.

This patch removes the s390 specific macro INTERNAL_VSYSCALL_CALL
and the common implementation in sysdeps/unix/sysv/linux/sysdep-vdso.h is used.
Then the vdso function is called via function-pointer and GCC generates a
new stack-frame and emits all needed cfi-rules.

The defines CLOBBER_[0-6] are removed as they  were only used in macro
INTERNAL_VSYSCALL_CALL.

The macro INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK is not used on s390.
The only user is power. Thus it is removed from s390 sysdep.h.

ChangeLog:

	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
	(INTERNAL_VSYSCALL_CALL, CLOBBER_0, CLOBBER_1, CLOBBER_2,
	 CLOBBER_3, CLOBBER_4, CLOBBER_5, CLOBBER_6,
	INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Remove.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
2017-12-04 16:40:13 +01:00
Florian Weimer 4bab02240e Implement the mlock2 function
Fallback using mlock is provided if the flags argument is zero.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-27 17:14:29 +01:00
Joseph Myers a23aa5b727 Add _Float64x function aliases.
This patch continues filling out TS 18661-3 support by adding *f64x
function aliases on platforms with _Float64x support.  (It so happens
the set of such platforms is exactly the same as the set of platforms
with _Float128 support, although on x86_64, x86 and ia32 the _Float64x
format is Intel extended rather than binary128.)  The API provided
corresponds exactly to that provided for _Float128, mostly coming from
TS 18661-3.  As these functions always alias those for another type
(long double, _Float128 or both), __* function names are not provided,
as in other cases of alias types.

Given the preparation done in previous patches, this one just enables
the feature via Makeconfig and bits/floatn.h, adds symbol versions,
and updates documentation and ABI baselines.  The symbol versions are
present unconditionally as GLIBC_2.27 in the relevant Versions files,
as it's OK for those to specify versions for functions that may not be
present in some configurations; no additional complexity is needed
unless in future some configuration gains support for this type that
didn't have such support in 2.27.  The Makeconfig additions for ia64
and x86 aren't strictly needed, as those configurations also get
float64x-alias-fcts definitions from
sysdeps/ieee754/float128/Makeconfig, but still seem appropriate given
that _Float64x is not _Float128 for those configurations.

A libm-test-ulps update for x86 is included.  This is because
bits/mathinline.h does not have _Float64x support added and for two
functions the use of out-of-line functions results in increased ulps
(ifloat64x shares ulps with ildouble / ifloat128 as appropriate).
Given that we'd like generally to eliminate bits/mathinline.h
optimizations, preferring to have such optimizations in GCC instead,
it seems reasonable not to add such support there for new types.  GCC
support for _FloatN / _FloatNx built-in functions is limited, but has
been improved in GCC 8, and at some point I hope the full set of libm
built-in functions in GCC, and other optimizations with
per-floating-type aspects, will be enabled for all _FloatN / _FloatNx
types.

Tested for x86_64 and x86, and with build-many-glibcs.py, with both
GCC 6 and GCC 7.

	* sysdeps/ia64/Makeconfig (float64x-alias-fcts): New variable.
	* sysdeps/ieee754/float128/Makeconfig (float64x-alias-fcts):
	Likewise.
	* sysdeps/ieee754/ldbl-128/Makeconfig (float64x-alias-fcts):
	Likewise.
	* sysdeps/x86/Makeconfig: New file.
	* bits/floatn-common.h (__HAVE_FLOAT64X): Remove macro.
	(__HAVE_FLOAT64X_LONG_DOUBLE): Likewise.
	* bits/floatn.h (__HAVE_FLOAT64X): New macro.
	(__HAVE_FLOAT64X_LONG_DOUBLE): Likewise.
	* sysdeps/ia64/bits/floatn.h (__HAVE_FLOAT64X): Likewise.
	(__HAVE_FLOAT64X_LONG_DOUBLE): Likewise.
	* sysdeps/ieee754/ldbl-128/bits/floatn.h (__HAVE_FLOAT64X):
	Likewise.
	(__HAVE_FLOAT64X_LONG_DOUBLE): Likewise.
	* sysdeps/mips/ieee754/bits/floatn.h (__HAVE_FLOAT64X): Likewise.
	(__HAVE_FLOAT64X_LONG_DOUBLE): Likewise.
	* sysdeps/powerpc/bits/floatn.h (__HAVE_FLOAT64X): Likewise.
	(__HAVE_FLOAT64X_LONG_DOUBLE): Likewise.
	* sysdeps/x86/bits/floatn.h (__HAVE_FLOAT64X): Likewise.
	(__HAVE_FLOAT64X_LONG_DOUBLE): Likewise.
	* manual/math.texi (Mathematics): Document support for _Float64x.
	* math/Versions (GLIBC_2.27): Add _Float64x functions.
	* stdlib/Versions (GLIBC_2.27): Likewise.
	* wcsmbs/Versions (GLIBC_2.27): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
	* sysdeps/i386/fpu/libm-test-ulps: Likewise.
	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
2017-11-27 14:16:47 +00:00
Florian Weimer 59d2cbb1fe Linux: Add memfd_create system call wrapper
The system call is somewhat obscure because it is closely related
to file descriptor sealing.  However, it is also the recommended
way to create alias mappings, which is why it has more general use.

No emulation is provided.  Except for the name of the
/proc/self/fd links, it would be possible to implement an
approximation using O_TMPFILE and tmpfs, but this does not appear
to be worth the added complexity.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-23 10:00:40 +01:00
Stefan Liebler 8beba15d53 S390: Add cfi information for start routines in order to stop unwinding.
GDB failed to detect the outermost frame while showing the backtrace
within a thread:
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Before this patch, the start routines like thread_start had no cfi information.
GDB is then using the prologue unwinder if no cfi information is available.
This unwinder tries to unwind r15 and stops e.g. if r15 was updated or
on some jump-instructions.

On older glibc-versions (before commit "Remove cached PID/TID in clone"
c579f48edb), the thread_start function used
such a jump-instruction and GDB did not fail with an error.

This patch adds cfi information for _start, thread_start and __makecontext_ret
and marks r14 as undefined which marks the frame as outermost frame and GDB
stops the backtrace. Also tested different gcc versions in order to test
_Unwind_Backtrace() in libgcc as this is used by backtrace() in glibc.

ChangeLog:

	* sysdeps/s390/s390-64/start.S (_start): Add cfi information for r14.
	* sysdeps/s390/s390-32/start.S: (_start): Likewise
	* sysdeps/unix/sysv/linux/s390/s390-64/clone.S
	(thread_start): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/clone.S
	(thread_start): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S
	(__makecontext_ret): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S
	(__makecontext_ret): Likewise.
2017-11-21 08:45:28 +01:00
H.J. Lu 8cb5295d3f Add jmp_buf-macros.h
Verify that sizes, alignments and field offsets of jmp_buf as well as
sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined.
Since jmp_buf is target specific, jmp_buf-macros.h is added for each
Linux target.  A new target must provides its own jmp_buf-macros.h.

TODO: Hurd needs to provide a jmp_buf-macros.h.

Tested with build-many-glibcs.py.

	* include/setjmp.h [!_ISOMAC]: Include <stddef.h> and
	<jmp_buf-macros.h>.
	[!_ISOMAC] (STR_HELPER): New.
	[!_ISOMAC] (STR): Likewise.
	[!_ISOMAC] (TEST_SIZE): Likewise.
	[!_ISOMAC] (TEST_ALIGN): Likewise.
	[!_ISOMAC] (TEST_OFFSET): Likewise.
	[!_ISOMAC] Add _Static_assert to check sizes, alignments and
	field offsets of jmp_buf as well as sigjmp_buf.
	* sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h: Likewise.
2017-11-09 05:10:03 -08:00
Joseph Myers 81325b12b1 Add _Float128 function aliases.
This patch adds support for *f128 function aliases on platforms where
long double has the binary128 format (and thus GCC 7 provides the
_Float128 type with the same ABI as long double but as a distinct type
in terms of C type compatibility).  This is the same API as provided
in glibc 2.26 for powerpc64le / x86_64 / x86 / ia64 where _Float128
has a different format from long double, with the bulk of the API
coming from TS 18661-3.  All the functions alias the corresponding
long double functions, and __* function names are not provided since
those are only needed once for each floating-point format, not more
than once for different types with the same format (so for example,
-ffinite-math-only maps foof128 to __fool_finite, while type-generic
macros end up calling e.g. __issignalingl for _Float128 arguments on
such platforms).

The preparation for this feature was done in previous patches, so this
one just needs to add the relevant makefile and header definitions,
and update macro definitions of libm_alias_ldouble_other_r, to turn on
the feature, and update documentation and ABI baselines.

Tested (a) for x86_64, (b) for aarch64, (c) with build-many-glibcs.py
with both GCC 6 and GCC 7.

	* sysdeps/ieee754/ldbl-128/Makeconfig: New file.
	* sysdeps/ieee754/ldbl-128/bits/floatn.h: Likewise.
	* sysdeps/ieee754/ldbl-128/float128-abi.h: Likewise.
	* sysdeps/generic/libm-alias-ldouble.h: Include <bits/floatn.h>.
	[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128]
	(libm_alias_ldouble_other_r): Also create _Float128 alias.
	* sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h: Include
	<bits/floatn.h>.
	[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128]
	(libm_alias_ldouble_other_r): Also create _Float128 alias.
	* manual/math.texi (Mathematics): Document additional architecture
	support for _Float128.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
2017-10-18 17:37:18 +00:00
Adhemerval Zanella 09c76a7409 Linux: Consolidate {RTLD_}SINGLE_THREAD_P definition
Current GLIBC has two ways to implement the single thread optimization
on syscalls to avoid calling the cancellation path: either by using
global variables (__{libc,pthread}_multiple_thread) or by accessing
the TCB field (defined by TLS_MULTIPLE_THREADS_IN_TCB).  Both the
variables and the macros to acces its value are defined in the
architecture sysdep-cancel.h header.

This patch consolidates its definition on only one header,
sysdeps/unix/sysv/linux/sysdep-cancel.h, and adds a new define
(SINGLE_THREAD_BY_GLOBAL) which the architecture defines if it prefer
to use the global variables instead of the TCB field.  This is an
optimization, so if the architecture does not define it, the TCB
method will be used as default.

Checked on x86_64-linux-gnu and on a build with major touched
ABIs (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf,
hppa-linux-gnu, i686-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu,
mips-linux-gnu, mips64-linux-gnu, powerpc-linux-gnu,
powerpc64le-linux-gnu, s390-linux-gnu, s390x-linux-gnu, sh4-linux-gnu,
sparcv9-linux-gnu, sparc64-linux-gnu, tilegx-linux-gnu).

	* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Remove file.
	* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
	(SINGLE_THREAD_BY_GLOBAL): Define.
	* sysdeps/unix/sysv/linux/aarch64/sysdep.h (SINGLE_THREAD_BY_GLOBAL):
	Likewise.
	* sysdeps/unix/sysv/linux/alpha/sysdep.h (SINGLE_THREAD_BY_GLOBAL):
	Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep.h (SINGLE_THREAD_BY_GLOBAL):
	Likewise.
	* sysdeps/unix/sysv/linux/hppa/sysdep.h (SINGLE_THREAD_BY_GLOBAL):
	Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sysdep.h
	(SINGLE_THREAD_BY_GLOBAL): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep.h (SINGLE_THREAD_BY_GLOBAL):
	Likewise.
2017-10-11 14:27:24 -03:00
Szabolcs Nagy 72d3d28108 New symbol version for logf, log2f and powf without SVID compat
This patch changes the logf, log2f and powf error handling semantics
to only set errno accoring to POSIX rules. New symbol version is
introduced at GLIBC_2.27.

The old wrappers are kept for compat symbols.

ia64 needed assembly change to have the new and compat versioned
symbol map to the same function.

All linux libm abilists are updated.

	* math/Versions (logf): New libm symbol at GLIBC_2.27.
	(log2f): Likewise.
	(powf): Likewise.
	* math/w_log2f.c: New file.
	* math/w_logf.c: New file.
	* math/w_powf.c: New file.
	* math/w_log2f_compat.c (__log2f_compat): For compat symbol only.
	* math/w_logf_compat.c (__logf_compat): Likewise.
	* math/w_powf_compat.c (__powf_compat): Likewise.
	* sysdeps/ia64/fpu/e_log2f.S: Add versioned symbols.
	* sysdeps/ia64/fpu/e_logf.S: Likewise.
	* sysdeps/ia64/fpu/e_powf.S: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2017-10-02 14:38:03 +01:00
Adhemerval Zanella ccf970c7a7 posix: Add compat glob symbol to not follow dangling symbols
This patch follows commit 5554304f0 (posix: Allow glob to match dangling
symlinks [BZ #866]) by adding a compat symbol that follow previous
semantic of not following dangling symlinks and thus avoiding call
gl_lstat with GLOB_ALTDIRFUNC.

It avoids failure with old binaries that not set the alternate function
pointer for lstat (GNUmake for instance).  The following scenario, for
instance, fails with current GNUmake because glibc will access unitialized
memory when calling gl_lstat:

  $ cat src/t/t.c
  int main ()
  {
    return 0;
  }
  $ cat Makefile
  SRC = $(wildcard src/*/t.c)
  OBJ = $(patsubst src/%.c, obj/%.o, $(SRC))

  prog:           $(OBJ)
                  $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $(OBJ) -o prog

  obj/%.o:        src/%.c
                  $(CC) $(CFLAGS) -c $< -o $@
  $ make

This works as expected with the patch applied.  Since it is for generic
ABI, default compat symbols are added with override for Linux due LFS.
Now we have two compat symbols for glob on Linux:

  1. sysdeps/unix/sysv/linux/oldglob.c which implements glob64 with
     the old dirent layout.  For this implementation I also set it to
     not follow dangling symlinks (which is the safest path).

  2. sysdeps/unix/sysv/linux/glob{64}-lstat-compat.c which implements
     the compat symbol for dangling symlinks.  As for generic glob,
     the implementation uses XSTAT_IS_XSTAT64 to define whether
     both __glob_lstat_compat and __glob64_lstat_compat should be
     different implementations.  For archictures that define
     XSTAT_IS_XSTAT64, __glob_lstat_compat is aliased to
     __glob64_lstat_compat.

  3. sysdeps/unix/sysv/linux/alpha/oldglob.c with a different glob_t
     layout.  As for 1. this patch changes it to not follow dangling
     symlinks.

The patch also bumps _GNU_GLOB_INTERFACE_VERSION to 2 to advertise the
new semantic.  On GNUmake, for instance, it will force to it use its
internal glob implementation instead and avoiding triggering the same
failure on builds against newer GLIBCs.

Checked on x86_64-linux-gnu and i686-linux-gnu.  I also checked
with a build against the major ABIs required to check for the abilist.

The changes should also work on gnulib (I run gnulib-tool.py check glob
and it shown no regressions).

	[BZ #22183]
	* include/gnu-versions.h (_GNU_GLOB_INTERFACE_VERSION): Increase
	version to 2.
	* posix/Makefile (routines): Add glob-lstat-compat and
	glob64-lstat-compat.
	* posix/Versions (GLIBC_2.27, glob, glob64): Add symbol version.
	* posix/glob-lstat-compat.c: New file.
	* posix/glob64-lstat-compat.c: Likewise.
	* posix/tst-glob_lstat_compat.c: Likewise.
	* sysdeps/unix/sysv/linux/glob-lstat-compat.c: Likewise.
	* sysdeps/unix/sysv/linux/alpha/glob-lstat-compat.c: Likewise.
	* sysdeps/unix/sysv/linux/glob64-lstat-compat.c: Likewise.
	* sysdeps/unix/sysv/linux/alpha/glob.c: Remove file.
	* posix/glob.c (glob_lstat): New function.
	(glob): Rename to __glob and add versioned symbol to 2.27.
	(glob_in_dir): Use glob_lstat.
	* posix/glob64.c (glob64): Add GLOB_ATTRIBUTE.
	* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/glob.c (glob): Add versioned symbol for
	2.27.
	* sysdeps/unix/sysv/linux/glob64.c (glob64): Likewise.
	* sysdeps/unix/sysv/linux/oldglob.c (GLOB_NO_LSTAT): Define.
	* sysdeps/unix/sysv/linux/alpha/oldglob.c (__old_glob): Do not use
	gl_lstat on glob call.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Add GLIBC_2.27 glob
	and glob64 symbols.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
	Likewise.
	* sysdeps/unix/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
2017-09-25 18:04:16 -07:00
Szabolcs Nagy f5f0f52651 New expf and exp2f version without SVID compat wrapper
This patch changes the expf and exp2f error handling semantics to only
set errno accoring to POSIX rules. New symbol version is introduced at
GLIBC_2.27.

The old wrappers are kept for compat symbols.

Internal calls to __expf now get the new error semantics, this seems to
only affect sysdeps/i386/fpu/s_expm1f.S where the errno-only behaviour
should be correct.

ia64 needed assembly change to have the new and compat versioned symbol
map to the same function.

All linux libm abilists are updated.

	* math/Versions (expf): New libm symbol at GLIBC_2.27.
	(exp2f): Likewise.
	* math/w_exp2f.c: New file.
	* math/w_expf.c: New file.
	* math/w_exp2f_compat.c (__exp2f_compat): For compat symbol only.
	* math/w_expf_compat.c (__expf_compat): Likewise.
	* sysdeps/ia64/fpu/e_exp2f.S: Add versioned symbols.
	* sysdeps/ia64/fpu/e_expf.S: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2017-09-25 10:45:08 +01:00
Adhemerval Zanella 3ca622e4d6 posix: Fix compat glob code on s390 and alpha
This patch fixes the compat glob implementation consolidation from
commit 116f1c64d with the following changes:

  - Add a compat implementation on s390 to avoid the architecture
    to build the symbols on default linux oldglob.c by setting
    GLOB_NO_OLD_VERSION.

  - Remove the duplicate rule to build oldglob on alpha.

Checked on s390-linux-gnu and alpha-linux-gnu using build-many-glibc.py.

	* sysdeps/unix/sysv/linux/s390/s390-32/oldglob.c: New file.
	* sysdeps/unix/sysv/linux/alpha/Makefile
	[$(subdir) = csu] (sysdep_routines): Remove rule.
2017-09-13 09:24:12 -03:00
Adhemerval Zanella 116f1c64d8 posix: Consolidate Linux glob implementation
This patch consolidates the glob implementation.  The main changes are:

  * On Linux all implementation now uses the default one at
    sysdeps/unix/sysv/linux/glob{free}{64}.c with the exception
    of alpha (which requires specific versioning) and s390-32 (which
    different than other 32 bits ports it does not add a compat one
    symbol for 2.1 version).

  * The default implementation uses XSTAT_IS_XSTAT64 to define whether
    both glob{free} and glob{free}64 should be different implementations.
    For archictures that define XSTAT_IS_XSTAT64, glob{free} is an alias
    to glob{free}64.

  * Move i386 olddirent.h header to Linux default directory, since it is
    the only header with this name and it is shared among different
    architectures (and used on compat glob symbol as well).

Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py
for all major architectures.

	* sysdeps/unix/sysv/linux/arm/glob64.c: Remove file.
	* sysdeps/unix/sysv/linux/i386/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/glob.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise.
	* sysdeps/wordsize-64/glob.c: Likewise.
	* sysdeps/wordsize-64/glob64.c: Likewise.
	* sysdeps/wordsize-64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/glob.c: New file.
	* sysdeps/unix/sysv/linux/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/globfree.c: Likewise.
	* sysdeps/unix/sysv/linux/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/oldglob.c [SHLIB_COMPAT]: Also
	adds !GLOB_NO_OLD_VERSION as an extra condition.
	* sysdeps/unix/sysv/linux/i386/alphasort64.c: Include olddirent.h
	using relative path instead of absolute one.
	* sysdeps/unix/sysv/linux/i386/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/readdir64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/versionsort64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/olddirent.h: Move to ...
	* sysdeps/unix/sysv/linux//olddirent.h: ... here.
2017-09-08 16:34:02 +02:00
Adhemerval Zanella 102dde842a Remove NO_CANCELLATION macro
The NO_CANCELLATION macro is used currently on generic headers to
define non cancellable syscalls and on Linux fcntl to implement the non
cancellable variation.  Former should be single-handled by not-cancel.h
header and former could be simplified build both cancellable and non
cancellable for default objects and alias the non-cancellable to default
one for rtld ones (since Linux already support cancellation as default).

This patch thus removes the NO_CANCELLATION macro and its usage.  The
generic non cancellable fcntl is route to internal fcntl.

Checked on x86_64-linux-gnu and i686-linux-gnu.  Also checked with
a build again major ABIs.

	* sysdeps/generic/not-cancel.h (NO_CANCELLATION): Remove macro.
	* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
	(NO_CANCELLATION): Likewise.
	* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
	(NO_CANCELLATION): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
	(NO_CANCELLATION): Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (NO_CANCELLATION):
	Likewise
	* sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/tile/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/not-cancel.h (__fcntl_nocancel): Add
	hidden prototype.
	* sysdeps/unix/sysv/linux/fcntl.c (__fcntl_nocancel): Define only
	for !IS_IN (rtld) and remove NO_CANCELLATION usage.
2017-08-31 16:10:34 -03:00
Adhemerval Zanella ebd6f0076a Remove cancellation support for syscall generation
This patch removes the cancellation mark from the auto-generation syscall
script.  Now all the cancellable syscalls are done throught C code using
the SYSCALL_CANCEL macro.  It simplifies the assembly required to each
architecture port, since the SYSCALL_CANCEL uses the already defined
INLINE_SYSCALL macros, and allows a more straigh fix on cancellation
machanism (since no more specific assembly fixes will be required).

Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.A
Also with build-many-glibc.py with remaning touched architectures.

	* sysdeps/unix/make-syscalls.sh: Remove cancellable tagging for
	syscall definitions.
	* sysdeps/unix/syscall-template.S (SYSCALL_CANCELLABLE): Remove
	definition.
	* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (__local_enable_asynccancel): Likewise.
	[IS_IN (libpthread)] (__local_disable_asynccancel): Likewise.
	[IS_IN (libc)] (__local_enable_asynccancel): Likewise.
	[IS_IN (libc)] (__local_enable_asynccancel): Likewise.
	[IS_IN (librt)] (__local_disable_asynccancel): Likewise.
	[IS_IN (librt)] (__local_disable_asynccancel): Likewise.
	(CENABLE): Likewise.
	(CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (PSEUDO): Remove
	defintion.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h (PSEUDO):
	Remove definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	(SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Remove file.
	* sysdeps/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h: New file.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Remove file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h: New file.
	* sysdeps/unix/sysv/linux/tile/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Remove
	definition.
	(PSEUDO_END): Likewise.
	[IS_IN (libpthread)] (CENABLE): Likewise.
	[IS_IN (libpthread)] (CDISABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (libc)] (CENABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[IS_IN (librt)] (CDISABLE): Likewise.
	[__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
2017-08-24 14:58:35 -03:00
Adhemerval Zanella 9b8f8593e5 Consolidate Linux fcntl implementation
This patch consolidates the fcntl Linux syscall generation on
sysdeps/unix/sysv/linux/fcntl.c.  It basically removes all the
architecture specific implementations.

Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.

	* sysdeps/unix/sysv/linux/arm/fcntl.c: Remove file.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/hppa/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/fcntl.c: New file.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c: Refactor to
	use default implementation.
2017-06-30 15:17:26 -03:00
Stefan Liebler 5e5b3b8866 S390: Fix build with gcc configured with --enable-default-pie. [BZ #21537]
Building glibc with gcc configured with --enable-default-pie failed on s390
due to assembler messages:
../sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S:44:
Error: junk at end of line, first unrecognized character is `@'

HIDDEN_JUMPTARGET was expanded to exit@PLT@GOTOFF.
If SHARED is not defined, HIDDEN_JUMPTARGET is defined to JUMPTARGET
in sysdeps/s390/s390-32/sysdep.h.  There it expanded to exit@PLT
in non SHARED case as PIC is defined if gcc is configured with
--enable-default-pie. Thus I've changed the "ifdef PIC" to "ifdef SHARED"
as we do not want PLTs in the static obj files.  I've also changed this
in sysdeps/s390/s390-64/sysdep.h.

I've also adjusted sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S.
If glibc is configured with --disable-hidden-plt, then NO_HIDDEN is defined.
In SHARED case HIDDEN_JUMPTARGET would be expanded to exit@PLT@GOTOFF
instead of __GI_exit@GOTOFF.
Now we jump to:
- __GI_exit if SHARED is defined
- exit@PLT if SHARED and NO_HIDDEN is defined
- exit if both are not defined.
On s390 31bit we have to setup GOT pointer in r12 if we use a PLT stub.
Therefore I use SYSCALL_PIC_SETUP from sysdep.h and added the missing semicolons.

ChangeLog:

	[BZ #21537]
	* sysdeps/s390/s390-32/sysdep.h (JUMPTARGET, SYSCALL_PIC_SETUP):
	Check SHARED instead of PIC.
	(SYSCALL_PIC_SETUP): Add missing semicolons.
	* sysdeps/s390/s390-64/sysdep.h (JUMPTARGET, SYSCALL_PIC_SETUP):
	Check SHARED instead of PIC.
	* sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S
	(__makecontext_ret): Adjust code to jump to exit.
2017-06-19 11:08:58 +02:00
Christian Borntraeger 35810f5ccf s390: optimize syscall function
Since kernel 2.6.0 all Linux version accept the system call number
in register 1 for svc 0. There is no need to have special handling
that uses EX for system calls < 256. This will simplify and speed
up that code.

A microbenchmark doing "syscall(__NR_getpid);" in a loops gets faster
by ~12%.

        * sysdeps/unix/sysv/linux/s390/s390-32/syscall.S: Simplify
        code by always using SVC 0 instead of EX.
        * sysdeps/unix/sysv/linux/s390/s390-64/syscall.S: Likewise.
2017-06-19 10:59:40 +02:00
Adhemerval Zanella 52bd938169 posix: Implement preadv2 and pwritev2
This patch adds support of preadv2 and pwritev2 which are similar to
preadv/pwritev but with an extra flag argument.  As for preadv/pwritev
both interfaces are added a non-standard GNU API.

For default 'posix' implementation trying to emulate the Linux supported
flags is troublesome:

   * We can not temporary change the file state of the O_DSYNC and O_SYNC
     flags to emulate RWF_{D}SYNC (attempts to change the state of using
     fcntl are silently ignored).

   * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal
     semantic not provided by any other flag (O_NONBLOCK for instance).

So default sysdeps/posix implementations fails with EOPNOTSUPP for any non
supported flag (which are none currently) calls generic preadv/pwritev.
Basically this implementation supports only preadv2 called as preadv (with
flags sets to 0).

The Linux one uses the preadv2/pwritev2 syscall if defined, otherwise it
call preadv/writev.  Instead of using the previous __ASSUME_* to
unconditionally issue the syscall (and avoid building the fallback routine),
it call pread/write if the preadv2/pwritev2 syscalls fails.  The idea
is just avoid adding another __ASSUME_* and checking each architecture
on every kernel bump and simplify code conditionals.

Checked on x86_64-linux-gnu and on i686-linux-gnu and a check with
run-built-tests=no on aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf,
ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu, mips{64,64n32}-linux-gnu,
nios2-linux-gnu, powerpc{64,64le}-linux-gnu, s390{x}-linux-gnu,
sparc{64,v9}-linux-gnu, tile{gx,pro}-linux-gnu, and sh4-linux-gnu (all using
gcc 6.3).

	* NEWS: Add note about pwritev2 and preadv2 inclusion.
	* misc/Makefile (routines): Add preadv2, preadv64v2, pwritev2, and
	pwritev64v2.
	(tests): Add tst-preadvwritev2 and tst-preadvwritev64v2.
	* misc/Versions (GLIBC_2.26): Add preadv2, preadv64v2, pwritev2, and
	pwritev64v2.
	* misc/preadv2.c: New file.
	* misc/preadv64v2.c: Likewise.
	* misc/pwritev2.c: Likewise.
	* misc/pwritev64v2.c: Likewise.
	* misc/tst-preadvwritev2.c: Likewise.
	* misc/tst-preadvwritev64v2.c: Likewise.
	* manual/llio.texi: Add preadv2 and pwritev2 documentation.
	* misc/sys/uio.h [__USE_GNU && !__USE_FILE_OFFSET64] (preadv2): New
	prototype.
	[__USE_GNU && !__USE_FILE_OFFSET64] (pwritev2):	Likewise.
	[__USE_GNU && __USE_FILE_OFFSET64] (preadv64v2): Likewise.
	[__USE_GNU && __USE_FILE_OFFSET64] (pwritev64v2): Likewise.
	* misc/tst-preadvwritev-common.c (PREADV): Define if not defined.
	(PWRITEV): Likewise.
	(do_test_with_offset): Use PREADV and PWRITEV macros and check for
	ENOSYS.
	* nptl/tst-cancel4.c (tf_pwritev2): New test.
	(tf_preadv2): Likewise.
	(tf_fsync): Add tf_pwritev2 and tf_preadv2.
	* sysdeps/posix/preadv2.c: Likewise.
	* sysdeps/posix/preadv64v2.c: Likewise.
	* sysdeps/posix/pwritev2.c: Likewise.
	* sysdeps/posix/pwritev64v2.c: Likewise.
	* sysdeps/unix/sysv/linux/kernel-features.h: Add comment for syscall
	support in kernel.
	* sysdeps/unix/sysv/linux/preadv2.c: Likewise.
	* sysdeps/unix/sysv/linux/preadv64v2.c: Likewise.
	* sysdeps/unix/sysv/linux/pwritev2.c: Likewise.
	* sysdeps/unix/sysv/linux/pwritev64v2.c: Likewise.
	* sysdeps/unix/sysv/linux/preadv.c (preadv): Add libc_hidden_def.
	* sysdeps/unix/sysv/linux/preadv64.c (preadv64): Likewise.
	* sysdeps/unix/sysv/linux/pwritev.c (pwritev): Likewise.
	* sysdeps/unix/sysv/linux/pwritev64.c (pwritev64): Likewise.
	* sysdeps/unix/sysv/linux/bits/uio.h: Add supported preadv2/pwritev2
	support flags on Linux.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist (GLIBC_2.26): Add
	preadv2, preadv64v2, pwritev2, pwritev64v2.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist (GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/arm/libc.abilist (GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist (GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist (GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist (GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist (GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
	(GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
	(GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist
	(GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist (GLIBC_2.26): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/sysv/linux/tile/tilegx/tilegx32/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/sysv/linux/tile/tilegx/tilegx64/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist (GLIBC_2.26):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist (GLIBC_2.26):
	Likewise.
2017-05-31 17:35:46 -03:00
Dennis Wölfing 2e0bbbfbf9 Add reallocarray function
The reallocarray function is an extension from OpenBSD.  It is an
integer-overflow-safe replacement for realloc(p, X*Y) and
malloc(X*Y) (realloc(NULL, X*Y)).  It can therefore help in preventing
certain security issues in code.

This is an updated version of a patch originally submitted by Rüdiger
Sonderfeld in May 2014 [1].

Checked on i686-linux-gnu and x86_64-linux-gnu.

[1] <https://sourceware.org/ml/libc-alpha/2014-05/msg00481.html>.

2017-05-30  Dennis Wölfing  <denniswoelfing@gmx.de>
            Rüdiger Sonderfeld  <ruediger@c-plusplus.de>

	* include/stdlib.h (__libc_reallocarray): New declaration.
	* malloc/Makefile (routines): Add reallocarray.
	(tests): Add tst-reallocarray.c.
	* malloc/Versions: Add reallocarray and __libc_reallocarray.
	* malloc/malloc-internal.h (check_mul_overflow_size_t): New inline
	function.
	* malloc/malloc.h (reallocarray): New declaration.
	* stdlib/stdlib.h (reallocarray): Likewise.
	* malloc/reallocarray.c: New file.
	* malloc/tst-reallocarray.c: New test file.
	* manual/memory.texi: Document reallocarray.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Add reallocarray.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tilepro/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
2017-05-30 18:27:57 -03:00
Adhemerval Zanella 158d5fa0e1 Consolidate Linux mmap implementation (BZ#21270)
This patch consolidates all Linux mmap implementations on default
sysdeps/unix/sysv/linux/mmap{64}.c one.  To accomodate all required
architecture specific requeriments a new internal header is created
(mmap_internal.h) where each architecture add its specific code
requirements.  Currently only x86_64 (to define MMAP_PREPARE to add
MAP_32BITS), s390 (which have a different kernel ABI for mmap), m68k
(which have variable minimum page sizes), and MIPS n32 (which zero
extend the offset to handle negative one correctly) redefine the new
header.

The patch also fixes BZ#21270 where default mmap64 on architectures
which uses mmap2 silent truncates large offsets value (larger than
1 << (page shift + 8 * sizeof (off_t)) or 1<<44 on architectures with
4096 bytes page size).  The new consolidate implementation returns
EINVAL as allowed by POSIX.

It also adds a tests for on current tst-mmap-offset one.  I have run
a full make check on x86_64, x86_64-32, i686, aarch64, armhf, powerpc,
powerpc64le, sparc64, and sparcv9 without any regressions.  I also ran
some basic tests (tst-mmap-offset) on sh4, m68k, and on qemu simulated
MIPS32 and MIPS64.

	[BZ #21270]
	* posix/tst-mmap-offset.c (do_prepare): New function.
	(do_test): Rename to do_test_bz18877 and use FAIL_RET.
	(do_test_bz21270): New function.
	* sysdeps/unix/sysv/linux/aarch64/mmap.c: Remove file.
	* sysdeps/unix/sysv/linux/arm/mmap.c: Remove file.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/hppa/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/m68k/mmap64.c: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/mmap64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/mmap64.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/mmap.c: Likewise.
	* sysdeps/unix/sysv/linux/mmap_internal.h: New file.
	* sysdeps/unix/sysv/linux/m68k/mmap_internal.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/mmap_internal.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/mmap_internal.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/mmap_internal.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list: Remove mmap
	from auto-generation list.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/mmap.c: New file.
	* sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Add check for invalid
	offsets and support for mmap2 syscall.
2017-04-12 11:04:28 -03:00
Adhemerval Zanella db3d848e15 Build divdi3 only for architecture that required it
As noted in [1], divdi3 object is only exported in a handful ABIs
(i386, m68k, powerpc32, s390-32, and ia64), however it is built
for all current architectures regardless.

This patch refact the make rules for this object to so only the
aforementioned architectures that actually require it builds it.

Also, to avoid internal PLT calls to the exported symbol from the
module, glibc uses an internal header (symbol-hacks.h) which is
unrequired (and in fact breaks the build for architectures that
intend to get symbol definitions from libgcc.a).  The patch also
changes it to create its own header (divdi3-symbol-hacks.h) and
adjust the architectures that require it accordingly.

I checked the build/check (with run-built-tests=no) on the
following architectures (which I think must cover all supported
ABI/builds) using GCC 6.3:

aarch64-linux-gnu
alpha-linux-gnu
arm-linux-gnueabihf
hppa-linux-gnu
ia64-linux-gnu
m68k-linux-gnu
microblaze-linux-gnu
mips64-n32-linux-gnu
mips-linux-gnu
mips64-linux-gnu
nios2-linux-gnu
powerpc-linux-gnu
powerpc-linux-gnu-power4
powerpc64-linux-gnu
powerpc64le-linux-gnu
s390x-linux-gnu
s390-linux-gnu
sh4-linux-gnu
sh4-linux-gnu-soft
sparc64-linux-gnu
sparcv9-linux-gnu
tilegx-linux-gnu
tilegx-linux-gnu-32
tilepro-linux-gnu
x86_64-linux-gnu
x86_64-linux-gnu-x32
i686-linux-gnu

I only saw one regression on sparcv9-linux-gnu (extra PLT call to
.udiv) which I address in next patch in the set.  It also correctly
build SH with GCC 7.0.1 (without any regression from c89721e25d).

[1] https://sourceware.org/ml/libc-alpha/2017-03/msg00243.html

	* sysdeps/i386/symbol-hacks.h: New file.
	* sysdeps/m68k/symbol-hacks.h: New file.
	* sysdeps/powerpc/powerpc32/symbol-hacks.h: New file.
	* sysdeps/s390/s390-32/symbol-hacks.h: New file.
	* sysdeps/unix/sysv/linux/i386/Makefile
	[$(subdir) = csu] (sysdep_routines): New rule: divdi3 object.
	[$(subdir) = csu] (sysdep-only-routines): Likewise.
	[$(subdir) = csu] (CFLAGS-divdi3.c): Likewise.
	* sysdeps/unix/sysv/linux/m68k/Makefile
	[$(subdir) = csu] (sysdep_routines): Likewise.
	[$(subdir) = csu] (sysdep-only-routines): Likewise.
	[$(subdir) = csu] (CFLAGS-divdi3.c): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
	[$(subdir) = csu] (sysdep_routines): Likewise.
	[$(subdir) = csu] (sysdep-only-routines): Likewise.
	[$(subdir) = csu] (CFLAGS-divdi3.c): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/Makefile
	[$(subdir) = csu] (sysdep_routines): Likewise.
	[$(subdir) = csu] (sysdep-only-routines): Likewise.
	[$(subdir) = csu] (CFLAGS-divdi3.c): Likewise.
	* sysdeps/wordsize-32/Makefile: Remove file.
	* sysdeps/wordsize-32/symbol-hacks.h: Definitions move to ...
	* sysdeps/wordsize-32/divdi3-symbol-hacks.h: ... here.
2017-04-06 15:14:34 -03:00
Adhemerval Zanella dd5905de03 Consolidate set* Linux implementation
This patch consolidates the Linux setegid, seteuid, setgid, setgroups,
setregid, setresgid, setresuid, setreuid, and setuid implementation on
default sysdeps/unix/sysv/linux/set*.c implementation.  It basically
removes all the architecture define implementations and add support for
__NR_set*32 syscall on Linux default implementation.

Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.

	* sysdeps/unix/sysv/linux/arm/setegid.c: Remove file.
	* sysdeps/unix/sysv/linux/arm/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/setregid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/setresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/setreuid.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/setuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setegid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setregid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setreuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/setuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setegid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setregid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setreuid.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/setuid.c: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setegid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setregid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setreuid.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/setuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setegid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setregid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setreuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/setuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setgroups.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setregid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setresgid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setresuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setreuid.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setuid.c: Likewise.
	* sysdeps/unix/sysv/linux/setegid.c (setegid): Use
	INLINE_SYSCALL_ERROR_RETURN_VALUE.
	* sysdeps/unix/sysv/linux/seteuid.c (seteuid): Likewise.
	* sysdeps/unix/sysv/linux/setgid.c (setgid): Use __NR_setgid32 if
	defined.
	* sysdeps/unix/sysv/linux/setgroups.c (setgroups): Use
	__NR_setgroups32 if defined.
	* sysdeps/unix/sysv/linux/setregid.c (__setregid): Use __NR_setregid32
	if defined.
	* sysdeps/unix/sysv/linux/setresgid.c (__setresgid): Use
	__NR_setresgid32 is defined.
	* sysdeps/unix/sysv/linux/setresuid.c (__setresuid): Use
	__NR_setresuid32 if defined.
	* sysdeps/unix/sysv/linux/setreuid.c (__setreuid): Use
	__NR_setreuid32 if defined.
	* sysdeps/unix/sysv/linux/setuid.c (__setuid): Use __NR_setuid32 if
	defined.
2017-03-28 12:29:27 -03:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Joseph Myers 423c2b9d08 Add fromfp functions.
TS 18661-1 defines fromfp functions (fromfp, fromfpx, ufromfp,
ufromfpx, and float and long double variants) to convert from
floating-point to an integer type with any signedness and any given
width up to that of intmax_t, in any of the five IEEE rounding modes
(the usual four for binary floating point, plus rounding to nearest
with ties rounding away from zero), with control of whether in-range
non-integer values should result in the "inexact" exception being
raised.  This patch implements these functions for glibc.

These implementations are (apart from raising exceptions) pure integer
implementations; it's entirely possible optimized versions could be
devised for some architectures.  A common math/fromfp.h header
provides various common helper code that can readily be shared between
the implementations for different types.  For each type, the bulk of
the implementation is also shared between the four functions, with
wrappers that define UNSIGNED and INEXACT macros appropriately before
including the main implementation.

As the functions return intmax_t and uintmax_t without math.h being
allowed to expose those typedef names, they are declared using
__intmax_t and __uintmax_t as obtained from <bits/types.h>.

The FP_INT_* rounding direction macros are defined as ascending
integers in the order the names are listed in the TS; I see no
significant value in allowing architectures to vary the values of
them.

The libm-test machinery is duly adapted to handle unsigned int
arguments, and intmax_t and uintmax_t results.  Because each test
input is generally tested for four functions, five rounding modes and
several different widths, the libm-test.inc additions are very large.
Thus, the diffs in the body of this message exclude the libm-test.inc
changes, with the full patch being attached gzipped.  The bulk of the
new tests were generated (expanded from a test input plus rounding
results and information about where it lies in the relevant interval
between integers, to libm-test tests for all relevant combinations of
function, rounding direction and width) by a script that's included in
the patch as math/gen-fromfp-tests.py (input data
math/gen-fromfp-tests-inputs); as an ad hoc script that's not really
expected to be rerun, it's not very polished, but it's at least
plausibly useful for adding any further tests for these functions in
future.  I may split the libm-test tests up by function in future (so
both libm-test.inc and auto-libm-test-out are split into separate
files, and the tests for each function are also built and run
separately), but not for 2.25.

For no obvious reason, adding tgmath tests for the new functions
resulted in -Wuninitialized errors from test-tgmath.c about the
variable i being used uninitialized.  Those errors were correct - the
variable is read by the frexp version in test-tgmath.c (where real
frexp would write through that pointer instead of reading it) - but I
don't know why this patch would result in the pre-existing issue being
newly detected.  The patch initializes the variable to avoid those
errors.

With these changes, glibc 2.25 should have all the library features
from TS 18661-1 other than the functions that round result to narrower
type (and constant rounding directions, but I'm considering those
mainly a compiler feature not a library one).

Tested for x86_64, x86, mips64 and powerpc.

	* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(fromfp): New declaration.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfpx): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfp): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfpx): Likewise.
	* math/tgmath.h (__TGMATH_TERNARY_FIRST_REAL_RET_ONLY): New macro.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfp): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfp): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfpx): Likewise.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfpx): Likewise.
	* math/math.h: Include <bits/types.h>.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (FP_INT_UPWARD): New enum
	constant and macro.
	(FP_INT_DOWNWARD): Likewise.
	(FP_INT_TOWARDZERO): Likewise.
	(FP_INT_TONEARESTFROMZERO): Likewise.
	(FP_INT_TONEAREST): Likewise.
	* math/Versions (fromfp): New libm symbol at version GLIBC_2.25.
	(fromfpf): Likewise.
	(fromfpl): Likewise.
	(ufromfp): Likewise.
	(ufromfpf): Likewise.
	(ufromfpl): Likewise.
	(fromfpx): Likewise.
	(fromfpxf): Likewise.
	(fromfpxl): Likewise.
	(ufromfpx): Likewise.
	(ufromfpxf): Likewise.
	(ufromfpxl): Likewise.
	* math/Makefile (libm-calls): Add s_fromfpF, s_ufromfpF,
	s_fromfpxF and s_ufromfpxF.
	* math/gen-fromfp-tests.py: New file.
	* math/gen-fromfp-tests-inputs: Likewise.
	* math/libm-test.inc: Include <stdint.h>
	(check_intmax_t): New function.
	(check_uintmax_t): Likewise.
	(struct test_fiu_M_data): New type.
	(struct test_fiu_U_data): Likewise.
	(RUN_TEST_fiu_M): New macro.
	(RUN_TEST_LOOP_fiu_M): Likewise.
	(RUN_TEST_fiu_U): Likewise.
	(RUN_TEST_LOOP_fiu_U): Likewise.
	(fromfp_test_data): New array.
	(fromfp_test): New function.
	(fromfpx_test_data): New array.
	(fromfpx_test): New function.
	(ufromfp_test_data): New array.
	(ufromfp_test): New function.
	(ufromfpx_test_data): New array.
	(ufromfpx_test): New function.
	(main): Call fromfp_test, fromfpx_test, ufromfp_test and
	ufromfpx_test.
	* math/gen-libm-test.pl (parse_args): Handle u, M and U descriptor
	characters.
	* math/test-tgmath-ret.c: Include <stdint.h>.
	(rm): New variable.
	(width): Likewise.
	(CHECK_RET_CONST_TYPE): Take extra arguments and pass them to
	called function.
	(CHECK_RET_CONST_FLOAT): Take extra arguments and pass them to
	CHECK_RET_CONST_TYPE.
	(CHECK_RET_CONST_DOUBLE): Likewise.
	(CHECK_RET_CONST_LDOUBLE): Likewise.
	(CHECK_RET_CONST): Take extra arguments and pass them to calls
	macros.
	(fromfp): New CHECK_RET_CONST call.
	(ufromfp): Likewise.
	(fromfpx): Likewise.
	(ufromfpx): Likewise.
	(do_test): Call check_return_fromfp, check_return_ufromfp,
	check_return_fromfpx and check_return_ufromfpx.
	* math/test-tgmath.c: Include <stdint.h>
	(NCALLS): Increase to 138.
	(F(compile_test)): Initialize i.  Call fromfp functions.
	(F(fromfp)): New function.
	(F(fromfpx)): Likewise.
	(F(ufromfp)): Likewise.
	(F(ufromfpx)): Likewise.
	* manual/arith.texi (Rounding Functions): Document FP_INT_UPWARD,
	FP_INT_DOWNWARD, FP_INT_TOWARDZERO, FP_INT_TONEARESTFROMZERO,
	FP_INT_TONEAREST, fromfp, fromfpf, fromfpl, ufromfp, ufromfpf,
	ufromfpl, fromfpx, fromfpxf, fromfpxl, ufromfpx, ufromfpxf and
	ufromfpxl.
	* manual/libm-err-tab.pl (@all_functions): Add fromfp, fromfpx,
	ufromfp and ufromfpx.
	* math/fromfp.h: New file.
	* sysdeps/ieee754/dbl-64/s_fromfp.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fromfp_main.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_fromfpx.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_ufromfp.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_ufromfpx.c: Likewise.
	* sysdeps/ieee754/flt-32/s_fromfpf.c: Likewise.
	* sysdeps/ieee754/flt-32/s_fromfpf_main.c: Likewise.
	* sysdeps/ieee754/flt-32/s_fromfpxf.c: Likewise.
	* sysdeps/ieee754/flt-32/s_ufromfpf.c: Likewise.
	* sysdeps/ieee754/flt-32/s_ufromfpxf.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fromfpl_main.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_fromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_ufromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_ufromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fromfpl_main.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_fromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_ufromfpl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_ufromfpxl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fromfp,
	ufromfp, fromfpx and ufromfpx.
	(CFLAGS-nldbl-fromfp.c): New variable.
	(CFLAGS-nldbl-fromfpx.c): Likewise.
	(CFLAGS-nldbl-ufromfp.c): Likewise.
	(CFLAGS-nldbl-ufromfpx.c): Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h: Include <stdint.h>.
	* sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c: New file.
	* sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c: Likewise.
	* sysdeps/nacl/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-12-31 00:40:59 +00:00
Joseph Myers 41c67149b9 Add roundeven, roundevenf, roundevenl.
TS 18661-1 defines roundeven functions that round a floating-point
number to the nearest integer, in that floating-point type, with ties
rounding to even (whereas the round functions round ties away from
zero).  As with other such functions, they raise no exceptions apart
from "invalid" for signaling NaNs.  There was a previous user request
for this functionality in glibc in
<https://sourceware.org/ml/libc-help/2015-02/msg00005.html>.

This patch implements these functions for glibc.  The implementations
use integer bit-manipulation (or roundeven on the high and low parts,
in the IBM long double case).  It's possible that there may be faster
approaches on some architectures (in particular, on AArch64 the frintn
instruction should do exactly what's required); I'll leave it to
architecture maintainers or others interested to implement such
architecture-specific versions if desired.  (Where architectures have
instructions to round to nearest integer in the current rounding mode,
implementations saving and restoring the rounding mode - and dealing
with exceptions if those instructions generate "inexact" - are also
possible, though their performance depends on the cost of manipulating
exceptions / rounding mode state.)

Tested for x86_64, x86, mips64 and powerpc.

	* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
	(roundeven): New declaration.
	* math/tgmath.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (roundeven): New
	macro.
	* math/Versions (roundeven): New libm symbol at version
	GLIBC_2.25.
	(roundevenf): Likewise.
	(roundevenl): Likewise.
	* math/Makefile (libm-calls): Add s_roundevenF.
	* math/libm-test.inc (roundeven_test_data): New array.
	(roundeven_test): New function.
	(main): Call roundeven_test.
	* math/test-tgmath.c (NCALLS): Increase to 134.
	(F(compile_test)): Call roundeven.
	(F(roundeven)): New function.
	* manual/arith.texi (Rounding Functions): Document roundeven,
	roundevenf and roundevenl.
	* manual/libm-err-tab.pl (@all_functions): Add roundeven.
	* include/math.h (roundeven): Use libm_hidden_proto.
	* sysdeps/ieee754/dbl-64/s_roundeven.c: New file.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_roundeven.c: Likewise.
	* sysdeps/ieee754/flt-32/s_roundevenf.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_roundevenl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_roundevenl.c: Likewise.
	* sysdeps/ieee754/ldbl-96/s_roundevenl.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add
	roundeven.
	(CFLAGS-nldbl-roundeven.c): New variable.
	* sysdeps/ieee754/ldbl-opt/nldbl-roundeven.c: New file.
	* sysdeps/nacl/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-12-21 01:48:27 +00:00