Commit Graph

22022 Commits

Author SHA1 Message Date
Joseph Myers 0c4fe28d7a Remove old po/ code for copying .po files from shared directory.
po/Makefile has both old code for copying .po files from a shared
directory /com/share/ftp/gnu/po/maint/glibc (presumably once present
on some GNU server), and new code for downloading them from the
Translation Project.  This patch removes the old code, leading only
the new code.

Tested for x86_64.

	* po/Makefile (linguas): Remove rule and dependencies.
	(linguas.mo): Likewise.
	(.PHONY): Do not depend on linguas and linguas.mo.
	(podir): Remove variable.
	(pofiles): Likewise.
	[$(pofiles)] (%.po): Remove rule.
2017-12-15 14:20:52 +00:00
Joseph Myers 174edbde7e Update SPARC divrem generation to match output.
While working on another patch I noticed that (a)
sysdeps/sparc/sparc32/Makefile is the only place with special
realclean settings, apart from po/, and (b) the generated files with a
rule in that Makefile to generate them (using m4) had been patched
manually so no longer corresponded with the output of the generator -
so if the timestamps were wrong, a build would result in changes to
the files in the source directory.  (They also didn't correspond
because of changes in make 3.81 to how make handles whitespace at the
start of a line in a sequence of backslash-newline continuation lines
within a recipe.)

This patch fixes the generation and output files to match.  The issue
with make and whitespace at start of continuation lines is fixed by
putting those newlines outside of arguments to echo, so the number of
spaces in the argument matches the number in the existing generated
files.  Then divrem.m4 is changed to avoid generating whitespace-only
lines (my fix to the outputs from 2013; this fix to the generator also
changes the indentation of a label in the output files) and to
generate an alias in udiv.S (Adhemerval's fix from March).

build-many-glibcs.py doesn't have a non-v9 SPARC configuration,
because non-v9 32-bit SPARC didn't build when I set up
build-many-glibcs.py but sparcv9 did build.  Whether or not non-v9
32-bit SPARC now builds (or indeed whether or not support for it is
obsolete), I tested by removing the sparcv8 and sparcv9 versions of
the four files in question, so forcing the generated files to be built
and used, and the compilation parts of the glibc testsuite passed.

	* sysdeps/sparc/sparc32/Makefile
	($(divrem:%=$(sysdep_dir)/sparc/sparc32/%.S)): Do not include
	start-of-line whitespace in argument of echo.
	* sysdeps/sparc/sparc32/divrem.m4: Avoid generating lines starting
	with whitespace.  Generate __wrap_.udiv alias.
	* sysdeps/sparc/sparc32/rem.S: Regenerated.
	* sysdeps/sparc/sparc32/sdiv.S: Likewise.
	* sysdeps/sparc/sparc32/udiv.S: Likewise.
	* sysdeps/sparc/sparc32/urem.S: Likewise.
2017-12-15 14:06:07 +00:00
Rajalakshmi Srinivasaraghavan 1e36806fb8 powerpc: st{r,p}cpy optimization for aligned strings
This patch makes use of vectors for aligned inputs.  Improvements
upto 30% seen for larger aligned inputs.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
2017-12-15 10:55:58 +05:30
Siddhesh Poyarekar 5f1603c331 Convert strcmp benchmark output to json format
The format is now parseable with the compare_strings.py script.
2017-12-15 02:31:41 +05:30
Siddhesh Poyarekar aa6932aa7b Remove redundant mention of SXID_ERASE
SXID_ERASE is implicit for all environment variables.  Avoid
mentioning it in the tunables list; that way only the ones with
SXID_IGNORE remain prominent and mentioned.  TODO: we need to audit
each of those cases and drop them to SXID_ERASE wherever possible.
2017-12-15 00:48:12 +05:30
Florian Weimer 3ff3dfa5af elf: Count components of the expanded path in _dl_init_path [BZ #22607] 2017-12-14 15:31:46 +01:00
Florian Weimer 8a0b17e48b elf: Compute correct array size in _dl_init_paths [BZ #22606] 2017-12-14 15:27:08 +01:00
Florian Weimer f58bd7f055 support: Simplify compiling most of support/ outside of glibc
Some include files were missing because they are implied by the
in-tree build process.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2017-12-14 13:48:56 +01:00
H.J. Lu 4ca945e9c5 x86-64: Remove sysdeps/x86_64/fpu/s_cosf.S
On Ivy Bridge, bench-cosf reports performance improvement:

           s_cosf.S      s_cosf.c       Improvement
max        114.136       82.401            39%
min        13.119        11.301            16%
mean       22.1882       21.8938           1%

	* sysdeps/x86_64/fpu/s_cosf.S: Removed.
2017-12-14 04:39:53 -08:00
Patrick McGehearty e6a1c5dc77 sparc: M7 optimized memset/bzero
Support added to identify Sparc M7/T7/S7/M8/T8 processor capability.
Performance tests run on Sparc S7 using new code and old niagara4 code.

Optimizations for memset also apply to bzero as they share code.

For memset/bzero, performance comparison with niagara4 code:
For memset nonzero data,
  256-1023 bytes - 60-90% gain (in cache); 5% gain (out of cache)
  1K+ bytes - 80-260% gain (in cache); 40-80% gain (out of cache)
For memset zero data (and bzero),
  256-1023 bytes - 80-120% gain (in cache), 0% gain (out of cache)
  1024+ bytes - 2-4x gain (in cache), 10-35% gain (out of cache)

Tested in sparcv9-*-* and sparc64-*-* targets in both multi and
non-multi arch configurations.

	Patrick McGehearty <patrick.mcgehearty@oracle.com>
	Adhemerval Zanella  <adhemerval.zanella@linaro.org>

	* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
	(sysdeps_routines): Add memset-niagara7.
	* sysdeps/sparc/sparc64/multiarch/Makefile (sysdes_rotuines):
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memset-niagara7.S: New
	file.
	* sysdeps/sparc/sparc64/multiarch/memset-niagara7.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Add __bzero_niagara7 and __memset_niagara7.
	* sysdeps/sparc/sparc64/multiarch/ifunc-memset.h (IFUNC_SELECTOR):
	Add niagara7 option.
	* NEWS: Mention sparc m7 optimized memcpy, mempcpy, memmove, and
	memset.
2017-12-14 08:48:19 -02:00
Patrick McGehearty 1b6e07f8e0 sparc: M7 optimized memcpy/mempcpy/memmove
Support added to identify Sparc M7/T7/S7/M8/T8 processor capability.
Performance tests run on Sparc S7 using new code and old niagara4 code.

Optimizations for memcpy also apply to mempcpy and memmove
where they share code. Optimizations for memset also apply
to bzero as they share code.

For memcpy/mempcpy/memmove, performance comparison with niagara4 code:
Long word aligned data
  0-127 bytes - minimal changes
  128-1023 bytes - 7-30% gain
  1024+ bytes - 1-7% gain (in cache); 30-100% gain (out of cache)
Word aligned data
  0-127 bytes - 50%+ gain
  128-1023 bytes - 10-200% gain
  1024+ bytes - 0-15% gain (in cache); 5-50% gain (out of cache)
Unaligned data
  0-127 bytes - 0-70%+ gain
  128-447 bytes - 40-80%+ gain
  448-511 bytes - 1-3% loss
  512-4096 bytes - 2-3% gain (in cache); 0-20% gain (out of cache)
  4096+ bytes - ± 3% (in cache); 20-50% gain (out of cache)

Tested in sparcv9-*-* and sparc64-*-* targets in both multi and
non-multi arch configurations.

	Patrick McGehearty  <patrick.mcgehearty@oracle.com>
	Adhemerval Zanella  <adhemerval.zanella@linaro.org>

	* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
	(sysdeps_routines): Add memcpy-memmove-niagara7 and memmove-ultra1.
	* sysdeps/sparc/sparc64/multiarch/Makefile (sysdeps_routines):
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-memmove-niagara7.S:
	New file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memmove-ultra1.S: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/rtld-memmove.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Add __memcpy_niagara7, __mempcpy_niagara7,
	and __memmove_niagara7.
	* sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h (IFUNC_SELECTOR):
	Add niagara7 option.
	* sysdeps/sparc/sparc64/multiarch/memmove.c: New file.
	* sysdeps/sparc/sparc64/multiarch/ifunc-memmove.h: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memcpy-memmove-niagara7.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memmove-ultra1.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/rtld-memmove.c: Likewise.
2017-12-14 08:47:38 -02:00
Jose E. Marchesi 767a26d6a0 sparc: assembly version of memmove for ultra1+
Tested in sparcv9-*-* and sparc64-*-* targets in both non-multi-arch and
multi-arch configurations.

	* sysdeps/sparc/sparc32/sparcv9/memmove.S: New file.
	* sysdeps/sparc/sparc32/sparcv9/rtld-memmove.c: Likewise.
	* sysdeps/sparc/sparc64/memmove.S: Likewise.
	* sysdeps/sparc/sparc64/rtld-memmove.c: Likewise.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-14 08:47:09 -02:00
Jose E. Marchesi bfb7bf2273 sparc: support the ADP hw capability
This patch adds support for the ADP (also known as adi) hardware
capability, as reported by the kernel sparc port when running on M7
machines.

Tested in both sparcv9-*-* and sparc64-*-* targets.

	* sysdeps/sparc/bits/hwcap.h (HWCAP_SPARC_ADP): Defined.
	* sysdeps/sparc/dl-procinfo.c: Added "adp" to the
	_dl_sparc_cap_flags array.
	* sysdeps/sparc/dl-procinfo.h (_DL_HWCAP_COUNT): Increment.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2017-12-14 08:47:07 -02:00
Siddhesh Poyarekar 2bce01ebba aarch64: Improve strcmp unaligned performance
Replace the simple byte-wise compare in the misaligned case with a
dword compare with page boundary checks in place.  For simplicity I've
chosen a 4K page boundary so that we don't have to query the actual
page size on the system.

This results in up to 3x improvement in performance in the unaligned
case on falkor and about 2.5x improvement on mustang as measured using
bench-strcmp.

	* sysdeps/aarch64/strcmp.S (misaligned8): Compare dword at a
	time whenever possible.
2017-12-13 18:50:27 +05:30
Carlos O'Donell 243b63337c Fix testing with nss-crypt.
A glibc master build with --enable-nss-crypt using the NSS
crypto libraries fails during make check with the following error:

<command-line>:0:0: error: "USE_CRYPT" redefined [-Werror]
<command-line>:0:0: note: this is the location of the previous
definition

This is caused by commit 36975e8e7e
by H.J. Lu which replaces all = with +=. The fix is to undefine
USE_CRYPT before defining it to zero.

Committed as an obvious fix. Fixes the build issue on x86_64 with
no regressions.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
2017-12-12 18:34:33 -08:00
Joseph Myers 6f7c009282 Add sysdeps/ieee754/soft-fp.
The default sysdeps/ieee754 fma implementations rely on exceptions and
rounding modes to achieve correct results through internal use of
round-to-odd.  Thus, glibc configurations without support for
exceptions and rounding modes instead need to use implementations of
fma based on soft-fp.

At present, this is achieved via having implementation files in
soft-fp/ that are #included by sysdeps files for each glibc
configuration that needs them.  In general this means such a
configuration has its own s_fma.c and s_fmaf.c.

TS 18661-1 adds functions that do an operation (+ - * / sqrt fma) on
arguments wider than the return type, with a single rounding of the
infinite-precision result to that return type.  These are also
naturally implemented using round-to-odd on platforms with hardware
support for rounding modes and exceptions but lacking hardware support
for these narrowing operations themselves.  (Platforms that have
direct hardware support for such narrowing operations include at least
ia64, and Power ISA 2.07 or later, which I think means POWER8 or
later.)

So adding the remaining TS 18661-1 functions would mean at least six
narrowing function implementations (fadd fsub fmul fdiv ffma fsqrt),
with aliases for other types and further implementations in some
configurations, that need to be overridden for configurations lacking
hardware exceptions and rounding modes.  Requiring all such
configurations (currently seven of them) to have their own source
files for all those functions seems undesirable.

Thus, this patch adds a directory sysdeps/ieee754/soft-fp to contain
libm function implementations based on soft-fp.  This directory is
then used via Implies from all the configurations that need it, so no
more files need adding to every such configuration when adding more
functions with soft-fp implementations.  A configuration can still
selectively #include a particular file from this directory if desired;
thus, the MIPS #include of the fmal implementation is retained, since
that's appropriate even for hard float (because long double is always
implementated in software for MIPS64, so the soft-fp implementation of
fmal is better than the ldbl-128 one).

This also provides additional motivation for my recent patch removing
--with-fp / --without-fp: previously there was no need for correct use
of --without-fp for no-FPU ARM or SH3, and now we have autodetection
nofpu/ sysdeps directories can be used by this patch for those
configurations without imposing any new requirements on how glibc is
configured.

(The mips64/*/fpu/s_fma.c files added by this patch are needed to keep
the dbl-64 version of fma for double, rather than the ldbl-128 one,
used in that case.)

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by this patch.

	* soft-fp/fmadf4.c: Move to ....
	* sysdeps/ieee754/soft-fp/s_fma.c: ... here.
	* soft-fp/fmasf4.c: Move to ....
	* sysdeps/ieee754/soft-fp/s_fmaf.c: ... here.
	* soft-fp/fmatf4.c: Move to ....
	* sysdeps/ieee754/soft-fp/s_fmal.c: ... here.
	* sysdeps/ieee754/soft-fp/Makefile: New file.
	* sysdeps/arm/preconfigure.ac: Define with_fp_cond.
	* sysdeps/arm/preconfigure: Regenerated.
	* sysdeps/arm/nofpu/Implies: New file.
	* sysdeps/arm/s_fma.c: Remove file.
	* sysdeps/arm/s_fmaf.c: Likewise.
	* sysdeps/m68k/coldfire/nofpu/Implies: New file.
	* sysdeps/m68k/coldfire/nofpu/s_fma.c: Remove file.
	* sysdeps/m68k/coldfire/nofpu/s_fmaf.c: Likewise.
	* sysdeps/microblaze/Implies: Add ieee754/soft-fp.
	* sysdeps/microblaze/s_fma.c: Remove file.
	* sysdeps/microblaze/s_fmaf.c: Likewise.
	* sysdeps/mips/mips32/nofpu/Implies: New file.
	* sysdeps/mips/mips64/n32/fpu/s_fma.c: Likewise.
	* sysdeps/mips/mips64/n32/nofpu/Implies: Likewise.
	* sysdeps/mips/mips64/n64/fpu/s_fma.c: Likewise.
	* sysdeps/mips/mips64/n64/nofpu/Implies: Likewise.
	* sysdeps/mips/ieee754/s_fma.c: Remove file.
	* sysdeps/mips/ieee754/s_fmaf.c: Likewise.
	* sysdeps/mips/ieee754/s_fmal.c: Update include for move of fmal
	implementation.
	* sysdeps/nios2/Implies: Add ieee754/soft-fp.
	* sysdeps/nios2/s_fma.c: Remove file.
	* sysdeps/nios2/s_fmaf.c: Likewise.
	* sysdeps/sh/nofpu/Implies: New file.
	* sysdeps/sh/s_fma.c: Remove file.
	* sysdeps/sh/s_fmaf.c: Likewise.
	* sysdeps/tile/Implies: Add ieee754/soft-fp.
	* sysdeps/tile/s_fma.c: Remove file.
	* sysdeps/tile/s_fmaf.c: Likewise.
2017-12-12 23:35:21 +00:00
H.J. Lu ac817e083b x86-64: Add cosf with FMA
On Skylake, bench-cosf reports performance improvement:

            Before        After         Improvement
max        135.362       94.552            43%
min        8.532         7.688             11%
mean       17.1446       11.8128           45%

	* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
	Add s_cosf-sse2 and s_cosf-fma.
	(CFLAGS-s_cosf-fma.c): New.
	* sysdeps/x86_64/fpu/multiarch/s_cosf-fma.c: New file.
	* sysdeps/x86_64/fpu/multiarch/s_cosf-sse2.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_cosf.c: Likewise.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-12 15:32:58 -08:00
Steve Ellcey eb4285768b Use memcpy instead of strncpy in nscd/nscd.h to fix build problem with ToT GCC
* nscd/nscd.h (init_traced_file): Change strncpy to memcpy.
2017-12-12 13:47:32 -08:00
Adhemerval Zanella cc683f7ed4 libio: Free backup area when it not required (BZ#22415)
Some libio operations fail to correctly free the backup area (created
by _IO_{w}default_pbackfail on unget{w}c) resulting in either invalid
buffer free operations or memory leaks.

For instance, on the example provided by BZ#22415 a following
fputc after a fseek to rewind the stream issues an invalid free on
the buffer.  It is because although _IO_file_overflow correctly
(from fputc) correctly calls _IO_free_backup_area, the
_IO_new_file_seekoff (called by fseek) updates the FILE internal
pointers without first free the backup area (resulting in invalid
values in the internal pointers).

The wide version also shows an issue, but instead of accessing invalid
pointers it leaks the backup memory on fseek/fputwc operation.

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

	* libio/Makefile (tests): Add tst-bz22415.
	(tst-bz22415-ENV): New rule.
	(generated): Add tst-bz22415.mtrace and tst-bz22415.check.
	(tests-special): Add tst-bz22415-mem.out.
	($(objpfx)tst-bz22415-mem.out): New rule.
	* libio/fileops.c (_IO_new_file_seekoff): Call _IO_free_backup_area
	in case of a successful seek operation.
	* libio/wfileops.c (_IO_wfile_seekoff): Likewise.
	(_IO_wfile_overflow): Call _IO_free_wbackup_area in case a write
	buffer is required.
	* libio/tst-bz22415.c: New test.
2017-12-12 17:29:54 -02:00
Adhemerval Zanella c80acdc325 Update IA64 libm-test-ulps
Ran on Itanium Processor 9020, GCC 7.2.1.

	* sysdeps/ia64/fpu/libm-test-ulps: Update.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-12 16:57:41 -02:00
James Clarke 89bd8016b3 ia64: Add ipc_priv.h header to set __IPC_64 to zero
When running strace, IPC_64 was set in the command, but ia64 is
an architecture where CONFIG_ARCH_WANT_IPC_PARSE_VERSION *isn't* set
in the kernel, so ipc_parse_version just returns IPC_64 without
clearing the IPC_64 bit in the command.

	* sysdeps/unix/sysv/linux/ia64/ipc_priv.h: New file defining
	__IPC_64 to 0 to avoid IPC_64 being set.

Signed-off-by: James Clarke <jrtc27@jrtc27.com>
2017-12-12 12:19:24 -02:00
Szabolcs Nagy 4e0dca54e9 [BZ #22593] Fix nextafter and nexttoward declaration
These functions set errno and thus the const attribute was wrong.

	[BZ #22593]
	* math/bits/mathcalls.h (nextafter): Remove const.
	(nexttoward): Likewise.
2017-12-12 13:59:18 +00:00
Joseph Myers 8df5d34720 Remove --with-fp / --without-fp.
There is a configure option --without-fp that specifies that nofpu
sysdeps directories should be used instead of fpu directories.

For most glibc configurations, this option is of no use: either there
is no valid nofpu variant of that configuration, or there are no fpu
or nofpu sysdeps directories for that processor and so the option does
nothing.  For a few configurations, if you are using a soft-float
compiler this option is required, and failing to use it generally
results in compilation errors from inline asm using unavailable
floating-point instructions.

We're moving away from --with-cpu to configuring glibc based on how
the compiler generates code, and it is natural to do so for
--without-fp as well; in most cases the soft-float and hard-float ABIs
are incompatible so you have no hope of building a working glibc with
an inappropriately configured compiler or libgcc.

This patch eliminates --without-fp, replacing it entirely by automatic
configuration based on the compiler.  Configurations for which this is
relevant (coldfire / mips / powerpc32 / sh) define a variable
with_fp_cond in their preconfigure fragments (under the same
conditions under which those fragments do anything); this is a
preprocessor conditional which the toplevel configure script then uses
in a test to determine which sysdeps directories to use.

The config.make with-fp variable remains.  It's used only by powerpc
(sysdeps/powerpc/powerpc32/Makefile) to add -mhard-float to various
flags variables.  For powerpc, -mcpu= options can imply use of
soft-float.  That could be an issue if you want to build for
e.g. 476fp, but are using --with-cpu=476 because there isn't a 476fp
sysdeps directory.  If in future we eliminate --with-cpu and replace
it entirely by testing the compiler, it would be natural at that point
to eliminate that code as well (as the user should then just use a
compiler defaulting to 476fp and the 476 sysdeps directory would be
used automatically).

Tested for x86_64, and tested with build-many-glibcs.py that installed
shared libraries are unchanged by this patch.

	* configure.ac (--with-fp): Remove configure option.
	(with_fp_cond): New variable.
	(libc_cv_with_fp): New configure test.  Use this variable instead
	of with_fp.
	* configure: Regenerated.
	* config.make.in (with-fp): Use @libc_cv_with_fp@.
	* manual/install.texi (Configuring and compiling): Remove
	--without-fp.
	* INSTALL: Regenerated.
	* sysdeps/m68k/preconfigure (with_fp_cond): Define for ColdFire.
	* sysdeps/mips/preconfigure (with_fp_cond): Define.
	* sysdeps/powerpc/preconfigure (with_fp_cond): Define for 32-bit.
	* sysdeps/sh/preconfigure (with_fp_cond): Define.
	* scripts/build-many-glibcs.py (Context.add_all_configs): Do not
	use --without-fp to configure glibc.
2017-12-12 13:56:47 +00:00
Rical Jasan 0cee1257a9 manual: Fix a typo in locale.texi.
* manual/locale.texi (nl_langinfo): Fix a typo.
2017-12-12 03:21:53 -08:00
Aurelien Jarno f54ad2f9ea manual/conf.texi: add a missing underscore in front of SC_SSIZE_MAX [BZ #22588]
Changelog:
	* manual/conf.texi (SC_SSIZE_MAX): Rename into _SC_SSIZE_MAX.
2017-12-12 00:11:29 +01:00
H.J. Lu 36975e8e7e Replace = with += in CFLAGS-xxx.c/CPPFLAGS-xxx.c
Replace = with += in CFLAGS-xxx.c and CPPFLAGS-xxx.c to allow Makefile
under sysdeps to define CFLAGS-xx.c and CPPFLAGS-xxx.c.

	* argp/Makefile (CFLAGS-argp-help.c): Replace = with +=.
	(CFLAGS-argp-parse.c): Likewise.
	(CFLAGS-argp-fmtstream.c): Likewise.
	* crypt/Makefile (CPPFLAGS-sha256-crypt.c): Likewise.
	(CPPFLAGS-sha512-crypt.c): Likewise.
	(CPPFLAGS-md5-crypt.c): Likewise.
	* debug/Makefile (CFLAGS-stack_chk_fail.c): Likewise.
	(CFLAGS-stack_chk_fail_local.c): Likewise.
	(CFLAGS-backtrace.c): Likewise.
	(CFLAGS-sprintf_chk.c): Likewise.
	(CFLAGS-snprintf_chk.c): Likewise.
	(CFLAGS-vsprintf_chk.c): Likewise.
	(CFLAGS-vsnprintf_chk.c): Likewise.
	(CFLAGS-asprintf_chk.c): Likewise.
	(CFLAGS-vasprintf_chk.c): Likewise.
	(CFLAGS-obprintf_chk.c): Likewise.
	(CFLAGS-dprintf_chk.c): Likewise.
	(CFLAGS-vdprintf_chk.c): Likewise.
	(CFLAGS-printf_chk.c): Likewise.
	(CFLAGS-fprintf_chk.c): Likewise.
	(CFLAGS-vprintf_chk.c): Likewise.
	(CFLAGS-vfprintf_chk.c): Likewise.
	(CFLAGS-gets_chk.c): Likewise.
	(CFLAGS-fgets_chk.c): Likewise.
	(CFLAGS-fgets_u_chk.c): Likewise.
	(CFLAGS-fread_chk.c): Likewise.
	(CFLAGS-fread_u_chk.c): Likewise.
	(CFLAGS-swprintf_chk.c): Likewise.
	(CFLAGS-vswprintf_chk.c): Likewise.
	(CFLAGS-wprintf_chk.c): Likewise.
	(CFLAGS-fwprintf_chk.c): Likewise.
	(CFLAGS-vwprintf_chk.c): Likewise.
	(CFLAGS-vfwprintf_chk.c): Likewise.
	(CFLAGS-fgetws_chk.c): Likewise.
	(CFLAGS-fgetws_u_chk.c): Likewise.
	(CFLAGS-read_chk.c): Likewise.
	(CFLAGS-pread_chk.c): Likewise.
	(CFLAGS-pread64_chk.c): Likewise.
	(CFLAGS-recv_chk.c): Likewise.
	(CFLAGS-recvfrom_chk.c): Likewise.
	(CFLAGS-tst-longjmp_chk.c): Likewise.
	(CPPFLAGS-tst-longjmp_chk.c): Likewise.
	(CFLAGS-tst-longjmp_chk2.c): Likewise.
	(CPPFLAGS-tst-longjmp_chk2.c): Likewise.
	(CFLAGS-tst-longjmp_chk3.c): Likewise.
	(CPPFLAGS-tst-longjmp_chk3.c): Likewise.
	(CFLAGS-tst-chk1.c): Likewise.
	(CFLAGS-tst-chk2.c): Likewise.
	(CFLAGS-tst-chk3.c): Likewise.
	(CFLAGS-tst-chk4.cc): Likewise.
	(CFLAGS-tst-chk5.cc): Likewise.
	(CFLAGS-tst-chk6.cc): Likewise.
	(CFLAGS-tst-lfschk1.c): Likewise.
	(CFLAGS-tst-lfschk2.c): Likewise.
	(CFLAGS-tst-lfschk3.c): Likewise.
	(CFLAGS-tst-lfschk4.cc): Likewise.
	(CFLAGS-tst-lfschk5.cc): Likewise.
	(CFLAGS-tst-lfschk6.cc): Likewise.
	(CFLAGS-tst-ssp-1.c): Likewise.
	* dirent/Makefile (CFLAGS-scandir.c): Likewise.
	(CFLAGS-scandir64.c): Likewise.
	(CFLAGS-scandir-tail.c): Likewise.
	(CFLAGS-scandir64-tail.c): Likewise.
	* elf/Makefile (CPPFLAGS-dl-tunables.c): Likewise.
	(CFLAGS-dl-tunables.c): Likewise.
	(CFLAGS-dl-runtime.c): Likewise.
	(CFLAGS-dl-lookup.c): Likewise.
	(CFLAGS-dl-iterate-phdr.c): Likewise.
	(CFLAGS-vismain.c): Likewise.
	(CFLAGS-tst-linkall-static.c): Likewise.
	(CFLAGS-tst-linkall-static.c): Likewise.
	(CPPFLAGS-dl-load.c): Likewise.
	(CFLAGS-ldconfig.c): Likewise.
	(CFLAGS-dl-cache.c): Likewise.
	(CFLAGS-cache.c): Likewise.
	(CFLAGS-rtld.c): Likewise.
	(CFLAGS-multiload.c): Likewise.
	(CFLAGS-filtmod1.c): Likewise.
	(CFLAGS-tst-align.c): Likewise.
	(CFLAGS-tst-align2.c): Likewise.
	(CFLAGS-tst-alignmod.c): Likewise.
	(CFLAGS-tst-alignmod2.c): Likewise.
	(CPPFLAGS-tst-execstack.c): Likewise.
	(CFLAGS-tst-ptrguard1-static.c): Likewise.
	(CFLAGS-tst-latepthreadmod.c): Likewise.
	* grp/Makefile (CFLAGS-getgrgid_r.c): Likewise.
	(CFLAGS-getgrnam_r.c): Likewise.
	(CFLAGS-getgrent_r.c): Likewise.
	(CFLAGS-getgrent.c): Likewise.
	(CFLAGS-fgetgrent.c): Likewise.
	(CFLAGS-fgetgrent_r.c): Likewise.
	(CFLAGS-putgrent.c): Likewise.
	(CFLAGS-initgroups.c): Likewise.
	(CFLAGS-getgrgid.c): Likewise.
	* gshadow/Makefile (CFLAGS-getsgent_r.c): Likewise.
	(CFLAGS-getsgent.c): Likewise.
	(CFLAGS-fgetsgent.c): Likewise.
	(CFLAGS-fgetsgent_r.c): Likewise.
	(CFLAGS-putsgent.c): Likewise.
	(CFLAGS-getsgnam.c): Likewise.
	(CFLAGS-getsgnam_r.c): Likewise.
	* iconv/Makefile (CFLAGS-iconv_prog.c): Likewise.
	(CFLAGS-iconv_charmap.c): Likewise.
	(CFLAGS-dummy-repertoire.c): Likewise.
	(CFLAGS-charmap.c): Likewise.
	(CFLAGS-linereader.c): Likewise.
	(CFLAGS-simple-hash.c): Likewise.
	(CFLAGS-gconv_conf.c): Likewise.
	(CFLAGS-iconvconfig.c): Likewise.
	* inet/Makefile (CFLAGS-gethstbyad_r.c): Likewise.
	(CFLAGS-gethstbyad.c): Likewise.
	(CFLAGS-gethstbynm_r.c): Likewise.
	(CFLAGS-gethstbynm.c): Likewise.
	(CFLAGS-gethstbynm2_r.c): Likewise.
	(CFLAGS-gethstbynm2.c): Likewise.
	(CFLAGS-gethstent_r.c): Likewise.
	(CFLAGS-gethstent.c): Likewise.
	(CFLAGS-rcmd.c): Likewise.
	(CFLAGS-getnetbynm_r.c): Likewise.
	(CFLAGS-getnetbynm.c): Likewise.
	(CFLAGS-getnetbyad_r.c): Likewise.
	(CFLAGS-getnetbyad.c): Likewise.
	(CFLAGS-getnetent_r.c): Likewise.
	(CFLAGS-getnetent.c): Likewise.
	(CFLAGS-getaliasent_r.c): Likewise.
	(CFLAGS-getaliasent.c): Likewise.
	(CFLAGS-getrpcent_r.c): Likewise.
	(CFLAGS-getrpcent.c): Likewise.
	(CFLAGS-getservent_r.c): Likewise.
	(CFLAGS-getservent.c): Likewise.
	(CFLAGS-getprtent_r.c): Likewise.
	(CFLAGS-getprtent.c): Likewise.
	(CFLAGS-either_ntoh.c): Likewise.
	(CFLAGS-either_hton.c): Likewise.
	(CFLAGS-getnetgrent.c): Likewise.
	(CFLAGS-getnetgrent_r.c): Likewise.
	(CFLAGS-tst-checks-posix.c): Likewise.
	(CFLAGS-tst-sockaddr.c): Likewise.
	* intl/Makefile (CFLAGS-tst-gettext.c): Likewise.
	(CFLAGS-tst-translit.c): Likewise.
	(CFLAGS-tst-gettext2.c): Likewise.
	(CFLAGS-tst-codeset.c): Likewise.
	(CFLAGS-tst-gettext3.c): Likewise.
	(CFLAGS-tst-gettext4.c): Likewise.
	(CFLAGS-tst-gettext5.c): Likewise.
	(CFLAGS-tst-gettext6.c): Likewise.
	* io/Makefile (CFLAGS-open.c): Likewise.
	(CFLAGS-open64.c): Likewise.
	(CFLAGS-creat.c): Likewise.
	(CFLAGS-creat64.c): Likewise.
	(CFLAGS-fcntl.c): Likewise.
	(CFLAGS-poll.c): Likewise.
	(CFLAGS-ppoll.c): Likewise.
	(CFLAGS-lockf.c): Likewise.
	(CFLAGS-statfs.c): Likewise.
	(CFLAGS-fstatfs.c): Likewise.
	(CFLAGS-statvfs.c): Likewise.
	(CFLAGS-fstatvfs.c): Likewise.
	(CFLAGS-fts.c): Likewise.
	(CFLAGS-fts64.c): Likewise.
	(CFLAGS-ftw.c): Likewise.
	(CFLAGS-ftw64.c): Likewise.
	(CFLAGS-lockf.c): Likewise.
	(CFLAGS-posix_fallocate.c): Likewise.
	(CFLAGS-posix_fallocate64.c): Likewise.
	(CFLAGS-fallocate.c): Likewise.
	(CFLAGS-fallocate64.c): Likewise.
	(CFLAGS-read.c): Likewise.
	(CFLAGS-write.c): Likewise.
	(CFLAGS-test-stat.c): Likewise.
	(CFLAGS-test-lfs.c): Likewise.
	* libio/Makefile (CFLAGS-fileops.c): Likewise.
	(CFLAGS-fputc.c): Likewise.
	(CFLAGS-fputwc.c): Likewise.
	(CFLAGS-freopen64.c): Likewise.
	(CFLAGS-freopen.c): Likewise.
	(CFLAGS-fseek.c): Likewise.
	(CFLAGS-fseeko64.c): Likewise.
	(CFLAGS-fseeko.c): Likewise.
	(CFLAGS-ftello64.c): Likewise.
	(CFLAGS-ftello.c): Likewise.
	(CFLAGS-fwide.c): Likewise.
	(CFLAGS-genops.c): Likewise.
	(CFLAGS-getc.c): Likewise.
	(CFLAGS-getchar.c): Likewise.
	(CFLAGS-getwc.c): Likewise.
	(CFLAGS-getwchar.c): Likewise.
	(CFLAGS-iofclose.c): Likewise.
	(CFLAGS-iofflush.c): Likewise.
	(CFLAGS-iofgetpos64.c): Likewise.
	(CFLAGS-iofgetpos.c): Likewise.
	(CFLAGS-iofgets.c): Likewise.
	(CFLAGS-iofgetws.c): Likewise.
	(CFLAGS-iofputs.c): Likewise.
	(CFLAGS-iofputws.c): Likewise.
	(CFLAGS-iofread.c): Likewise.
	(CFLAGS-iofsetpos64.c): Likewise.
	(CFLAGS-iofsetpos.c): Likewise.
	(CFLAGS-ioftell.c): Likewise.
	(CFLAGS-iofwrite.c): Likewise.
	(CFLAGS-iogetdelim.c): Likewise.
	(CFLAGS-iogetline.c): Likewise.
	(CFLAGS-iogets.c): Likewise.
	(CFLAGS-iogetwline.c): Likewise.
	(CFLAGS-ioputs.c): Likewise.
	(CFLAGS-ioseekoff.c): Likewise.
	(CFLAGS-ioseekpos.c): Likewise.
	(CFLAGS-iosetbuffer.c): Likewise.
	(CFLAGS-iosetvbuf.c): Likewise.
	(CFLAGS-ioungetc.c): Likewise.
	(CFLAGS-ioungetwc.c): Likewise.
	(CFLAGS-oldfileops.c): Likewise.
	(CFLAGS-oldiofclose.c): Likewise.
	(CFLAGS-oldiofgetpos64.c): Likewise.
	(CFLAGS-oldiofgetpos.c): Likewise.
	(CFLAGS-oldiofsetpos64.c): Likewise.
	(CFLAGS-oldiofsetpos.c): Likewise.
	(CFLAGS-peekc.c): Likewise.
	(CFLAGS-putc.c): Likewise.
	(CFLAGS-putchar.c): Likewise.
	(CFLAGS-putwc.c): Likewise.
	(CFLAGS-putwchar.c): Likewise.
	(CFLAGS-rewind.c): Likewise.
	(CFLAGS-wfileops.c): Likewise.
	(CFLAGS-wgenops.c): Likewise.
	(CFLAGS-oldiofopen.c): Likewise.
	(CFLAGS-iofopen.c): Likewise.
	(CFLAGS-iofopen64.c): Likewise.
	(CFLAGS-oldtmpfile.c): Likewise.
	(CFLAGS-tst_putwc.c): Likewise.
	* locale/Makefile (CFLAGS-md5.c): Likewise.
	(CFLAGS-charmap.c): Likewise.
	(CFLAGS-locfile.c): Likewise.
	(CFLAGS-charmap-dir.c): Likewise.
	* login/Makefile (CFLAGS-grantpt.c): Likewise.
	(CFLAGS-getpt.c): Likewise.
	(CFLAGS-pt_chown.c): Likewise.
	* malloc/Makefile (CFLAGS-mcheck-init.c): Likewise.
	(CFLAGS-obstack.c): Likewise.
	* math/Makefile (CFLAGS-test-tgmath3.c): Likewise.
	(CFLAGS-test-double-vlen4-wrappers.c): Likewise.
	(CFLAGS-test-double-vlen8-wrappers.c): Likewise.
	(CFLAGS-test-float-vlen8-wrappers.c): Likewise.
	(CFLAGS-test-float-vlen16-wrappers.c): Likewise.
	(CFLAGS-test-tgmath.c): Likewise.
	(CFLAGS-test-tgmath2.c): Likewise.
	(CFLAGS-test-tgmath-ret.c): Likewise.
	(CFLAGS-test-powl.c): Likewise.
	(CFLAGS-test-snan.c): Likewise.
	(CFLAGS-test-signgam-finite.c): Likewise.
	(CFLAGS-test-signgam-finite-c99.c): Likewise.
	(CFLAGS-test-signgam-finite-c11.c): Likewise.
	(CFLAGS-test-signgam-uchar.c): Likewise.
	(CFLAGS-test-signgam-uchar-init.c): Likewise.
	(CFLAGS-test-signgam-uchar-static.c): Likewise.
	(CFLAGS-test-signgam-uchar-init-static.c): Likewise.
	(CFLAGS-test-signgam-uint.c): Likewise.
	(CFLAGS-test-signgam-uint-init.c): Likewise.
	(CFLAGS-test-signgam-uint-static.c): Likewise.
	(CFLAGS-test-signgam-uint-init-static.c): Likewise.
	(CFLAGS-test-signgam-ullong.c): Likewise.
	(CFLAGS-test-signgam-ullong-init.c): Likewise.
	(CFLAGS-test-signgam-ullong-static.c): Likewise.
	(CFLAGS-test-signgam-ullong-init-static.c): Likewise.
	(CFLAGS-test-math-cxx11.cc): Likewise.
	(CFLAGS-test-math-isinff.cc): Likewise.
	(CFLAGS-test-math-iszero.cc): Likewise.
	(CFLAGS-test-math-issignaling.cc): Likewise.
	(CFLAGS-test-math-iscanonical.cc): Likewise.
	(CFLAGS-test-iszero-excess-precision.c): Likewise.
	(CFLAGS-test-iseqsig-excess-precision.c): Likewise.
	(CFLAGS-test-flt-eval-method.c): Likewise.
	(CFLAGS-test-fe-snans-always-signal.c): Likewise.
	(CFLAGS-test-finite-macros.c): Likewise.
	* misc/Makefile (CFLAGS-select.c): Likewise.
	(CFLAGS-tsearch.c): Likewise.
	(CFLAGS-lsearch.c): Likewise.
	(CFLAGS-pselect.c): Likewise.
	(CFLAGS-readv.c): Likewise.
	(CFLAGS-writev.c): Likewise.
	(CFLAGS-preadv.c): Likewise.
	(CFLAGS-preadv64.c): Likewise.
	(CFLAGS-pwritev.c): Likewise.
	(CFLAGS-pwritev64.c): Likewise.
	(CFLAGS-preadv2.c): Likewise.
	(CFLAGS-preadv64v2.c): Likewise.
	(CFLAGS-pwritev2.c): Likewise.
	(CFLAGS-pwritev64v2.c): Likewise.
	(CFLAGS-usleep.c): Likewise.
	(CFLAGS-syslog.c): Likewise.
	(CFLAGS-error.c): Likewise.
	(CFLAGS-getpass.c): Likewise.
	(CFLAGS-mkstemp.c): Likewise.
	(CFLAGS-mkstemp64.c): Likewise.
	(CFLAGS-getsysstats.c): Likewise.
	(CFLAGS-getusershell.c): Likewise.
	(CFLAGS-err.c): Likewise.
	(CFLAGS-tst-tsearch.c): Likewise.
	(CFLAGS-msync.c): Likewise.
	(CFLAGS-fdatasync.c): Likewise.
	(CFLAGS-fsync.c): Likewise.
	* nptl/Makefile (CFLAGS-nptl-init.c): Likewise.
	(CFLAGS-unwind.c): Likewise.
	(CFLAGS-unwind-forcedunwind.c): Likewise.
	(CFLAGS-pthread_cancel.c): Likewise.
	(CFLAGS-pthread_setcancelstate.c): Likewise.
	(CFLAGS-pthread_setcanceltype.c): Likewise.
	(CFLAGS-cancellation.c): Likewise.
	(CFLAGS-libc-cancellation.c): Likewise.
	(CFLAGS-pthread_exit.c): Likewise.
	(CFLAGS-forward.c): Likewise.
	(CFLAGS-pthread_testcancel.c): Likewise.
	(CFLAGS-pthread_join.c): Likewise.
	(CFLAGS-pthread_timedjoin.c): Likewise.
	(CFLAGS-pthread_once.c): Likewise.
	(CFLAGS-pthread_cond_wait.c): Likewise.
	(CFLAGS-sem_wait.c): Likewise.
	(CFLAGS-sem_timedwait.c): Likewise.
	(CFLAGS-fcntl.c): Likewise.
	(CFLAGS-lockf.c): Likewise.
	(CFLAGS-pread.c): Likewise.
	(CFLAGS-pread64.c): Likewise.
	(CFLAGS-pwrite.c): Likewise.
	(CFLAGS-pwrite64.c): Likewise.
	(CFLAGS-wait.c): Likewise.
	(CFLAGS-waitpid.c): Likewise.
	(CFLAGS-sigwait.c): Likewise.
	(CFLAGS-msgrcv.c): Likewise.
	(CFLAGS-msgsnd.c): Likewise.
	(CFLAGS-tcdrain.c): Likewise.
	(CFLAGS-open.c): Likewise.
	(CFLAGS-open64.c): Likewise.
	(CFLAGS-pause.c): Likewise.
	(CFLAGS-recv.c): Likewise.
	(CFLAGS-send.c): Likewise.
	(CFLAGS-accept.c): Likewise.
	(CFLAGS-sendto.c): Likewise.
	(CFLAGS-connect.c): Likewise.
	(CFLAGS-recvfrom.c): Likewise.
	(CFLAGS-recvmsg.c): Likewise.
	(CFLAGS-sendmsg.c): Likewise.
	(CFLAGS-close.c): Likewise.
	(CFLAGS-read.c): Likewise.
	(CFLAGS-write.c): Likewise.
	(CFLAGS-nanosleep.c): Likewise.
	(CFLAGS-sigsuspend.c): Likewise.
	(CFLAGS-msync.c): Likewise.
	(CFLAGS-fdatasync.c): Likewise.
	(CFLAGS-fsync.c): Likewise.
	(CFLAGS-pt-system.c): Likewise.
	(CFLAGS-tst-cleanup2.c): Likewise.
	(CFLAGS-tst-cleanupx2.c): Likewise.
	(CFLAGS-flockfile.c): Likewise.
	(CFLAGS-ftrylockfile.c): Likewise.
	(CFLAGS-funlockfile.c): Likewise.
	(CFLAGS-tst-initializers1.c): Likewise.
	(CFLAGS-tst-initializers1-c89.c): Likewise.
	(CFLAGS-tst-initializers1-c99.c): Likewise.
	(CFLAGS-tst-initializers1-c11.c): Likewise.
	(CFLAGS-tst-initializers1-gnu89.c): Likewise.
	(CFLAGS-tst-initializers1-gnu99.c): Likewise.
	(CFLAGS-tst-initializers1-gnu11.c): Likewise.
	* nscd/Makefile (CFLAGS-nscd_getpw_r.c): Likewise.
	(CFLAGS-nscd_getgr_r.c): Likewise.
	(CFLAGS-nscd_gethst_r.c): Likewise.
	(CFLAGS-nscd_getai.c): Likewise.
	(CFLAGS-nscd_initgroups.c): Likewise.
	* posix/Makefile (CFLAGS-getaddrinfo.c): Likewise.
	(CFLAGS-pause.c): Likewise.
	(CFLAGS-pread.c): Likewise.
	(CFLAGS-pread64.c): Likewise.
	(CFLAGS-pwrite.c): Likewise.
	(CFLAGS-pwrite64.c): Likewise.
	(CFLAGS-sleep.c): Likewise.
	(CFLAGS-wait.c): Likewise.
	(CFLAGS-waitid.c): Likewise.
	(CFLAGS-waitpid.c): Likewise.
	(CFLAGS-getopt.c): Likewise.
	(CFLAGS-wordexp.c): Likewise.
	(CFLAGS-sysconf.c): Likewise.
	(CFLAGS-pathconf.c): Likewise.
	(CFLAGS-fpathconf.c): Likewise.
	(CFLAGS-spawn.c): Likewise.
	(CFLAGS-spawnp.c): Likewise.
	(CFLAGS-spawni.c): Likewise.
	(CFLAGS-glob.c): Likewise.
	(CFLAGS-glob64.c): Likewise.
	(CFLAGS-getconf.c): Likewise.
	(CFLAGS-nanosleep.c): Likewise.
	* pwd/Makefile (CFLAGS-getpwent_r.c): Likewise.
	(CFLAGS-getpwent.c): Likewise.
	(CFLAGS-getpw.c): Likewise.
	(CFLAGS-fgetpwent_r.c): Likewise.
	* resolv/Makefile (CFLAGS-res_hconf.c): Likewise.
	* rt/Makefile (CFLAGS-aio_suspend.c): Likewise.
	(CFLAGS-mq_timedreceive.c): Likewise.
	(CFLAGS-mq_timedsend.c): Likewise.
	(CFLAGS-clock_nanosleep.c): Likewise.
	(CFLAGS-librt-cancellation.c): Likewise.
	* shadow/Makefile (CFLAGS-getspent_r.c): Likewise.
	(CFLAGS-getspent.c): Likewise.
	(CFLAGS-fgetspent.c): Likewise.
	(CFLAGS-fgetspent_r.c): Likewise.
	(CFLAGS-putspent.c): Likewise.
	(CFLAGS-getspnam.c): Likewise.
	(CFLAGS-getspnam_r.c): Likewise.
	* signal/Makefile (CFLAGS-sigpause.c): Likewise.
	(CFLAGS-sigsuspend.c): Likewise.
	(CFLAGS-sigtimedwait.c): Likewise.
	(CFLAGS-sigwait.c): Likewise.
	(CFLAGS-sigwaitinfo.c): Likewise.
	(CFLAGS-sigreturn.c): Likewise.
	* stdio-common/Makefile (CFLAGS-vfprintf.c): Likewise.
	(CFLAGS-vfwprintf.c): Likewise.
	(CFLAGS-tmpfile.c): Likewise.
	(CFLAGS-tmpfile64.c): Likewise.
	(CFLAGS-tempname.c): Likewise.
	(CFLAGS-psignal.c): Likewise.
	(CFLAGS-vprintf.c): Likewise.
	(CFLAGS-cuserid.c): Likewise.
	(CFLAGS-errlist.c): Likewise.
	(CFLAGS-siglist.c): Likewise.
	(CFLAGS-scanf15.c): Likewise.
	(CFLAGS-scanf17.c): Likewise.
	* stdlib/Makefile (CFLAGS-bsearch.c): Likewise.
	(CFLAGS-msort.c): Likewise.
	(CFLAGS-qsort.c): Likewise.
	(CFLAGS-system.c): Likewise.
	(CFLAGS-fmtmsg.c): Likewise.
	(CFLAGS-strfmon.c): Likewise.
	(CFLAGS-strfmon_l.c): Likewise.
	(CFLAGS-strfromd.c): Likewise.
	(CFLAGS-strfromf.c): Likewise.
	(CFLAGS-strfroml.c): Likewise.
	(CFLAGS-tst-bsearch.c): Likewise.
	(CFLAGS-tst-qsort.c): Likewise.
	(CFLAGS-tst-makecontext2.c): Likewise.
	* sunrpc/Makefile (CFLAGS-xbootparam_prot.c): Likewise.
	(CFLAGS-xnlm_prot.c): Likewise.
	(CFLAGS-xrstat.c): Likewise.
	(CFLAGS-xyppasswd.c): Likewise.
	(CFLAGS-xklm_prot.c): Likewise.
	(CFLAGS-xrex.c): Likewise.
	(CFLAGS-xsm_inter.c): Likewise.
	(CFLAGS-xmount.c): Likewise.
	(CFLAGS-xrusers.c): Likewise.
	(CFLAGS-xspray.c): Likewise.
	(CFLAGS-xnfs_prot.c): Likewise.
	(CFLAGS-xrquota.c): Likewise.
	(CFLAGS-xkey_prot.c): Likewise.
	(CFLAGS-auth_unix.c): Likewise.
	(CFLAGS-key_call.c): Likewise.
	(CFLAGS-pmap_rmt.c): Likewise.
	(CFLAGS-clnt_perr.c): Likewise.
	(CFLAGS-openchild.c): Likewise.
	* sysvipc/Makefile (CFLAGS-msgrcv.c): Likewise.
	(CFLAGS-msgsnd.c): Likewise.
	* termios/Makefile (CFLAGS-tcdrain.c): Likewise.
	* time/Makefile (CFLAGS-tzfile.c): Likewise.
	(CFLAGS-tzset.c): Likewise.
	(CFLAGS-getdate.c): Likewise.
	(CFLAGS-test_time.c): Likewise.
	(CPPFLAGS-tst-tzname.c): Likewise.
	* timezone/Makefile (CFLAGS-zdump.c): Likewise.
	(CFLAGS-zic.c): Likewise.
	* wcsmbs/Makefile (CFLAGS-wcwidth.c): Likewise.
	(CFLAGS-wcswidth.c): Likewise.
	(CFLAGS-wcstol.c): Likewise.
	(CFLAGS-wcstoul.c): Likewise.
	(CFLAGS-wcstoll.c): Likewise.
	(CFLAGS-wcstoull.c): Likewise.
	(CFLAGS-wcstod.c): Likewise.
	(CFLAGS-wcstold.c): Likewise.
	(CFLAGS-wcstof128.c): Likewise.
	(CFLAGS-wcstof.c): Likewise.
	(CFLAGS-wcstol_l.c): Likewise.
	(CFLAGS-wcstoul_l.c): Likewise.
	(CFLAGS-wcstoll_l.c): Likewise.
	(CFLAGS-wcstoull_l.c): Likewise.
	(CFLAGS-wcstod_l.c): Likewise.
	(CFLAGS-wcstold_l.c): Likewise.
	(CFLAGS-wcstof128_l.c): Likewise.
	(CFLAGS-wcstof_l.c): Likewise.
	(CPPFLAGS-tst-wchar-h.c): Likewise.
	(CPPFLAGS-wcstold_l.c): Likewise.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
2017-12-11 13:11:33 -08:00
Paul Clarke f4b2aea6e1 New generic cosf
The same logic used in s_cosf.S version for x86 and powerpc
is used to create a generic s_cosf.c, so there is no performance
improvement in x86_64 and powerpc64.

	* sysdeps/ieee754/flt-32/s_cosf.c: New implementation.
2017-12-11 17:39:42 -02:00
Adhemerval Zanella c9cd7b0ce5 powerpc: POWER8 memcpy optimization for cached memory
On POWER8, unaligned memory accesses to cached memory has little impact
on performance as opposed to its ancestors.

It is disabled by default and will only be available when the tunable
glibc.tune.cached_memopt is set to 1.

                 __memcpy_power8_cached      __memcpy_power7
============================================================
    max-size=4096:     33325.70 ( 12.65%)        38153.00
    max-size=8192:     32878.20 ( 11.17%)        37012.30
   max-size=16384:     33782.20 ( 11.61%)        38219.20
   max-size=32768:     33296.20 ( 11.30%)        37538.30
   max-size=65536:     33765.60 ( 10.53%)        37738.40

	* manual/tunables.texi (Hardware Capability Tunables): Document
	glibc.tune.cached_memopt.
	* sysdeps/powerpc/cpu-features.c: New file.
	* sysdeps/powerpc/cpu-features.h: New file.
	* sysdeps/powerpc/dl-procinfo.c [!IS_IN(ldconfig)]: Add
	_dl_powerpc_cpu_features.
	* sysdeps/powerpc/dl-tunables.list: New file.
	* sysdeps/powerpc/ldsodefs.h: Include cpu-features.h.
	* sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
	(INIT_ARCH): Initialize use_aligned_memopt.
	* sysdeps/powerpc/powerpc64/dl-machine.h [defined(SHARED &&
	IS_IN(rtld))]: Restrict dl_platform_init availability and
	initialize CPU features used by tunables.
	* sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines):
	Add memcpy-power8-cached.
	* sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: Add
	__memcpy_power8_cached.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy.c: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy-power8-cached.S:
	New file.

Reviewed-by: Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
2017-12-11 17:39:42 -02:00
H.J. Lu e70c6fee46 string: Replace = with += in CFLAGS-xxx.c
Replace = with += in CFLAGS-xxx.c to allow Makefile under sysdeps to
define CFLAGS-xx.c.

	* string/Makefile (CFLAGS-inl-tester.c): Replace = with +=.
	(CFLAGS-noinl-tester.c): Likewise.
	(CFLAGS-tst-strlen.c): Likewise.
	(CFLAGS-stratcliff.c): Likewise.
	(CFLAGS-test-ffs.c): Likewise.
	(CFLAGS-tst-inlcall.c): Likewise.
	(CFLAGS-tst-xbzero-opt.c): Likewise.
	(CFLAGS-memcpy.c): Likewise.
	(CFLAGS-wordcopy.c): Likewise.
2017-12-11 08:39:24 -08:00
Stefan Liebler dee943668f S390: Add CFI rule in _dl_runtime_resolve[_vx] for unwinding.
In _dl_runtime_resolve[_vx], unwinding fails after the new stack frame
is created as there is no CFI rule for r15. This is also observeable in
GDB: Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Therefore this patch is now storing r15 on stack and is using cfi_offset rule.
The stmg/lmg instruction is used to store/load r14 and r15 with one instruction.
On 64bit, the offsets of the fprs have moved to store r15 directly after r14.
On 31bit, the r14/r15 is now stored between the other gprs and fprs as the space
wasn't used.

ChangeLog:

	* sysdeps/s390/s390-64/dl-trampoline.h (_dl_runtime_resolve):
	Store r15 on stack and add cfi rule.
	* sysdeps/s390/s390-32/dl-trampoline.h (_dl_runtime_resolve):
	Likewise.
2017-12-11 08:47:51 +01:00
Aurelien Jarno f648728cb1 elf/rtld.c (init_tls): Add missing new line to the _dl_fatal_printf call [BZ #22577]
Changelog:
	* elf/rtld.c (init_tls): Add missing new line to the _dl_fatal_printf
	call.
2017-12-10 19:10:28 +01:00
H.J. Lu 9d0ffa60ad x86-64: Add sinf with FMA
On Skylake, bench-sinf reports performance improvement:

            Before        After         Improvement
max        153.996       100.094           54%
min        8.546         6.852             25%
mean       18.1223       11.802            54%

	* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
	Add s_sinf-sse2 and s_sinf-fma.
	(CFLAGS-s_sinf-fma.c): New.
	* sysdeps/x86_64/fpu/multiarch/s_sinf-fma.c: New file.
	* sysdeps/x86_64/fpu/multiarch/s_sinf-sse2.c: Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_sinf.c: Likewise.
2017-12-07 10:11:16 -08:00
H.J. Lu 9574c7b68d x86-64: Remove sysdeps/x86_64/fpu/s_sinf.S
On Ivy Bridge, bench-sinf reports performance improvement:

          s_sinf.S      s_sinf.c       Improvement
max        91.521        86.148            6%
min        14.061        11.265            25%
mean       23.3758       23.3344           0.2%

	* sysdeps/x86_64/fpu/s_sinf.S: Removed.
2017-12-07 09:44:17 -08:00
Joseph Myers d15e83c5f5 Fix ctanh (0 + i NaN), ctanh (0 + i Inf) (bug 22568, DR#471).
As per C11 DR#471, ctanh (0 + i NaN) and ctanh (0 + i Inf) should
return 0 + i NaN (with "invalid" exception in the second case but not
the first), not NaN + i NaN.  This has corresponding implications for
ctan since its special cases are defined by ctan (z) = -i ctanh (iz).
This patch implements these cases for ctanh and ctan, updating
tests accordingly.

Tested for x86_64.

	[BZ #22568]
	* math/s_ctan_template.c (M_DECL_FUNC (__ctan)): Set imaginary
	part of result to imaginary part of argument if it is zero and the
	real part of the argument is not finite.
	* math/s_ctanh_template.c (M_DECL_FUNC (__ctanh)): Set real part
	of result to real part of argument if it is zero and the imaginary
	part of the argument is not finite.
2017-12-07 16:21:00 +00:00
Mike FABIAN d89756ebe1 lt_LT locale: Base collation on copy "iso14651_t1" [BZ #22524]
[BZ #22524]
	* localedata/Makefile: Add lt_LT.UTF-8 to test-input
	and to the list of locales to be built for testing.
	* localedata/lt_LT.UTF-8.in: New file for testing the collation.
	* localedata/locales/lt_LT (LC_COLLATE): Use “copy "iso14651_t1"”
	and build the collation rules upon that.
2017-12-07 15:38:11 +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 fb1ca2aa3e Support defining strtof32, wcstof32 aliases.
This patch adds support for defining strtof32, wcstof32, strtof32_l
and wcstof32_l functions as aliases of the corresponding float
functions when _Float32 support is enabled.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float32 changes.

	* stdlib/strtof.c: Include <bits/floatn.h>
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32): Define
	and later undefine as macro.  Define as weak alias if
	[!USE_WIDE_CHAR].
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32): Define
	and later undefine as macro.  Define as weak alias if
	[USE_WIDE_CHAR].
	* stdlib/strtof_l.c: Include <bits/floatn.h>
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32_l): Define
	and later undefine as macro.  Define as weak alias if
	[!USE_WIDE_CHAR].
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32_l): Define
	and later undefine as macro.  Define as weak alias if
	[USE_WIDE_CHAR].
2017-12-06 23:06:12 +00:00
Joseph Myers fc10cc3f32 Support defining strfromf32 alias.
This patch adds support for defining strfromf32 as an alias of
strfromf when _Float32 support is enabled.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float32 changes.

	* stdlib/strfromf.c: Include <bits/floatn.h>.
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strfromf32): Define
	and later undefine as macro and define as weak alias.
2017-12-06 22:44:56 +00:00
Joseph Myers e420d22826 Add header for _Float32 testing.
This patch adds the header required for testing _Float32 function
aliases, using float ulps.  The corresponding makefile support will be
included in the main patch that enables those aliases.

In conjunction with other _Float32 changes, tested for x86_64 and with
build-many-glibcs.py.

	* math/test-float32.h: New file.
2017-12-06 22:17:11 +00:00
Joseph Myers 26007a2f68 Support _Float32 in libm_alias_float.
This patch makes the libm_alias_float macro support creating _Float32
aliases, in preparation for enabling glibc support for that type.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float32 changes.

	* sysdeps/generic/libm-alias-float.h: Include <bits/floatn.h>.
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32]
	(libm_alias_float_other_r): Create f32 alias.
	(libm_alias_float_r): Use semicolon before call to
	libm_alias_float_other_r.
2017-12-06 22:14:09 +00:00
Joseph Myers c191f64cd5 Correct some ia64 libm_alias_float_other calls.
This patch corrects three ia64 libm_alias_float_other calls so they
generate the intended _Float32 aliases when such aliases are enabled.

Tested with build-many-glibcs.py for ia64-linux-gnu (that installed
stripped shared libraries are unchanged when applied to current
sources, and that this enables compilation tests to pass when used in
conjunction with other _Float32 patches).

	* sysdeps/ia64/fpu/e_exp2f.S (__exp2f): Use exp2 not __exp2 as
	second argument to libm_alias_float_other.
	* sysdeps/ia64/fpu/e_log2f.S (__log2f): Use log2 not __log2 as
	second argument to libm_alias_float_other.
	* sysdeps/ia64/fpu/e_powf.S (__powf): Use pow not __pow as second
	argument to libm_alias_float_other.
2017-12-06 21:50:32 +00:00
Joseph Myers 5244527da1 Make cacosh (0 + iNaN) return NaN + i pi/2 (bug 22561, DR#471).
As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 +
iNaN) should return NaN +/- i pi/2, not NaN + iNaN.

This patch fixes the code accordingly.  The test has hardcoded the
result with positive sign of the imaginary part (with an associated
comment), since the unspecified sign for a result other than 0 or
infinity isn't currently supported by the test infrastructure.

Tested for x86_64.

	[BZ #22561]
	* math/s_cacosh_template.c (M_DECL_FUNC (__cacosh)): Use pi/2 for
	real part of result for argument 0 + i * NaN.
	* math/libm-test-cacosh.inc (cacosh_test_data): Update expected
	results for tests of 0 + i * NaN.
2017-12-06 21:35:20 +00:00
Adhemerval Zanella d73fac82be Update Alpha libm-test-ulps
* sysdeps/alpha/fpu/libm-test-ulps: Update.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-06 18:55:09 -02:00
David S. Miller 7ec094e801 Sparc ulp update.
* sysdeps/sparc/fpu/libm-test-ulps: Update
	exp_{downward,towardzero,upward} ulps.
2017-12-06 12:18:51 -08:00
Joseph Myers 1dbe6f64ab Don't make local variables static in ldbl-96 j1l.
The ldbl-96 implementation of j1l has some function-local variables
that are declared static for no apparent reason (this dates back to
the first addition of that file).

Any vaguely recent compiler, probably including any that are supported
for building glibc, optimizes away the "static" here, as the values of
the variables on entry to the function are dead.  So there is not
actually a user-visible bug here at present (but with any compilers
that didn't optimize away the static at all, possibly building with
less or no optimization, so that the function stored intermediate
values to and then loaded them from the variables, there would have
been a thread-safety issue).  But the "static" clearly doesn't belong
there and might potentially make things unsafe were compilation
without optimization to be supported in future, so this patch removes
it.

Tested for x86_64.

	* sysdeps/ieee754/ldbl-96/e_j1l.c (qone): Don't make local
	variables static.
2017-12-06 15:19:06 +00:00
Joseph Myers 53994f1263 Make some ldbl-128, ldbl-128ibm arrays const.
I noticed that an x86_64 build of libm unexpectedly contained more
non-constant data than an older version (before _Float128 support)
did.  The problem is non-const arrays in the ldbl-128 j0l and j1l
implementations; this patch makes those arrays, and the corresponding
ldbl-128ibm ones, const.

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

	* sysdeps/ieee754/ldbl-128/e_j0l.c (Y0_2N): Make const.
	(Y0_2D): Likewise.
	* sysdeps/ieee754/ldbl-128/e_j1l.c (Y0_2N): Likewise.
	(Y0_2D): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_j0l.c (Y0_2N): Likewise.
	(Y0_2D): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_j1l.c (Y0_2N): Likewise.
	(Y0_2D): Likewise.
2017-12-06 13:42:58 +00:00
Mike FABIAN 62ea2193ee hsb_DE locale: Base collation on copy "iso14651_t1" [BZ #22515]
[BZ #22515]
	* localedata/Makefile: Add hsb_DE.UTF-8 to test-input
	and to the list of locales to be built for testing.
	* localedata/hsb_DE.UTF-8.in: New file for testing the collation.
	* localedata/locales/hsb_DE (LC_COLLATE): Use “copy "iso14651_t1"”
	and build the collation rules upon that.
2017-12-06 12:04:29 +01:00
Florian Weimer 37ac8e635a Add references to CVE-2017-17426 2017-12-06 07:40:42 +01:00
Rajalakshmi Srinivasaraghavan 87235d7006 Update NEWS to add sinf optimization 2017-12-06 10:49:11 +05:30
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
Joseph Myers f778723496 Use long double not double for _Float64 with old GCC if values the same.
If double, long double and _Float64 all have the same set of values,
TS 18661-3 requires the usual arithmetic conversions on long double
and _Float64 to produce _Float64.  For this to be the case when
building with a compiler without a distinct _Float64 type, _Float64
must be a typedef for long double, not for double.  (_Float32x,
however, must be double in such a case, not long double, because the
usual arithmetic conversions on _Float32x and double must produce
double.)

This patch adjusts the fallback definition of _Float64 and associated
macros accordingly in that case, to fix the build of test-tgmath3 with
GCC 6 for such a configuration.  Tested in conjunction with _Float64
changes with build-many-glibcs.py for arm-linux-gnueabi, to make sure
the issue with test-tgmath3 is fixed.  Also tested for x86_64.

	* bits/floatn-common.h: Include <bits/long-double.h>.
	[__HAVE_FLOAT64 && (!__GNUC_PREREQ (7, 0) || defined __cplusplus)
	&& __NO_LONG_DOUBLE_MATH] (__f64): Use suffix 'l'.
	[__HAVE_FLOAT64 && (!__GNUC_PREREQ (7, 0) || defined __cplusplus)
	&& __NO_LONG_DOUBLE_MATH] (__CFLOAT64): Use _Complex long double.
	[__HAVE_FLOAT64 && (!__GNUC_PREREQ (7, 0) || defined __cplusplus)
	&& __NO_LONG_DOUBLE_MATH] (_Float64): Use long double.
	[__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH]
	(__builtin_huge_valf64): Use __builtin_huge_vall.
	[__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH]
	(__builtin_inff64): Use __builtin_infl.
	[__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH]
	(__builtin_nanf64): Use __builtin_nanl.
	[__HAVE_FLOAT64 && !__GNUC_PREREQ (7, 0) && __NO_LONG_DOUBLE_MATH]
	(__builtin_nansf64): Use __builtin_nansl.
2017-12-05 21:52:15 +00:00
Rogerio Alves 07ed18d26a Add elision tunables
This patch adds several new tunables to control the behavior of
elision on supported platforms[1].   Since elision now depends
on tunables, we should always *compile* with elision enabled,
and leave the code disabled, but available for runtime
selection.  This gives us *much* better compile-time testing of
the existing code to avoid bit-rot[2].

Tested on ppc, ppc64, ppc64le, s390x and x86_64.

[1] This part of the patch was initially proposed by
Paul Murphy but was "staled" because the framework have changed
since the patch was originally proposed:

https://patchwork.sourceware.org/patch/10342/

[2] This part of the patch was inititally proposed as a RFC by
Carlos O'Donnell.  Make sense to me integrate this on the patch:

https://sourceware.org/ml/libc-alpha/2017-05/msg00335.html

	* elf/dl-tunables.list: Add elision parameters.
	* manual/tunables.texi: Add entries about elision tunable.
	* sysdeps/unix/sysv/linux/powerpc/elision-conf.c:
	Add callback functions to dynamically enable/disable elision.
	Add multiple callbacks functions to set elision parameters.
	Deleted __libc_enable_secure check.
	* sysdeps/unix/sysv/linux/s390/elision-conf.c: Likewise.
	* sysdeps/unix/sysv/linux/x86/elision-conf.c: Likewise.
	* configure: Regenerated.
	* configure.ac: Option enable_lock_elision was deleted.
	* config.h.in: ENABLE_LOCK_ELISION flag was deleted.
	* config.make.in: Remove references to enable_lock_elision.
	* manual/install.texi: Elision configure option was removed.
	* INSTALL: Regenerated to remove enable_lock_elision.
	* nptl/Makefile:
	Disable elision so it can verify error case for destroying a mutex.
	* sysdeps/powerpc/nptl/elide.h:
	Cleanup ENABLE_LOCK_ELISION check.
	Deleted macros for the case when ENABLE_LOCK_ELISION was not defined.
	* sysdeps/s390/configure: Regenerated.
	* sysdeps/s390/configure.ac: Remove references to enable_lock_elision..
	* nptl/tst-mutex8.c:
	Deleted all #ifndef ENABLE_LOCK_ELISION from the test.
	* sysdeps/powerpc/powerpc32/sysdep.h:
	Deleted all ENABLE_LOCK_ELISION checks.
	* sysdeps/powerpc/powerpc64/sysdep.h: Likewise.
	* sysdeps/powerpc/sysdep.h: Likewise.
	* sysdeps/s390/nptl/bits/pthreadtypes-arch.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/force-elision.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/elision-conf.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/force-elision.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/Makefile: Remove references to
	enable-lock-elision.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
2017-12-05 17:48:48 -02:00
Joseph Myers a5a2a76bb7 Support defining strtof64, strtof32x, wcstof64, wcstof32x aliases.
This patch adds support for defining strtof64, strtof32x, wcstof64,
wcstof32x and the corresponding _l functions as aliases of the
corresponding double functions when _Float64 and _Float32x support is
enabled.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float64 / _Float32x changes.

	* stdlib/strtod.c: Include <bits/floatn.h>.
	(BUILD_DOUBLE): New macro.
	[BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64]
	(strtof64): Define and later undefine as macro.  Define as weak
	alias if [!USE_WIDE_CHAR].
	[BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64]
	(wcstof64): Define and later undefine as macro.  Define as weak
	alias if [USE_WIDE_CHAR].
	[BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X]
	(strtof32x): Define and later undefine as macro.  Define as weak
	alias if [!USE_WIDE_CHAR].
	[BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X]
	(wcstof32x): Define and later undefine as macro.  Define as weak
	alias if [USE_WIDE_CHAR].
	* stdlib/strtod_l.c: Include <bits/floatn.h>.
	(BUILD_DOUBLE): New macro.
	[BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64]
	(strtof64_l): Define and later undefine as macro.  Define as weak
	alias if [!USE_WIDE_CHAR].
	[BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64]
	(wcstof64_l): Define and later undefine as macro.  Define as weak
	alias if [USE_WIDE_CHAR].
	[BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X]
	(strtof32x_l): Define and later undefine as macro.  Define as weak
	alias if [!USE_WIDE_CHAR].
	[BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X]
	(wcstof32x_l): Define and later undefine as macro.  Define as weak
	alias if [USE_WIDE_CHAR].
2017-12-05 18:31:53 +00:00
Adhemerval Zanella 94d80dfc73 math: Use sign as double for reduced case in sinf
This patch avoid an extra floating point to integer conversion in
reduced internal function for generic sinf by defining the sign as
double instead of integers.

There is no much difference on Haswell with GCC 7.2.1:

           Before        After
min          9.11        9.108
mean       21.982      21.9224

However H.J. Lu reported gains on Skylake:

Before:

  "sinf": {
   "": {
    "duration": 3.4044e+10,
    "iterations": 1.9942e+09,
    "max": 141.106,
    "min": 7.704,
    "mean": 17.0715
   }
  }

After:

  "sinf": {
   "": {
    "duration": 3.40665e+10,
    "iterations": 2.03199e+09,
    "max": 95.994,
    "min": 7.704,
    "mean": 16.765
   }
  }

Checked on x86_64-linux-gnu.

	* sysdeps/ieee754/flt-32/s_sinf.c (ones): Define as double.
	(reduced): Use ones as double instead of integer.
2017-12-05 16:27:44 -02:00
Szabolcs Nagy 00d54af7c8 [PATCH] fix sinf(NAN)
sinf(NAN) should not signal invalid fp exception
so use isless instead of < where NAN is compared.

this makes the sinf tests pass on aarch64.

	* sysdeps/ieee754/flt-32/s_sinf.c (sinf): Use isless.
2017-12-05 18:09:22 +00:00
Joseph Myers 1f70eae4cf Support defining strfromf64, strfromf32x aliases.
This patch adds support for defining strfromf64 and strfromf32x
aliases of strfromd when the corresponding types are enabled.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float64 / _Float32x changes.

	* stdlib/strfromd.c: Include <bits/floatn.h>.
	[__HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (strfromf64): Define
	and later undefine as macro and define as weak alias.
	[__HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (strfromf32x):
	Likewise.
2017-12-05 18:01:25 +00:00
Joseph Myers e2c4dce535 Add headers for _Float64, _Float32x testing.
This patch adds the headers required for testing _Float64 and
_Float32x function aliases (using double ulps).  The corresponding
makefile support will be included in the patch that actually adds
those aliases; there doesn't seem much point in adding makefile
conditionals for testing something that will be available
unconditionally.

In conjunction with other _Float64 / _Float32x changes, test for
x86_64 and with build-many-glibcs.py.

	* math/test-float32x.h: New file.
	* math/test-float64.h: Likewise.
2017-12-05 17:34:25 +00:00
Joseph Myers f2d64d621e Support _Float64, _Float32x in libm_alias_double.
This patch makes the libm_alias_double macros support creating
_Float64 and _Float32x aliases, in preparation for enabling glibc
support for those types.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float64 / _Float32x changes.

	* sysdeps/generic/libm-alias-double.h: Include <bits/floatn.h>.
	(libm_alias_double_other_r_f64): New macro.
	(libm_alias_double_other_r_f32x): Likewise.
	(libm_alias_double_other_r): Use libm_alias_double_other_r_f64 and
	libm_alias_double_other_r_f32x.
	(libm_alias_double_r): Use semicolon before call to
	libm_alias_double_other_r.
	* sysdeps/ieee754/ldbl-opt/libm-alias-double.h: Include
	<bits/floatn.h>.
	(libm_alias_double_other_r_f64): New macro.
	(libm_alias_double_other_r_f32x): Likewise.
	(libm_alias_double_other_r): Use libm_alias_double_other_r_f64 and
	libm_alias_double_other_r_f32x.
2017-12-05 17:00:57 +00:00
H.J. Lu 91c318e7b9 s_sinf.c: Replace floor with simple casts
Since s_sinf.c either assigns the return value of floor to integer or
passes double converted from integer to floor, this patch replaces
floor with simple casts.

Also since long == int for 32-bit targets, we can use long instead of
int to avoid 64-bit integer for 64-bit targets.

On Skylake, bench-sinf reports performance improvement:

           Before        After         Improvement
max        130.566       129.564           30%
min        7.704         7.706             0%
mean       21.8188       19.1363           30%

	* sysdeps/ieee754/flt-32/s_sinf.c (reduced): Replace long with
	int.
	(SINF_FUNC): Likewise.  Replace floor with simple casts.
2017-12-05 08:47:27 -08:00
Mike FABIAN de9661d6be et_EE locale: Base collation on iso14651_t1 [BZ #22517]
[BZ #22517]
	* localedata/Makefile: Add et_EE.UTF-8 to test-input
	and to the list of locales to be built for testing.
	* localedata/et_EE.UTF-8.in: New file for testing the collation.
	* localedata/locales/et_EE (LC_COLLATE): Use “copy "iso14651_t1"”
        and build the collation rules upon that.
2017-12-05 17:10:08 +01:00
Chris Metcalf f18b8dc7d7 tilegx: work around vector insn bug in gcc
Avoid an issue in gcc where some of the vector (aka SIMD) ops will
sometimes end up getting wrongly optimized out.  We use these
instructions in many of the string implementations.  If/when we
have an upstreamed fix for this problem in gcc we can conditionalize
the use of the extended assembly workaround in glibc.
2017-12-05 10:24:56 -05: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
Florian Weimer da616c1496 support/tst-test_compare: Fix 32-bit/64-bit expected output mismatch
The use of a long type resulted in test output differences between
32-bit and 64-bit architectures, causing the test to fail on 32-bit
architectures.
2017-12-05 15:08:59 +01:00
Joseph Myers 216933b242 Use libm_alias_float for powerpc.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes powerpc libm function implementations use
libm_alias_float to define function aliases.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for all its hard-float powerpc configurations.

	* sysdeps/powerpc/fpu/s_cosf.c: Include <libm-alias-float.h>.
	(cosf): Define using libm_alias_float.
	* sysdeps/powerpc/fpu/s_fabs.S: Include <libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
	* sysdeps/powerpc/fpu/s_fmaf.S: Include <libm-alias-float.h>.
	(fmaf): Define using libm_alias_float.
	* sysdeps/powerpc/fpu/s_rintf.c: Include <libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/powerpc/fpu/s_sinf.c: Include <libm-alias-float.h>.
	(sinf): Define using libm_alias_float.
	* sysdeps/powerpc/power5+/fpu/s_modff.c: Include
	<libm-alias-float.h>.
	(modff): Define using libm_alias_float.
	* sysdeps/powerpc/power7/fpu/s_logbf.c: Include
	<libm-alias-float.h>.
	(logbf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_ceilf.S: Include
	<libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Include
	<libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_floorf.S: Include
	<libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_llrintf.c: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_llroundf.c: Include
	<libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Include
	<libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_lround.S: Include
	<libm-alias-float.h>.
	(lroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S: Include
	<libm-alias-float.h>.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_rintf.S: Include
	<libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Include
	<libm-alias-float.h>.
	(roundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/fpu/s_truncf.S: Include
	<libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf.c:
	Include <libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c:
	Include <libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf.c:
	Include <libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrintf.c:
	Include <libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llroundf.c:
	Include <libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logbf.c:
	Include <libm-alias-float.h>.
	(logbf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrintf.c:
	Include <libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lroundf.c:
	Include <libm-alias-float.h>.
	(lroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modff.c:
	Include <libm-alias-float.h>.
	(modff): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_roundf.c:
	Include <libm-alias-float.h>.
	(roundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf.c:
	Include <libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Include
	<libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S: Include
	<libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S: Include
	<libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Include
	<libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Include
	<libm-alias-float.h>.
	(lroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S: Include
	<libm-alias-float.h>.
	(roundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S: Include
	<libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Include
	<libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Include
	<libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S: Include
	<libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S: Include
	<libm-alias-float.h>.
	(lroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c: Include
	<libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c: Include
	<libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf.c: Include
	<libm-alias-float.h>.
	(cosf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c: Include
	<libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrintf.c: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf.c: Include
	<libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_logbf.c: Include
	<libm-alias-float.h>.
	(logbf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_modff.c: Include
	<libm-alias-float.h>.
	(modff): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c: Include
	<libm-alias-float.h>.
	(roundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf.c: Include
	<libm-alias-float.h>.
	(sinf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c: Include
	<libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Include
	<libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Include
	<libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Include
	<libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/s_llroundf.S: Include
	<libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S: Include
	<libm-alias-float.h>.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/s_rintf.S: Include
	<libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Include
	<libm-alias-float.h>.
	(roundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Include
	<libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S: Include
	<libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S: Include
	<libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: Include
	<libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S: Include
	<libm-alias-float.h>.
	(roundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S: Include
	<libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Include
	<libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: Include
	<libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_cosf.S: Include
	<libm-alias-float.h>.
	(cosf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: Include
	<libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_sinf.S: Include
	<libm-alias-float.h>.
	(sinf): Define using libm_alias_float.
2017-12-05 00:26:26 +00:00
Florian Weimer 934855246d support: Add TEST_COMPARE macro 2017-12-04 20:56:08 +01:00
Mike FABIAN 96b06a19e6 tr_TR locale: Base collation on iso14651_t1 [BZ #22527]
[BZ #22527]
	*  localedata/locales/tr_TR (LC_COLLATE): Base collation rules
	on iso14651_t1. A test file localedata/tr_TR.UTF-8.in is already
	available, this rewrite of the collation rules does reproduce
	the test file in the same order.
2017-12-04 18:36:01 +01:00
Mike FABIAN 1f6d91f328 hr_HR locale: Don’t use single code points for the digraphs in LC_TIME
[BZ #10580]
	* localedata/locales/hr_HR (LC_TIME): Use two letters for the
	digraphs in the month and day names. Using single code points for
	digraphs is deprecated.  While there are dedicated Unicode
	codepoints, for the digraphs, these are included for backwards
	compatibility and modern texts use a sequence of Basic Latin
	characters. See: https://www.unicode.org/faq/ligature_digraph.html
	This makes the month and day names agree exactly with CLDR now,
	CLDR does not use the single code points for the digraphs either.
2017-12-04 18:36:01 +01:00
Chris Metcalf 2e49fed84c tile: update ca{cos,sin,tan}{,h} double ULPs 2017-12-04 12:31:20 -05:00
Joseph Myers 73895b499b Use __floor not floor in sinf.
The new sinf implementation introduced localplt failures for all
platforms where the compiler did not inline the calls to floor
(converted to trunc by machine-independent optimizations).  This patch
changes the calls to use __floor as normal in libm.

We can't use the public function names floor / floorf / floorl /
floorf128 in libm code in the absence of appropriate asms to redirect
floor/trunc calls, if not inlined, to use the internal names instead
(while avoiding breaking code building the floor functions themselves)
- while having such asms and then calling the public functions
unconditionally would be desirable for optimization (few architectures
have __floor inlines in math_private.h, and once the built-in function
is used you don't need them), using __floor is the minimum safe fix
for the present test regressions.

Tested with build-many-glibcs.py that this fixes the localplt test
failure for arm-linux-gnueabi.

	* sysdeps/ieee754/flt-32/s_sinf.c (SINF_FUNC): Use __floor instead
	of floor.
2017-12-04 16:58:08 +00:00
Siddhesh Poyarekar 4c1d801a59 aarch64: Avoid hidden symbols for memcpy/memmove into static binaries
The __GI_* symbol aliases for __memcpy_generic are unnecessary since
they're never used.  Add them only for libc.so to avoid PLT.  Maybe
some time in future we need to evaluate the relative cost of PLT vs
gains from multiarch memcpy implementations and take a call on whether
to drop this completely.

	* sysdeps/aarch64/multiarch/memcpy_generic.S (__GI_memcpy):
	Define only for libc.so.
2017-12-04 21:17:17 +05:30
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
Rajalakshmi Srinivasaraghavan 7863a71181 New generic sinf
This implementation is based on optimized sinf assembly versions
of x86_64 and powerpc.
2017-12-04 10:12:10 +05:30
John David Anglin b3f7fb12f5 Handle __gmon_start__ as undefined weak on hppa.
[BZ libc/19170]
	* sysdeps/hppa/crti.S: Declare PREINIT_FUNCTION weak_extern when
	PREINIT_FUNCTION_WEAK is nonzero.
	(gmon_initializer): New function.  Put procedure label for it in
	.init_array section.
	(_init): Don't call PREINIT_FUNCTION.
	* sysdeps/hppa/crtn.S (__gmon_start__): Remove.
	* sysdeps/hppa/dl-lookupcfg.h (DL_FIXUP_MAKE_VALUE): Create null fixup
	value when map argument is null.
2017-12-02 14:43:28 -05:00
John David Anglin 800a496acb Improve PIC pc-relative instruction sequences on hppa.
* sysdeps/hppa/dl-fptr.c (elf_machine_resolve): Remove unnecessary
	depi instruction from PIC pc-relative sequence.
	* sysdeps/hppa/dl-fptr.h (ELF_MACHINE_LOAD_ADDRESS): Likewise.
	* sysdeps/hppa/dl-machine.h (elf_machine_dynamic): Likewise.
	(elf_machine_load_address): Likewise.
	(elf_machine_runtime_setup): Likewise.
2017-12-02 11:04:16 -05:00
Joseph Myers d17542d235 Use libm_alias_double for remaining powerpc functions.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes the remaining double powerpc functions use
libm_alias_double to define function aliases (with consequent removal
of the need for local compat symbol handling).  Previous cleanups
avoid this patch changing installed stripped shared libraries for any
build-many-glibcs.py configuration (there are still some functions in
this patch for which the order of double and float aliases changes
within an individual source file, but in this case this doesn't result
in changes to the final library).

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for all its hard-float powerpc configurations.

	* sysdeps/powerpc/power7/fpu/s_logb.c: Include
	<libm-alias-double.h>.
	(logb): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Include
	<libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_llrint.c: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_llround.c: Include
	<libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_lrint.S: Include
	<libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_lround.S: Include
	<libm-alias-double.h>.
	(lround): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c:
	Include <libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llrint.c:
	Include <libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_llround.c:
	Include <libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c: Include
	<libm-alias-double.h>.
	(logb): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lrint.c:
	Include <libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_lround.c:
	Include <libm-alias-double.h>.
	(lround): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S: Include
	<libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S: Include
	<libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S: Include
	<libm-alias-double.h>.
	(lround): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Include
	<libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S: Include
	<libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power6x/fpu/s_lrint.S: Include
	<libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power6x/fpu/s_lround.S: Include
	<libm-alias-double.h>.
	(lround): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c: Include
	<libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	(lrint): Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c: Include
	<libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	(lround): Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c: Include
	<libm-alias-double.h>.
	(logb): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Include
	<libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/s_llrint.S: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	(lrint): Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_llround.S: Include
	<libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	(lround): Likewise.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_llround.S: Include
	<libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	(lround): Likewise.
	* sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Include
	<libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/power6x/fpu/s_llrint.S: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	(lrint): Likewise.
	* sysdeps/powerpc/powerpc64/power6x/fpu/s_llround.S: Include
	<libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	(lround): Likewise.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	(lrint): Likewise.
	* sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: Include
	<libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	(lround): Likewise.
2017-12-02 00:11:37 +00:00
Joseph Myers 0ddde474db Define powerpc64 lroundl compat symbol only once.
sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c defines the
lroundl compat symbol, version GLIBC_2_1, twice, once based on llround
and once based on __lround.  Those are aliases for each other (llround
weak, __lround strong), but defining it twice does not make sense.
This patch changes it to define the compat symbol once only, matching
how libm_alias_double defines it.

Tested with build-many-glibcs.py for its powerpc64 configurations.

	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c
	[LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)] (lroundl): Do not define
	compat symbol based on llround.
2017-12-01 23:58:05 +00:00
Joseph Myers 0d5ba561c1 Base powerpc logbl compat symbols on __logb not logb.
Some powerpc logb implementations define a compat symbol for logbl
based on logb, whereas libm_alias_double defines such a compat symbol
based on __logb instead.  This difference (logb is weak, __logb isn't)
is enough to result in different installed stripped shared libraries.
The difference in the installed libraries isn't significant, but first
changing the compat_symbol calls helps make it possible to validate a
subsequent change to use libm_alias_double by comparison of libraries,
so this patch does such a preliminary change.

Tested with build-many-glibcs.py for all its hard-float powerpc
configurations.

	* sysdeps/powerpc/power7/fpu/s_logb.c
	[LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)] (logbl): Define as compat
	symbol based on __logb, not on logb.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_logb.c
	[LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)] (logbl): Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_logb.c
	[LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)] (logbl): Likewise.
2017-12-01 23:37:46 +00:00
Joseph Myers 51ea3b2042 Ues libm_alias_double for various powerpc functions.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch various powerpc functions use libm_alias_double to
define function aliases (with consequent removal of the need for local
compat symbol handling).  (The present patch excludes the changes to
some functions where such changes could result in differences in
installed stripped shared libraries because of changes to the exact
ordering or properties of symbols in individual .os files.)

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for all its hard-float powerpc configurations.

	* sysdeps/powerpc/fpu/s_rint.c: Include <libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/powerpc/power5+/fpu/s_modf.c: Include
	<libm-alias-double.h>.
	(modf): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_ceil.S: Include
	<libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_floor.S: Include
	<libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S: Include
	<libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_rint.S: Include
	<libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_round.S: Include
	<libm-alias-double.h>.
	(round): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_trunc.S: Include
	<libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil.c: Include
	<libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor.c:
	Include <libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_modf.c: Include
	<libm-alias-double.h>.
	(modf): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_round.c:
	Include <libm-alias-double.h>.
	(round): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc.c:
	Include <libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S: Include
	<libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S: Include
	<libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S: Include
	<libm-alias-double.h>.
	(round): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S: Include
	<libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c: Include
	<libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c: Include
	<libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_modf.c: Include
	<libm-alias-double.h>.
	(modf): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c: Include
	<libm-alias-double.h>.
	(round): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c: Include
	<libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/s_ceil.S: Include
	<libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/s_floor.S: Include
	<libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/s_nearbyint.S: Include
	<libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/s_rint.S: Include
	<libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/s_round.S: Include
	<libm-alias-double.h>.
	(round): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Include
	<libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S: Include
	<libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S: Include
	<libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S: Include
	<libm-alias-double.h>.
	(round): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S: Include
	<libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
2017-12-01 23:09:47 +00:00
Joseph Myers ec2cf3f444 Use libm_alias_double for powerpc fabs, fma.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes powerpc fabs and fma use libm_alias_double
to define function aliases.  This brings in automatic symbol
versioning compat handling, so the powerpc32 and powerpc64 wrappers
that added such handling to the generic sysdeps/powerpc/fpu versions
are removed as no longer required (there are no sysdeps directory
ordering issues that would necessitate keeping trivial wrappers
there).

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for all its hard-float powerpc configurations.

	* sysdeps/powerpc/fpu/s_fabs.S: Include <libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/powerpc/fpu/s_fma.S: Include <libm-alias-double.h>.
	(fma): Define using libm_alias_double.
	* sysdeps/powerpc/powerpc32/fpu/s_fabs.S: Remove file.
	* sysdeps/powerpc/powerpc32/fpu/s_fma.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_fabs.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_fma.S: Likewise.
2017-12-01 22:23:28 +00:00
Adhemerval Zanella 0594b13f5d x32: Remove unused getcpu implementation
Checked on x86_64-linux-gnu-x32.

	* sysdeps/unix/sysv/linux/x86_64/x32/getcpu.c: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-01 15:48:40 -02:00
Adhemerval Zanella dbdfcf3bba sparc: Remove ununsed ifunc assembly macros
Now that all SPARC ifunc converted to C implementation there is no need
for both C and assembly macros.  This patch removes the assembly ones.

Checked on sparcv9-linux-gnu and sparc64-linux-gnu.

	* sysdeps/sparc/sparc-ifunc.h (SPARC_ASM_IFUNC_DFLT,
	SPARC_ASM_IFUNC1, SPARC_ASM_IFUNC2, SET, SPARC_ASM_VIS2_IFUNC,
	SPARC_ASM_VIS3_IFUNC, SPARC_ASM_VIS3_VIS2_IFUNC): Remove macros.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-01 15:48:40 -02:00
Adhemerval Zanella 5b7bd9756c sparc: Fix sparv9 multiarch build
Fix build caused by 5b4e5e7869.

	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c: Fix build
	due redirect macro.
2017-12-01 15:47:23 -02:00
Andreas Schwab ef9ecfa63c intl: create target directory for bison 2017-12-01 15:15:16 +01:00
Adhemerval Zanella 2a14526bfa sparc: refactor cpu_relax to C
* sysdeps/sparc/sparc64/cpu_relax.c: New file.
	* sysdeps/sparc/sparc32/sparcv9/cpu_relax.c: Likewise.
	* sysdeps/sparc/sparc64/cpu_relax.S: Remove file.
	* sysdeps/sparc/sparc32/sparcv9/cpu_relax.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-01 11:51:10 -02:00
Adhemerval Zanella 1c051a9b09 sparc: refactor sparc32 nearbyint{f} selector to C
This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_nearbyint{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_nearbyintf-generic and
	s_nearbyint-generic.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint-generic.S:
	New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf-generic.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.c:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S: Remove
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S:
	Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-01 11:51:08 -02:00
Adhemerval Zanella dbeb74ef84 sparc: refactor sparc32 rint{f} selector to C
This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_rint{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_rintf-generic and s_rint-generic.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint-generic.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf-generic.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S: Remove file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-01 11:49:36 -02:00
Adhemerval Zanella fa7ded9612 sparc: refactor sparc32 llrint{f} selector to C
This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_llrint{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_llrintf-generic and s_llrint-generic.
	* sysdeps/sparc/sparcv9/fpu/multiarch/s_llrint-generic.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf-generic.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S: Remove file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-01 11:49:19 -02:00
Adhemerval Zanella e240cf0e0e sparc: refactor sparc32 fabs{f} selector to C
This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_fabs{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_fabsf-generic and s_fabs-generic.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs-generic.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf-generic.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S: Remove file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-01 11:48:58 -02:00
Adhemerval Zanella 5b4e5e7869 sparc: refactor sparc32 copysign selector to C
This patch refactors the sparc32 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_copysign{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
	(sysdep_calls): New rule.
	(sysdep_routines): Use sysdep_calls as base.
	(libm-sysdep_routines): Add generic rule for symbols shared with
	libc.  Add s_copysign-generic and s_copysign-generic objects.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign-generic.S:
	New file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf-generic.S:
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S: Remove file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-12-01 11:48:39 -02:00
Mike FABIAN d985adae22 is_IS locale: Base collation on iso14651_t1 [BZ #22519] 2017-12-01 14:08:58 +01:00
Joseph Myers ff84a0e050 Use libm_alias_float for e500.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes an e500 libm function implementation use
libm_alias_float to define function aliases.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged for its e500 configurations.

	* sysdeps/powerpc/powerpc32/e500/nofpu/s_fabsf.S: Include
	<libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
2017-12-01 01:12:42 +00:00
H.J. Lu ef5d8b4342 mips: Don't use MIN in dl-machine.h
MIN is used, but param.h may not be included, so expand its single use
inline.

	* sysdeps/mips/dl-machine.h (elf_machine_reloc): Expand MIN.
2017-11-30 16:34:09 -08:00
Joseph Myers f938b397dd Use libm_alias_float for coldfire.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes coldfire libm function implementations use
libm_alias_float to define function aliases.

Untested, given the currently broken state of GCC for coldfire.

	* sysdeps/m68k/coldfire/fpu/s_fabsf.c: Include
	<libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
	* sysdeps/m68k/coldfire/fpu/s_lrintf.c: Include
	<libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	* sysdeps/m68k/coldfire/fpu/s_rintf.c: Include
	<libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
2017-11-30 23:52:35 +00:00
Joseph Myers 2251fad025 Use libm_alias_double for coldfire.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes coldfire libm function implementations use
libm_alias_double to define function aliases.

Untested, given the currently broken state of GCC for coldfire.

	* sysdeps/m68k/coldfire/fpu/s_fabs.c: Include
	<libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/m68k/coldfire/fpu/s_lrint.c: Include
	<libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	* sysdeps/m68k/coldfire/fpu/s_rint.c: Include
	<libm-alias-double.h>.
	(rint): Define using libm_alias_double.
2017-11-30 23:47:18 +00:00
Joseph Myers e53df1dee8 Rework m68k libm functions to use declare_mgen_alias.
Many m68k libm functions use their own system to share code between
different types and functions, involving defining macros before
including code for another function (for example, s_atan.c also acts
as a template that can define other functions).

Thes files serving as templates generate function aliases directly
with e.g. "weak_alias (__CONCATX(__,FUNC), FUNC)" in s_atan.c.  To be
prepared to generate _Float32, _Float64 and _Float32x function
aliases, this needs changing so that the libm_alias_* macros get used
instead.  As the macro to use varies depending on the type, that would
mean additional macros to define in several different places to get
the appropriate alias-generation macro used in each case.

Rather than adding to the m68k-specific mechanisms, this patch
converts the functions in question to use something closer to the
math/ type-generic template mechanism.  After this patch, these
functions have m68k-specific templates such as s_atan_template.c, but
those templates use all the same macros as in the math/ templates,
such as FLOAT, M_DECL_FUNC, M_SUF and declare_mgen_alias.  There is no
automatic generation of the files such as s_atan.c that include the
appropriate math-type-macros-*.h header and the template file (the
existing automatic generation logic is only applicable for the fixed
set of templates listed in math/ - and sysdeps sources always override
files generated that way), so those files are still checked in, but
they are all the obvious two-line files (with one additional
definition in the case of the expm1 implementations), rather than
making e.g. s_atan.c special.

Functions are only converted where they should have aliases for
_FloatN / _FloatNx types.  Those m68k functions that do not generate
public names (those that only generate __ieee754_*, with wrappers
generating the public names, and classification functions that only
exist once per format not once per type so don't get aliases) are
unchanged.  However, log1p (public names generated by wrapper) and
significand (not provided for new types so no new aliases needed)
needed changing because they previously included the atan
implementations.  Now, s_significand.c is the main implementation for
functions with that prototype and using the old implementation
approach, while log1p includes it in place of atan.

Any further cleanups in this area (which preserve the proper set of
functions getting aliases defined by libm_alias_float and
libm_alias_double) are of course welcome, just not needed for the
goals of this patch.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by the patch.

	* sysdeps/m68k/m680x0/fpu/s_atan_template.c: New file.
	* sysdeps/m68k/m680x0/fpu/s_ceil_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_cos_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_expm1_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_fabs_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_floor_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_frexp_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_lrint_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_modf_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_nearbyint_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_remquo_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_rint_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_sin_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_sincos_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_tan_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_tanh_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_trunc_template.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_atan.c: Reimplement to use
	s_atan_template.c.
	* sysdeps/m68k/m680x0/fpu/s_atanf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_atanl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_ceil.c: Reimplement to use
	s_ceil_template.c.
	* sysdeps/m68k/m680x0/fpu/s_ceilf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_ceill.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_cos.c: Reimplement to use
	s_cos_template.c.
	* sysdeps/m68k/m680x0/fpu/s_cosf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_cosl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_expm1.c: Reimplement to use
	s_expm1_template.c.
	* sysdeps/m68k/m680x0/fpu/s_expm1f.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_expm1l.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_fabs.c: Reimplement to use
	s_fabs_template.c.
	* sysdeps/m68k/m680x0/fpu/s_fabsf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_fabsl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_floor.c: Reimplement to use
	s_floor_template.c.
	* sysdeps/m68k/m680x0/fpu/s_floorf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_floorl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_frexp.c: Reimplement to use
	s_frexp_template.c.
	* sysdeps/m68k/m680x0/fpu/s_frexpf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_lrint.c: Reimplement to use
	s_lrint_template.c.
	* sysdeps/m68k/m680x0/fpu/s_lrintf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_lrintl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_modf.c: Reimplement to use
	s_modf_template.c.
	* sysdeps/m68k/m680x0/fpu/s_modff.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_modfl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_nearbyint.c: Reimplement to use
	s_nearbyint_template.c.
	* sysdeps/m68k/m680x0/fpu/s_nearbyintf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_nearbyintl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_remquo.c: Reimplement to use
	s_remquo_template.c.
	* sysdeps/m68k/m680x0/fpu/s_remquof.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_remquol.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_rint.c: Reimplement to use
	s_rint_template.c.
	* sysdeps/m68k/m680x0/fpu/s_rintf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_rintl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_sin.c: Reimplement to use
	s_sin_template.c.
	* sysdeps/m68k/m680x0/fpu/s_sinf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_sinl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_sincos.c: Reimplement to use
	s_sincos_template.c.
	* sysdeps/m68k/m680x0/fpu/s_sincosf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_sincosl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_tan.c: Reimplement to use
	s_tan_template.c.
	* sysdeps/m68k/m680x0/fpu/s_tanf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_tanl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_tanh.c: Reimplement to use
	s_tanh_template.c.
	* sysdeps/m68k/m680x0/fpu/s_tanhf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_tanhl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_trunc.c: Reimplement to use
	s_trunc_template.c.
	* sysdeps/m68k/m680x0/fpu/s_truncf.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_truncl.c: Likewise.
	* sysdeps/m68k/m680x0/fpu/s_significand.c: Reimplement based on
	s_atan.c instead of including s_atan.c.
	* sysdeps/m68k/m680x0/fpu/s_significandf.c: Reimplement based on
	s_atanf.c instead of including s_atanf.c.
	* sysdeps/m68k/m680x0/fpu/s_significandl.c: Reimplement based on
	s_atanl.c instead of including s_atanl.c.
	* sysdeps/m68k/m680x0/fpu/s_log1p.c: Include s_significand.c
	instead of s_atan.c.
	* sysdeps/m68k/m680x0/fpu/s_log1pf.c: Include s_significandf.c
	instead of s_atanf.c.
	* sysdeps/m68k/m680x0/fpu/s_log1pl.c: Include s_significandl.c
	instead of s_atanl.c.
2017-11-30 22:39:07 +00:00
Joseph Myers c0535adfeb Remove scripts/update-copyrights handling of intl/plural.c.
Since this file is no longer checked in, update-copyrights no longer
needs to avoid changing it.

	* scripts/update-copyrights: Do not handle intl/plural.c
	specially.
2017-11-30 21:25:25 +00:00
Juro Bystricky 1faaf7035c plural.c: improve reproducibility
There is a subtle non-determinism when building glibc.
This depends on whether the glibc is built using the distibuted
file intl/plural.c or built using the generated file intl/plural.c.
These two files (intl/plural.c generated vs. distributed) are slightly
different, hence we may end up with slightly different libraries.

Originally, having "bison" installed was optional. So if "bison" was
not present, we always built libraries with the distributed plural.c.
If bison was installed, we *** may have *** replaced the distributed
file plural.c with a new plural.c generated from plural.y. if the
timestamps triggered this rule:

plural.c plural.y
	$(BISON) $(BISONFLAGS) $@ $^

Given that timestamps are not preserved in GIT repositories, the above
rule is not reliable without explicitly touching plural.c or plural.y.
In other words, the rule may or may not have fired.

In summary: there are two distinct sources of non-determinism:

1. Having "bison" installed or not
2. Having "bison" installed but timestamps poorly defined.

This patch fixes this by requiring "bison" being installed
and by always generating intl/plural.c from intl/plural.y.
(This is achieved by simply removing checked-in intl/plural.c)

	[BZ #22432]
	* configure.ac (BISON): Require to be present.
	* configure: Regenerated.
	* intl/Makefile (generated): Add plural.c.
	[$(BISON) != no]: Make code unconditional.
	(plural.c): Change rule to $(objpfx)plural.c.
	($(objpfx)plural.o): Depend on $(objpfx)plural.c.
	* intl/plural.c: Remove.
	* manual/install.texi (Tools for Compilation): Document bison as
	required.
	* INSTALL: Regenerated.
2017-11-30 21:21:15 +00:00
Joseph Myers bd6ea9edd1 Use libm_alias macros in m68k llrint functions.
Most m68k libm functions share code via sources for one function
including those for another function or type, in a way that will
require significant changes to create function aliases in a way
friendly to adding _FloatN / _FloatNx aliases.

The llrint function implementations, however, use a conventional
separate implementation for each floating-point type.  Thus preparing
them for _FloatN / _FloatNx aliases is just a matter of changing them
to include the appropriate headers and use the appropriate macros,
which this patch does.  The llrintl changes aren't strictly required,
since m68k long double does not meet the criteria for a _FloatN /
_FloatNx type, but are included anyway to keep consistency between the
implementations for the three types.

Tested with build-many-glibcs.py that installed stripped shared
libraries for m68k-linux-gnu are unchanged by the patch.

	* sysdeps/m68k/m680x0/fpu/s_llrint.c: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/m68k/m680x0/fpu/s_llrintf.c: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/m68k/m680x0/fpu/s_llrintl.c: Include
	<libm-alias-ldouble.h>.
	(llrintl): Define using libm_alias_ldouble.
2017-11-30 19:15:21 +00:00
Joseph Myers faec63238f Use declare_mgen_alias in m68k templates.
Some m68k libm functions have their own templates replacing the
generic math/ ones but using the type-generic template machinery.
These currently define function aliases directly using weak_alias.  In
preparation for additional _FloatN / _FloatNx function aliases, this
patch changes them to use declare_mgen_alias for creating aliases
instead.

Tested with build-many-glibcs.py that installed stripped shared
libraries for m68k-linux-gnu are unchanged by the patch.

	* sysdeps/m68k/m680x0/fpu/s_ccosh_template.c (ccosh): Use
	declare_mgen_alias instead of weak_alias.
	* sysdeps/m68k/m680x0/fpu/s_cexp_template.c (cexp): Likewise.
	* sysdeps/m68k/m680x0/fpu/s_csin_template.c (csin): Likewise.
	* sysdeps/m68k/m680x0/fpu/s_csinh_template.c (csinh): Likewise.
2017-11-30 19:03:57 +00:00
Adhemerval Zanella 9e2279a0e9 sparc: refactor sparc64 __mpn_add_n selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
add_n-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
	Add add_n-generic.
	* sysdeps/sparc/sparc64/multiarch/add_n-generic.S: New file.
	* sysdeps/sparc/sparc64/multiarch/add_n.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/add_n.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-30 14:10:28 -02:00
Adhemerval Zanella 75f37c71db sparc: refactor sparc64 __mpn_submul_1 selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
submul_1-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
	Add submul_1-generic.
	* sysdeps/sparc/sparc64/multiarch/submul_1-generic.S: New file.
	* sysdeps/sparc/sparc64/multiarch/submul_1.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/submul_1.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-30 14:10:25 -02:00
Adhemerval Zanella dda1d2e88b sparc: refactor sparc64 __mpn_addmul_1 selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
addmul_1-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
	Add addmul_1-generic.
	* sysdeps/sparc/sparc64/multiarch/addmul_1-generic.S: New file.
	* sysdeps/sparc/sparc64/multiarch/addmul_1.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/addmul_1.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-30 14:10:20 -02:00
Adhemerval Zanella b70cbbfcc8 sparc: refactor sparc64 __mpn_sub_n selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
sub_n-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
	Add sub_n-generic.
	* sysdeps/sparc/sparc64/multiarch/sub_n-generic.S: New file.
	* sysdeps/sparc/sparc64/multiarch/sub_n.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/sub_n.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-30 14:10:16 -02:00
Adhemerval Zanella 023cade3b3 sparc: refactor sparc64 __mpn_mul_1 selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
mul_1-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/multiarch/Makefile (sysdep_routines):
	Add mul_1-generic.
	* sysdeps/sparc/sparc64/multiarch/mul_1-generic.S: New file.
	* sysdeps/sparc/sparc64/multiarch/mul_1.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/mul_1.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-30 14:10:12 -02:00
Mike FABIAN fbb5fd03d3 sr_RS and bs_BA locales: make collation rules the same as for hr_HR [BZ #22534]
According to CLDR, collation rules for Serbian and Bosnian
	should be the same as for Croatian.

	[BZ #22534]
	* localedata/Makefile: Add sr_RS.UTF-8 and bs_BA.UTF-8 to test-input
	and to the list of locales to be built for testing.
	* localedata/bs_BA.UTF-8.in: New file (same as hr_HR.UTF-8.in).
	* localedata/sr_RS.UTF-8.in: New file (same as hr_HR.UTF-8.in).
	* localedata/locales/bs_BA (LC_COLLATE): Use “copy "hr_HR"”.
	* localedata/locales/sr_RS (LC_COLLATE): Use “copy "hr_HR"”.
2017-11-30 16:03:22 +01:00
Mike FABIAN 5e56e937c9 hr_HR locale: fix collation and expand collation test file
* localedata/locales/hr_HR (LC_COLLATE): Fix collation
	to make test case pass.
	* localedata/hr_HR.UTF-8.in: Add more test strings.
2017-11-30 14:57:46 +01:00
Mike FABIAN cf4341ca90 Fix test case for hr_HR monetary formatting
* stdlib/tst-strfmon_l.c: Fix testcase. Needed because of [BZ #10580]
2017-11-30 14:56:49 +01:00
Dragan Stanojević - Nevidljivi 9ca6b34378 Add test case for collation in hr_HR locale
* localedata/Makefile: Add hr_HR.UTF-8 to test-input and to
	the list of locales to built for testing.
	* localedata/hr_HR.UTF-8.in: New file.
2017-11-30 14:55:38 +01:00
Dragan Stanojević - Nevidljivi 37075ae18d hr_HR locale: various updates [BZ #10580]
[BZ #10580]
        * localedata/locales/hr_HR (LC_COLLATE): Base collation rules on
        iso14651_t1.
        * localedata/locales/hr_HR (LC_TIME): Sync month and day names with
        CLDR (except use ligatures for the digraphs, CLDR does not use
        the ligatures), add first_workday, some fixes in the date and time
        formats.
        * localedata/locales/hr_HR (LC_CTYPE): Add transliteration rules
        for Đ and đ.
        * localedata/locales/hr_HR (LC_MONETARY): Change currency_symbol to
        lower case. p_cs_precedes and n_cs_precedes should be 0 instead of 1.
        Add int_p_cs_precedes and int_n_cs_precedes.
        * localedata/locales/hr_HR (LC_NUMERIC): Change thousands_sep to
        "<U202F>" (NARROW NO-BREAK SPACE) and grouping to 3;3 (Agrees with
        LC_MONETARY now).
        * localedata/locales/hr_HR (LC_TELEPHONE): Add tel_dom_fmt.
	* localedata/locales/hr_HR (LC_NAME): Add name_mr, name_mrs, and
        name_miss.
	* localedata/locales/hr_HR (LC_ADDRESS): Add country_post, country_isbn,
        and lang_lib. Change postal_fmt.

change
2017-11-30 14:53:30 +01:00
H.J. Lu f33632ccd1 x86: Make a space in jmpbuf for shadow stack pointer
To support Shadow Stack (SHSTK) in Intel Control-flow Enforcement
Technology (CET) in setjmp/longjmp, we need to save shadow stack
pointer in jmp_buf.  The __saved_mask field in jmp_buf has type
of __sigset_t.  On Linux, __sigset_t is defined as

 #define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
typedef struct
{
  unsigned long int __val[_SIGSET_NWORDS];
} __sigset_t;

which is much bigger than expected by the __sigprocmask system call,
which has

typedef struct {
        unsigned long sig[_NSIG_WORDS];
} sigset_t;

For Linux/x86, we can shrink __sigset_t used by __saved_mask in jmp_buf
to add paddings for shadow stack pointer.  As long as the new __sigset_t
is not smaller than sigset_t expected by the __sigprocmask system call,
it should work correctly.

This patch adds an internal header file, <setjmpP.h>, to define
__jmp_buf_sigset_t for __saved_mask in jmp_buf for Linux/x86 with a
space to store shadow stack pointer.  It verifies __jmp_buf_sigset_t has
the suitable size for the __sigprocmask system call.   A run-time test,
tst-saved_mask-1.c, is added to verify that size of __jmp_buf_sigset_t
is sufficient.  If its size is too small, the test fails with

rt_sigprocmask(SIG_SETMASK, strace: umoven: short read (4 < 8) @0x7fa8aa28effc
0x7fa8aa28effc, NULL, 8) = -1 EFAULT (Bad address)
rt_sigprocmask(SIG_SETMASK, strace: umoven: short read (4 < 8) @0x7fa8aa28effc
0x7fa8aa28effc, NULL, 8) = -1 EFAULT (Bad address)
rt_sigprocmask(SIG_SETMASK, NULL, 0x7fa8aa28effc, 8) = -1 EFAULT (Bad address)
exit_group(1)                           = ?

Tested with build-many-glibcs.py.

	* debug/longjmp_chk.c: Include <setjmpP.h> instead of
	<setjmp.h>.
	* setjmp/longjmp.c: Include <setjmpP.h> instead of <setjmp.h>.
	(__libc_siglongjmp): Cast &env[0].__saved_mask to "sigset_t *".
	* setjmp/sigjmp.c: Include <setjmpP.h> instead of <setjmp.h>.
	(__sigjmp_save): Cast &env[0].__saved_mask to "sigset_t *".
	* sysdeps/generic/setjmpP.h: New file.
	* sysdeps/unix/sysv/linux/x86/jmp_buf-ssp.sym: Likewise.
	* sysdeps/unix/sysv/linux/x86/setjmpP.h: Likewise.
	* sysdeps/unix/sysv/linux/x86/tst-saved_mask-1.c: Likewise.
	* sysdeps/unix/sysv/linux/x86/Makefile (gen-as-const-headers):
	Add jmp_buf-ssp.sym.
	(tests): Add tst-saved_mask-1.
2017-11-30 04:58:01 -08:00
Arjun Shankar 34697694e8 Fix integer overflow in malloc when tcache is enabled [BZ #22375]
When the per-thread cache is enabled, __libc_malloc uses request2size (which
does not perform an overflow check) to calculate the chunk size from the
requested allocation size. This leads to an integer overflow causing malloc
to incorrectly return the last successfully allocated block when called with
a very large size argument (close to SIZE_MAX).

This commit uses checked_request2size instead, removing the overflow.
2017-11-30 13:42:53 +01:00
Joseph Myers 18305fba55 Remove SPARC lllrint aliases.
The sparc32/sparcv9/fpu/multiarch implementations of llrint / llrintf
have aliases lllrint / lllrintf.  No such function is exported from or
used in libm and these aliases should not be there; I expect they
arose accidentally in the course of converting a 64-bit implementation
(where lrint and llrint can be aliases) to a 32-bit llrint
implementation.  This patch removes those spurious aliases.

Tested (compilation only) with build-many-glibcs.py for
sparcv9-linux-gnu.

	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S
	(__lllrint): Remove alias.
	(lllrint): Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S
	(__lllrintf): Likewise.
	(lllrintf): Likewise.
2017-11-30 00:43:28 +00:00
Joseph Myers 3e5efdbdbe Use libm_alias_float for sparc.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes sparc libm function implementations use
libm_alias_float to define function aliases.

Tested with build-many-glibcs.py for all its sparc configurations that
installed stripped shared libraries are unchanged by the patch.

	* sysdeps/sparc/sparc32/fpu/s_copysignf.S: Include
	<libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/fpu/s_fabsf.S: Include
	<libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysignf.S:
	Include <libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabsf.S: Include
	<libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c: Include
	<libm-alias-float.h>.
	(fdimf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c: Include
	<libm-alias-float.h>.
	(fmaf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrintf.S: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyintf.S:
	Include <libm-alias-float.h>.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rintf.S: Include
	<libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_llrintf.S: Include
	<libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_lrintf.S: Include
	<libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyintf.S: Include
	<libm-alias-float.h>.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_rintf.S: Include
	<libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c: Include
	<libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c: Include
	<libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c: Include
	<libm-alias-float.h>.
	(fmaf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c: Include
	<libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	(llrintf): Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c: Include
	<libm-alias-float.h>.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c: Include
	<libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c: Include
	<libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/s_copysignf.S: Include
	<libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/s_fabsf.c: Include
	<libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/s_lrintf.S: Include
	<libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	(llrintf): Likewise.
	* sysdeps/sparc/sparc64/fpu/s_nearbyintf.S: Include
	<libm-alias-float.h>.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/sparc/sparc64/fpu/s_rintf.S: Include
	<libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
2017-11-30 00:30:40 +00:00
Joseph Myers 875cd54855 Use libm_alias_double for sparc.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes sparc libm function implementations use
libm_alias_double to define function aliases (with consequent
simplification where compat symbol handling is now done by those
macros rather than locally in architecture-specific code).

Tested with build-many-glibcs.py for all its sparc configurations that
installed stripped shared libraries are unchanged by the patch.

	* sysdeps/sparc/sparc32/fpu/s_copysign.S: Include
	<libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/fpu/s_fabs.S: Include
	<libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S:
	Include <libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S: Include
	<libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c: Include
	<libm-alias-double.h>.
	(fdim): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c: Include
	<libm-alias-double.h>.
	(fma): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_llrint.S: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_nearbyint.S:
	Include <libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_rint.S: Include
	<libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S: Include
	<libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_llrint.S: Include
	<libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_nearbyint.S: Include
	<libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_rint.S: Include
	<libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c: Include
	<libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c: Include
	<libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c: Include
	<libm-alias-double.h>.
	(fma): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c: Include
	<libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	(llrint): Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c: Include
	<libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c: Include
	<libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c: Include
	<libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/s_copysign.S: Include
	<libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/s_fabs.c: Include
	<libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/s_lrint.S: Include
	<libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	(llrint): Likewise.
	* sysdeps/sparc/sparc64/fpu/s_nearbyint.S: Include
	<libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/sparc/sparc64/fpu/s_rint.S: Include
	<libm-alias-double.h>.
	(rint): Define using libm_alias_double.
2017-11-29 23:40:07 +00:00
Joseph Myers cf4ebc27fe Fix missing sparcv9 --disable-multi-arch fabsl compat symbol (bug 22229).
The --disable-multi-arch case of sparcv9 libm is missing a fabsl
compat symbol for when long double had the same ABI as double.  This
patch adds the missing compat symbol to this implementation.  As my
fix for other instances of this missing compat symbol postdates the
last release, I'm considering this as being part of bug 22229 that was
missing from my previous fix rather than as a separate issue, and so
as not needing a new bug report in Bugzilla.

Tested (compilation only) with build-many-glibcs.py for
sparcv9-linux-gnu --disable-multi-arch.

	[BZ #22229]
	* sysdeps/sparc/sparc32/sparcv9/fpu/s_fabs.S: Include
	<math_ldbl_opt.h>.
	(fabsl): Define as compat symbol at version GLIBC_2_0 for libm.
2017-11-29 23:09:03 +00:00
Joseph Myers 0c09737883 Add SPARC --disable-multi-arch builds to build-many-glibcs.py.
While working on SPARC changes to use libm_alias_* I noticed that the
non-multi-arch sparc32/sparcv9/fpu/s_fabs.S was missing compat symbol
support for fabsl.  This clearly shows inadequate test coverage, so
this patch adds SPARC --disable-multi-arch builds to
build-many-glibcs.py (the 32-bit one fails testing until that bug is
fixed, the 64-bit one passes testing).

	* scripts/build-many-glibcs.py (Context.add_all_configs): Add
	SPARC --disable-multi-arch glibc variants.
2017-11-29 22:51:46 +00:00
Joseph Myers 34bb10aabf Use libm_alias_float for x86_64.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes x86_64 libm function implementations use
libm_alias_float to define function aliases, or libm_alias_float_other
where the main name is defined with versioned_symbol.

Tested with the glibc testsuite for x86_64, and tested with
build-many-glibcs.py for all its x86_64 configurations that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/x86_64/fpu/multiarch/e_exp2f.c: Include
	<libm-alias-float.h>.
	(exp2f): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/x86_64/fpu/multiarch/e_expf.c: Include
	<libm-alias-float.h>.
	(exp2f): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/x86_64/fpu/multiarch/e_log2f.c: Include
	<libm-alias-float.h>.
	(exp2f): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/x86_64/fpu/multiarch/e_logf.c: Include
	<libm-alias-float.h>.
	(exp2f): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/x86_64/fpu/multiarch/e_powf.c: Include
	<libm-alias-float.h>.
	(exp2f): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/x86_64/fpu/multiarch/s_ceilf.c: Include
	<libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/multiarch/s_floorf.c: Include
	<libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Include
	<libm-alias-float.h>.
	(fmaf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c: Include
	<libm-alias-float.h>.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/multiarch/s_rintf.c: Include
	<libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/multiarch/s_truncf.c: Include
	<libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/s_copysignf.S: Include <libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/s_cosf.S: Include <libm-alias-float.h>.
	(cosf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/s_fabsf.c: Include <libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/s_fmaxf.S: Include <libm-alias-float.h>.
	(fmaxf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/s_fminf.S: Include <libm-alias-float.h>.
	(fminf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/s_llrintf.S: Include <libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	[!__ILP32__] (lrintf): Likewise.
	* sysdeps/x86_64/fpu/s_sincosf.S: Include <libm-alias-float.h>.
	(sincosf): Define using libm_alias_float.
	* sysdeps/x86_64/fpu/s_sinf.S: Include <libm-alias-float.h>.
	(sinf): Define using libm_alias_float.
	* sysdeps/x86_64/x32/fpu/s_lrintf.S: Include <libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
2017-11-29 21:25:41 +00:00
Joseph Myers 011fba7e48 Use libm_alias_double for x86_64.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes x86_64 libm function implementations use
libm_alias_double to define function aliases.

Tested with the glibc testsuite for x86_64, and tested with
build-many-glibcs.py for all its x86_64 configurations that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/x86_64/fpu/multiarch/s_atan.c: Include
	<libm-alias-double.h>.
	(atan): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/multiarch/s_ceil.c: Include
	<libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/multiarch/s_floor.c: Include
	<libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/multiarch/s_fma.c: Include
	<libm-alias-double.h>.
	(fma): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/multiarch/s_nearbyint.c: Include
	<libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/multiarch/s_rint.c: Include
	<libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/multiarch/s_sin.c: Include
	<libm-alias-double.h>.
	(sin): Define using libm_alias_double.
	(cos): Likewise.
	* sysdeps/x86_64/fpu/multiarch/s_tan.c: Include
	<libm-alias-double.h>.
	(tan): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/multiarch/s_trunc.c: Include
	<libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/s_copysign.S: Include <libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/s_fabs.c: Include <libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/s_fmax.S: Include <libm-alias-double.h>.
	(fmax): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/s_fmin.S: Include <libm-alias-double.h>.
	(fmin): Define using libm_alias_double.
	* sysdeps/x86_64/fpu/s_llrint.S: Include <libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	[!__ILP32__] (lrint): Likewise.
	* sysdeps/x86_64/x32/fpu/s_lrint.S: Include <libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
2017-11-29 19:01:21 +00:00
Adhemerval Zanella 21bfcc3d24 sparc: refactor sparc64 rint{f} selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_rint{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_rintf-generic and s_rint-generic
	objects.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_rint-generic.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_rint.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_rintf-generic.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_rint.S: Remove file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_rintf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-29 16:22:21 -02:00
Adhemerval Zanella 522228ddea sparc: refactor sparc64 lrint{f} selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_lrint{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_lrint-generic and s_lrint-generic
	objects.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_lrint-generic.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf-generic.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_lrint.S: Remove file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_lrintf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-29 16:22:21 -02:00
Adhemerval Zanella 2a6f4fab24 sparc: refactor sparc64 nearbyint{f} selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_nearbyint{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_nearbyint-generic and
	s_nearbyintf-generic objects.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint-generic.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf-generic.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyint.S: Remove file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_nearbyintf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-29 16:22:20 -02:00
Adhemerval Zanella 712b5b83e1 sparc: refactor sparc64 finite{f} selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_finite{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile (sysdeps_calls):
	Add s_finitef-generic and s_finite-generic objects.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_finite-generic.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_finite.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_finitef-generic.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_finite.S: Remove file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_finitef.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-29 16:22:20 -02:00
Adhemerval Zanella c96d3335a3 sparc: refactor sparc64 isinf{f} selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
s_isinf{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile (sysdeps_calls):
	Add isinff-generic and s_isinf-generic objects.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isinf-generic.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isinff-generic.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isinf.S: Remove file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isinff.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-29 16:22:20 -02:00
Adhemerval Zanella c6862a2371 sparc: refactor sparc64 isnan{f} selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
(s_isnan{f}-generic.S).

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile (sysdeps_calls):
	Add s_isnanf-generic and s_isnan-generic objects.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isnan-generic.S: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf-generic.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isnan.S: Remove file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_isnanf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-29 16:22:15 -02:00
Adhemerval Zanella 1cbd7bfe65 sparc: refactor sparc64 signbit{f} selector to C
This patch refactors the sparc64 ifunc selector to a C implementation.
Also, the generic symbol is moved to its own implementation file
(s_signbit{f}-generic.S).

It also simplifies the multiarch Makefile by moving the common objects
from libm-sysdeps_routines and sysdeps_routines to a new sysdeps_call
rule and including it where required with the correct prefix.

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* sysdeps/sparc/sparc-ifunc.h (sparc_libm_ifunc_redirected): New
	macro.
	* sysdeps/sparc/sparc64/fpu/multiarch/Makefile (sysdep_calls): New
	rule.
	(sysdep_routines): Use sysdep_calls as base.
	(libm-sysdep_routines): Add generic rule for symbols shared with
	libc.  Add s_signbit-generic and s_signbitf-generic objects.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_signbit-generic.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf-generic.S: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_signbit.S: Remove file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_signbitf.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-29 16:21:27 -02:00
Joseph Myers aa1142c593 Use libm_alias_float for ia64.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes ia64 libm function implementations use
libm_alias_float to define function aliases.  The same approach is
followed as with the corresponding long double and double patches: the
ia64-specific macros are left unchanged, with calls to
libm_alias_float_other being added in most cases and libm_alias_float
itself being used in only a few places.

Tested with build-many-glibcs.py for ia64-linux-gnu that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/ia64/fpu/libm-symbols.h: Include <libm-alias-float.h>.
	* sysdeps/ia64/fpu/e_acosf.S (acosf): Use libm_alias_float_other.
	* sysdeps/ia64/fpu/e_acoshf.S (acoshf): Likewise.
	* sysdeps/ia64/fpu/e_asinf.S (asinf): Likewise.
	* sysdeps/ia64/fpu/e_atan2f.S (atan2f): Likewise.
	* sysdeps/ia64/fpu/e_atanhf.S (atanhf): Likewise.
	* sysdeps/ia64/fpu/e_coshf.S (coshf): Likewise.
	* sysdeps/ia64/fpu/e_exp10f.S (exp10f): Likewise.
	* sysdeps/ia64/fpu/e_exp2f.S (exp2f): Likewise.
	* sysdeps/ia64/fpu/e_expf.S (expf): Likewise.
	* sysdeps/ia64/fpu/e_fmodf.S (fmodf): Likewise.
	* sysdeps/ia64/fpu/e_hypotf.S (hypotf): Likewise.
	* sysdeps/ia64/fpu/e_lgammaf_r.c (lgammaf_r): Define using
	libm_alias_float_r.
	* sysdeps/ia64/fpu/e_log2f.S (log2f): Use libm_alias_float_other.
	* sysdeps/ia64/fpu/e_logf.S (log10f): Likewise.
	(logf): Likewise.
	* sysdeps/ia64/fpu/e_powf.S (powf): Likewise.
	* sysdeps/ia64/fpu/e_remainderf.S (remainderf): Likewise.
	* sysdeps/ia64/fpu/e_sinhf.S (sinhf): Likewise.
	* sysdeps/ia64/fpu/e_sqrtf.S (sqrtf): Likewise.
	* sysdeps/ia64/fpu/libm_sincosf.S (sincosf): Likewise.
	* sysdeps/ia64/fpu/s_asinhf.S (asinhf): Likewise.
	* sysdeps/ia64/fpu/s_atanf.S (atanf): Likewise.
	* sysdeps/ia64/fpu/s_cbrtf.S (cbrtf): Likewise.
	* sysdeps/ia64/fpu/s_ceilf.S (ceilf): Likewise.
	* sysdeps/ia64/fpu/s_copysign.S (copysignf): Define using
	libm_alias_float.
	* sysdeps/ia64/fpu/s_cosf.S (sinf): Use libm_alias_float_other.
	(cosf): Likewise.
	* sysdeps/ia64/fpu/s_erfcf.S (erfcf): Likewise.
	* sysdeps/ia64/fpu/s_erff.S (erff): Likewise.
	* sysdeps/ia64/fpu/s_expm1f.S (expm1f): Likewise.
	* sysdeps/ia64/fpu/s_fabsf.S (fabsf): Likewise.
	* sysdeps/ia64/fpu/s_fdimf.S (fdimf): Likewise.
	* sysdeps/ia64/fpu/s_floorf.S (floorf): Likewise.
	* sysdeps/ia64/fpu/s_fmaf.S (fmaf): Likewise.
	* sysdeps/ia64/fpu/s_fmaxf.S (fmaxf): Likewise.
	* sysdeps/ia64/fpu/s_frexpf.c (frexpf): Likewise.
	* sysdeps/ia64/fpu/s_ldexpf.c (ldexpf): Likewise.
	* sysdeps/ia64/fpu/s_log1pf.S (log1pf): Likewise.
	* sysdeps/ia64/fpu/s_logbf.S (logbf): Likewise.
	* sysdeps/ia64/fpu/s_modff.S (modff): Likewise.
	* sysdeps/ia64/fpu/s_nearbyintf.S (nearbyintf): Likewise.
	* sysdeps/ia64/fpu/s_nextafterf.S (nextafterf): Likewise.
	* sysdeps/ia64/fpu/s_rintf.S (rintf): Likewise.
	* sysdeps/ia64/fpu/s_roundf.S (roundf): Likewise.
	* sysdeps/ia64/fpu/s_scalblnf.c (scalblnf): Likewise.
	* sysdeps/ia64/fpu/s_scalbnf.c (scalbnf): Define using
	libm_alias_float.
	* sysdeps/ia64/fpu/s_tanf.S (tanf): Use libm_alias_float_other.
	* sysdeps/ia64/fpu/s_tanhf.S (tanhf): Likewise.
	* sysdeps/ia64/fpu/s_truncf.S (truncf): Likewise.
	* sysdeps/ia64/fpu/w_lgammaf_main.c
	[BUILD_LGAMMA && !USE_AS_COMPAT] (lgammaf): Likewise.
	* sysdeps/ia64/fpu/w_tgammaf_compat.S (tgammaf): Likewise.
2017-11-29 17:38:35 +00:00
Alexandre Oliva 8da25eec0a Collation fix: make forward accent sorting the default [BZ #17750]
[BZ #17750]
	* Makefile: add fr_CA.UTF-8 to test-input and LOCALES.
	* localedata/fr_CA.UTF-8.in: New file with test data for backward
	accents sorting.
	* localedata/fr_FR.UTF-8.in: Fix test data for forward accents
	sorting.
	* localedata/locales/cs_CZ (LC_COLLATE): Remove “define DIACRIT_FORWARD”
	* localedata/locales/de_DE (LC_COLLATE): Likewise.
	* localedata/locales/hu_HU (LC_COLLATE): Likewise.
	* localedata/locales/lb_LU (LC_COLLATE): Likewise.
	* localedata/locales/yuw_PG (LC_COLLATE): Likewise.
	* localedata/locales/fr_CA (LC_COLLATE): Add “define DIACRIT_BACKWARD”
	* localedata/locales/iso14651_t1_common: Use “ifdef DIACRIT_FORWARD”
	instead of “ifdef DIACRIT_BACKWARD”.

The only locale which currently needs backward accents sorting is fr_CA.
Therefore, forward accents sorting should be the default.

Before this patch, backwards accent sorting was the default and all
locales except fr_CA had to use

    define DIACRIT_FORWARD

before

    copy "iso14651_t1"

Most locales didn’t do that and thus got the inappropriate backwards accents sorting
by accident. Now only the fr_CA locale needs to use

    define DIACRIT_BACKWARD

before

    copy "iso14651_t1"

Original patch slightly modified by: Mike FABIAN <mfabian@redhat.com>
2017-11-29 11:56:46 +01:00
Adhemerval Zanella a55430cb0e sparc: Assume VIS3 support
This patch assumes VIS3 support by binutils, which is supported since
version 2.22.  This leads to some code simplification, mostly on
multiarch build where there is only one variant instead of previously
two (whether binutils supports VIS3 instructions or not).

For multiarch files where HAVE_AS_VIS3_SUPPORT was checked and
the default implementation was built with a different name, a new
file with (implementation with -generic appended) is added.

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* config.h.in (HAVE_AS_VIS3_SUPPORT): Remove check for VIS3 support.
	* sysdeps/sparc/configure.ac (HAVE_AS_VIS3_SUPPORT): Likewise.
	* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c: Likewise.
	* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c: Likewise.
	* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c: Likewise.
	* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c: Likewise.
	* sysdeps/sparc/sparc-ifunc.h [!HAVE_AS_VIS3_SUPPORT]
	(SPARC_ASM_VIS3_IFUNC, SPARC_ASM_VIS3_VIS2_IFUNC): Remove macros.
	* sysdeps/sparc/sparc32/sparcv9/Makefile [$(have-as-vis3) != yes]
	(ASFLAGS.o, ASFLAGS-.os, ASFLAGS-.op, ASFLAGS-.oS): Remove rules.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
	($(have-as-vis3) == yes): Remove conditional.
	* sysdeps/sparc/sparc64/Makefile (($(have-as-vis3) == yes)):
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c: New
	file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c: New file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-29 08:18:00 -02:00
Joseph Myers 0609ec0a74 Use libm_alias_double for ia64.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes ia64 libm function implementations use
libm_alias_double to define function aliases.  The same approach is
followed as with the corresponding long double patch: the
ia64-specific macros are left unchanged, with calls to
libm_alias_double_other being added in most cases and
libm_alias_double itself being used in only a few places.

Tested with build-many-glibcs.py for ia64-linux-gnu that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/ia64/fpu/libm-symbols.h: Include <libm-alias-double.h>.
	* sysdeps/ia64/fpu/e_acos.S (acos): Use libm_alias_double_other.
	* sysdeps/ia64/fpu/e_acosh.S (acosh): Likewise.
	* sysdeps/ia64/fpu/e_asin.S (asin): Likewise.
	* sysdeps/ia64/fpu/e_atan2.S (atan2): Likewise.
	* sysdeps/ia64/fpu/e_atanh.S (atanh): Likewise.
	* sysdeps/ia64/fpu/e_cosh.S (cosh): Likewise.
	* sysdeps/ia64/fpu/e_exp.S (exp): Likewise.
	* sysdeps/ia64/fpu/e_exp10.S (exp10): Likewise.
	* sysdeps/ia64/fpu/e_exp2.S (exp2): Likewise.
	* sysdeps/ia64/fpu/e_fmod.S (fmod): Likewise.
	* sysdeps/ia64/fpu/e_hypot.S (hypot): Likewise.
	* sysdeps/ia64/fpu/e_lgamma_r.c (lgamma_r): Define using
	libm_alias_double_r.
	* sysdeps/ia64/fpu/e_log.S (log10): Use libm_alias_double_other.
	(log): Likewise.
	* sysdeps/ia64/fpu/e_log2.S (log2): Likewise.
	* sysdeps/ia64/fpu/e_pow.S (pow): Likewise.
	* sysdeps/ia64/fpu/e_remainder.S (remainder): Likewise.
	* sysdeps/ia64/fpu/e_sinh.S (sinh): Likewise.
	* sysdeps/ia64/fpu/e_sqrt.S (sqrt): Likewise.
	* sysdeps/ia64/fpu/libm_sincos.S (sincos): Likewise.
	* sysdeps/ia64/fpu/s_asinh.S (asinh): Likewise.
	* sysdeps/ia64/fpu/s_atan.S (atan): Likewise.
	* sysdeps/ia64/fpu/s_cbrt.S (cbrt): Likewise.
	* sysdeps/ia64/fpu/s_ceil.S (ceil): Likewise.
	* sysdeps/ia64/fpu/s_copysign.S (copysign): Define using
	libm_alias_double.
	* sysdeps/ia64/fpu/s_cos.S (sin): Use libm_alias_double_other.
	(cos): Likewise.
	* sysdeps/ia64/fpu/s_erf.S (erf): Likewise.
	* sysdeps/ia64/fpu/s_erfc.S (erfc): Likewise.
	* sysdeps/ia64/fpu/s_expm1.S (expm1): Likewise.
	* sysdeps/ia64/fpu/s_fabs.S (fabs): Likewise.
	* sysdeps/ia64/fpu/s_fdim.S (fdim): Likewise.
	* sysdeps/ia64/fpu/s_floor.S (floor): Likewise.
	* sysdeps/ia64/fpu/s_fma.S (fma): Likewise.
	* sysdeps/ia64/fpu/s_fmax.S (fmax): Likewise.
	* sysdeps/ia64/fpu/s_frexp.c (frexp): Likewise.
	* sysdeps/ia64/fpu/s_ldexp.c (ldexp): Likewise.
	* sysdeps/ia64/fpu/s_log1p.S (log1p): Likewise.
	* sysdeps/ia64/fpu/s_logb.S (logb): Likewise.
	* sysdeps/ia64/fpu/s_modf.S (modf): Likewise.
	* sysdeps/ia64/fpu/s_nearbyint.S (nearbyint): Likewise.
	* sysdeps/ia64/fpu/s_nextafter.S (nextafter): Likewise.
	* sysdeps/ia64/fpu/s_rint.S (rint): Likewise.
	* sysdeps/ia64/fpu/s_round.S (round): Likewise.
	* sysdeps/ia64/fpu/s_scalbn.c (scalbn): Define using
	libm_alias_double.
	* sysdeps/ia64/fpu/s_tan.S (tan): Use libm_alias_double_other.
	* sysdeps/ia64/fpu/s_tanh.S (tanh): Likewise.
	* sysdeps/ia64/fpu/s_trunc.S (trunc): Likewise.
	* sysdeps/ia64/fpu/w_lgamma_main.c
	[BUILD_LGAMMA && !USE_AS_COMPAT] (lgamma): Likewise.
	* sysdeps/ia64/fpu/w_tgamma_compat.S (tgamma): Likewise.
2017-11-29 01:23:23 +00:00
John David Anglin d5bfa34a53 Fix gmon static test failures.
* sysdeps/hppa/start.S (_start): Check PIC instead of SHARED.  Load
	address of $global$ into %dp register earlier.  Use pc-relative
	instruction sequence for PIC case.
2017-11-28 20:01:05 -05:00
Joseph Myers e4602cba2f Use libm_alias_float for i386.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes i386 libm function implementations use
libm_alias_float (or libm_alias_float_other in cases where the main
symbol name is defined with versioned_symbol) to define function
aliases.

Tested with build-many-glibcs.py for all its i386 configurations that
installed stripped shared libraries are unchanged by the patch, as
well as running the full glibc testsuite for i686.

	* sysdeps/i386/fpu/s_asinhf.S: Include <libm-alias-float.h>.
	(asinhf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_atanf.S: Include <libm-alias-float.h>.
	(atanf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_cbrtf.S: Include <libm-alias-float.h>.
	(cbrtf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_ceilf.S: Include <libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_copysignf.S: Include <libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_expm1f.S: Include <libm-alias-float.h>.
	(expm1f): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_fabsf.S: Include <libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_floorf.S: Include <libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_fmaxf.S: Include <libm-alias-float.h>.
	(fmaxf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_fminf.S: Include <libm-alias-float.h>.
	(fminf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_frexpf.S: Include <libm-alias-float.h>.
	(frexpf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_llrintf.S: Include <libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_logbf.S: Include <libm-alias-float.h>.
	(logbf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_lrintf.S: Include <libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_nearbyintf.S: Include <libm-alias-float.h>.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_remquof.S: Include <libm-alias-float.h>.
	(remquof): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_rintf.S: Include <libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/i386/fpu/s_truncf.S: Include <libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
	* sysdeps/i386/i686/fpu/multiarch/e_exp2f.c: Include
	<libm-alias-float.h>.
	(exp2f): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/i386/i686/fpu/multiarch/e_expf.c: Include
	<libm-alias-float.h>.
	(expf): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/i386/i686/fpu/multiarch/e_log2f.c: Include
	<libm-alias-float.h>.
	(log2f): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/i386/i686/fpu/multiarch/e_logf.c: Include
	<libm-alias-float.h>.
	(logf): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/i386/i686/fpu/multiarch/e_powf.c: Include
	<libm-alias-float.h>.
	(powf): Define using libm_alias_float, or libm_alias_float_other
	if [SHARED].
	* sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Include
	<libm-alias-float.h>.
	(cosf): Define using libm_alias_float.
	* sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Include
	<libm-alias-float.h>.
	(sincosf): Define using libm_alias_float.
	* sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Include
	<libm-alias-float.h>.
	(sinf): Define using libm_alias_float.
	* sysdeps/i386/i686/fpu/s_fmaxf.S: Include <libm-alias-float.h>.
	(fmaxf): Define using libm_alias_float.
	* sysdeps/i386/i686/fpu/s_fminf.S: Include <libm-alias-float.h>.
	(fminf): Define using libm_alias_float.
	* sysdeps/i386/i686/multiarch/s_fmaf.c: Include
	<libm-alias-float.h>.
	(fmaf): Define using libm_alias_float.
2017-11-29 00:10:35 +00:00
Joseph Myers bc4e8f9b49 Use libm_alias_double for i386.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes i386 libm function implementations use
libm_alias_double to define function aliases.

Tested with build-many-glibcs.py for all its i386 configurations that
installed stripped shared libraries are unchanged by the patch, as
well as running the full glibc testsuite for i686.

	* sysdeps/i386/fpu/s_asinh.S: Include <libm-alias-double.h>.
	(asinh): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_atan.S: Include <libm-alias-double.h>.
	(atan): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_cbrt.S: Include <libm-alias-double.h>.
	(cbrt): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_ceil.S: Include <libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_copysign.S: Include <libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_expm1.S: Include <libm-alias-double.h>.
	(expm1): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_fabs.S: Include <libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_fdim.c: Include <libm-alias-double.h>.
	(fdim): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_floor.S: Include <libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_fmax.S: Include <libm-alias-double.h>.
	(fmax): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_fmin.S: Include <libm-alias-double.h>.
	(fmin): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_frexp.S: Include <libm-alias-double.h>.
	(frexp): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_llrint.S: Include <libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_logb.S: Include <libm-alias-double.h>.
	(logb): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_lrint.S: Include <libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_nearbyint.S: Include <libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_remquo.S: Include <libm-alias-double.h>.
	(remquo): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_rint.S: Include <libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/i386/fpu/s_trunc.S: Include <libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
	* sysdeps/i386/i686/fpu/s_fmax.S: Include <libm-alias-double.h>.
	(fmax): Define using libm_alias_double.
	* sysdeps/i386/i686/fpu/s_fmin.S: Include <libm-alias-double.h>.
	(fmin): Define using libm_alias_double.
	* sysdeps/i386/i686/multiarch/s_fma.c: Include <libm-alias-double.h>.
	(fma): Define using libm_alias_double.
2017-11-28 18:15:44 +00:00
H.J. Lu 8d81ce0c6d Properly compute offsets of note descriptor and next note [BZ #22370]
A note header has 3 4-bytes fields, followed by note name and note
descriptor.  According to gABI, in a note entry, the note name field,
not note name size, is padded for the note descriptor.  And the note
descriptor field, not note descriptor size, is padded for the next
note entry.  Notes are aligned to 4 bytes in 32-bit objects and 8 bytes
in 64-bit objects.

For all GNU notes, the name is "GNU" which is 4 bytes.  They have the
same format in the first 16 bytes in both 32-bit and 64-bit objects.
They differ by note descriptor size and note type.  So far, .note.ABI-tag
and .note.gnu.build-id notes are always aligned to 4 bytes.  The exsting
codes compute the note size by aligning the note name size and note
descriptor size to 4 bytes.  It happens to produce the same value as
the actual note size by luck since the name size is 4 and offset of the
note descriptor is 16.  But it will produce the wrong size when note
alignment is 8 bytes in 64-bit objects.

This patch defines ELF_NOTE_DESC_OFFSET and ELF_NOTE_NEXT_OFFSET to
properly compute offsets of note descriptor and next note.  It uses
alignment of PT_NOTE segment to support both 4-byte and 8-byte note
alignments in 64-bit objects.  To handle PT_NOTE segments with
incorrect alignment, which may lead to an infinite loop, if segment
alignment is less than 4, we treate alignment as 4 bytes since some
note segments have 0 or 1 byte alignment.

	[BZ #22370]
	* elf/dl-hwcaps.c (ROUND): Removed.
	(_dl_important_hwcaps): Replace ROUND with ELF_NOTE_DESC_OFFSET
	and ELF_NOTE_NEXT_OFFSET.
	* elf/dl-load.c (ROUND): Removed.
	(open_verify): Replace ROUND with ELF_NOTE_NEXT_OFFSET.
	* elf/readelflib.c (ROUND): Removed.
	(process_elf_file): Replace ROUND with ELF_NOTE_NEXT_OFFSET.
	* include/elf.h [!_ISOMAC]: Include <libc-pointer-arith.h>.
	[!_ISOMAC] (ELF_NOTE_DESC_OFFSET): New.
	[!_ISOMAC] (ELF_NOTE_NEXT_OFFSET): Likewise.
2017-11-28 09:57:00 -08:00
Joseph Myers 313ba4630f Use libm_alias_float for s390.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes an s390 libm function implementation use
libm_alias_float to define function aliases.

Tested with build-many-glibcs.py for s390-linux-gnu and
s390x-linux-gnu that installed stripped shared libraries are unchanged
by the patch.

	* sysdeps/s390/fpu/s_fmaf.c: Include <libm-alias-float.h>.
	[!__fmaf] (fmaf): Define using libm_alias_float.
2017-11-28 17:34:13 +00:00
Joseph Myers 6940bd966b Use libm_alias_double for s390.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes s390 libm function implementations use
libm_alias_double to define function aliases.  This allows
sysdeps/unix/sysv/linux/s390/fpu/s_fma.c to be removed, as
libm_alias_double handles symbol versioning for long double compat
symbols.

Tested with build-many-glibcs.py for s390-linux-gnu and
s390x-linux-gnu that installed stripped shared libraries are unchanged
by the patch.

	* sysdeps/s390/fpu/s_fma.c: Include <libm-alias-double.h>.
	[!__fma] (fma): Define using libm_alias_double.
	* sysdeps/unix/sysv/linux/s390/fpu/s_fma.c: Remove.
2017-11-28 17:18:20 +00:00
Mike FABIAN 22c69b6ad6 Add the Changelog entry for “cs_CZ locale: Base collation on iso14651_t1 [BZ #22336]” 2017-11-28 16:46:11 +01:00
Siddhesh Poyarekar 8d7d3ba8c5 localedata: Remove duplicate cs_CZ from LOCALES
The LOCALES variable in the localedata had two instances of cs_CZ
which generated the following warning:

../gen-locales.mk:11: target '/opt/build/localedata/cs_CZ.UTF-8/LC_CTYPE' given more than once in the same rule

Dropped the duplicate entry.
2017-11-28 20:04:31 +05:30
Victor Rodriguez 0422ed1e84 benchtests: Enable BENCHSET to run subset of tests
This patch adds BENCHSET variable to benchtests/Makefile in order to
provide the capability to run a list of subsets of benchmark tests, ie;

    make bench BENCHSET="bench-pthread bench-math malloc-thread"

This helps users to benchmark specific glibc area

ChangeLog:

        * benchtests/Makefile:Add BENCHSET to allow subsets of
        benchmarks to be run.
        * benchtests/README: Add documentation for: Running subsets of
        benchmarks.

Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
Reviewed-By: Siddhesh Poyarekar <siddhesh@sourceware.org>
2017-11-28 19:57:46 +05:30
Victor Rodriguez d5090db30e benchtests: Expand range of tests names in schema.json
When executing bench-math the benchmark output is invalid with this
error msg:

    Invalid benchmark output: 'workload-spec2006.wrf' does not match any of
    the regexes: '^[_a-zA-Z0-9]*$¹ or Invalid benchmark output: Additional
    properties are not allowed ('workload-spec2006.wrf' was unexpected)

The error was seen when running the test:
workload-spec2006.wrf, 'stack=1024,guard=1' and 'stack=1024,guard=2'.
The problem is that the current regex's do not accept the hyphen, dot, equal
and comma in the output.

This patch changes the regex in benchout.schema.json to accept symbols in
benchmark tests names.

ChangeLog:

        * benchtests/scripts/benchout.schema.json: Fix regex to accept a
        wider range of tests names.

Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
Reviewed-By: Siddhesh Poyarekar <siddhesh@sourceware.org>
2017-11-28 19:52:57 +05:30
Victor Rodriguez 0595e36034 benchtests: Adjust valid and accepted properties
Benchmark workload-spec2006.wrf does not produce max, min or mean
results but instead produce throughput. This is represented in
benchtests/bench-skeleton.c. This patch adjust benchout.schema.json to consider
bench.out from bench-math benchmarks as valid

ChangeLog:

	* benchtests/scripts/benchout.schema.json: Add throughput as accepted
	result from property and remove "max", min" and "mean" from required
	properties based on benchtests/bench-skeleton.c.

Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
Reviewed-By: Siddhesh Poyarekar <siddhesh@sourceware.org>
2017-11-28 19:49:59 +05:30
Florian Weimer b4c645c2f5 posix: Make tst-getaddrinfo[45] xtests due to DNS dependency [BZ #20826]
These tests need a working Internet connection with DNS.

We have additional coverage of getaddrinfo through the resolv tests, so
the loss of default test coverage seems acceptable.
2017-11-28 12:20:01 +01:00
Adhemerval Zanella 6905656404 sparc: Implement memset/bzero ifunc selection in C
This patch refactor the SPARC64 ifunc selector to a C implementation.
No functional change is expected, including ifunc resolution rules.

Checked on sparc64-linux-gnu, sparcv9-linux-gnu and x86_64-linux-gnu.

	* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
	[$(subdir) = string] (sysdep_routines): Add memset-ultra1.
	* sysdeps/sparc/sparc64/multiarch/Makefile [$(subdir) = string]
	(sysdep_routines): Add memset-ultra1.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/ifunc-memset.h: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memset-ultra1.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memset.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/bzero.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S: Remove file.
	* sysdeps/sparc/sparc64/multiarch/memset.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-28 08:53:15 -02:00
Adhemerval Zanella 88684de7a6 sparc: Implement memcpy/mempcpy ifunc selection in C
This patch refactor the SPARC64 ifunc selector to a C implementation.
The x86_64 implementation is used as default, which resulted in common
definitions (ifunc-init.h) used on both architectures.  No functional
change is expected, including ifunc resolution rules.

Checked on sparc64-linux-gnu, sparcv9-linux-gnu and x86_64-linux-gnu.

	* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S: Likewise.
	* sysdeps/sparc/sparc64/multiarch/memcpy.c: Likewise.
	* sysdeps/sparc/sparc64/multiarch/mempcpy.c: Likewise.
	* sysdeps/sparc/sparc-ifunc.h (sparc_libc_ifunc_redirected): New
	macro.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
	[$(subdir) = string] (sysdep_routines): Add memcpy-ultra1.
	* sysdeps/sparc/sparc64/multiarch/Makefile [$(subdir) = string]
	(sysdep_routines): Add memcpy-ultra1.
	* sysdeps/sparc/sparc64/multiarch/memcpy.S: Remove file.
	* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-28 08:53:15 -02:00
Joseph Myers f433d0b3bb Use libm_alias_float for alpha.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes alpha libm function implementations use
libm_alias_float macros to define function aliases.  In the case of
the ABI compatibility for complex functions, libm_alias_float_other is
used, with the cfloat_versions macro adjusted to take a function name
argument without the trailing 'f' to facilitate this, and
cfloat_versions dealing with calling libm_alias_float_other (except
for clog10f, which doesn't use that macro because of the complexity
associated with __clog10f also being exported).

Tested with build-many-glibcs.py for alpha-linux-gnu that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/alpha/fpu/cfloat-compat.h: Include <libm-alias-float.h>.
	(cfloat_versions): Take function argument without trailing 'f'.
	Call libm_alias_float_other.
	* sysdeps/alpha/fpu/cabsf.c: Update call to cfloat_versions.
	* sysdeps/alpha/fpu/cargf.c: Likewise.
	* sysdeps/alpha/fpu/cimagf.c: Likewise.
	* sysdeps/alpha/fpu/conjf.c: Likewise.
	* sysdeps/alpha/fpu/crealf.c: Likewise.
	* sysdeps/alpha/fpu/s_cacosf.c: Likewise.
	* sysdeps/alpha/fpu/s_cacoshf.c: Likewise.
	* sysdeps/alpha/fpu/s_casinf.c: Likewise.
	* sysdeps/alpha/fpu/s_casinhf.c: Likewise.
	* sysdeps/alpha/fpu/s_catanf.c: Likewise.
	* sysdeps/alpha/fpu/s_catanhf.c: Likewise.
	* sysdeps/alpha/fpu/s_ccosf.c: Likewise.
	* sysdeps/alpha/fpu/s_ccoshf.c: Likewise.
	* sysdeps/alpha/fpu/s_cexpf.c: Likewise.
	* sysdeps/alpha/fpu/s_clogf.c: Likewise.
	* sysdeps/alpha/fpu/s_cpowf.c: Likewise.
	* sysdeps/alpha/fpu/s_cprojf.c: Likewise.
	* sysdeps/alpha/fpu/s_csinf.c: Likewise.
	* sysdeps/alpha/fpu/s_csinhf.c: Likewise.
	* sysdeps/alpha/fpu/s_csqrtf.c: Likewise.
	* sysdeps/alpha/fpu/s_ctanf.c: Likewise.
	* sysdeps/alpha/fpu/s_ctanhf.c: Likewise.
	* sysdeps/alpha/fpu/s_clog10f.c: Include <libm-alias-float.h>.
	(clog10f): Use libm_alias_float_other.
	* sysdeps/alpha/fpu/s_ceilf.c: Include <libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_copysignf.c: Include <libm-alias-float.h>.
	(copysignf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_fabsf.c: Include <libm-alias-float.h>.
	(fabsf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_floorf.c: Include <libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_fmax.S: Include <libm-alias-float.h>.
	(fmaxf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_fmin.S: Include <libm-alias-float.h>.
	(fminf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_lrintf.c: Include <libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	(llrintf): Likewise.
	* sysdeps/alpha/fpu/s_lroundf.c: Include <libm-alias-float.h>.
	(lroundf): Define using libm_alias_float.
	(llroundf): Likewise.
	* sysdeps/alpha/fpu/s_rintf.c: Include <libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/alpha/fpu/s_truncf.c: Include <libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
2017-11-28 01:19:03 +00:00
Joseph Myers 15ff490014 Use libm_alias_float for aarch64.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes aarch64 libm function implementations use
libm_alias_float to define function aliases.

Tested with build-many-glibcs.py for aarch64-linux-gnu that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/aarch64/fpu/s_ceilf.c: Include <libm-alias-float.h>.
	(ceilf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_floorf.c: Include <libm-alias-float.h>.
	(floorf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_fmaf.c: Include <libm-alias-float.h>.
	(fmaf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_fmaxf.c: Include <libm-alias-float.h>.
	(fmaxf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_fminf.c: Include <libm-alias-float.h>.
	(fminf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_llrintf.c: Include <libm-alias-float.h>.
	(llrintf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_llroundf.c: Include <libm-alias-float.h>.
	(llroundf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_lrintf.c: Include <libm-alias-float.h>.
	(lrintf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_lroundf.c: Include <libm-alias-float.h>.
	(lroundf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_nearbyintf.c: Include
	<libm-alias-float.h>.
	(nearbyintf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_rintf.c: Include <libm-alias-float.h>.
	(rintf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_roundf.c: Include <libm-alias-float.h>.
	(roundf): Define using libm_alias_float.
	* sysdeps/aarch64/fpu/s_truncf.c: Include <libm-alias-float.h>.
	(truncf): Define using libm_alias_float.
2017-11-28 00:55:42 +00:00
Joseph Myers 5de606387b Use libm_alias_double for alpha.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes alpha libm function implementations use
libm_alias_double to define function aliases.  This also simplifies
the code because the compatibility for long double = double is handled
by libm_alias_double instead of locally in each source file.

Tested with build-many-glibcs.py for alpha-linux-gnu that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/alpha/fpu/s_ceil.c: Include <libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/alpha/fpu/s_copysign.c: Include <libm-alias-double.h>.
	(copysign): Define using libm_alias_double.
	* sysdeps/alpha/fpu/s_fabs.c: Include <libm-alias-double.h>.
	(fabs): Define using libm_alias_double.
	* sysdeps/alpha/fpu/s_floor.c: Include <libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/alpha/fpu/s_fmax.S: Include <libm-alias-double.h>.
	(fmax): Define using libm_alias_double.
	* sysdeps/alpha/fpu/s_fmin.S: Include <libm-alias-double.h>.
	(fmin): Define using libm_alias_double.
	* sysdeps/alpha/fpu/s_lrint.c: Include <libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	(llrint): Likewise.
	* sysdeps/alpha/fpu/s_lround.c: Include <libm-alias-double.h>.
	(lround): Define using libm_alias_double.
	(llround): Likewise.
	* sysdeps/alpha/fpu/s_rint.c: Include <libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/alpha/fpu/s_trunc.c: Include <libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
2017-11-28 00:07:56 +00:00
Joseph Myers d812486444 Support ldbl-opt libm_alias_double use from .S files.
This patch makes the ldbl-opt libm_alias_double implementation support
use from .S sources, by adding a semicolon after its use of
weak_alias.

Tested (compilation only) with build-many-glibcs.py for
alpha-linux-gnu, in conjunction with a patch introducing uses of
libm_alias_double in alpha .S files.

	* sysdeps/ieee754/ldbl-opt/libm-alias-double.h
	(libm_alias_double_r): Add semicolon after weak_alias call.
2017-11-28 00:01:11 +00:00
Joseph Myers f07d2ec8c0 Use libm_alias_double for aarch64.
Continuing the preparation for additional _FloatN / _FloatNx function
aliases, this patch makes aarch64 libm function implementations use
libm_alias_double to define function aliases.

Tested with build-many-glibcs.py for aarch64-linux-gnu that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/aarch64/fpu/s_ceil.c: Include <libm-alias-double.h>.
	(ceil): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_floor.c: Include <libm-alias-double.h>.
	(floor): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_fma.c: Include <libm-alias-double.h>.
	(fma): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_fmax.c: Include <libm-alias-double.h>.
	(fmax): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_fmin.c: Include <libm-alias-double.h>.
	(fmin): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_llrint.c: Include <libm-alias-double.h>.
	(llrint): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_llround.c: Include <libm-alias-double.h>.
	(llround): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_lrint.c: Include <libm-alias-double.h>.
	(lrint): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_lround.c: Include <libm-alias-double.h>.
	(lround): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_nearbyint.c: Include <libm-alias-double.h>.
	(nearbyint): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_rint.c: Include <libm-alias-double.h>.
	(rint): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_round.c: Include <libm-alias-double.h>.
	(round): Define using libm_alias_double.
	* sysdeps/aarch64/fpu/s_trunc.c: Include <libm-alias-double.h>.
	(trunc): Define using libm_alias_double.
2017-11-27 23:54:32 +00: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
Andreas Schwab c2c299fd24 Consolidate link map sorting
Combine the four places where link maps are sorted into a single function.
This also moves the logic to skip the first map (representing the main
binary) to the callers.
2017-11-27 11:37:19 +01:00
Joseph Myers de61465c04 Use libm_alias_float128 more in sysdeps/ieee754/float128.
This patch uses libm_alias_float128 in place of weak_alias more in
sysdeps/ieee754/float128, in preparation for defining _Float64x
aliases when appropriate.

Tested for x86_64, and for powerpc64le (compilation only) with
build-many-glibcs.py in conjunction with _Float64x support patches.

	* sysdeps/ieee754/float128/s_fromfpf128.c (fromfpf128): Define
	using libm_alias_float128.
	* sysdeps/ieee754/float128/s_fromfpxf128.c (fromfpxf128):
	Likewise.
	* sysdeps/ieee754/float128/s_setpayloadf128.c (setpayloadf128):
	Likewise.
	* sysdeps/ieee754/float128/s_setpayloadsigf128.c
	(setpayloadsigf128): Likewise.
	* sysdeps/ieee754/float128/s_ufromfpf128.c (ufromfpf128):
	Likewise.
	* sysdeps/ieee754/float128/s_ufromfpxf128.c (ufromfpxf128):
	Likewise.
2017-11-24 23:53:54 +00:00
Joseph Myers 9ae6d171bc Use -mfloat128 for _Float64x tests for powerpc64le.
Supporting _Float64x on powerpc64le means that tests of that type need
to use -mfloat128 just like tests of _Float128.  This patch adds the
necessary uses of that option.

Tested (compilation only) for powerpc64le with build-many-glibcs.py,
in conjunction with _Float64x support patches.

	* sysdeps/powerpc/powerpc64le/Makefile ($(foreach
	suf,$(all-object-suffixes),$(objpfx)test-float64x%$(suf))): Add
	-mfloat128 to CFLAGS.
	($(foreach
	suf,$(all-object-suffixes),$(objpfx)test-ifloat64x%$(suf))):
	Likewise.
	(CFLAGS-libm-test-support-float64x.c): New variable.
	($(objpfx)test-float64x% $(objpfx)test-ifloat64x%): Add
	$(f128-loader-link) to gnulib-tests.
2017-11-24 23:38:51 +00:00
Joseph Myers 6e70d156c7 Support _Float64x in libm_alias macros.
This patch adds support for libm_alias_ldouble and libm_alias_float128
to create *f64x function aliases when appropriate.

Making such aliases work for functions defined in assembly sources
requires adding some semicolons after weak_alias calls in alias macro
definitions.  For C, semicolons are already present in the macros
called when required, but a GNU C extension allows excess semicolons
at file scope in a source file (and glibc already uses this), so it is
OK to have extra semicolons present in the macro definitions.  For
assembly sources, making multiple alias macro calls from a single
macro expansion means there are no newlines between the calls, so an
explicit separator is needed.  If hppa were to have .S sources in
libm, a more complicated approach would be needed that used
ASM_LINE_SEP when building assembly sources but not for C, but right
now there are no such sources so just using a semicolon (as already
present unconditionally in some such macro expansions) suffices.

Tested for x86_64, including in conjunction with _Float64x support
patches.

	* sysdeps/generic/libm-alias-float128.h: Include <bits/floatn.h>.
	(libm_alias_float128_other_r): If
	[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE], define f64x
	alias.
	(libm_alias_float128_r): Add semicolon after weak_alias call.
	* sysdeps/generic/libm-alias-ldouble.h
	(libm_alias_ldouble_other_r_f128): New macro.
	(libm_alias_ldouble_other_r_f64x): Likewise.
	(libm_alias_ldouble_other_r): Use libm_alias_ldouble_other_r_f128
	and libm_alias_ldouble_other_r_f64x.
	(libm_alias_ldouble_r): Add semicolon after weak_alias call.
	* sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h
	(libm_alias_ldouble_other_r_f128): New macro.
	(libm_alias_ldouble_other_r_f64x): Likewise.
	(libm_alias_ldouble_other_r): Use libm_alias_ldouble_other_r_f128
	and libm_alias_ldouble_other_r_f64x.
2017-11-24 23:33:14 +00:00
Joseph Myers df2806cdb5 Support strfromf64x alias.
This patch adds support for defining strfromf64x as a function alias
(of strfroml or strfromf128, as appropriate) when _Float64x is
supported.

Tested for x86_64, including in conjunction with _Float64x support
patches, and also tested build for other configurations (in
conjunction with _Float64x support patches) with build-many-glibcs.py
to cover the various different files needing updating to define these
aliases.

	* stdlib/strfroml.c: Always include <stdlib.h>.
	[__HAVE_FLOAT64X_LONG_DOUBLE] (strfromf64x): Define and later
	undefine as macro and define as weak alias.
	* sysdeps/ieee754/float128/strfromf128.c: Include <bits/floatn.h>.
	[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE]: Include
	<stdlib.h>.
	[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strfromf64x):
	Define and later undefine as macro and define as weak alias.
2017-11-24 23:12:30 +00:00
Joseph Myers 0df4fe3557 Support strtof64x, wcstof64x aliases.
This patch adds support for defining strtof64x, strtof64x_l, wcstof64
and wcstof64x_l function aliases when _Float64x is supported.

Tested for x86_64, including in conjunction with _Float64x support
patches, and also tested build for other configurations (in
conjunction with _Float64x support patches) with build-many-glibcs.py
to cover the various different files needing updating to define these
aliases.

	* stdlib/strtold.c [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x):
	Define and later undefine as macro.  Define as weak alias if
	[!USE_WIDE_CHAR].
	[__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x): Define and later
	undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
	* sysdeps/ieee754/float128/strtof128.c: Include <bits/floatn.h>.
	[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x):
	Define and later undefine as macro.  Define as weak alias if
	[!USE_WIDE_CHAR].
	[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x):
	Define and later undefine as macro.  Define as weak alias if
	[USE_WIDE_CHAR].
	* sysdeps/ieee754/float128/strtof128_l.c
	[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l):
	Define and later undefine as macro.  Define as weak alias if
	[!USE_WIDE_CHAR].
	[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l):
	Define and later undefine as macro.  Define as weak alias if
	[USE_WIDE_CHAR].
	* sysdeps/ieee754/ldbl-128/strtold_l.c
	[__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later
	undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
	[__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later
	undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
	* sysdeps/ieee754/ldbl-64-128/strtold_l.c
	[__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later
	undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
	[__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later
	undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
	* sysdeps/ieee754/ldbl-96/strtold_l.c
	[__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later
	undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
	[__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later
	undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
2017-11-24 22:51:53 +00:00
Joseph Myers ae7207d033 Support testing _Float64x libm functions.
This patch adds support for testing _Float64x libm functions.  A
configuration with such functions sets float64x-alias-fcts = yes in a
sysdeps Makeconfig file; until such settings are added, this test
support is inactive.

Tested for x86_64, including in conjunction with _Float64x support
patches.

	* math/test-float64x.h: New file.
	* math/Makefile (type-float64x-yes): New variable.
	(test-types): Add $(type-float64x-$(float64x-alias-fcts)).
2017-11-24 22:25:03 +00:00
Joseph Myers 9596fc69b1 Make min_of_type_ macros function-like.
math_private.h uses __MATH_TG in defining the min_of_type macro used
within libm, with min_of_type_<suffix> macros for each type.  This
runs into problems with __MATH_TG expansions used with additional
_FloatN and _FloatNx type support, because those can end up
macro-expanding the FUNC argument to __MATH_TG before it gets
concatenated with a suffix - meaning that min_of_type_ can't
simultaneously be the macro name for double, and a prefix to other
macro names, since the latter case requires such premature macro
expansion not to occur.  (This is not a problem for the uses of
__MATH_TG in installed headers because FUNC there is a function name
in the implementation namespace, and the suffixes themselves don't get
macro-expanded.)

This patch fixes the problem by making min_of_type_<suffix> macros
function-like, so no macro expansion occurs when min_of_type_ is
expanded on its own as a macro argument, only later when followed by
() after expansion.

Tested for x86_64, including in conjunction with _Float64x support
patches.

	* sysdeps/generic/math_private.h (min_of_type_f): Make into a
	function-like macro.
	(min_of_type_): Likewise.
	(min_of_type_l): Likewise.
	(min_of_type_f128): Likewise.
	(min_of_type): Pass () as last argument of __MATH_TG.
2017-11-24 22:03:35 +00:00
Joseph Myers 46453c3cda Define __STDC_WANT_IEC_60559_TYPES_EXT__ in tst-strtod-round-skeleton.c.
The tst-strtod-round-skeleton.c conditionals relating to handling of
_Float64x require associated <float.h> macros, which requires
__STDC_WANT_IEC_60559_TYPES_EXT__ to be defined before <float.h> is
included if _Float64x is supported.  This patch adds the necessary
definition.

Tested for x86_64, including in conjunction with _Float64x support
patches.

	* stdlib/tst-strtod-round-skeleton.c
	(__STDC_WANT_IEC_60559_TYPES_EXT__): Define before including
	headers.
2017-11-24 21:42:55 +00:00
Joseph Myers 01e659e711 Fix gen-tgmath-tests.py for _Float64, _Float64x testing.
math/gen-tgmath-tests.py was missing a create_type argument when
creating the internal types for combinations of long double with
_Float64 and _Float64x, so resulting in output that did not compile
when glibc support for those types was enabled.  This patch adds the
missing argument so that the tests properly compile in that case.

Tested for x86_64, including in conjunction with _Float64x support
patches.

	* math/gen-tgmath-tests.py (Type.init_types): Pass suffix argument
	for combinations of long double with _Float64 and _Float64x.
2017-11-24 21:22:34 +00:00
Joseph Myers 5c60afdd67 Handle more _FloatN, _FloatNx types in bits/libm-simd-decl-stubs.h.
This patch adds the macro definitions to bits/libm-simd-decl-stubs.h
required to handle additional _FloatN and _FloatNx types.

Tested for x86_64, including in conjunction with _Float64x support
patches.

	* bits/libm-simd-decl-stubs.h (__DECL_SIMD_cosf16): New macro.
	(__DECL_SIMD_cosf32): Likewise.
	(__DECL_SIMD_cosf64): Likewise.
	(__DECL_SIMD_cosf32x): Likewise.
	(__DECL_SIMD_cosf64x): Likewise.
	(__DECL_SIMD_cosf128x): Likewise.
	(__DECL_SIMD_sinf16): Likewise.
	(__DECL_SIMD_sinf32): Likewise.
	(__DECL_SIMD_sinf64): Likewise.
	(__DECL_SIMD_sinf32x): Likewise.
	(__DECL_SIMD_sinf64x): Likewise.
	(__DECL_SIMD_sinf128x): Likewise.
	(__DECL_SIMD_sincosf16): Likewise.
	(__DECL_SIMD_sincosf32): Likewise.
	(__DECL_SIMD_sincosf64): Likewise.
	(__DECL_SIMD_sincosf32x): Likewise.
	(__DECL_SIMD_sincosf64x): Likewise.
	(__DECL_SIMD_sincosf128x): Likewise.
	(__DECL_SIMD_logf16): Likewise.
	(__DECL_SIMD_logf32): Likewise.
	(__DECL_SIMD_logf64): Likewise.
	(__DECL_SIMD_logf32x): Likewise.
	(__DECL_SIMD_logf64x): Likewise.
	(__DECL_SIMD_logf128x): Likewise.
	(__DECL_SIMD_expf16): Likewise.
	(__DECL_SIMD_expf32): Likewise.
	(__DECL_SIMD_expf64): Likewise.
	(__DECL_SIMD_expf32x): Likewise.
	(__DECL_SIMD_expf64x): Likewise.
	(__DECL_SIMD_expf128x): Likewise.
	(__DECL_SIMD_powf16): Likewise.
	(__DECL_SIMD_powf32): Likewise.
	(__DECL_SIMD_powf64): Likewise.
	(__DECL_SIMD_powf32x): Likewise.
	(__DECL_SIMD_powf64x): Likewise.
	(__DECL_SIMD_powf128x): Likewise.
2017-11-24 21:11:37 +00:00
Joseph Myers 9d4b01173c Move wcstof128 symbol versions to wcsmbs/Versions.
This patch moves wcstof128 and wcstof128_l Versions file entries from
stdlib/Versions to wcsmbs/Versions, which is a more appropriate place
for them.

Tested for x86_64, and with build-many-glibcs.py that installed
stripped shared libraries are unchanged by the patch.

	* stdlib/Versions (libc): Move entries for wcstof128 and
	wcstof128_l to ....
	* wcsmbs/Versions (libc): ... here.
	Include <float128-abi.h>.
2017-11-24 18:38:45 +00:00
Florian Weimer 7911dd47da Linux: Introduce <bits/mman-shared.h>
This header file enables sharing of portable declarations and
definitions across all Linux architectures, including hppa (which does
not use <bits/mman-linux.h>).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2017-11-24 17:55:59 +01:00
Adhemerval Zanella c45d78aac4 posix: Fix generic p{read,write}v buffer allocation (BZ#22457)
As described in BZ#22457 an interpose malloc can free an invalid
pointer for fallback preadv implementation.  Fortunately this is
just and issue on microblaze-linux-gnu running kernels older than
3.15.  This patch fixes it by calling mmap/unmap instead of
posix_memalign/ free.

Checked on microblaze-linux-gnu check with run-built-tests=no and
by using the sysdeps/posix implementation on x86_64-linux-gnu (just
for sanity test where it shown no regression).

	[BZ #22457]
	* sysdeps/posix/preadv_common.c (PREADV): Use mmap/munmap instead of
	posix_memalign/free.
	* sysdeps/posix/pwritev_common.c (PWRITEV): Likewise.
2017-11-24 12:16:15 -02:00
Mike FABIAN 3ffc4cc1ad pl_PL locale: Base collation on iso14651_t1
[BZ #22469]
	* localedata/locales/pl_PL (LC_COLLATE): Use “copy "iso14651_t1"”
	and implement the collation rules for pl from CLDR on top of that.
	* Makefile: Add pl_PL.UTF-8 to test-input and to the list
	of locales to be built for testing.
	* pl_PL.UTF-8.in: New file with test data to test the Polish sorting.
2017-11-24 10:07:05 +05:30
Joseph Myers 3a327316ad Use libm_alias_ldouble macros in sysdeps/ia64/fpu.
Continuing the preparation for additional _FloatN / _FloatNx aliases,
this patch makes long double functions in sysdeps/ia64/fpu use
libm_alias_ldouble macros, so that they can have _Float64x aliases
added in future.

Most ia64 libm functions are defined using ia64-specific macros in
libm-symbols.h.  These are left unchanged, with libm-alias-ldouble.h
included from libm-symbols.h (and the expectation that other
libm-alias-*.h headers will be included from there as well in future),
and libm_alias_ldouble_other then being used in most cases to define
aliases for any additional types (currently the empty set).  Functions
that used weak_alias are converted to use libm_alias_ldouble.

Tested (compilation only) with build-many-glibcs.py for ia64,
including that installed stripped shared libraries are unchanged by
the patch.

	* sysdeps/ia64/fpu/libm-symbols.h: Include <libm-alias-ldouble.h>.
	* sysdeps/ia64/fpu/e_acoshl.S (acoshl): Use
	libm_alias_ldouble_other.
	* sysdeps/ia64/fpu/e_acosl.S (acosl): Likewise.
	* sysdeps/ia64/fpu/e_asinl.S (asinl): Likewise.
	* sysdeps/ia64/fpu/e_atanhl.S (atanhl): Likewise.
	* sysdeps/ia64/fpu/e_coshl.S (coshl): Likewise.
	* sysdeps/ia64/fpu/e_exp10l.S (exp10l): Likewise.
	* sysdeps/ia64/fpu/e_exp2l.S (exp2l): Likewise.
	* sysdeps/ia64/fpu/e_fmodl.S (fmodl): Likewise.
	* sysdeps/ia64/fpu/e_hypotl.S (hypotl): Likewise.
	* sysdeps/ia64/fpu/e_lgammal_r.c (lgammal_r): Define using
	libm_alias_ldouble_r.
	* sysdeps/ia64/fpu/e_log2l.S (log2l): Use
	libm_alias_ldouble_other.
	* sysdeps/ia64/fpu/e_logl.S (logl): Likewise.
	(log10l): Likewise.
	* sysdeps/ia64/fpu/e_powl.S (powl): Likewise.
	* sysdeps/ia64/fpu/e_remainderl.S (remainderl): Likewise.
	* sysdeps/ia64/fpu/e_sinhl.S (sinhl): Likewise.
	* sysdeps/ia64/fpu/e_sqrtl.S (sqrtl): Likewise.
	* sysdeps/ia64/fpu/libm_sincosl.S (sincosl): Likewise.
	* sysdeps/ia64/fpu/s_asinhl.S (asinhl): Likewise.
	* sysdeps/ia64/fpu/s_atanl.S (atanl): Likewise.
	(atan2l): Likewise.
	* sysdeps/ia64/fpu/s_cbrtl.S (cbrtl): Likewise.
	* sysdeps/ia64/fpu/s_ceill.S (ceill): Likewise.
	* sysdeps/ia64/fpu/s_copysign.S (copysignl): Define using
	libm_alias_ldouble.
	* sysdeps/ia64/fpu/s_cosl.S (sinl): Use libm_alias_ldouble_other.
	(cosl): Likewise.
	* sysdeps/ia64/fpu/s_erfcl.S (erfcl): Likewise.
	* sysdeps/ia64/fpu/s_erfl.S (erfl): Likewise.
	* sysdeps/ia64/fpu/s_expm1l.S (expm1l): Likewise.
	(expl): Likewise.
	* sysdeps/ia64/fpu/s_fabsl.S (fabsl): Likewise.
	* sysdeps/ia64/fpu/s_fdiml.S (fdiml): Likewise.
	* sysdeps/ia64/fpu/s_floorl.S (floorl): Likewise.
	* sysdeps/ia64/fpu/s_fmal.S (fmal): Likewise.
	* sysdeps/ia64/fpu/s_fmaxl.S (fmaxl): Likewise.
	* sysdeps/ia64/fpu/s_frexpl.c (frexpl): Likewise.
	* sysdeps/ia64/fpu/s_ldexpl.c (ldexpl): Likewise.
	* sysdeps/ia64/fpu/s_log1pl.S (log1pl): Likewise.
	* sysdeps/ia64/fpu/s_logbl.S (logbl): Likewise.
	* sysdeps/ia64/fpu/s_modfl.S (modfl): Likewise.
	* sysdeps/ia64/fpu/s_nearbyintl.S (nearbyintl): Define using
	libm_alias_ldouble.
	* sysdeps/ia64/fpu/s_nextafterl.S (nextafterl): Use
	libm_alias_ldouble_other.
	* sysdeps/ia64/fpu/s_rintl.S (rintl): Likewise.
	* sysdeps/ia64/fpu/s_roundl.S (roundl): Likewise.
	* sysdeps/ia64/fpu/s_scalbnl.c (scalbnl): Define using
	libm_alias_ldouble.
	* sysdeps/ia64/fpu/s_tanhl.S (tanhl): Use
	libm_alias_ldouble_other.
	* sysdeps/ia64/fpu/s_tanl.S (tanl): Likewise.
	* sysdeps/ia64/fpu/s_truncl.S (truncl): Likewise.
	* sysdeps/ia64/fpu/w_lgammal_main.c
	[BUILD_LGAMMA && !USE_AS_COMPAT] (lgammal): Likewise.
	* sysdeps/ia64/fpu/w_tgammal_compat.S (tgammal): Likewise.
2017-11-23 23:34:54 +00:00
Florian Weimer 0a947e061d malloc: Call tcache destructor in arena_thread_freeres
It does not make sense to register separate cleanup functions for arena
and tcache since they're always going to be called together.  Call the
tcache cleanup function from within arena_thread_freeres since it at
least makes the order of those cleanups clear in the code.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2017-11-23 14:47:31 +01:00
Florian Weimer 67f36c7922 nss: Export nscd hash function as __nss_hash [BZ #22459] 2017-11-23 14:08:11 +01:00
Florian Weimer cccb6d4e87 sigwait: Do not fail with EINTR and return error code [BZ #22478]
Since

commit 8b0e795aaa
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Nov 1 11:49:05 2017 -0200

    Simplify Linux sig{timed}wait{info} implementations

sigwait can fail with EINTR.  Applications do not expect that, and the
error code is not documented in POSIX or the manual pages.

This commit restores the previous behavior by retrying the system call
on EINTR.  It also returns the error code, not -1, on the remaing
errors.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-23 11:20:53 +01: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
Joseph Myers 0a9d1d62b3 Fix typo in variable name in gen-locale.sh.
* localedata/gen-locale.sh: Fix typo in variable name.
2017-11-22 23:42:40 +00:00
Joseph Myers 754034c429 Obsolete p_secstodate.
This patch, relative to a tree with
<https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html> (pending
review) applied, obsoletes p_secstodate, making the underlying
function __p_secstodate into a compat symbol not available for new
binaries or ports.  The calls in ns_print.c (part of incomplete
handling of TKEY) are changed to use %lu to print times instead of
trying to pretty-print the times any more.

Tested for x86_64.

	* resolv/res_debug.c (p_secstodate): Condition definition on
	[SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_27)].  Define
	directly as __p_secstodate, and as a compat symbol.  Do not use
	libresolv_hidden_def.
	* resolv/resolv.h (p_secstodate): Remove macro and function
	declaration.
	* resolv/ns_print.c (ns_sprintrrf): Print times with %lu, not
	using p_secstodate.
	* include/resolv.h (__p_secstodate): Do not use
	libresolv_hidden_proto.
	* resolv/Makefile (tests): Move tst-p_secstodate to ....
	(tests-internal): ... here.
	* resolv/tst-p_secstodate.c: Include <shlib-compat.h>.  Condition
	all contents on [TEST_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_27)]
	and declare and use __p_secstodate and use compat_symbol_reference
	in that case.
	[!TEST_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_27)] (do_test): Add
	implementation returning 77.
2017-11-22 22:21:10 +00:00
Joseph Myers f120cda607 Fix p_secstodate overflow handling (bug 22463).
The resolv/res_debug.c function p_secstodate (which is a public
function exported from libresolv, taking an unsigned long argument)
does:

        struct tm timebuf;
        time = __gmtime_r(&clock, &timebuf);
        time->tm_year += 1900;
        time->tm_mon += 1;
        sprintf(output, "%04d%02d%02d%02d%02d%02d",
                time->tm_year, time->tm_mon, time->tm_mday,
                time->tm_hour, time->tm_min, time->tm_sec);

If __gmtime_r returns NULL (because the year overflows the range of
int), this will dereference a null pointer.  Otherwise, if the
computed year does not fit in four characters, this will cause a
buffer overrun of the fixed-size 15-byte buffer.  With current GCC
mainline, there is a compilation failure because of the possible
buffer overrun.

I couldn't find a specification for how this function is meant to
behave, but Paul pointed to RFC 4034 as relevant to the cases where
this function is called from within glibc.  The function's interface
is inherently problematic when dates beyond Y2038 might be involved,
because of the ambiguity in how to interpret 32-bit timestamps as such
dates (the RFC suggests interpreting times as being within 68 years of
the present date, which would mean some kind of interface whose
behavior depends on the present date).

This patch works on the basis of making a minimal fix in preparation
for obsoleting the function.  The function is made to handle times in
the interval [0, 0x7fffffff] only, on all platforms, with <overflow>
used as the output string in other cases (and errno set to EOVERFLOW
in such cases).  This seems to be a reasonable state for the function
to be in when made a compat symbol by a future patch, being compatible
with any existing uses for existing timestamps without trying to work
for later timestamps.  Results independent of the range of time_t also
simplify the testcase.

I couldn't persuade GCC to recognize the ranges of the struct tm
fields by adding explicit range checks with a call to
__builtin_unreachable if outside the range (this looks similar to
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80776>), so having added
a range check on the input, this patch then disables the
-Wformat-overflow= warning for the sprintf call (I prefer that to the
use of strftime, as being more transparently correct without knowing
what each of %m and %M etc. is).

I do not know why this build failure should be new with mainline GCC
(that is, I don't know what GCC change might have introduced it, when
the basic functionality for such warnings was already in GCC 7).

I do not know if this is a security issue (that is, if there are
plausible ways in which a date before -999 or after 9999 from an
untrusted source might end up in this function).  The system clock is
arguably an untrusted source (in that e.g. NTP is insecure), but
probably not to that extent (NTP can't communicate such wild
timestamps), and uses from within glibc are limited to 32-bit inputs.

Tested with build-many-glibcs.py that this restores the build for arm
with yesterday's mainline GCC.  Also tested for x86_64 and x86.

	[BZ #22463]
	* resolv/res_debug.c: Include <libc-diag.h>.
	(p_secstodate): Assert time_t at least as wide as u_long.  On
	overflow, use integer seconds since the epoch as output, or use
	"<overflow>" as output and set errno to EOVERFLOW if integer
	seconds since the epoch would be 14 or more characters.
	(p_secstodate) [__GNUC_PREREQ (7, 0)]: Disable -Wformat-overflow=
	for sprintf call.
	* resolv/tst-p_secstodate.c: New file.
	* resolv/Makefile (tests): Add tst-p_secstodate.
	($(objpfx)tst-p_secstodate): Depend on $(objpfx)libresolv.so.
2017-11-22 22:12:07 +00:00
Joseph Myers a90d1ac2d2 Remove unused sparc64/soft-fp libm function implementations.
sysdeps/sparc/sparc64/soft-fp has files s_frexpl.c, s_scalblnl.c and
s_scalbnl.c that are never used because the ldbl-128 versions always
come first in the sysdeps directory ordering.  This patch removes the
unused files.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by this patch.

	* sysdeps/sparc/sparc64/soft-fp/s_frexpl.c: Remove file.
	* sysdeps/sparc/sparc64/soft-fp/s_scalblnl.c: Likewise.
	* sysdeps/sparc/sparc64/soft-fp/s_scalbnl.c: Likewise.
2017-11-22 21:11:00 +00:00
Paul Eggert 0285e6bdf2 * posix/regcomp.c (init_word_char): Add comments. 2017-11-22 11:22:30 -08:00
Joseph Myers 4bae615022 Avoid use of strlen in getlogin_r (bug 22447).
Building glibc with current mainline GCC fails, among other reasons,
because of an error for use of strlen on the nonstring ut_user field.
This patch changes the problem code in getlogin_r to use __strnlen
instead.  It also needs to set the trailing NUL byte of the result
explicitly, because of the case where ut_user does not have such a
trailing NUL byte (but the result should always have one).

Tested for x86_64.  Also tested that, in conjunction with
<https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
the build for arm with mainline GCC.

	[BZ #22447]
	* sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
	strlen to compute length of ut_user and set trailing NUL byte of
	result explicitly.
2017-11-22 18:44:23 +00:00
Mike FABIAN 4b7af5fca7 lv_LV locale: fix collation [BZ #15537]
[BZ #15537]
	* localedata/locales/lv_LV (LC_COLLATE): Fix collation by
	using “copy "iso14651_t1"” and then implementing the
	collation rules for lv from CLDR on top of that.
	* Makefile: Add lv_LV.UTF-8 to test-input and to the list
	of locales to be built for testing.
	* lv_LV.UTF-8.in: New file with test data to test the Latvian
	sorting.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2017-11-22 10:31:47 +05:30
Joseph Myers 922bb78c0c Update hppa bits/mman.h from Linux 4.14.
This patch updates the hppa bits/mman.h based on Linux 4.14.  Some
MADV_* macros are removed in Linux 4.14 as unused/unimplemented, so
this patch removes them from glibc, while adding two new macros added
in Linux 4.14.

Tested (compilation only) for hppa with build-many-glibcs.py.

	* sysdeps/unix/sysv/linux/hppa/bits/mman.h
	[__USE_MISC] (MADV_SPACEAVAIL): Remove macro.
	[__USE_MISC] (MADV_VPS_PURGE): Likewise.
	[__USE_MISC] (MADV_VPS_INHERIT): Likewise.
	[__USE_MISC] (MADV_HWPOISON): New macro.
	[__USE_MISC] (MADV_SOFT_OFFLINE): Likewise.
2017-11-21 22:21:23 +00:00
Adhemerval Zanella a3aaa59816 nptl: Add workaround for ASSERT_PTHREAD_INTERNAL_SIZE with GCC 4.9
GCC 4.9 (the minimum current supported) emits an warning for universal
zero initializer ({0}) on ASSERT_PTHREAD_INTERNAL_SIZE:

pthread_attr_init.c: In function ‘__pthread_attr_init_2_1’:
pthread_attr_init.c:37:3: error: missing braces around initializer [-Werror=missing-braces]
   ASSERT_PTHREAD_INTERNAL_SIZE (pthread_attr_t, struct pthread_attr);
   ^
pthread_attr_init.c:37:3: error: (near initialization for ‘(anonymous).__size’) [-Werror=missing-braces]

It is fact GCC BZ#53119 [1] fixed in later version (GCC5+).  Since
current branch is closed and there is no indication it will be backports
(comment #20 in same bug report) this patch fixes by using a double
bracket to zero initialize the struct.

Checked on x86_64-linux-gnu with GCC 7 and GCC 4.9.

	* nptl/pthreadP.h (ASSERT_PTHREAD_INTERNAL_SIZE): Add workarond for
	-Wmissing-braces on GCC 4.9.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-21 10:19:56 -02: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
Stefan Liebler 80eb52e3a9 Remove attribute_hidden for wchar ifunc symbols.
On s390 (31bit) various debug/tst-*chk* testcases are failing as the tests
are ending with a segmentation fault.

One test is e.g. calling wcsnrtombs in debug/tst-chk1.c:1549.
The function wcsnrtombs itself calls __wcsnlen. This function is called via
PLT! The PLT-stub itself loads the address from GOT (r12 is assumed to be
the GOT-pointer). In this case the loaded address is zero and the following
branch leads to the segmentation fault.

Due to the attribute_hidden in commit 44af8a32c3
"Mark internal wchar functions with attribute_hidden [BZ #18822]"
for e.g. the __wcsnlen function, r12 is not loaded with the GOT-pointer
in wcsnrtombs.

On s390x (64bit), this __wcsnlen call is also using the PLT-stub. But it is
not failing as the GOT-pointer is setup with larl-instruction by the PLT-stub
itself.
Note: On s390x/s390, __wcsnlen is an IFUNC symbol.

On x86_64, __wcsnlen is also an IFUNC symbol and is called via PLT, too.

Further IFUNC symbols on s390 which were marked as hidden by the mentioned
commit are: __wcscat, __wcsncpy, __wcpncpy, __wcschrnul.

This patch removes the attribute_hidden in wchar.h.
Then the compiler setups e.g. r12 on s390 in order to call __wcsnlen via PLT.

ChangeLog:

	* include/wchar.h (__wcsnlen, __wcscat, __wcsncpy, __wcpncpy,
	__wcschrnul): Remove attribute_hidden.
2017-11-21 08:43:23 +01:00
Paul Eggert 567d8c1f68 regex: don't assume uint64_t or uint32_t
This avoids -Werror=overflow errors for 32-bit systems in
the 64-bit case.  Problem reported by Joseph Myers in:
https://sourceware.org/ml/libc-alpha/2017-11/msg00694.html
Also, when this code is used in Gnulib it ports to platforms
that lack uint64_t and uint32_t.  The C standard doesn't guarantee
them, and on some 32-bit compilers there is no uint64_t.
Problem reported by Gianluigi Tiesi in:
http://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00154.html
* posix/regcomp.c (init_word_char): Don't assume that the types
uint64_t and uint32_t exist.  Adapted from Gnulib patch
2012-05-27T06:40:00!eggert@cs.ucla.edu.  See:
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=252b52457da7887667c036d18cc5169777615bb0
2017-11-20 20:40:17 -08:00
Siddhesh Poyarekar 5a67c4fa01 aarch64: Optimized memset for falkor
The generic memset reads dczid_el0 on every memset.  This has a
significant impact on falkor for a range of sizes because reading
dczid_el0 is slow.

The DZP bit in the dczid_el0 register does not change dynamically, so
it is safe to read once during program startup.  With this patch
dczid_el0 is read once during startup and zva_size is cached.  This is
used to invoke the falkor-specific memset; the generic memset routine
remains unchanged.

The gains due to this are significant for falkor, with run time
reductions as high as 48%.  Here's a sample from the falkor tests:

Function: memset
Variant: walk
                      simple_memset	__memset_falkor	__memset_generic
=====================================================================
length=256, char=0:   139.96 (-698.28%)	   9.07 ( 48.26%)  17.53
length=257, char=0:   140.50 (-699.03%)	   9.53 ( 45.80%)  17.58
length=258, char=0:   140.96 (-703.95%)	   9.58 ( 45.36%)  17.53
length=259, char=0:   141.56 (-705.16%)	   9.53 ( 45.79%)  17.58
length=260, char=0:   142.15 (-710.76%)	   9.57 ( 45.39%)  17.53
length=261, char=0:   142.50 (-710.39%)	   9.53 ( 45.78%)  17.58
length=262, char=0:   142.97 (-715.09%)	   9.57 ( 45.42%)  17.54
length=263, char=0:   143.51 (-716.18%)	   9.53 ( 45.80%)  17.58
length=264, char=0:   143.93 (-720.55%)	   9.58 ( 45.39%)  17.54
length=265, char=0:   144.56 (-722.07%)	   9.53 ( 45.80%)  17.59
length=266, char=0:   144.98 (-726.42%)	   9.58 ( 45.42%)  17.54
length=267, char=0:   145.53 (-727.53%)	   9.53 ( 45.80%)  17.59
length=268, char=0:   146.25 (-731.81%)	   9.53 ( 45.79%)  17.58
length=269, char=0:   146.52 (-735.39%)	   9.53 ( 45.66%)  17.54
length=270, char=0:   146.97 (-735.81%)	   9.53 ( 45.80%)  17.58
length=271, char=0:   147.54 (-741.08%)	   9.58 ( 45.38%)  17.54
length=512, char=0:   268.26 (-1307.85%)  12.06 ( 36.71%)  19.05
length=513, char=0:   268.73 (-1273.89%)  13.56 ( 30.68%)  19.56
length=514, char=0:   269.31 (-1276.89%)  13.56 ( 30.68%)  19.56
length=515, char=0:   269.73 (-1279.05%)  13.56 ( 30.68%)  19.56
length=516, char=0:   270.34 (-1282.24%)  13.56 ( 30.67%)  19.56
length=517, char=0:   270.83 (-1284.71%)  13.56 ( 30.66%)  19.56
length=518, char=0:   271.20 (-1286.54%)  13.56 ( 30.67%)  19.56
length=519, char=0:   271.67 (-1288.67%)  13.65 ( 30.24%)  19.56
length=520, char=0:   272.14 (-1291.04%)  13.65 ( 30.22%)  19.56
length=521, char=0:   272.66 (-1293.69%)  13.65 ( 30.23%)  19.56
length=522, char=0:   273.14 (-1296.13%)  13.65 ( 30.20%)  19.56
length=523, char=0:   273.64 (-1298.75%)  13.65 ( 30.23%)  19.56
length=524, char=0:   274.34 (-1302.16%)  13.66 ( 30.20%)  19.57
length=525, char=0:   274.64 (-1297.78%)  13.56 ( 30.99%)  19.65
length=526, char=0:   275.20 (-1300.04%)  13.56 ( 31.01%)  19.66
length=527, char=0:   275.66 (-1302.86%)  13.56 ( 30.99%)  19.65
length=1024, char=0:  524.46 (-2169.75%)  20.12 ( 12.92%)  23.11
length=1025, char=0:  525.14 (-2124.63%)  21.62 (  8.40%)  23.61
length=1026, char=0:  525.59 (-2125.36%)  21.88 (  7.37%)  23.62
length=1027, char=0:  525.98 (-2127.14%)  21.62 (  8.46%)  23.62
length=1028, char=0:  526.68 (-2131.10%)  21.62 (  8.42%)  23.61
length=1029, char=0:  527.10 (-2131.70%)  21.79 (  7.73%)  23.62
length=1030, char=0:  527.54 (-2118.51%)  21.62 (  9.10%)  23.78
length=1031, char=0:  527.98 (-2136.37%)  21.62 (  8.43%)  23.61
length=1032, char=0:  528.70 (-2139.38%)  21.62 (  8.43%)  23.61
length=1033, char=0:  529.25 (-2124.37%)  21.62 (  9.11%)  23.79
length=1034, char=0:  529.48 (-2142.95%)  21.62 (  8.43%)  23.61
length=1035, char=0:  530.11 (-2145.13%)  21.62 (  8.44%)  23.61
length=1036, char=0:  530.76 (-2147.10%)  21.79 (  7.73%)  23.62
length=1037, char=0:  531.03 (-2149.45%)  21.62 (  8.42%)  23.61
length=1038, char=0:  531.64 (-2151.87%)  21.62 (  8.42%)  23.61
length=1039, char=0:  531.99 (-2151.63%)  21.80 (  7.75%)  23.63

	* sysdeps/aarch64/memset-reg.h: New file.
	* sysdeps/aarch64/memset.S: Use it.
	(__memset): Rename to MEMSET macro.
	[ZVA_MACRO]: Use zva_macro.
	* sysdeps/aarch64/multiarch/Makefile (sysdep_routines):
	Add memset_generic and memset_falkor.
	* sysdeps/aarch64/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Add memset ifuncs.
	* sysdeps/aarch64/multiarch/init-arch.h (INIT_ARCH): New
	local variable zva_size.
	* sysdeps/aarch64/multiarch/memset.c: New file.
	* sysdeps/aarch64/multiarch/memset_generic.S: New file.
	* sysdeps/aarch64/multiarch/memset_falkor.S: New file.
	* sysdeps/aarch64/multiarch/rtld-memset.S: New file.
	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c
	(DCZID_DZP_MASK): New macro.
	(DCZID_BS_MASK): Likewise.
	(init_cpu_features): Read and set zva_size.
	* sysdeps/unix/sysv/linux/aarch64/cpu-features.h
	(struct cpu_features): New member zva_size.
2017-11-20 18:25:04 +05:30
Siddhesh Poyarekar eb332f9feb benchtests: Bump start size since smaller sizes are noisy
Numbers for very small sizes (< 128B) are much noisier for non-cached
benchmarks like the walk benchmarks, so don't include them.

	* benchtests/bench-memcpy-walk.c (START_SIZE): Set to 128.
	* benchtests/bench-memmove-walk.c (START_SIZE): Likewise.
	* benchtests/bench-memset-walk.c (START_SIZE): Likewise.
2017-11-20 18:03:32 +05:30
Siddhesh Poyarekar 4d7632ff68 benchtests: Fix walking sizes and directions for *-walk benchmarks
Make the walking benchmarks walk only backwards since copying both
ways is biased in favour of implementations that use non-temporal
stores for larger sizes; falkor is one of them.  This also fixes up
bugs in computation of the result which ended up multiplying the
length with the timing result unnecessarily.

	* benchtests/bench-memcpy-walk.c (do_one_test): Copy only
	backwards.  Fix timing computation.
	* benchtests/bench-memmove-walk.c (do_one_test): Likewise.
	* benchtests/bench-memset-walk.c (do_one_test): Walk backwards
	on memset by N at a time.  Fix timing computation.
2017-11-20 18:03:32 +05:30
Florian Weimer a465b89ee8 manual: Document the MAP_HUGETLB, MADV_HUGEPAGE, MADV_NOHUGEPAGE flags 2017-11-20 13:23:17 +01:00
Florian Weimer 0f74bbf513 manual: Document mprotect and introduce section on memory protection 2017-11-19 11:27:59 +01:00
Florian Weimer f6e965ee94 manual: Move preadv/writev variants to Scatter-Gather section
Also remove a comment about performance.  fwrite vs writev performance
is a very complex topic and cannot be reduced to a simple advice based
on transfer size.
2017-11-19 08:58:31 +01:00
Christian Brauner 5f9d19490b
support_become_root: Fix comment style 2017-11-18 17:54:24 +01:00
Christian Brauner ea69a5c874
support_become_root: Don't fail when /proc/<pid/setgroups is missing
The requirement to write "deny" to /proc/<pid>/setgroups for a given user
namespace before being able to write a gid mapping was introduced in Linux
3.19.  Before that this requirement including the file did not exist.
So don't fail when errno == ENOENT.
2017-11-18 16:23:01 +01:00
Florian Weimer 8db7f48cb7 tst-ttyname: Fix namespace setup for Fedora
On Fedora, the previous initialization sequence did not work and
resulted in failures like:

info:  entering chroot 1
info:    testcase: basic smoketest
info:      ttyname: PASS {name="/dev/pts/5", errno=0}
info:      ttyname_r: PASS {name="/dev/pts/5", ret=0, errno=0}
error: ../sysdeps/unix/sysv/linux/tst-ttyname.c:122: write (setroups, "deny"): Operation not permitted
info:  entering chroot 2
error: ../sysdeps/unix/sysv/linux/tst-ttyname.c:122: write (setroups, "deny"): Operation not permitted
error: 2 test failures

Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-18 14:34:46 +01:00
Florian Weimer 273a0c4983 support_enter_mount_namespace: Unshare with mount --make-rprivate
System defaults vary, and a mere unshare (CLONE_NEWNS) (which is part of
support_become_root) is no longer sufficient.

Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-18 14:30:20 +01:00
Florian Weimer 8adfb0eeff support_create_temp_directory: Align behavior with create_temp_file
create_temp_file automatically supplies the test directory and the
XXXXXX suffix.  support_create_temp_directory required the caller to
specify them, which was confusing.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
2017-11-18 14:11:09 +01:00
Tulio Magno Quites Machado Filho df0c40ee3a powerpc: Update AT_HWCAP2 bits
Linux commit ID cba6ac4869e45cc93ac5497024d1d49576e82666 reserved a new
bit for a scenario where transactional memory is available, but the
suspended state is disabled.

	* sysdeps/powerpc/bits/hwcap.h (PPC_FEATURE2_HTM_NO_SUSPEND): New
	macro.
	* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add
	htm-no-suspend.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
2017-11-17 21:49:02 -02:00
Joseph Myers f58e5f4809 Use libm_alias_ldouble in sysdeps/x86_64/fpu.
This patch continues the preparation for additional _FloatN / _FloatNx
function aliases by using libm_alias_ldouble for sysdeps/x86_64/fpu
long double functions, so that they can have _Float64x aliases added
in future.

Tested for x86_64, including build-many-glibcs.py tests that installed
stripped shared libraries are unchanged by the patch.

	* sysdeps/x86_64/fpu/e_expl.S: Include <libm-alias-ldouble.h>.
	[USE_AS_EXPM1L] (expm1l): Define using libm_alias_ldouble.
	* sysdeps/x86_64/fpu/s_ceill.S: Include <libm-alias-ldouble.h>.
	(ceill): Define using libm_alias_ldouble.
	* sysdeps/x86_64/fpu/s_copysignl.S: Include
	<libm-alias-ldouble.h>.
	(copysignl): Define using libm_alias_ldouble.
	* sysdeps/x86_64/fpu/s_fabsl.S: Include <libm-alias-ldouble.h>.
	(fabsl): Define using libm_alias_ldouble.
	* sysdeps/x86_64/fpu/s_floorl.S: Include <libm-alias-ldouble.h>.
	(floorl): Define using libm_alias_ldouble.
	* sysdeps/x86_64/fpu/s_fmaxl.S: Include <libm-alias-ldouble.h>.
	(fmaxl): Define using libm_alias_ldouble.
	* sysdeps/x86_64/fpu/s_fminl.S: Include <libm-alias-ldouble.h>.
	(fminl): Define using libm_alias_ldouble.
	* sysdeps/x86_64/fpu/s_llrintl.S: Include <libm-alias-ldouble.h>.
	(llrintl): Define using libm_alias_ldouble.
	(lrintl): Likewise.
	* sysdeps/x86_64/fpu/s_nearbyintl.S: Include
	<libm-alias-ldouble.h>.
	(nearbyintl): Define using libm_alias_ldouble.
	* sysdeps/x86_64/fpu/s_truncl.S: Include <libm-alias-ldouble.h>.
	(truncl): Define using libm_alias_ldouble.
	* sysdeps/x86_64/x32/fpu/s_lrintl.S: Include
	<libm-alias-ldouble.h>.
	(lrintl): Define using libm_alias_ldouble.
2017-11-17 23:39:11 +00:00
Joseph Myers 2ce30701e6 Use libm_alias_ldouble in sysdeps/i386/fpu.
This patch continues the preparation for additional _FloatN / _FloatNx
function aliases by using libm_alias_ldouble for sysdeps/i386/fpu long
double functions, so that they can have _Float64x aliases added in
future.

Tested for x86_64 (which includes some of these implementations) and
x86, including build-many-glibcs.py tests that installed stripped
shared libraries are unchanged by the patch.

	* sysdeps/i386/fpu/e_expl.S: Include <libm-alias-ldouble.h>.
	[USE_AS_EXPM1L] (expm1l): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_asinhl.S: Include <libm-alias-ldouble.h>.
	(asinhl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_atanl.c: Include <libm-alias-ldouble.h>.
	(atanl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_cbrtl.S: Include <libm-alias-ldouble.h>.
	(cbrtl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_ceill.S: Include <libm-alias-ldouble.h>.
	(ceill): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_copysignl.S: Include <libm-alias-ldouble.h>.
	(copysignl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_fabsl.S: Include <libm-alias-ldouble.h>.
	(fabsl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_floorl.S: Include <libm-alias-ldouble.h>.
	(floorl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_fmaxl.S: Include <libm-alias-ldouble.h>.
	(fmaxl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_fminl.S: Include <libm-alias-ldouble.h>.
	(fminl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_frexpl.S: Include <libm-alias-ldouble.h>.
	(frexpl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_llrintl.S: Include <libm-alias-ldouble.h>.
	(llrintl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_logbl.c: Include <libm-alias-ldouble.h>.
	(logbl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_lrintl.S: Include <libm-alias-ldouble.h>.
	(lrintl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_nearbyintl.S: Include <libm-alias-ldouble.h>.
	(nearbyintl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_nextafterl.c: Include <libm-alias-ldouble.h>.
	(nextafterl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_remquol.S: Include <libm-alias-ldouble.h>.
	(remquol): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_rintl.c: Include <libm-alias-ldouble.h>.
	(rintl): Define using libm_alias_ldouble.
	* sysdeps/i386/fpu/s_truncl.S: Include <libm-alias-ldouble.h>.
	(truncl): Define using libm_alias_ldouble.
	* sysdeps/i386/i686/fpu/s_fmaxl.S: Include <libm-alias-ldouble.h>.
	(fmaxl): Define using libm_alias_ldouble.
	* sysdeps/i386/i686/fpu/s_fminl.S: Include <libm-alias-ldouble.h>.
	(fminl): Define using libm_alias_ldouble.
2017-11-17 22:54:39 +00:00
Joseph Myers 015c6dc288 Support bits/floatn.h inclusion from .S files.
Further _FloatN / _FloatNx type alias support will involve making
architecture-specific .S files use the common macros for libm function
aliases.  Making them use those macros will also serve to simplify
existing code for aliases / symbol versions in various cases, similar
to such simplifications for ldbl-opt code.

The libm-alias-*.h files sometimes need to include <bits/floatn.h> to
determine which aliases they should define.  At present, this does not
work for inclusion from .S files because <bits/floatn.h> can define
typedefs for old compilers.  This patch changes all the
<bits/floatn.h> and <bits/floatn-common.h> headers to include
__ASSEMBLER__ conditionals.  Those conditionals disable everything
related to C syntax in the __ASSEMBLER__ case, not just the problem
typedefs, as that seemed cleanest.  The __HAVE_* definitions remain in
the __ASSEMBLER__ case, as those provide information that is required
to define the correct set of aliases.

Tested with build-many-glibcs.py for a representative set of
configurations (x86_64-linux-gnu i686-linux-gnu ia64-linux-gnu
powerpc64le-linux-gnu mips64-linux-gnu-n64 sparc64-linux-gnu) with GCC
6.  Also tested with GCC 6 for i686-linux-gnu in conjunction with
changes to use alias macros in .S files.

	* bits/floatn-common.h [!__ASSEMBLER]: Disable everything related
	to C syntax instead of availability and properties of types.
	* bits/floatn.h [!__ASSEMBLER]: Likewise.
	* sysdeps/ia64/bits/floatn.h [!__ASSEMBLER]: Likewise.
	* sysdeps/ieee754/ldbl-128/bits/floatn.h [!__ASSEMBLER]: Likewise.
	* sysdeps/mips/ieee754/bits/floatn.h [!__ASSEMBLER]: Likewise.
	* sysdeps/powerpc/bits/floatn.h [!__ASSEMBLER]: Likewise.
	* sysdeps/x86/bits/floatn.h [!__ASSEMBLER]: Likewise.
2017-11-17 22:01:43 +00:00
Florian Weimer ce003e5d4c support_become_root: Enable file creation in user namespaces
Without UID/GID maps, file creation will file with EOVERFLOW.

This patch is based on DJ Delorie's work on container testing.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
2017-11-17 22:11:28 +01:00
Joseph Myers e7df6c5c79 Add AArch64 HWCAP_DCPOP from Linux 4.14.
This patch adds the HWCAP_DCPOP macro from Linux 4.14 to the AArch64
bits/hwcap.h.

Tested (compilation only) for aarch64 with build-many-glibcs.py.

	* sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h (HWCAP_DCPOP): New
	macro.
2017-11-17 14:03:04 +00:00
Adhemerval Zanella 58a813bf6e aarch64: Fix f{max,min}{f} build for GCC 4.9 and 5
GCC 4.9 and 5 do not generate a correct f{max,min}nm instruction for
__builtin_{fmax,fmin}{f} without -ffinite-math-only.  It is clear a
compiler issue since the instruction can handle NaN and Inf correctly
and GCC6+ does not show this issue.

We can backport a fix to GCC 5, raise the minimum required GCC version
for aarch64 (since GCC 4.9 branch is now closed [1]) and/or add
configure check to check for this issue.  However I think
-ffinite-math-only should be safe for these specific implementations
and it is a simpler solution.

Checked on aarch64-linux-gnu with GCC 5.3.1.

	* sysdeps/aarch64/fpu/Makefile (CFLAGS-s_fmax.c, CFLAGS-s_fmaxf.c,
	CFLAGS-s_fmin.c, CFLAGS-s_fminf.c): New rule: add -ffinite-math-only.

[1] https://gcc.gnu.org/ml/gcc/2016-08/msg00010.html

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2017-11-17 09:23:07 -02:00
Joseph Myers 6a6aa1f389 Add Linux 4.14 ARPHRD_RAWIP to net/if_arp.h.
This patch adds ARPHRD_RAWIP from Linux 4.14 to the Linux
net/if_arp.h.

Tested for x86_64.

	* sysdeps/unix/sysv/linux/net/if_arp.h (ARPHRD_RAWIP): New macro.
2017-11-16 17:52:43 +00:00
Joseph Myers f97773d1e7 Update kernel version in syscall-names.list to 4.14.
Linux 4.14 does not add any new syscalls; this patch updates the
version number in syscall-names.list to reflect that it's still
current for 4.14.

Tested for x86_64 (compilation with build-many-glibcs.py, using Linux
4.14).

	* sysdeps/unix/sysv/linux/syscall-names.list: Update kernel
	version to 4.14.
2017-11-16 17:51:54 +00:00
Siddhesh Poyarekar 7b0fb8706c Fix botched up regeneration in the last commit 2017-11-16 12:08:52 +05:30
Siddhesh Poyarekar a306c790a8 Prefer https for Sourceware links
Update all sourceware links to https.  The website redirects
everything to https anyway so let the web server do a bit less work.
The only reference that remains unchanged is the one in the old
ChangeLog, since it didn't seem worth changing it.

	* NEWS: Update sourceware link to https.
	* configure.ac: Likewise.
	* crypt/md5test-giant.c: Likewise.
	* dlfcn/bug-atexit1.c: Likewise.
	* dlfcn/bug-atexit2.c: Likewise.
	* localedata/README: Likewise.
	* malloc/tst-mallocfork.c: Likewise.
	* manual/install.texi: Likewise.
	* nptl/tst-pthread-getattr.c: Likewise.
	* stdio-common/tst-fgets.c: Likewise.
	* stdio-common/tst-fwrite.c: Likewise.
	* sunrpc/Makefile: Likewise.
	* sysdeps/arm/armv7/multiarch/memcpy_impl.S: Likewise.
	* wcsmbs/tst-mbrtowc2.c: Likewise.
	* configure: Regenerate.
	* INSTALL: Regenerate.
2017-11-16 11:49:26 +05:30
Martin Sebor 7532837d7b The -Wstringop-truncation option new in GCC 8 detects common misuses
of the strncat and strncpy function that may result in truncating
the copied string before the terminating NUL.  To avoid false positive
warnings for correct code that intentionally creates sequences of
characters that aren't guaranteed to be NUL-terminated, arrays that
are intended to store such sequences should be decorated with a new
nonstring attribute.  This change add this attribute to Glibc and
uses it to suppress such false positives.

ChangeLog:
	* misc/sys/cdefs.h (__attribute_nonstring__): New macro.
	* sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
	* sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
2017-11-15 17:39:59 -07:00
Luke Shumaker d9611e3085
linux ttyname{_r}: Add tests
Add a new tst-ttyname test that includes several named sub-testcases.

This patch is ordered after the patches with the fixes that it tests for (to
avoid breaking `git bisect`), but for reference, here's how each relevant change
so far affected the testcases in this commit, starting with
15e9a4f378c8607c2ae1aa465436af4321db0e23:

  |                                 | before  |         | make checks | don't |
  |                                 | 15e9a4f | 15e9a4f | consistent  | bail  |
  |---------------------------------+---------+---------+-------------+-------|
  | basic smoketest                 | PASS    | PASS    | PASS        | PASS  |
  | no conflict, no match           | PASS[1] | PASS    | PASS        | PASS  |
  | no conflict, console            | PASS    | FAIL!   | FAIL        | PASS! |
  | conflict, no match              | FAIL    | PASS!   | PASS        | PASS  |
  | conflict, console               | FAIL    | FAIL    | FAIL        | PASS! |
  | with readlink target            | PASS    | PASS    | PASS        | PASS  |
  | with readlink trap; fallback    | FAIL    | FAIL    | FAIL        | PASS! |
  | with readlink trap; no fallback | FAIL    | PASS!   | PASS        | PASS  |
  | with search-path trap           | FAIL    | FAIL    | PASS!       | PASS  |
  |---------------------------------+---------+---------+-------------+-------|
  |                                 | 4/9     | 5/9     | 6/9         | 9/9   |

  [1]: 15e9a4f introduced a semantic that, under certain failure
       conditions, ttyname sets errno=ENODEV, where previously it didn't
       set errno; it's not quite fair to hold "before 15e9a4f" ttyname to
       those new semantics.  This testcase actually fails, but would have
       passed if we tested for the old the semantics.

Each of the failing tests before 15e9a4f are all essentially the same bug: that
it returns a PTY slave with the correct minor device number, but from the wrong
devpts filesystem instance.

15e9a4f sought to fix this, but missed several of the cases that can cause this
to happen, and also broke the case where both the erroneous PTY and the correct
PTY exist.

Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-15 21:09:01 +01:00
Luke Shumaker a09dfc19ed
linux ttyname{_r}: Don't bail prematurely [BZ #22145]
Commit 15e9a4f378 introduced logic for ttyname()
sending back ENODEV to signal that we can't get a name for the TTY because we
inherited it from a different mount namespace.

However, just because we inherited it from a different mount namespace and it
isn't available at its original path, doesn't mean that its name is unknowable;
we can still try to find it by allowing the normal fall back on iterating
through devices.

An example scenario where this happens is with "/dev/console" in containers.
It's a common practice among container managers to allocate a PTY master/slave
pair in the host's mount namespace (the slave having a path like "/dev/pty/$X"),
bind mount the slave to "/dev/console" in the container's mount namespace, and
send the slave FD to a process in the container. Inside of the
container, the slave-end isn't available at its original path ("/dev/pts/$X"),
since the container mount namespace has a separate devpts instance from the host
(that path may or may not exist in the container; if it does exist, it's not the
 same PTY slave device). Currently ttyname{_r} sees that the file at the
original "/dev/pts/$X" path doesn't match the FD passed to it, and fails early
and gives up, even though if it kept searching it would find the TTY at
"/dev/console". Fix that; don't have the ENODEV path force an early return
inhibiting the fall-back search.

This change is based on the previous patch that adds use of is_mytty in
getttyname and getttyname_r. Without that change, this effectively reverts
15e9a4f, which made us disregard the false similarity of file pointed to by
"/proc/self/fd/$Y", because if it doesn't bail prematurely then that file
("/dev/pts/$X") will just come up again anyway in the fall-back search.

Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-15 20:47:12 +01:00
Luke Shumaker 2fbce9c203
linux ttyname{_r}: Make tty checks consistent
In the ttyname and ttyname_r routines on Linux, at several points it needs to
check if a given TTY is the TTY we are looking for. It used to be that this
check was (to see if `maybe` is `mytty`):

       __xstat64(_STAT_VER, maybe_filename, &maybe) == 0
    #ifdef _STATBUF_ST_RDEV
       && S_ISCHR(maybe.st_mode) && maybe.st_rdev == mytty.st_rdev
    #else
       && maybe.st_ino == mytty.st_ino && maybe.st_dev == mytty.st_dev
    #endif

This check appears in several places.

Then, one of the changes made in commit 15e9a4f378
was to change that check to:

       __xstat64(_STAT_VER, maybe_filename, &maybe) == 0
    #ifdef _STATBUF_ST_RDEV
       && S_ISCHR(maybe.st_mode) && maybe.st_rdev == mytty.st_rdev
    #endif
       && maybe.st_ino == mytty.st_ino && maybe.st_dev == mytty.st_dev

That is, it made the st_ino and st_dev parts of the check happen even if we have
the st_rdev member. This is an important change, because the kernel allows
multiple devpts filesystem instances to be created; a device file in one devpts
instance may share the same st_rdev with a file in another devpts instance, but
they aren't the same file.

This check appears twice in each file (ttyname.c and ttyname_r.c), once (in
ttyname and __ttyname_r) to check if a candidate file found by inspecting /proc
is the desired TTY, and once (in getttyname and getttyname_r) to check if a
candidate file found by searching /dev is the desired TTY. However, 15e9a4f
only updated the checks for files found via /proc; but the concern about
collisions between devpts instances is just as valid for files found via /dev.

So, update all 4 occurrences the check to be consistent with the version of the
check introduced in 15e9a4f. Make it easy to keep all 4 occurrences of the
check consistent by pulling it in to a static inline function, is_mytty.

Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-15 20:47:07 +01:00
Luke Shumaker d10d6cab16
linux ttyname: Change return type of is_pty from int to bool
is_pty returning a bool is fine since there's no possible outcome other than
true or false, and bool is used throughout the codebase.

Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-15 20:47:02 +01:00
Luke Shumaker 9b5a87502d
linux ttyname: Update a reference to kernel docs for kernel 4.10
Linux 4.10 moved many of the documentation files around.

4.10 came out between the time the patch adding the comment (commit
15e9a4f378) was submitted and the time
it was applied (in February, January, and March 2017; respectively).

Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-15 20:46:56 +01:00
Luke Shumaker 495a56fdeb
manual: Update to mention ENODEV for ttyname and ttyname_r
Commit 15e9a4f378 introduced ENODEV as a possible
error condition for ttyname and ttyname_r. Update the manual to mention this GNU
extension.

Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
2017-11-15 20:46:45 +01:00
Joseph Myers 78cde19f62 Add MSG_ZEROCOPY from Linux 4.14 to bits/socket.h.
This patch adds the new MSG_ZEROCOPY constant from Linux 4.14 to the
Linux bits/socket.h.

Tested for x86_64.

	* sysdeps/unix/sysv/linux/bits/socket.h (MSG_ZEROCOPY): New enum
	constant and macro.
2017-11-15 18:41:32 +00:00
Joseph Myers fa680dc614 Add MADV_WIPEONFORK, MADV_KEEPONFORK from Linux 4.14.
This patch adds the new MADV_WIPEONFORK and MADV_KEEPONFORK from Linux
4.14 to bits/mman-linux.h (and bits/mman.h in the hppa case).  Note
there are further hppa MADV_* changes in 4.14; I plan a separate glibc
patch for those.

Tested for x86_64.

	* sysdeps/unix/sysv/linux/bits/mman-linux.h
	[__USE_MISC] (MADV_WIPEONFORK): New macro.
	[__USE_MISC] (MADV_KEEPONFORK): Likewise.
	* sysdeps/unix/sysv/linux/hppa/bits/mman.h
	[__USE_MISC] (MADV_WIPEONFORK): Likewise.
	[__USE_MISC] (MADV_KEEPONFORK): Likewise.
2017-11-15 18:40:29 +00:00
Adhemerval Zanella 1ba1d8a44d Optimize sigrelse implementation
This patch simplifies sighold a bit by removing an extra sigprocmask
and using SIG_BLOCK (which union of the current set and the set argument).

Checked on x86_64-linux-gnu.

	* signal/sighold.c (sighold): Optimize implementation.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-15 15:45:39 -02:00
Adhemerval Zanella ad4f43a234 Cleanup sigpause implementation
This patch simplify sigpause by remobing the single thread optimization
since it will be handled already by the __sigsuspend call.

Checked on x86_64-linux-gnu.

	* sysdeps/posix/sigpause.c (do_sigpause): Remove.
	(__sigpause): Rely on __sigsuspend to implement single thread
	optimization.  Add LIBC_CANCEL_HANDLED for cancellation marking.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Zack Weinberg <zackw@panix.com>
2017-11-15 15:45:39 -02:00
Joseph Myers d0212d429d Use Linux 4.14 in build-many-glibcs.py.
* scripts/build-many-glibcs.py (Context.checkout): Default Linux
	kernel version to 4.14.
2017-11-15 17:10:03 +00:00
Steve Ellcey 2180fee114 Check length of ifname before copying it into to ifreq structure.
[BZ #22442]
	* sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
	Check if ifname is too long.
2017-11-15 08:58:48 -08:00
Luke Shumaker cad7ca3908 linux: Include <sysdep-cancel.h> for epoll_wait
The epoll_wait wrapper uses the raw syscall if __NR_epoll_wait is defined,
and falls back to calling epoll_pwait(..., NULL) if it isn't defined.
However, it didn't include the appropriate headers for __NR_epoll_wait to
be defined, so it was *always* falling back to calling epoll_pwait!

This mistake was introduced in b62c381591,
when epoll_wait changed from being in syscalls.list to always having a C
wrapper.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-15 14:40:17 -02:00
Mike FABIAN 58c9f659ee ka_GE locale: Add “X” back to yesexpr.
* localedata/locales/ka_GE (LC_MESSAGES): Add “X” back to yesexpr,
	was accidentally lost.
2017-11-15 13:23:13 +01:00
Mike FABIAN 0fa87c01ab az_IR locale: Add standard copyright header
* localedata/locales/az_IR: Add standard copyright header.
2017-11-15 13:23:13 +01:00
Florian Weimer 34eb41579c malloc: Account for all heaps in an arena in malloc_info [BZ #22439]
This commit adds a "subheaps" field to the malloc_info output that
shows the number of heaps that were allocated to extend a non-main
arena.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2017-11-15 11:40:41 +01:00
Florian Weimer 7a9368a117 malloc: Add missing arena lock in malloc_info [BZ #22408]
Obtain the size information while the arena lock is acquired, and only
print it later.
2017-11-15 11:39:01 +01:00
Joseph Myers be3a79a3cc Use __builtin_tgmath in tgmath.h with GCC 8 (bug 21660).
GCC mainline now supports __builtin_tgmath to allow <tgmath.h> macro
implementations that expand their arguments only once, so avoiding
exponential blowup in the size of macro expansions when calls to those
macros are nested in arguments to those macros.

This patch makes glibc's tgmath.h support using __builtin_tgmath, as a
much simpler and more efficient alternative to the existing
implementation.  (As a side effect, the new feature would make it much
more practical to support decimal floating point in <tgmath.h> with
new compilers; currently, libdfp does not provide a <tgmath.h>
implementation, and making decimal arguments cause integer arguments
to be considered of type _Decimal64 instead of double would have been
very problematic in the old implementation.)

Tested for x86_64 (with GCC mainline).

	[BZ #21660]
	* math/tgmath.h (__HAVE_BUILTIN_TGMATH): New macro.
	[__HAVE_BUILTIN_TGMATH] (__TG_F16_ARG): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TG_F32_ARG): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TG_F64_ARG): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TG_F128_ARG): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TG_F32X_ARG): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TG_F64X_ARG): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TG_F128X_ARG): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_FUNCS): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_RCFUNCS): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_1): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_2): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_2STD): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_3): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_1C): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_2C): Likewise.
	(__tgml): Make conditional on [!__HAVE_BUILTIN_TGMATH].
	(__floating_type): Likewise.
	(__real_integer_type): Likewise.
	(__complex_integer_type): Likewise.
	(__expr_is_real): Likewise.
	(__tgmath_real_type_sub): Likewise.
	(__tgmath_real_type): Likewise.
	(__tgmath_complex_type_sub): Likewise.
	(__tgmath_complex_type): Likewise.
	(__TGMATH_F128): Likewise.
	(__TGMATH_CF128): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_UNARY_REAL_ONLY): Define using
	new macros.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_UNARY_REAL_RET_ONLY): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_BINARY_FIRST_REAL_ONLY):
	Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_BINARY_FIRST_REAL_STD_ONLY):
	Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_BINARY_REAL_ONLY): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_BINARY_REAL_STD_ONLY): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_BINARY_REAL_RET_ONLY): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY):
	Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_TERNARY_REAL_ONLY): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_TERNARY_FIRST_REAL_RET_ONLY):
	Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_UNARY_REAL_IMAG): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_UNARY_IMAG): Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_UNARY_REAL_IMAG_RET_REAL):
	Likewise.
	[__HAVE_BUILTIN_TGMATH] (__TGMATH_BINARY_REAL_IMAG): Likewise.
	(__TGMATH_UNARY_REAL_IMAG_RET_REAL_SAME): New macro.
	(carg): Use __TGMATH_UNARY_REAL_IMAG_RET_REAL_SAME.
	(cimag): Likewise.
	(creal): Likewise.
2017-11-15 02:08:56 +00:00
Joseph Myers 2e64ec9c9e Fix string/tester.c build with GCC 8.
GCC 8 warns about more cases of string functions truncating their
output or not copying a trailing NUL byte.

This patch fixes testsuite build failures caused by such warnings in
string/tester.c.  In general, the warnings are disabled around the
relevant calls using DIAG_* macros, since the relevant cases are being
deliberately tested.  In one case, the warning is with
-Wstringop-overflow= instead of -Wstringop-truncation; in that case,
the conditional is __GNUC_PREREQ (7, 0) (being the version where
-Wstringop-overflow= was introduced), to allow the conditional to be
removed sooner, since it's harmless to disable the warning for a
GCC version where it doesn't actually occur.  In the case of warnings
for strncpy calls in test_memcmp, the calls in question are changed to
use memcpy, as they don't copy a trailing NUL and the point of that
code is to test memcmp rather than strncpy.

Tested (compilation) with GCC 8 for x86_64-linux-gnu with
build-many-glibcs.py (in conjunction with Martin's patch to allow
glibc to build).

	* string/tester.c (test_stpncpy): Disable -Wstringop-truncation
	for stpncpy calls for GCC 8.
	(test_strncat): Disable -Wstringop-truncation warning for strncat
	calls for GCC 8.  Disable -Wstringop-overflow= warning for one
	strncat call for GCC 7.
	(test_strncpy): Disable -Wstringop-truncation warning for strncpy
	calls for GCC 8.
	(test_memcmp): Use memcpy instead of strncpy for calls not copying
	trailing NUL.
2017-11-14 17:52:26 +00:00
Joseph Myers ec72135e5f Fix string/bug-strncat1.c build with GCC 8.
GCC 8 warns about strncat calls with truncated output.
string/bug-strncat1.c tests such a call; this patch disables the
warning for it.

Tested (compilation) with GCC 8 for x86_64-linux-gnu with
build-many-glibcs.py (in conjunction with Martin's patch to allow
glibc to build).

	* string/bug-strncat1.c: Include <libc-diag.h>.
	(main): Disable -Wstringop-truncation for strncat call for GCC 8.
2017-11-14 17:50:36 +00:00
Claude Paroz a259f5d388 Replaced unicode sequences in the ASCII printable range
[BZ #22387]
	* localedata/locales/aa_DJ: Improved readibility by replacing
	<Uxxxx> sequences in the ASCII printable range by their ASCII
	character equivalents.
	* localedata/locales/aa_ER: Likewise.
	* localedata/locales/aa_ER@saaho: Likewise.
	* localedata/locales/aa_ET: Likewise.
	* localedata/locales/af_ZA: Likewise.
	* localedata/locales/agr_PE: Likewise.
	* localedata/locales/ak_GH: Likewise.
	* localedata/locales/am_ET: Likewise.
	* localedata/locales/anp_IN: Likewise.
	* localedata/locales/ar_AE: Likewise.
	* localedata/locales/ar_BH: Likewise.
	* localedata/locales/ar_DZ: Likewise.
	* localedata/locales/ar_EG: Likewise.
	* localedata/locales/ar_IN: Likewise.
	* localedata/locales/ar_IQ: Likewise.
	* localedata/locales/ar_JO: Likewise.
	* localedata/locales/ar_KW: Likewise.
	* localedata/locales/ar_LB: Likewise.
	* localedata/locales/ar_LY: Likewise.
	* localedata/locales/ar_MA: Likewise.
	* localedata/locales/ar_OM: Likewise.
	* localedata/locales/ar_QA: Likewise.
	* localedata/locales/ar_SA: Likewise.
	* localedata/locales/ar_SD: Likewise.
	* localedata/locales/ar_SS: Likewise.
	* localedata/locales/ar_SY: Likewise.
	* localedata/locales/ar_TN: Likewise.
	* localedata/locales/ar_YE: Likewise.
	* localedata/locales/as_IN: Likewise.
	* localedata/locales/ast_ES: Likewise.
	* localedata/locales/ayc_PE: Likewise.
	* localedata/locales/az_AZ: Likewise.
	* localedata/locales/az_IR: Likewise.
	* localedata/locales/be_BY: Likewise.
	* localedata/locales/be_BY@latin: Likewise.
	* localedata/locales/bem_ZM: Likewise.
	* localedata/locales/ber_DZ: Likewise.
	* localedata/locales/ber_MA: Likewise.
	* localedata/locales/bg_BG: Likewise.
	* localedata/locales/bhb_IN: Likewise.
	* localedata/locales/bho_IN: Likewise.
	* localedata/locales/bi_VU: Likewise.
	* localedata/locales/bn_BD: Likewise.
	* localedata/locales/bn_IN: Likewise.
	* localedata/locales/bo_CN: Likewise.
	* localedata/locales/bo_IN: Likewise.
	* localedata/locales/br_FR: Likewise.
	* localedata/locales/brx_IN: Likewise.
	* localedata/locales/bs_BA: Likewise.
	* localedata/locales/byn_ER: Likewise.
	* localedata/locales/ca_AD: Likewise.
	* localedata/locales/ca_ES: Likewise.
	* localedata/locales/ca_FR: Likewise.
	* localedata/locales/ca_IT: Likewise.
	* localedata/locales/ce_RU: Likewise.
	* localedata/locales/chr_US: Likewise.
	* localedata/locales/cmn_TW: Likewise.
	* localedata/locales/crh_UA: Likewise.
	* localedata/locales/cs_CZ: Likewise.
	* localedata/locales/csb_PL: Likewise.
	* localedata/locales/cv_RU: Likewise.
	* localedata/locales/cy_GB: Likewise.
	* localedata/locales/da_DK: Likewise.
	* localedata/locales/de_AT: Likewise.
	* localedata/locales/de_BE: Likewise.
	* localedata/locales/de_CH: Likewise.
	* localedata/locales/de_DE: Likewise.
	* localedata/locales/de_IT: Likewise.
	* localedata/locales/de_LI: Likewise.
	* localedata/locales/de_LU: Likewise.
	* localedata/locales/doi_IN: Likewise.
	* localedata/locales/dv_MV: Likewise.
	* localedata/locales/dz_BT: Likewise.
	* localedata/locales/el_CY: Likewise.
	* localedata/locales/el_GR: Likewise.
	* localedata/locales/en_AG: Likewise.
	* localedata/locales/en_AU: Likewise.
	* localedata/locales/en_BW: Likewise.
	* localedata/locales/en_CA: Likewise.
	* localedata/locales/en_DK: Likewise.
	* localedata/locales/en_GB: Likewise.
	* localedata/locales/en_HK: Likewise.
	* localedata/locales/en_IE: Likewise.
	* localedata/locales/en_IL: Likewise.
	* localedata/locales/en_IN: Likewise.
	* localedata/locales/en_NG: Likewise.
	* localedata/locales/en_NZ: Likewise.
	* localedata/locales/en_PH: Likewise.
	* localedata/locales/en_SG: Likewise.
	* localedata/locales/en_US: Likewise.
	* localedata/locales/en_ZA: Likewise.
	* localedata/locales/en_ZM: Likewise.
	* localedata/locales/en_ZW: Likewise.
	* localedata/locales/eo: Likewise.
	* localedata/locales/es_AR: Likewise.
	* localedata/locales/es_BO: Likewise.
	* localedata/locales/es_CL: Likewise.
	* localedata/locales/es_CO: Likewise.
	* localedata/locales/es_CR: Likewise.
	* localedata/locales/es_CU: Likewise.
	* localedata/locales/es_DO: Likewise.
	* localedata/locales/es_EC: Likewise.
	* localedata/locales/es_ES: Likewise.
	* localedata/locales/es_GT: Likewise.
	* localedata/locales/es_HN: Likewise.
	* localedata/locales/es_MX: Likewise.
	* localedata/locales/es_NI: Likewise.
	* localedata/locales/es_PA: Likewise.
	* localedata/locales/es_PE: Likewise.
	* localedata/locales/es_PR: Likewise.
	* localedata/locales/es_PY: Likewise.
	* localedata/locales/es_SV: Likewise.
	* localedata/locales/es_US: Likewise.
	* localedata/locales/es_UY: Likewise.
	* localedata/locales/es_VE: Likewise.
	* localedata/locales/et_EE: Likewise.
	* localedata/locales/eu_ES: Likewise.
	* localedata/locales/eu_ES@euro: Likewise.
	* localedata/locales/fa_IR: Likewise.
	* localedata/locales/ff_SN: Likewise.
	* localedata/locales/fi_FI: Likewise.
	* localedata/locales/fil_PH: Likewise.
	* localedata/locales/fo_FO: Likewise.
	* localedata/locales/fr_BE: Likewise.
	* localedata/locales/fr_CA: Likewise.
	* localedata/locales/fr_CH: Likewise.
	* localedata/locales/fr_FR: Likewise.
	* localedata/locales/fr_LU: Likewise.
	* localedata/locales/fur_IT: Likewise.
	* localedata/locales/fy_DE: Likewise.
	* localedata/locales/fy_NL: Likewise.
	* localedata/locales/ga_IE: Likewise.
	* localedata/locales/gd_GB: Likewise.
	* localedata/locales/gez_ER: Likewise.
	* localedata/locales/gez_ET: Likewise.
	* localedata/locales/gl_ES: Likewise.
	* localedata/locales/gu_IN: Likewise.
	* localedata/locales/gv_GB: Likewise.
	* localedata/locales/ha_NG: Likewise.
	* localedata/locales/hak_TW: Likewise.
	* localedata/locales/he_IL: Likewise.
	* localedata/locales/hi_IN: Likewise.
	* localedata/locales/hif_FJ: Likewise.
	* localedata/locales/hne_IN: Likewise.
	* localedata/locales/hr_HR: Likewise.
	* localedata/locales/hsb_DE: Likewise.
	* localedata/locales/ht_HT: Likewise.
	* localedata/locales/hu_HU: Likewise.
	* localedata/locales/hy_AM: Likewise.
	* localedata/locales/i18n: Likewise.
	* localedata/locales/ia_FR: Likewise.
	* localedata/locales/id_ID: Likewise.
	* localedata/locales/ig_NG: Likewise.
	* localedata/locales/ik_CA: Likewise.
	* localedata/locales/is_IS: Likewise.
	* localedata/locales/it_CH: Likewise.
	* localedata/locales/it_IT: Likewise.
	* localedata/locales/iu_CA: Likewise.
	* localedata/locales/ja_JP: Likewise.
	* localedata/locales/ka_GE: Likewise.
	* localedata/locales/kk_KZ: Likewise.
	* localedata/locales/kl_GL: Likewise.
	* localedata/locales/kn_IN: Likewise.
	* localedata/locales/ko_KR: Likewise.
	* localedata/locales/kok_IN: Likewise.
	* localedata/locales/ks_IN: Likewise.
	* localedata/locales/ks_IN@devanagari: Likewise.
	* localedata/locales/ku_TR: Likewise.
	* localedata/locales/kw_GB: Likewise.
	* localedata/locales/ky_KG: Likewise.
	* localedata/locales/lb_LU: Likewise.
	* localedata/locales/lg_UG: Likewise.
	* localedata/locales/li_BE: Likewise.
	* localedata/locales/li_NL: Likewise.
	* localedata/locales/lij_IT: Likewise.
	* localedata/locales/ln_CD: Likewise.
	* localedata/locales/lo_LA: Likewise.
	* localedata/locales/lt_LT: Likewise.
	* localedata/locales/lv_LV: Likewise.
	* localedata/locales/lzh_TW: Likewise.
	* localedata/locales/mag_IN: Likewise.
	* localedata/locales/mai_IN: Likewise.
	* localedata/locales/mg_MG: Likewise.
	* localedata/locales/mhr_RU: Likewise.
	* localedata/locales/mi_NZ: Likewise.
	* localedata/locales/mk_MK: Likewise.
	* localedata/locales/ml_IN: Likewise.
	* localedata/locales/mn_MN: Likewise.
	* localedata/locales/mni_IN: Likewise.
	* localedata/locales/mr_IN: Likewise.
	* localedata/locales/ms_MY: Likewise.
	* localedata/locales/mt_MT: Likewise.
	* localedata/locales/my_MM: Likewise.
	* localedata/locales/nan_TW: Likewise.
	* localedata/locales/nan_TW@latin: Likewise.
	* localedata/locales/nb_NO: Likewise.
	* localedata/locales/nds_DE: Likewise.
	* localedata/locales/nds_NL: Likewise.
	* localedata/locales/ne_NP: Likewise.
	* localedata/locales/nhn_MX: Likewise.
	* localedata/locales/niu_NU: Likewise.
	* localedata/locales/niu_NZ: Likewise.
	* localedata/locales/nl_AW: Likewise.
	* localedata/locales/nl_BE: Likewise.
	* localedata/locales/nl_NL: Likewise.
	* localedata/locales/nn_NO: Likewise.
	* localedata/locales/nr_ZA: Likewise.
	* localedata/locales/nso_ZA: Likewise.
	* localedata/locales/oc_FR: Likewise.
	* localedata/locales/om_ET: Likewise.
	* localedata/locales/om_KE: Likewise.
	* localedata/locales/or_IN: Likewise.
	* localedata/locales/os_RU: Likewise.
	* localedata/locales/pa_IN: Likewise.
	* localedata/locales/pa_PK: Likewise.
	* localedata/locales/pap_AW: Likewise.
	* localedata/locales/pap_CW: Likewise.
	* localedata/locales/pl_PL: Likewise.
	* localedata/locales/ps_AF: Likewise.
	* localedata/locales/pt_BR: Likewise.
	* localedata/locales/pt_PT: Likewise.
	* localedata/locales/quz_PE: Likewise.
	* localedata/locales/raj_IN: Likewise.
	* localedata/locales/ro_RO: Likewise.
	* localedata/locales/ru_RU: Likewise.
	* localedata/locales/ru_UA: Likewise.
	* localedata/locales/rw_RW: Likewise.
	* localedata/locales/sa_IN: Likewise.
	* localedata/locales/sat_IN: Likewise.
	* localedata/locales/sc_IT: Likewise.
	* localedata/locales/sd_IN: Likewise.
	* localedata/locales/sd_IN@devanagari: Likewise.
	* localedata/locales/se_NO: Likewise.
	* localedata/locales/sgs_LT: Likewise.
	* localedata/locales/shs_CA: Likewise.
	* localedata/locales/si_LK: Likewise.
	* localedata/locales/sid_ET: Likewise.
	* localedata/locales/sk_SK: Likewise.
	* localedata/locales/sl_SI: Likewise.
	* localedata/locales/sm_WS: Likewise.
	* localedata/locales/so_DJ: Likewise.
	* localedata/locales/so_ET: Likewise.
	* localedata/locales/so_KE: Likewise.
	* localedata/locales/so_SO: Likewise.
	* localedata/locales/sq_AL: Likewise.
	* localedata/locales/sq_MK: Likewise.
	* localedata/locales/sr_ME: Likewise.
	* localedata/locales/sr_RS: Likewise.
	* localedata/locales/sr_RS@latin: Likewise.
	* localedata/locales/ss_ZA: Likewise.
	* localedata/locales/st_ZA: Likewise.
	* localedata/locales/sv_FI: Likewise.
	* localedata/locales/sv_SE: Likewise.
	* localedata/locales/sw_KE: Likewise.
	* localedata/locales/sw_TZ: Likewise.
	* localedata/locales/szl_PL: Likewise.
	* localedata/locales/ta_IN: Likewise.
	* localedata/locales/ta_LK: Likewise.
	* localedata/locales/tcy_IN: Likewise.
	* localedata/locales/te_IN: Likewise.
	* localedata/locales/tg_TJ: Likewise.
	* localedata/locales/th_TH: Likewise.
	* localedata/locales/the_NP: Likewise.
	* localedata/locales/ti_ER: Likewise.
	* localedata/locales/ti_ET: Likewise.
	* localedata/locales/tig_ER: Likewise.
	* localedata/locales/tk_TM: Likewise.
	* localedata/locales/tl_PH: Likewise.
	* localedata/locales/tn_ZA: Likewise.
	* localedata/locales/to_TO: Likewise.
	* localedata/locales/tpi_PG: Likewise.
	* localedata/locales/tr_CY: Likewise.
	* localedata/locales/tr_TR: Likewise.
	* localedata/locales/ts_ZA: Likewise.
	* localedata/locales/tt_RU: Likewise.
	* localedata/locales/tt_RU@iqtelif: Likewise.
	* localedata/locales/ug_CN: Likewise.
	* localedata/locales/uk_UA: Likewise.
	* localedata/locales/unm_US: Likewise.
	* localedata/locales/ur_IN: Likewise.
	* localedata/locales/ur_PK: Likewise.
	* localedata/locales/uz_UZ: Likewise.
	* localedata/locales/uz_UZ@cyrillic: Likewise.
	* localedata/locales/ve_ZA: Likewise.
	* localedata/locales/vi_VN: Likewise.
	* localedata/locales/wa_BE: Likewise.
	* localedata/locales/wae_CH: Likewise.
	* localedata/locales/wal_ET: Likewise.
	* localedata/locales/wo_SN: Likewise.
	* localedata/locales/xh_ZA: Likewise.
	* localedata/locales/yi_US: Likewise.
	* localedata/locales/yo_NG: Likewise.
	* localedata/locales/yue_HK: Likewise.
	* localedata/locales/yuw_PG: Likewise.
	* localedata/locales/zh_CN: Likewise.
	* localedata/locales/zh_HK: Likewise.
	* localedata/locales/zh_SG: Likewise.
	* localedata/locales/zh_TW: Likewise.
	* localedata/locales/zu_ZA: Likewise.
2017-11-14 08:51:13 +01:00
Florian Weimer cae87e64dc support: Add <support/next_to_fault.h>
Based on the implementation in resolv/tst-inet_pton.c.
2017-11-13 19:29:32 +01:00
Florian Weimer eceed67166 Add missing ChangeLog sub-entries 2017-11-13 17:58:32 +01:00
H.J. Lu 4a306ef1c8 ld.so: Add architecture specific fields
To support Intel Control-flow Enforcement Technology (CET) run-time
control:

1. An architecture specific field in the writable ld.so namespace is
needed to indicate if CET features are enabled at run-time.
2. An architecture specific field in struct link_map is needed if
CET features are enabled in an ELF module.

This patch adds dl-procruntime.c to the writable ld.so namespace and
link_map.h to struct link_map.

Tested with build-many-glibcs.py.

	* elf/dl-support.c: Include <dl-procruntime.c>.
	* include/link.h: Include <link_map.h>.
	* sysdeps/generic/dl-procruntime.c: New file.
	* sysdeps/generic/link_map.h: Likewise.
	* sysdeps/generic/ldsodefs.h: Include <dl-procruntime.c> in
	the writable ld.so namespace.
2017-11-13 08:02:52 -08:00
Paul Eggert e69897bf20 timezone: pacify GCC -Wstringop-truncation
Problem reported by Martin Sebor in:
https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
* timezone/zic.c (writezone): Use memcpy, not strncpy.
2017-11-12 22:00:28 -08:00
Florian Weimer 1ffe1ccb6e support: Add xstrndup, xunlink, xreadlink, support_create_temp_directory 2017-11-12 09:53:06 +01:00
John David Anglin 456b40a97f Fix clog10_downward ulps on hppa.
2017-11-11  John David Anglin  <danglin@gcc.gnu.org>

	* sysdeps/hppa/fpu/libm-test-ulps: Update clog10_downward ulps.
2017-11-11 12:12:28 -05:00
Florian Weimer c0a25aa92b resolv: More precise checks in res_hnok, res_dnok [BZ #22409] [BZ #22412]
res_hnok rejected some host names used on the Internet, such as
www-.example.com.  res_hnok and res_dnok failed to perform basic syntax
checking on DNS domain names.

Also fix res_mailok, res_ownok.
2017-11-11 11:51:08 +01:00
Florian Weimer 9e0ad3049d resolv: ns_name_pton should report trailing \ as error [BZ #22413] 2017-11-11 11:41:45 +01:00
Florian Weimer e2a9fca810 resolv: Add tst-ns_name_pton 2017-11-11 11:33:32 +01:00
Florian Weimer 5c1a69238f resolv: Add tst-res_hnok 2017-11-11 11:23:40 +01:00
Florian Weimer a19c0a1db5 resolv: Use test framework in tst-resolv-network
The main function was left in place by accident when the
test was imported.
2017-11-11 10:54:56 +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 3683b423a4 Handle more _FloatN, _FloatNx types in include/float.h.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch adds support in include/float.h.  This header
defines macros for _Float128 properties when using compilers before
GCC 7 that lack those macros in <float.h>.  For testing _Float32 /
_Float64 / _Float32x / _Float64x functions with older compilers, such
macros need to be defined for those types as well; for the older
compilers, those types will always be typedefs for another type, so
the definitions can be in terms of the macros for that other type.

Tested for x86_64.

	* include/float.h
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_MANT_DIG): New macro.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_DECIMAL_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_MIN_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_MIN_10_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_MAX_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_MAX_10_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_MAX): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_EPSILON): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_MIN): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32] (FLT32_TRUE_MIN): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_MANT_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_DECIMAL_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_MIN_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_MIN_10_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_MAX_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_MAX_10_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_MAX): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_EPSILON): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_MIN): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64] (FLT64_TRUE_MIN): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_MANT_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_DECIMAL_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_MIN_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_MIN_10_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_MAX_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_MAX_10_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_MAX): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_EPSILON): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_MIN): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT32X] (FLT32X_TRUE_MIN): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_MANT_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_DECIMAL_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_DIG): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_MIN_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_MIN_10_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_MAX_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_MAX_10_EXP): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_MAX): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_EPSILON): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_MIN): Likewise.
	[!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X] (FLT64X_TRUE_MIN): Likewise.
2017-11-07 23:49:04 +00:00
Joseph Myers 58c4a1612d Handle more _FloatN, _FloatNx types in type-generic strtod tests.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch adds support to type-generic strtod tests.
GEN_STRTOD_TEST_FOREACH and STRTOD_TEST_FOREACH are made to handle the
full set of such types.  tst-strtod-round-skeleton.c is updated for
those types it can handle without needing changes to the generator
(i.e. those types that have already-handled formats).

Tested for x86_64.

	* stdlib/tst-strtod.h (F16): New macro.
	(F32): Likewise.
	(F64): Likewise.
	(F32X): Likewise.
	(F64X): Likewise.
	(F128X): Likewise.
	(IF_FLOAT16): Likewise.
	(IF_FLOAT32): Likewise.
	(IF_FLOAT64): Likewise.
	(IF_FLOAT32X): Likewise.
	(IF_FLOAT64X): Likewise.
	(IF_FLOAT128X): Likewise.
	(GEN_TEST_STRTOD_FOREACH): Conditionally call macros for _Float16,
	_Float32, _Float64, _Float32x, _Float64x and _Float128x.
	(STRTOD_TEST_FOREACH): Likewise.
	* stdlib/tst-strtod-round-skeleton.c (CHOOSE_f32): New macro.
	(CHOOSE_f64): Likewise.
	(CHOOSE_f32x): Likewise.
	(CHOOSE_f64x): Likewise.
2017-11-07 18:08:44 +00:00
Andreas Schwab feda96a178 Remove traces of tst-typesizes 2017-11-07 16:17:18 +01:00
Mike FABIAN 1bd0cbb8cf mfe_MU, miq_NI locales: Escape slashes in d_fmt [BZ #22403]
[BZ #22403]
	* localedata/locales/mfe_MU (LC_TIME): Fix wrong d_fmt, / needs
	to be escaped.
	* localedata/locales/miq_NI (LC_TIME): Fix wrong d_fmt, / needs
	to be escaped.
2017-11-07 15:28:59 +01:00
Claude Paroz d8301314bc an_ES, kab_DZ, om_ET locales: Escape slashes in d_fmt [BZ #22403]
[BZ #22403]
	* localedata/locales/an_ES (LC_TIME): Fix wrong d_fmt, / needs
	to be escaped.
	* localedata/locales/kab_DZ (LC_TIME): Fix wrong d_fmt, / needs
	to be escaped.
	* localedata/locales/om_ET (LC_TIME): Fix wrong d_fmt, / needs
	to be escaped.
2017-11-07 15:28:59 +01:00
Adhemerval Zanella 06be6368da nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION}
This patch adds two new internal defines to set the internal
pthread_mutex_t layout required by the supported ABIS:

  1. __PTHREAD_MUTEX_NUSERS_AFTER_KIND which control whether to define
     __nusers fields before or after __kind.  The preferred value for
     is 0 for new ports and it sets __nusers before __kind.

  2. __PTHREAD_MUTEX_USE_UNION which control whether internal __spins and
     __list members will be place inside an union for linuxthreads
     compatibility.  The preferred value is 0 for ports and it sets
     to not use an union to define both fields.

It fixes the wrong offsets value for __kind value on x86_64-linux-gnu-x32.
Checked with a make check run-built-tests=no on all afected ABIs.

	[BZ #22298]
	* nptl/allocatestack.c (allocate_stack): Check if
	__PTHREAD_MUTEX_HAVE_PREV is non-zero, instead if
	__PTHREAD_MUTEX_HAVE_PREV is defined.
	* nptl/descr.h (pthread): Likewise.
	* nptl/nptl-init.c (__pthread_initialize_minimal_internal):
	Likewise.
	* nptl/pthread_create.c (START_THREAD_DEFN): Likewise.
	* sysdeps/nptl/fork.c (__libc_fork): Likewise.
	* sysdeps/nptl/pthread.h (PTHREAD_MUTEX_INITIALIZER): Likewise.
	* sysdeps/nptl/bits/thread-shared-types.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): New
	defines.
	(__pthread_internal_list): Check __PTHREAD_MUTEX_USE_UNION instead
	of __WORDSIZE for internal layout.
	(__pthread_mutex_s): Check __PTHREAD_MUTEX_NUSERS_AFTER_KIND instead
	of __WORDSIZE for internal __nusers layout and __PTHREAD_MUTEX_USE_UNION
	instead of __WORDSIZE whether to use an union for __spins and __list
	fields.
	(__PTHREAD_MUTEX_HAVE_PREV): Define also for __PTHREAD_MUTEX_USE_UNION
	case.
	* sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): New
	defines.
	* sysdeps/alpha/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/arm/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/ia64/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/m68k/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/mips/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/nios2/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/s390/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/sh/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/sparc/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/tile/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/x86/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-07 09:48:41 -02:00
Adhemerval Zanella 72b3c6eecd nptl: Change tst-typesizes to _Static_assert
Instead of rely on runtime check to assure correct pthread types
size a better strategy would use _Static_assert to trigger an error
on build time (and thus allowing to check to potentially ABI breakage
on cross-compiling make check).

This patch moves nptl/tst-typesizes.c to libpthread build time on
each specific initialization routine and also remove some runtime
redundant asserts for the same type sizes.

Checked on x86_64-linux-gnu and with a build check for all affected
ABIs (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf,
hppa-linux-gnu, i686-linux-gnu, ia64-linux-gnu, m68k-linux-gnu,
microblaze-linux-gnu, mips64-linux-gnu, mips64-n32-linux-gnu,
mips-linux-gnu, powerpc64le-linux-gnu, powerpc-linux-gnu,
s390-linux-gnu, s390x-linux-gnu, sh4-linux-gnu, sparc64-linux-gnu,
sparcv9-linux-gnu, tilegx-linux-gnu, tilegx-linux-gnu-x32,
tilepro-linux-gnu, x86_64-linux-gnu, and x86_64-linux-x32).

	* nptl/pthreadP.h (ASSERT_TYPE_SIZE, ASSERT_PTHREAD_INTERNAL_SIZE):
	New macros.
	* nptl/pthread_attr_init.c (__pthread_mutex_init): Add build time
	checks for expected input type size.
	* nptl/pthread_barrier_init.c (__pthread_barrier_init): Likewise.
	* nptl/pthread_barrierattr_init.c (pthread_barrierattr_init):
	Likewise.
	* nptl/pthread_cond_init.c (__pthread_cond_init): Likewise.
	* nptl/pthread_condattr_init.c (__pthread_condattr_init): Likewise.
	* nptl/pthread_mutex_init.c (__pthread_mutex_init): Likewise.
	* nptl/pthread_mutexattr_init.c (__pthread_mutexattr_init): Likewise.
	* nptl/pthread_rwlock_init.c (__pthread_rwlock_init): Likewise.
	* nptl/pthread_rwlockattr_init.c (pthread_rwlockattr_init): Likewise.
	* nptl/sem_init.c (__new_sem_init, __old_sem_init): Likewise
	* nptl/pthread_attr_destroy.c (__pthread_attr_destroy): Remove
	superflous runtime assert check.
	* nptl/pthread_attr_getaffinity.c (__pthread_attr_getaffinity_new):
	Likewise.
	* nptl/pthread_attr_getdetachstate.c (__pthread_attr_getdetachstate):
	Likewise.
	* nptl/pthread_attr_getguardsize.c (pthread_attr_getguardsize):
	Likewise.
	* nptl/pthread_attr_getinheritsched.c (__pthread_attr_getinheritsched):
	Likewise.
	* nptl/pthread_attr_getschedparam.c (__pthread_attr_getschedparam):
	Likewise.
	* nptl/pthread_attr_getschedpolicy.c (__pthread_attr_getschedpolicy):
	Likewise.
	* nptl/pthread_attr_getscope.c (__pthread_attr_getscope): Likewise.
	* nptl/pthread_attr_getstack.c (__pthread_attr_getstack): Likewise.
	* nptl/pthread_attr_getstackaddr.c (__pthread_attr_getstackaddr):
	Likewise.
	* nptl/pthread_attr_getstacksize.c (__pthread_attr_getstacksize):
	Likewise.
	* nptl/pthread_attr_setaffinity.c (__pthread_attr_setaffinity_new):
	Likewise.
	* nptl/pthread_attr_setdetachstate.c (__pthread_attr_setdetachstate):
	Likewise.
	* nptl/pthread_attr_setguardsize.c (pthread_attr_setguardsize):
	Likewise.
	* nptl/pthread_attr_setinheritsched.c
	(__pthread_attr_setinheritsched): Likewise.
	* nptl/pthread_attr_setschedparam.c (__pthread_attr_setschedparam):
	Likewise.
	* nptl/pthread_attr_setschedpolicy.c (__pthread_attr_setschedpolicy):
	Likewise.
	* nptl/pthread_attr_setscope.c (__pthread_attr_setscope): Likewise.
	* nptl/pthread_attr_setstack.c (__pthread_attr_setstack,
	__old_pthread_attr_setstack): Likewise.
	* nptl/pthread_attr_setstackaddr.c (__pthread_attr_setstackaddr):
	Likewise.
	* nptl/pthread_attr_setstacksize.c (__pthread_attr_setstacksize):
	Likewise.
	* nptl/pthread_getattr_default_np.c (pthread_getattr_default_np):
	Likewise.
	* nptl/pthread_mutex_lock.c (__pthread_mutex_lock): Likewise.
	* nptl/pthread_setattr_default_np.c (pthread_setattr_default_np):
	Likewise.
	* nptl/tst-typesizes.c: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-07 09:48:37 -02:00
Adhemerval Zanella dff91cd45e nptl: Add tests for internal pthread_mutex_t offsets
This patch adds a new build test to check for internal fields
offsets for user visible internal field.  Although currently
the only field which is statically initialized to a non zero value
is pthread_mutex_t.__data.__kind value, the tests also check the
offset of __kind, __spins, __elision (if supported), and __list
internal member.  A internal header (pthread-offset.h) is added
to each major ABI with the reference value.

Checked on x86_64-linux-gnu and with a build check for all affected
ABIs (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabihf,
hppa-linux-gnu, i686-linux-gnu, ia64-linux-gnu, m68k-linux-gnu,
microblaze-linux-gnu, mips64-linux-gnu, mips64-n32-linux-gnu,
mips-linux-gnu, powerpc64le-linux-gnu, powerpc-linux-gnu,
s390-linux-gnu, s390x-linux-gnu, sh4-linux-gnu, sparc64-linux-gnu,
sparcv9-linux-gnu, tilegx-linux-gnu, tilegx-linux-gnu-x32,
tilepro-linux-gnu, x86_64-linux-gnu, and x86_64-linux-x32).

	* nptl/pthreadP.h (ASSERT_PTHREAD_STRING,
	ASSERT_PTHREAD_INTERNAL_OFFSET): New macro.
	* nptl/pthread_mutex_init.c (__pthread_mutex_init): Add build time
	checks for internal pthread_mutex_t offsets.
	* sysdeps/aarch64/nptl/pthread-offsets.h
	(__PTHREAD_MUTEX_NUSERS_OFFSET, __PTHREAD_MUTEX_KIND_OFFSET,
	__PTHREAD_MUTEX_SPINS_OFFSET, __PTHREAD_MUTEX_ELISION_OFFSET,
	__PTHREAD_MUTEX_LIST_OFFSET): New macro.
	* sysdeps/alpha/nptl/pthread-offsets.h: Likewise.
	* sysdeps/arm/nptl/pthread-offsets.h: Likewise.
	* sysdeps/hppa/nptl/pthread-offsets.h: Likewise.
	* sysdeps/i386/nptl/pthread-offsets.h: Likewise.
	* sysdeps/ia64/nptl/pthread-offsets.h: Likewise.
	* sysdeps/m68k/nptl/pthread-offsets.h: Likewise.
	* sysdeps/microblaze/nptl/pthread-offsets.h: Likewise.
	* sysdeps/mips/nptl/pthread-offsets.h: Likewise.
	* sysdeps/nios2/nptl/pthread-offsets.h: Likewise.
	* sysdeps/powerpc/nptl/pthread-offsets.h: Likewise.
	* sysdeps/s390/nptl/pthread-offsets.h: Likewise.
	* sysdeps/sh/nptl/pthread-offsets.h: Likewise.
	* sysdeps/sparc/nptl/pthread-offsets.h: Likewise.
	* sysdeps/tile/nptl/pthread-offsets.h: Likewise.
	* sysdeps/x86_64/nptl/pthread-offsets.h: Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-07 09:48:28 -02:00
Florian Weimer b7fc95f8c8 Move <bits/mman-linux.h> to the Linux sysdeps directory
The header file is no longer used on anything but Linux.
2017-11-07 12:11:42 +01:00
Rajalakshmi Srinivasaraghavan 6b86036452 powerpc: Use latest optimization for internal function calls
Update strcasestr-power8 to use power8 version of strnlen for
calculating length.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
2017-11-07 10:07:48 +05:30
Adhemerval Zanella d83da3a4ce Optimize sighold implementation
This patch simplifies sighold a bit by removing an extra sigprocmask
and using SIG_BLOCK (which union of the current set and the set argument).

Checked on x86_64-linux-gnu.

	* signal/sighold.c (sighold): Optimize implementation.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Zack Weinberg <zackw@panix.com>
2017-11-06 17:37:57 -02:00
Adhemerval Zanella 6a4235f129 Cleanup Linux sigqueue implementation
This patch simplify Linux sigqueue implementation by assuming
__NR_rt_sigqueueinfo existence due minimum kernel requirement
(it pre-dates Linux git inclusion for Linux 2.6.12).

Checked on x86_64-linux-gnu.

	* sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Asssume
	__NR_rt_sigqueueinfo.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Zack Weinberg <zackw@panix.com>
2017-11-06 17:37:57 -02:00
Adhemerval Zanella 8b0e795aaa Simplify Linux sig{timed}wait{info} implementations
This patch simplifies sig{timed}wait{info} by:

  - Assuming __NR_rt_sigtimedwait existence on all architectures due minimum
    kernel version requirement (it pre-dates Linux git inclusion for Linux
    2.6.12).

  - Call __sigtimedwait on both sigwait and sigwaitinfo.

  - Now that sigwait is based on an internal sigtimedwait call and it is
    present of both libc.so and libpthread.so we need to add an external
    private definition of __sigtimedwait for libpthread.so call.

Checked on x86_64-linux-gnu.

	* sysdeps/unix/sysv/linux/Versions (libc) [GLIBC_PRIVATE]: Add
	__sigtimedwait.
	* sysdeps/unix/sysv/linux/sigtimedwait.c: Simplify includes and
	assume __NR_rt_sigtimedwait.
	* sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Call __sigtimedwait
	and add LIBC_CANCEL_HANDLED for cancellation marking.
	* sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Zack Weinberg <zackw@panix.com>
2017-11-06 17:37:57 -02:00
Adhemerval Zanella a1a638dda9 arm: Implement memchr ifunc selection in C
This patch refactor ARM memchr ifunc selector to a C implementation.
No functional change is expected, including ifunc resolution rules.

It also reorganize the ifunc options code:

  1. The memchr_impl.S is renamed to memchr_neon.S and multiple
     compilation options (which route to armv6t2/memchr one) is
     removed.  The code to build if __ARM_NEON__ is defined is
     also simplified.

  2. A memchr_noneon is added (which as build along previous ifunc
     resolution) and includes the armv6t2 direct.

  3. Same as 2. for loader object.

Alongside the aforementioned changes, it also some cleanus:

  - Internal memchr definition (__GI_memcpy) is now a hidden
    symbol.
  - No need to create hidden definition for the ifunc variants.

Checked on armv7-linux-gnueabihf and with a build for arm-linux-gnueabi,
arm-linux-gnueabihf with and without multiarch support and with both
GCC 7.1 and GCC mainline.

	* sysdeps/arm/armv7/multiarch/Makefile [$(subdir) = string]
	(sysdeps_routines): Add memchr_noneon.
	* sysdeps/arm/armv7/multiarch/ifunc-memchr.h: New file.
	* sysdeps/arm/armv7/multiarch/memchr_noneon.S: Likewise.
	* sysdeps/arm/armv7/multiarch/rtld-memchr.S: Likewise.
	* sysdeps/arm/armv7/multiarch/memchr.S: Remove file.
	* sysdeps/arm/armv7/multiarch/memchr.c: New file.
	* sysdeps/arm/armv7/multiarch/memchr_impl.S: Move to ...
	* sysdeps/arm/armv7/multiarch/memchr_neon.S: ... here.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-06 17:37:57 -02:00
Adhemerval Zanella 802c1f1645 arm: Implement memcpy ifunc selection in C
This patch refactor ARM memcpy ifunc selector to a C implementation.
No functional change is expected, including ifunc resolution rules.

It also adds some cleanup:

  - Internal memcpy hidden definition (__GI_memcpy) is now a hidden
    symbol.

  - No need to create hidden definition for the ifunc variants.

Checked on armv7-linux-gnueabihf and with a build for arm-linux-gnueabi,
arm-linux-gnueabihf with and without multiarch support and with both
GCC 7.1 and GCC mainline.  I also checked with the some possible
multiarch different configurations that trigger different memcpy
buids (__ARM_NEON__ && !__SOFT_FP__, !__ARM_NEON__ && !__SOFT_FP__, and
!__ARM_NEON__ && __SOFT_FP__).

	* sysdeps/arm/arm-ifunc.h: New file.
	* sysdeps/arm/armv7/multiarch/ifunc-memcpy.h: Likewise.
	* sysdeps/arm/armv7/multiarch/memcpy.c: Likewise.
	* sysdeps/arm/armv7/multiarch/memcpy_arm.S: Likewise.
	* sysdeps/arm/armv7/multiarch/rtld-memcpy.S: Likewise.
	* sysdeps/arm/armv7/multiarch/memcpy_neon.S [!__ARM_NEON__]
	(__memcpy_neon): Avoid create hidden alias.
	* sysdeps/arm/armv7/multiarch/memcpy_vfp.S [!__ARM_NEON_]
	(__memcpy_vfp): Likewise.
	* sysdeps/arm/armv7/multiarch/Makefile [$(subdir) = string]
	(sysdep_routines): Add memcpy_arm.
	* sysdeps/arm/armv7/multiarch/memcpy.S: Remove file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-06 17:37:57 -02:00
H.J. Lu abcb584d0e Use newly built crt*.o files to build shared objects [BZ #22362]
When multi-lib GCC is used to build glibc, the search order of GCC driver
for crt*.o is -B*/`gcc -print-multi-directory`, the installed diretory,
-B*/.  This patch adds multi-lib support to csu/Makefile so that
-B/glibc-build-directory/csu/ will pick up the newly built crt*.o.

Tested on x86-64 for i686 and x32.

	[BZ #22362]
	* Makerules (make-link-multidir): New.
	* config.make.in (multidir): New.
	* configure.ac (libc_cv_multidir): New.  AC_SUBST.
	* configure: Regenerated.
	* csu/Makefile [$(multidir) != .](multilib-extra-objs): New.
	[$(multidir) != .](extra-objs): Add $(multilib-extra-objs).
	[$(multidir) != .]($(addprefix $(objpfx)$(multidir)/, $(install-lib))):
	New target.
2017-11-06 08:29:57 -08:00
Joseph Myers 4e2dff67be Do not declare _Float128 support for powerpc64le -mlong-double-64 (bug 22402).
The powerpc bits/floatn.h declares _Float128 support to be present
when the compiler supports it for powerpc64le.  However, in the case
where -mlong-double-64 is used, __MATH_TG does not actually support
_Float128; it only supports _Float128 in the distinct-long-double
case.

This shows up as a build failure when building glibc mainline with GCC
mainline, given the recently added sanity check in math.h for
configurations supported by __MATH_TG, as the compat code for
-mlong-double-64 fails to build.  However, the bug was logically
present before that change (including in 2.26), just less visible.

This patch fixes the build failure by declaring _Float128 to be
unsupported in that case.  (Of course this can't actually stop users
calling the type-generic macros with _Float128 arguments with
-mlong-double-64, just as they could be called with other unsupported
types on other platforms, but perhaps makes it less likely by making
all the type-specific _Float128 interfaces invisible in that case.)

Tested compilation for powerpc64le with build-many-glibcs.py.

	[BZ #22402]
	* sysdeps/powerpc/bits/floatn.h: Include <bits/long-double.h>.
	[__NO_LONG_DOUBLE_MATH] (__HAVE_FLOAT128): Define to 0.
2017-11-06 13:26:15 +00:00
Mike FABIAN a1c7cd3c72 tpi_PG locale: Fix wrong d_fmt 2017-11-04 14:59:29 +01:00
Florian Weimer b9af29c020 manual: Document the O_TMPFILE flag
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
2017-11-04 00:57:42 +01:00
Joseph Myers 4ca70e1a2b Handle more _FloatN, _FloatNx types in __MATH_TG.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch prepares __MATH_TG to handle more such types.

Various unhandled cases, which do not correspond to any current glibc
configuration, have explicit #errors added.  _Float32 and _Float64x
are then handled appropriately in the _Generic case, which is the only
one, other than the cases where use of sizeof is sufficient, where
they should ever be explicit types at the language level instead of
typedefs.  There is no need to handle _Float64 or _Float32x explicitly
there because the default case calling a double function is correct
for those types.

Tested for x86_64.

	* math/math.h [__HAVE_DISTINCT_FLOAT16
	|| __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64
	|| __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X
	|| __HAVE_DISTINCT_FLOAT128X]: Use #error.
	[__NO_LONG_DOUBLE_MATH && __HAVE_DISTINCT_FLOAT128]: Likewise.
	[__HAVE_DISTINCT_FLOAT128 && !__HAVE_GENERIC_SELECTION
	&& __HAVE_FLOATN_NOT_TYPEDEF]: Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
	(__MATH_TG_F32): New macro.
	[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
	(__MATH_TG_F64X): Likewise.
	[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
	(__MATH_TG): Use __MATH_TG_F32 and __MATH_TG_F64X.
2017-11-03 23:50:00 +00:00
Dmitry V. Levin ba0e6668f4 Update translations from the Translation Project
* po/de.po: Update translations.
* po/ru.po: Likewise.
2017-11-03 23:30:23 +00:00
Florian Weimer bc18a6d362 manual: Document the linkat function
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
2017-11-04 00:28:37 +01:00
Joseph Myers 86ec486597 Handle more _FloatN, _FloatNx types in tgmath.h.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch improves how <tgmath.h> handles such types.

Use of #error is added for cases of distinct types that are not
supported by the header, to indicate that additional work on the
header would be needed if, for example, _Float16 support were added to
glibc.  Given that #error, types with the same format as other types
are handled automatically by the sizeof-based logic, so the only case
needing special handling is that where _Float64x exists, has the same
format as _Float128, does not have the same format as long double, and
is not a typedef for _Float128.  In this case (which will apply for
powerpc64le once _Float64x support is added to glibc), the
__builtin_types_compatible_p calls testing for _Float128 need
corresponding calls testing for _Float64x, which this patch adds.

Tested for x86_64.

	* math/tgmath.h [__HAVE_DISTINCT_FLOAT16
	|| __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64
	|| __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X
	|| __HAVE_DISTINCT_FLOAT128X]: Use #error.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
	&& __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_F128): Handle _Float64x
	the same as _Float128.
	[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
	&& __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
	&& __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_CF128): Likewise.
2017-11-03 21:11:50 +00:00
Joseph Myers 9725517070 Declare strtof, strfromf functions for more _FloatN, _FloatNx types.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch arranges for <stdlib.h> to declare strtof and
strfromf functions for all such types, similarly to the declarations
already present for _Float128.

Tested for x86_64.

	* stdlib/stdlib.h
	[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof16):
	Declare.
	[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof32):
	Likewise.
	[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof64):
	Likewise.
	[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strtof32x): Likewise.
	[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strtof64x): Likewise.
	[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strtof128x): Likewise.
	[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf16): Likewise.
	[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf32): Likewise.
	[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf64): Likewise.
	[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf32x): Likewise.
	[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf64x): Likewise.
	[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(strfromf128x): Likewise.
	[__USE_GNU && __HAVE_FLOAT16] (strtof16_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT32] (strtof32_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT64] (strtof64_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT32X] (strtof32x_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT64X] (strtof64x_l): Likewise.
	[__USE_GNU && __HAVE_FLOAT128X] (strtof128x_l): Likewise.
2017-11-03 17:10:39 +00:00
Richard Henderson 6d58ce5e50 aarch64: Guess L1 cache linesize for aarch64
Using the cache hierarchy linesize minimum in CTR_EL0.
See the comment within the code for rationale.

	* sysdeps/unix/sysv/linux/aarch64/sysconf.c: New file.
2017-11-03 16:40:27 +00:00
Szabolcs Nagy 659ca26736 aarch64: optimize _dl_tlsdesc_dynamic fast path
Remove some load/store instructions from the dynamic tlsdesc resolver
fast path.  This gives around 20% faster tls access in dlopened shared
libraries (assuming glibc ran out of static tls space).

	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Optimize.
2017-11-03 14:50:55 +00:00
Szabolcs Nagy 94d2f0af15 arm: Remove lazy tlsdesc initialization related code
Lazy tlsdesc initialization is no longer used in the dynamic linker
so all related code can be removed.

	* sysdeps/arm/dl-machine.h (elf_machine_runtime_setup): Remove
	DT_TLSDESC_GOT initialization.
	* sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_lazy_resolver): Remove.
	(_dl_tlsdesc_resolve_hold): Likewise.
	* sysdeps/aarch64/dl-tlsdesc.h (_dl_tlsdesc_lazy_resolver): Remove.
	(_dl_tlsdesc_resolve_hold): Likewise.
	* sysdeps/aarch64/tlsdesc.c (_dl_tlsdesc_lazy_resolver_fixup): Remove.
	(_dl_tlsdesc_resolve_hold_fixup): Likewise.
2017-11-03 14:49:20 +00:00
Szabolcs Nagy 28e1ddf340 arm: Remove unnecessary volatile qualifier
There is no reason to treat tlsdesc entries as volatile objects.

	* sysdeps/arm/dl-machine.h (elf_machine_rel): Remove volatile.
2017-11-03 14:48:35 +00:00
Szabolcs Nagy 0ca3d1d6d0 [BZ #18572] arm: Disable lazy initialization of tlsdesc entries
Follow up to
https://sourceware.org/ml/libc-alpha/2015-11/msg00272.html

Always do tls descriptor initialization at load time during relocation
processing (as if DF_BIND_NOW were set for the binary) to avoid barriers
at every tls access.  This patch mimics bind-now semantics in the lazy
relocation code of the arm target (elf_machine_lazy_rel).

Ideally the static linker should be updated too to not emit tlsdesc
relocs in DT_REL*, so elf_machine_lazy_rel is not called on them at all.

	[BZ #18572]
	* sysdeps/arm/dl-machine.h (elf_machine_lazy_rel): Do symbol binding
	non-lazily for R_ARM_TLS_DESC.
2017-11-03 14:47:35 +00:00
Szabolcs Nagy 2c1d4e5fe4 [BZ #17078] arm: remove prelinker support for R_ARM_TLS_DESC
This patch reverts

commit 9c82da17b5
Author: Maciej W. Rozycki <macro@codesourcery.com>
Date:   2014-07-17 19:22:05 +0100

    [BZ #17078] ARM: R_ARM_TLS_DESC prelinker support

This only implemented support for the lazy binding case (and thus
closed the bugzilla ticket prematurely), however tlsdesc on arm is
not correct with lazy binding because there is a data race between
the lazy initialization code and tlsdesc resolver functions.

Lazy initialization of tlsdesc entries will be removed from arm to
fix the data races and thus this half-finished prelinker support
is no longer useful.

	[BZ #17078]
	* sysdeps/arm/dl-machine.h (elf_machine_rela): Remove the
	R_ARM_TLS_DESC case.
	(elf_machine_lazy_rel): Remove the prelink check.
2017-11-03 14:45:26 +00:00
Szabolcs Nagy 91c5a366d8 aarch64: Remove barriers from TLS descriptor functions
Remove ldar synchronization and most lazy TLSDESC initialization
related code.

	* sysdeps/aarch64/dl-machine.h (elf_machine_runtime_setup): Remove
	DT_TLSDESC_GOT initialization.
	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_return_lazy): Remove.
	(_dl_tlsdesc_resolve_rela): Likewise.
	(_dl_tlsdesc_resolve_hold): Likewise.
	(_dl_tlsdesc_undefweak): Remove ldar.
	(_dl_tlsdesc_dynamic): Likewise.
	* sysdeps/aarch64/dl-tlsdesc.h (_dl_tlsdesc_return_lazy): Remove.
	(_dl_tlsdesc_resolve_rela): Likewise.
	(_dl_tlsdesc_resolve_hold): Likewise.
	* sysdeps/aarch64/tlsdesc.c (_dl_tlsdesc_resolve_rela_fixup): Remove.
	(_dl_tlsdesc_resolve_hold_fixup): Likewise.
	(_dl_tlsdesc_resolve_rela): Likewise.
	(_dl_tlsdesc_resolve_hold): Likewise.
2017-11-03 14:43:32 +00:00
Szabolcs Nagy b7cf203b5c aarch64: Disable lazy symbol binding of TLSDESC
Always do TLS descriptor initialization at load time during relocation
processing to avoid barriers at every TLS access. In non-dlopened shared
libraries the overhead of tls access vs static global access is > 3x
bigger when lazy initialization is used (_dl_tlsdesc_return_lazy)
compared to bind-now (_dl_tlsdesc_return) so the barriers dominate tls
access performance.

TLSDESC relocs are in DT_JMPREL which are processed at load time using
elf_machine_lazy_rel which is only supposed to do lightweight
initialization using the DT_TLSDESC_PLT trampoline (the trampoline code
jumps to the entry point in DT_TLSDESC_GOT which does the lazy tlsdesc
initialization at runtime).  This patch changes elf_machine_lazy_rel
in aarch64 to do the symbol binding and initialization as if DF_BIND_NOW
was set, so the non-lazy code path of elf/do-rel.h was replicated.

The static linker could be changed to emit TLSDESC relocs in DT_REL*,
which are processed non-lazily, but the goal of this patch is to always
guarantee bind-now semantics, even if the binary was produced with an
old linker, so the barriers can be dropped in tls descriptor functions.

After this change the synchronizing ldar instructions can be dropped
as well as the lazy initialization machinery including the DT_TLSDESC_GOT
setup.

I believe this should be done on all targets, including ones where no
barrier is needed for lazy initialization.  There is very little gain in
optimizing for large number of symbolic tlsdesc relocations which is an
extremely uncommon case.  And currently the tlsdesc entries are only
readonly protected with -z now and some hardennings against writable
JUMPSLOT relocs don't work for TLSDESC so they are a security hazard.
(But to fix that the static linker has to be changed.)

	* sysdeps/aarch64/dl-machine.h (elf_machine_lazy_rel): Do symbol
	binding and initialization non-lazily for R_AARCH64_TLSDESC.
2017-11-03 14:41:35 +00:00
Szabolcs Nagy 0cc5b022f8 Mark lazy tlsdesc helper functions unused to avoid warnings
These static functions are not needed if a target does not do lazy
tlsdesc initialization.

	* elf/tlsdeschtab.h (_dl_tls_resolve_early_return_p): Mark unused.
	(_dl_tlsdesc_wake_up_held_fixups): Likewise.
2017-11-03 14:40:28 +00:00
Joseph Myers 43ddff2e36 Declare wcstof functions for more _FloatN, _FloatNx types.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch arranges for <wchar.h> to declare wcstof functions
for all such types, similarly to the declarations already present for
_Float128.

Tested for x86_64.

	* wcsmbs/wchar.h [__HAVE_FLOAT16 && __USE_GNU] (wcstof16):
	Declare.
	[__HAVE_FLOAT32 && __USE_GNU] (wcstof32): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (wcstof64): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (wcstof32x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (wcstof64x): Likewise.
	[__HAVE_FLOAT128X && __USE_GNU] (wcstof128x): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (wcstof16_l): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (wcstof32_l): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (wcstof64_l): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (wcstof32x_l): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (wcstof64x_l): Likewise.
	[__HAVE_FLOAT128X && __USE_GNU] (wcstof128x_l): Likewise.
2017-11-02 23:36:00 +00:00
Mike FABIAN 5baac970a8 tpi_PG locale: fix syntax error [BZ #22382]
[BZ #22382]
	* localedata/locales/tpi_PG (LC_TIME): Fix syntax error.
	* localedata/locales/tpi_PG: Add standard header.
2017-11-02 17:38:14 +01:00
Florian Weimer ef11081fed test-errno-linux: quotactl can fail with EPERM in containers
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-02 13:55:51 +01:00
Florian Weimer d10b132bf5 stdio-common: Use array_length and array_end macros 2017-11-02 12:45:20 +01:00
Florian Weimer c94a5688fb <array_length.h>: New array_length and array_end macros 2017-11-02 12:45:20 +01:00
Rafal Luzynski 067f5d97b3 Fix ChangeLog typo
It's been confirmed by the original author: "01-31" should be "10-31".
2017-11-02 12:37:59 +01:00
Florian Weimer 2fac6a6cd5 posix/tst-glob-tilde.c: Add test for bug 22332 2017-11-02 11:06:45 +01:00
Joseph Myers 260fbd0a39 Include bits/cmathcalls.h for more _FloatN, _FloatNx types.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch arranges for <bits/cmathcalls.h> to be included by
<complex.h> for each such type under conditions and with macros
defined corresponding to those used for _Float128.

Tested for x86_64.

	* math/complex.h
	[(__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC))
	&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Include <bits/cmathcalls.h>
	with appropriate macros defined and undefined.
	[(__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC))
	&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
	[(__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC))
	&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
	[(__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC))
	&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
	[(__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC))
	&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
	[(__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC))
	&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
2017-11-01 23:42:31 +00:00
Joseph Myers 2f1b212e54 Clean up complex.h handling of float128.
This patch cleans up the way complex.h handles inclusion of
bits/cmathcalls.h for float128.  The inclusion was between those for
the types float and long double; the patch moves it after that for
long double, matching how bits/mathcalls.h and bits/math-finite.h
inclusions are ordered.  There is no need for the undefine and define
of _Mdouble_complex_ to be conditional, since __CFLOAT128 is always
defined by bits/floatn.h when _Float128 is supported, so the patch
removes the unnecessary conditionals.

Tested for x86_64.

	* math/complex.h
	[(__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !LIBC))
	&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Move conditional code after
	that for long double.  Do not condition define and undefine of
	_Mdouble_complex_ on [__CFLOAT128].
2017-11-01 17:03:58 +00:00
H.J. Lu 95b93c6e0d x86: Add sysdeps/x86/sysdep.h
Add a new header file, sysdeps/x86/sysdep.h, for common assembly code
macros between i386 and x86-64.  Tested on i686 and x86-64.  There are
no differences in outputs of "readelf -a" and "objdump -dw" on all glibc
shared objects before and after the patch.

	* sysdeps/i386/sysdep.h: Include <sysdeps/x86/sysdep.h> instead
	of <sysdeps/generic/sysdep.h>.
	(ALIGNARG): Removed.
	(ASM_SIZE_DIRECTIVE): Likewise.
	(ENTRY): Likewise.
	(END): Likewise.
	(ENTRY_CHK): Likewise.
	(END_CHK): Likewise.
	(syscall_error): Likewise.
	(mcount): Likewise.
	(PSEUDO_END): Likewise.
	(L): Likewise.
	(atom_text_section): Likewise.
	* sysdeps/x86/sysdep.h: New file.
	* sysdeps/x86_64/sysdep.h: Include <sysdeps/x86/sysdep.h> instead
	of <sysdeps/generic/sysdep.h>.
	(ALIGNARG): Removed.
	(ASM_SIZE_DIRECTIVE): Likewise.
	(ENTRY): Likewise.
	(END): Likewise.
	(ENTRY_CHK): Likewise.
	(END_CHK): Likewise.
	(syscall_error): Likewise.
	(mcount): Likewise.
	(PSEUDO_END): Likewise.
	(L): Likewise.
	(atom_text_section): Likewise.
2017-11-01 05:37:26 -07:00
Rafal Luzynski 1bb3653925 localedata: Once again correct and regenerate i18n_ctype.
Following the previous work by Carlos O'Donell the category of LC_CTYPE
is correctly set to "i18n:2012" rather than "unicode:2014" and the
i18n_ctype file is once again regenerated from scratch to make sure it
does not contain any manual additions except the copyright message.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

	* localedata/unicode-gen/gen_unicode_ctype.py (output_head):
	category of LC_CTYPE set to "i18n:2012".
	* localedata/locales/i18n_ctype: Regenerate.
2017-10-31 23:54:47 +01:00
Yury Norov 87bbc4cf1e Remove useless #ifdefs from Linux sig*.c syscalls
sigprocmask.c, sigtimedwait.c, sigwait.c and sigwaitinfo.c files from
sysdeps/unix/sysv/linux include nptl-signals.h via nptl/pthreadP.h,
and so SIGCANCEL and SIGSETXID become defined unconditionally. But
later in the code, there are some checks weither symbols defined,
which is useless. This patch removes useless checks.

Checked on x86_64-linux-gnu.

	* sysdeps/unix/sysv/linux/sigprocmask.c: Remove useless #ifdefs.
	* sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.
	* sysdeps/unix/sysv/linux/sigwait.c: Likewise.
	* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Reviewed-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-10-31 17:49:18 -02:00
Yury Norov e8681faa01 Consolidate Linux sigpending() implementation
ia64, s390-64, sparc64 and x86_64 host their own implementation of
sigpending() in corresponding files, but they are identical to generic
linux file despite few comments. This patch removes that files, so the
implementation of sigpending() is taken from sysdeps/unix/sysv/linux
for all ports.

Build-tested on x86_64.

	* sysdeps/unix/sysv/linux/ia64/sigpending.c: Remove file.
	* sysdeps/unix/sysv/linux/s390/s390-64/sigpending.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sigpending.c: Likewise.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-10-31 17:49:11 -02:00
Joseph Myers 43e662837c Define CMPLX macros for more _FloatN, _FloatNx types.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch defines CMPLX* macros for all such types, as
already done for _Float128.

Tested for x86_64.

	* math/complex.h
	[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (CMPLXF16):
	New macro.
	[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (CMPLXF32):
	Likewise.
	[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (CMPLXF64):
	Likewise.
	[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(CMPLXF32X): Likewise.
	[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(CMPLXF64X): Likewise.
	[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(CMPLXF128X): Likewise.
2017-10-31 17:04:30 +00:00
Joseph Myers 540af6e2f1 Adjust __MATH_EVAL_FMT2 definition to handle _Float16 better.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch adds an additional case in the definition of
__MATH_EVAL_FMT2, as used in defining iseqsig: when
__FLT_EVAL_METHOD__ is 0 or 32, it adds 0.0f to the arguments, so that
the correct function would be selected in the case of _Float16
arguments with excess precision (were glibc to support _Float16, which
of course __MATH_TG and other facilities do not at present - and
_Float16 support is not part of what this patch series is aiming for,
but this particular fix is simple so is included anyway).

Tested for x86_64.

	* math/math.h
	[__FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 32]
	(__MATH_EVAL_FMT2): Define to add 0.0f.
2017-10-31 16:01:51 +00:00
Alan Modra 58af72b4e2 [PowerPC64] sysdep.h doesn't need to be included in multiarch files
When the .c/.S file neither uses nor modifies macros defined in
sysdep.h there is no point to #include it.  The same goes for
math_ldbl_opt.h except that it includes shlib-compat.h, and if
compat_symbol is redefined we need to include shlib-compat.h first.

	* sysdeps/powerpc/powerpc64/fpu/multiarch/e_expf-power8.S: Don't
	include sysdep.h.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_cosf-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_sinf-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memchr-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memchr-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memmove-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memrchr-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memrchr-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memset-power4.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memset-power6.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memset-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/memset-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/rawmemchr-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/stpcpy-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/stpncpy-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strchr-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strchr-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strchr-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strchrnul-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strchrnul-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcmp-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcpy-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strcspn-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strlen-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strlen-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncase-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncpy-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncpy-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strnlen-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strnlen-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strrchr-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strspn-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strstr-power7.S: Likewise.

	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S: Don't
	include sysdep.h and math_ldbl_opt.h.

	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S: Don't
	include sysdep.h and math_ldbl_opt.h.  Include shlib-compat.h.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S: Likewise.
2017-10-31 12:27:19 +10:30
Alan Modra 112f30b3f1 [PowerPC64] strncase_l-power7.c should use strncase_l.c
This is another one where we'll be wanting the base symbols for
powerpc64le rather than just a power7 variant.

	* sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c: Include
	string/strncase_l.c, not string/strncase.c.
	(USE_IN_EXTENDED_LOCALE_MODEL): Don't define.
	(libc_hidden_def): Redefine.
2017-10-31 12:27:19 +10:30
Alan Modra e9e7eced01 [PowerPC64] Tidy strcasecmp_l-power7.S symbols
The routine being assembled here is strcasecmp_l, so ask for that via
__STRCMP and STRCMP defines.  That change means tweaking the power7
override.  Needed for later powerpc64le changes where we want the base
symbols, not just a power7 variant.

	* sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S:
	(__STRCMP, STRCMP, __strcasecmp_l): Define.
	(__strcasecmp): Don't define.
2017-10-31 12:27:19 +10:30
Alan Modra f7b465cfcb [PowerPC64] Wrap str{,n}cmp-power{8,9}.S in IS_IN(libc)
These functions aren't used in ld.so at the moment since we don't have
strcmp or strncmp ifuncs for them there.  Remove the ld.so bloat.

	* sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S: Wrap in
	IS_IN (libc).
	* sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S: Likewise.
	* sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S: Likewise.
2017-10-31 12:27:19 +10:30
Alan Modra d46b09f988 [PowerPC64] Remove duplicate define in stpncpy-power8.S
USE_AS_STPNCPY is defined by sysdeps/powerpc/powerpc64/power8/stpncpy.S,
included by this file.

	* sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S: Don't define
	USE_AS_STPNCPY.
2017-10-31 12:27:19 +10:30
Alan Modra e9b8e19419 [PowerPC64] Don't define __GI_ variant of isnan for static lib
It seems to me that libc.a should not contain any of the __GI_
symbols, and certainly --enable-multi-arch ought to not add to the
list.  At the end of this patch series we have the following in both
--enable-multi-arch and --disable-multi-arch libc.a:
0000000000000000 T __GI___readdir64
0000000000000000 T __GI___fxstatat64
0000000000000000 T __GI_getrlimit
0000000000000000 T __GI___getrlimit

	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S (hidden_def):
	Redefine only when SHARED.
2017-10-31 12:27:19 +10:30
Joseph Myers b61afe8c81 Include bits/math-finite.h for more _FloatN, _FloatNx types.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch extends the includes of <bits/math-finite.h> to
cover all such types, under conditions analogous to those for
_Float128.

Tested for x86_64.

	* math/math.h [__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC)]:
	Include <bits/math-finite.h> with appropriate macros defined and
	undefined.
	[__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC)]: Likewise.
	[__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC)]: Likewise.
	[__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC)]: Likewise.
	[__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC)]: Likewise.
	[__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC)]: Likewise.
2017-10-30 22:15:40 +00:00
Joseph Myers eda162dd8a Remove _Mlong_double_ etc. macros.
math.h has a macro _Mlong_double_ for the type to use when declaring
long double functions, and similar macros for other types.
math/Makefile uses -D_Mlong_double_=double in the case of long double
having the same ABI as double.

This originates with:

Mon Jul  8 13:37:40 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

        * math/math.h (_Mfloat_, _Mlong_double_): New macros, defined iff not
        already defined to float, long double.  Use those macros for _Mdouble_
        defns when including mathcalls.h.
        * math/Makefile [$(long-double-fcts) != yes] (CPPFLAGS): Append
        -D_Mlong_double_=double.

However, math.h stopped declaring long double functions in the case of
long double having the same ABI as double (and thus probably stopped
actually needing the Makefile definition of _Mlong_double_) with:

1998-11-05  Ulrich Drepper  <drepper@cygnus.com>

        * math/math.h: Unconditionally include bits/mathdef.h.  Declare
        long double functions only if __NO_LONG_DOUBLE_MATH is not
        defined.
        * sysdeps/generic/bits/mathdef.h: Define only if __USE_ISOC9X.
        Define __NO_LONG_DOUBLE_MATH.
        * sysdeps/m68k/fpu/bits/mathdef.h: Define only if __USE_ISOC9X.
        * sysdeps/i386/fpu/bits/mathdef.h: Likewise.

The declarations were since restored for compiling user code, but
remain absent when _LIBC is defined, which is sufficient to avoid
problems declaring function aliases of incompatible types.  Thus the
indirection through the _Mlong_double_ macro is not needed (probably
since that 1998 patch), and this patch removes _Mlong_double_ and
associated macros for other types, leaving only the macro _Mdouble_
which is actually used as the type for which a given inclusion of
<bits/mathcalls.h> should declared functions.

Tested for x86_64, and tested with build-many-glibcs.py that installed
stripped shared libraries are unchanged by this patch.

	* math/math.h [!_Mfloat_] (_Mfloat_): Do not define.
	[!_Mlong_double_] (_Mlong_double_): Likewise.
	[!_Mfloat16_] (_Mfloat16_): Likewise.
	[!_Mfloat32_] (_Mfloat32_): Likewise.
	[!_Mfloat64_] (_Mfloat64_): Likewise.
	[!_Mfloat128_] (_Mfloat128_): Likewise.
	[!_Mfloat32x_] (_Mfloat32x_): Likewise.
	[!_Mfloat64x_] (_Mfloat64x_): Likewise.
	[!_Mfloat128x_] (_Mfloat128x_): Likewise.
	(_Mdouble_): Define without indirection through those macros.
	* math/complex.h [!_Mfloat_] (_Mfloat_): Do not define.
	[!_Mfloat128_] (_Mfloat128_): Likewise.
	[_Mlong_double_] (_Mlong_double_): Likewise.
	(_Mdouble_): Define without indirection through those macros.
	* math/Makefile [$(long-double-fcts) != yes] (math-CPPFLAGS): Do
	not add -D_Mlong_double_=double.
	* include/math.h [_ISOMAC] (_Mlong_double_): Do not undefine.
	* math/test-signgam-finite-c99.c (_Mlong_double_): Likewise.
2017-10-30 20:58:51 +00:00
H.J. Lu 4ad5106e3b sysdeps/x86/libc-start.c: Add /* !SHARED */
* sysdeps/x86/libc-start.c: Add /* !SHARED */.
2017-10-30 13:40:28 -07:00
H.J. Lu fe326df7b0 Reformat sysdeps/x86/libc-start.c
* sysdeps/x86/libc-start.c: Reformat.
2017-10-30 13:01:18 -07:00
H.J. Lu c5cc45148c i586: Use conditional branches in strcpy.S [BZ #22353]
i586 strcpy.S used a clever trick with LEA to implement jump table:

/* ECX has the last 2 bits of the address of source - 1.  */
	andl	$3, %ecx

        call    2f
2:      popl    %edx
	/* 0xb is the distance between 2: and 1:.  */
        leal    0xb(%edx,%ecx,8), %ecx
        jmp     *%ecx

        .align 8
1:  /* ECX == 0 */
        orb     (%esi), %al
        jz      L(end)
        stosb
        xorl    %eax, %eax
        incl    %esi
    /* ECX == 1 */
        orb     (%esi), %al
        jz      L(end)
        stosb
        xorl    %eax, %eax
        incl    %esi
    /* ECX == 2 */
        orb     (%esi), %al
        jz      L(end)
        stosb
        xorl    %eax, %eax
        incl    %esi
    /* ECX == 3 */
L(1):   movl    (%esi), %ecx
        leal    4(%esi),%esi

This fails if there are instruction length changes before L(1):.  This
patch replaces it with conditional branches:

	cmpb	$2, %cl
	je	L(Src2)
	ja	L(Src3)
	cmpb	$1, %cl
	je	L(Src1)

L(Src0):

which have similar performance and work with any instruction lengths.

Tested on i586 and i686 with and without --disable-multi-arch.

	[BZ #22353]
	* sysdeps/i386/i586/strcpy.S (STRCPY): Use conditional branches.
	(1): Renamed to ...
	(L(Src0)): This.
	(L(Src1)): New.
	(L(Src2)): Likewise.
	(L(1)): Renamed to ...
	(L(Src3)): This.
2017-10-30 10:02:30 -07:00
Joseph Myers ce12269fac Add _FloatN, _FloatNx M_* constants.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch adds M_* constants for such types.  The decimal
expansions used are all the same as used for _Float128; there's no
need to reduce the precision used.  In the case of _Float128x, #error
is used because the constants would need additional precision, but how
much is needed would depend on the actual _Float128x format used, so
it's not possible to add header support simply as part of code that
handles all _FloatN / _FloatNx types similarly.

Tested for x86_64.

	* math/math.h [__HAVE_FLOAT16 && __USE_GNU] (M_Ef16): New macro.
	[__HAVE_FLOAT16 && __USE_GNU] (M_LOG2Ef16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_LOG10Ef16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_LN2f16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_LN10f16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_PIf16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_PI_2f16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_PI_4f16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_1_PIf16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_2_PIf16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_2_SQRTPIf16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_SQRT2f16): Likewise.
	[__HAVE_FLOAT16 && __USE_GNU] (M_SQRT1_2f16): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_Ef32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_LOG2Ef32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_LOG10Ef32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_LN2f32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_LN10f32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_PIf32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_PI_2f32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_PI_4f32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_1_PIf32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_2_PIf32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_2_SQRTPIf32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_SQRT2f32): Likewise.
	[__HAVE_FLOAT32 && __USE_GNU] (M_SQRT1_2f32): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_Ef64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_LOG2Ef64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_LOG10Ef64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_LN2f64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_LN10f64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_PIf64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_PI_2f64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_PI_4f64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_1_PIf64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_2_PIf64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_2_SQRTPIf64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_SQRT2f64): Likewise.
	[__HAVE_FLOAT64 && __USE_GNU] (M_SQRT1_2f64): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_Ef32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_LOG2Ef32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_LOG10Ef32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_LN2f32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_LN10f32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_PIf32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_PI_2f32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_PI_4f32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_1_PIf32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_2_PIf32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_2_SQRTPIf32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_SQRT2f32x): Likewise.
	[__HAVE_FLOAT32X && __USE_GNU] (M_SQRT1_2f32x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_Ef64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_LOG2Ef64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_LOG10Ef64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_LN2f64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_LN10f64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_PIf64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_PI_2f64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_PI_4f64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_1_PIf64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_2_PIf64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_2_SQRTPIf64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_SQRT2f64x): Likewise.
	[__HAVE_FLOAT64X && __USE_GNU] (M_SQRT1_2f64x): Likewise.
	[__HAVE_FLOAT128X && __USE_GNU]: Use #error.
2017-10-30 16:42:28 +00:00
Florian Weimer 4484b9e296 Assume that _DIRENT_HAVE_D_TYPE is always defined.
References remain in io/fts.c, io/ftw.c, posix/glob.c,
sysdeps/posix/getcwd.c.  These files are (potentially) externally
shared.
2017-10-30 15:48:33 +01:00
Florian Weimer 68fe16dd32 ffsl, ffsll: Declare under __USE_MISC, not just __USE_GNU
Recent BSDs declare these functions, too.
2017-10-30 13:59:59 +01:00