]> sourceware.org Git - glibc.git/log
glibc.git
6 years agoUes libm_alias_double for various powerpc functions.
Joseph Myers [Fri, 1 Dec 2017 23:09:47 +0000 (23:09 +0000)]
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.

6 years agoUse libm_alias_double for powerpc fabs, fma.
Joseph Myers [Fri, 1 Dec 2017 22:23:28 +0000 (22:23 +0000)]
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.

6 years agoUpdate NEWS to add CVE-2017-15804 entry
Aurelien Jarno [Fri, 1 Dec 2017 20:53:51 +0000 (21:53 +0100)]
Update NEWS to add CVE-2017-15804 entry

6 years agopowerpc: Regenerate ULPs
Gabriel F. T. Gomes [Fri, 17 Nov 2017 20:20:42 +0000 (18:20 -0200)]
powerpc: Regenerate ULPs

On POWER9, cbrtf128 fails by 1 ULP.

* sysdeps/powerpc/fpu/libm-test-ulps: Regenerate.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
6 years agox32: Remove unused getcpu implementation
Adhemerval Zanella [Sat, 14 Oct 2017 10:55:54 +0000 (07:55 -0300)]
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>
6 years agosparc: Remove ununsed ifunc assembly macros
Adhemerval Zanella [Fri, 13 Oct 2017 16:47:36 +0000 (13:47 -0300)]
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>
6 years agosparc: Fix sparv9 multiarch build
Adhemerval Zanella [Fri, 1 Dec 2017 17:43:45 +0000 (15:43 -0200)]
sparc: Fix sparv9 multiarch build

Fix build caused by 5b4e5e78690c4938de312a8b176f4b14eb7bea4a.

* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.c: Fix build
due redirect macro.

6 years agointl: create target directory for bison
Andreas Schwab [Fri, 1 Dec 2017 13:37:57 +0000 (14:37 +0100)]
intl: create target directory for bison

6 years agosparc: refactor cpu_relax to C
Adhemerval Zanella [Sat, 14 Oct 2017 12:47:08 +0000 (09:47 -0300)]
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>
6 years agosparc: refactor sparc32 nearbyint{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 19:11:33 +0000 (16:11 -0300)]
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>
6 years agosparc: refactor sparc32 rint{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 19:05:24 +0000 (16:05 -0300)]
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>
6 years agosparc: refactor sparc32 llrint{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 19:00:36 +0000 (16:00 -0300)]
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>
6 years agosparc: refactor sparc32 fabs{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 18:49:25 +0000 (15:49 -0300)]
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>
6 years agosparc: refactor sparc32 copysign selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 18:34:33 +0000 (15:34 -0300)]
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>
6 years agois_IS locale: Base collation on iso14651_t1 [BZ #22519]
Mike FABIAN [Fri, 1 Dec 2017 12:45:51 +0000 (13:45 +0100)]
is_IS locale: Base collation on iso14651_t1 [BZ #22519]

6 years agoUse libm_alias_float for e500.
Joseph Myers [Fri, 1 Dec 2017 01:12:42 +0000 (01:12 +0000)]
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.

6 years agomips: Don't use MIN in dl-machine.h
H.J. Lu [Fri, 1 Dec 2017 00:33:59 +0000 (16:33 -0800)]
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.

6 years agoUse libm_alias_float for coldfire.
Joseph Myers [Thu, 30 Nov 2017 23:52:35 +0000 (23:52 +0000)]
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.

6 years agoUse libm_alias_double for coldfire.
Joseph Myers [Thu, 30 Nov 2017 23:47:18 +0000 (23:47 +0000)]
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.

6 years agoRework m68k libm functions to use declare_mgen_alias.
Joseph Myers [Thu, 30 Nov 2017 22:39:07 +0000 (22:39 +0000)]
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.

6 years agoRemove scripts/update-copyrights handling of intl/plural.c.
Joseph Myers [Thu, 30 Nov 2017 21:25:25 +0000 (21:25 +0000)]
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.

6 years agoplural.c: improve reproducibility
Juro Bystricky [Thu, 30 Nov 2017 21:21:15 +0000 (21:21 +0000)]
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.

6 years agoUse libm_alias macros in m68k llrint functions.
Joseph Myers [Thu, 30 Nov 2017 19:15:21 +0000 (19:15 +0000)]
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.

6 years agoUse declare_mgen_alias in m68k templates.
Joseph Myers [Thu, 30 Nov 2017 19:03:57 +0000 (19:03 +0000)]
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.

6 years agosparc: refactor sparc64 __mpn_add_n selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 18:01:58 +0000 (15:01 -0300)]
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>
6 years agosparc: refactor sparc64 __mpn_submul_1 selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 17:59:09 +0000 (14:59 -0300)]
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>
6 years agosparc: refactor sparc64 __mpn_addmul_1 selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 17:56:29 +0000 (14:56 -0300)]
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>
6 years agosparc: refactor sparc64 __mpn_sub_n selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 17:53:13 +0000 (14:53 -0300)]
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>
6 years agosparc: refactor sparc64 __mpn_mul_1 selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 17:52:51 +0000 (14:52 -0300)]
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>
6 years agosr_RS and bs_BA locales: make collation rules the same as for hr_HR [BZ #22534]
Mike FABIAN [Thu, 30 Nov 2017 14:57:25 +0000 (15:57 +0100)]
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"”.

6 years agohr_HR locale: fix collation and expand collation test file
Mike FABIAN [Thu, 30 Nov 2017 11:13:02 +0000 (12:13 +0100)]
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.

6 years agoFix test case for hr_HR monetary formatting
Mike FABIAN [Thu, 30 Nov 2017 09:50:44 +0000 (10:50 +0100)]
Fix test case for hr_HR monetary formatting

* stdlib/tst-strfmon_l.c: Fix testcase. Needed because of [BZ #10580]

6 years agoAdd test case for collation in hr_HR locale
Dragan Stanojević - Nevidljivi [Thu, 30 Nov 2017 09:02:55 +0000 (10:02 +0100)]
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.

6 years agohr_HR locale: various updates [BZ #10580]
Dragan Stanojević - Nevidljivi [Thu, 30 Nov 2017 08:14:51 +0000 (09:14 +0100)]
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

6 years agox86: Make a space in jmpbuf for shadow stack pointer
H.J. Lu [Thu, 30 Nov 2017 12:49:25 +0000 (04:49 -0800)]
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.

6 years agoFix integer overflow in malloc when tcache is enabled [BZ #22375]
Arjun Shankar [Thu, 30 Nov 2017 12:31:45 +0000 (13:31 +0100)]
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.

6 years agoRemove SPARC lllrint aliases.
Joseph Myers [Thu, 30 Nov 2017 00:43:28 +0000 (00:43 +0000)]
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.

6 years agoUse libm_alias_float for sparc.
Joseph Myers [Thu, 30 Nov 2017 00:30:40 +0000 (00:30 +0000)]
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.

6 years agoUse libm_alias_double for sparc.
Joseph Myers [Wed, 29 Nov 2017 23:40:07 +0000 (23:40 +0000)]
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.

6 years agoFix missing sparcv9 --disable-multi-arch fabsl compat symbol (bug 22229).
Joseph Myers [Wed, 29 Nov 2017 23:09:03 +0000 (23:09 +0000)]
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.

6 years agoAdd SPARC --disable-multi-arch builds to build-many-glibcs.py.
Joseph Myers [Wed, 29 Nov 2017 22:51:46 +0000 (22:51 +0000)]
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.

6 years agoUse libm_alias_float for x86_64.
Joseph Myers [Wed, 29 Nov 2017 21:25:41 +0000 (21:25 +0000)]
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.

6 years agoUse libm_alias_double for x86_64.
Joseph Myers [Wed, 29 Nov 2017 19:01:21 +0000 (19:01 +0000)]
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.

6 years agosparc: refactor sparc64 rint{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 16:42:07 +0000 (13:42 -0300)]
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>
6 years agosparc: refactor sparc64 lrint{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 16:20:00 +0000 (13:20 -0300)]
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>
6 years agosparc: refactor sparc64 nearbyint{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 15:00:28 +0000 (12:00 -0300)]
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>
6 years agosparc: refactor sparc64 finite{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 14:48:57 +0000 (11:48 -0300)]
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>
6 years agosparc: refactor sparc64 isinf{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 14:39:43 +0000 (11:39 -0300)]
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>
6 years agosparc: refactor sparc64 isnan{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 14:28:55 +0000 (11:28 -0300)]
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>
6 years agosparc: refactor sparc64 signbit{f} selector to C
Adhemerval Zanella [Fri, 13 Oct 2017 12:56:49 +0000 (09:56 -0300)]
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>
6 years agoUse libm_alias_float for ia64.
Joseph Myers [Wed, 29 Nov 2017 17:38:35 +0000 (17:38 +0000)]
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.

6 years agoCollation fix: make forward accent sorting the default [BZ #17750]
Alexandre Oliva [Tue, 28 Nov 2017 15:23:02 +0000 (16:23 +0100)]
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>

6 years agosparc: Assume VIS3 support
Adhemerval Zanella [Thu, 12 Oct 2017 22:43:50 +0000 (19:43 -0300)]
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>
6 years agoUse libm_alias_double for ia64.
Joseph Myers [Wed, 29 Nov 2017 01:23:23 +0000 (01:23 +0000)]
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.

6 years agoFix gmon static test failures.
John David Anglin [Wed, 29 Nov 2017 01:01:05 +0000 (20:01 -0500)]
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.

6 years agoUse libm_alias_float for i386.
Joseph Myers [Wed, 29 Nov 2017 00:10:35 +0000 (00:10 +0000)]
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.

6 years agoUse libm_alias_double for i386.
Joseph Myers [Tue, 28 Nov 2017 18:15:44 +0000 (18:15 +0000)]
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.

6 years agoProperly compute offsets of note descriptor and next note [BZ #22370]
H.J. Lu [Tue, 28 Nov 2017 17:56:47 +0000 (09:56 -0800)]
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.

6 years agoUse libm_alias_float for s390.
Joseph Myers [Tue, 28 Nov 2017 17:34:13 +0000 (17:34 +0000)]
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.

6 years agoUse libm_alias_double for s390.
Joseph Myers [Tue, 28 Nov 2017 17:18:20 +0000 (17:18 +0000)]
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.

6 years agoAdd the Changelog entry for “cs_CZ locale: Base collation on iso14651_t1 [BZ #22336]”
Mike FABIAN [Tue, 28 Nov 2017 15:42:13 +0000 (16:42 +0100)]
Add the Changelog entry for “cs_CZ locale: Base collation on iso14651_t1 [BZ #22336]”

6 years agolocaledata: Remove duplicate cs_CZ from LOCALES
Siddhesh Poyarekar [Tue, 28 Nov 2017 14:34:31 +0000 (20:04 +0530)]
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.

6 years agobenchtests: Enable BENCHSET to run subset of tests
Victor Rodriguez [Tue, 28 Nov 2017 14:27:46 +0000 (19:57 +0530)]
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>
6 years agobenchtests: Expand range of tests names in schema.json
Victor Rodriguez [Tue, 28 Nov 2017 14:22:57 +0000 (19:52 +0530)]
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>
6 years agobenchtests: Adjust valid and accepted properties
Victor Rodriguez [Tue, 28 Nov 2017 14:19:59 +0000 (19:49 +0530)]
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>
6 years agoposix: Make tst-getaddrinfo[45] xtests due to DNS dependency [BZ #20826]
Florian Weimer [Tue, 28 Nov 2017 11:20:01 +0000 (12:20 +0100)]
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.

6 years agosparc: Implement memset/bzero ifunc selection in C
Adhemerval Zanella [Tue, 3 Oct 2017 13:58:29 +0000 (10:58 -0300)]
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>
6 years agosparc: Implement memcpy/mempcpy ifunc selection in C
Adhemerval Zanella [Tue, 3 Oct 2017 03:48:27 +0000 (00:48 -0300)]
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>
6 years agocs_CZ locale: Base collation on iso14651_t1 [BZ #22336]
Mike FABIAN [Fri, 24 Nov 2017 09:47:18 +0000 (15:17 +0530)]
cs_CZ locale: Base collation on iso14651_t1 [BZ #22336]

[BZ #22336]
* localedata/locales/cs_CZ (LC_COLLATE): Use “copy "iso14651_t1"”
and implement the collation rules for cs from CLDR on top of that.
* Makefile: Add cs_CZ.UTF-8 to test-input and to the list
of locales to be built for testing.
* cs_CZ.UTF-8.in: New file with test data to test the Czech sorting.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
6 years agoUse libm_alias_float for alpha.
Joseph Myers [Tue, 28 Nov 2017 01:19:03 +0000 (01:19 +0000)]
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.

6 years agoUse libm_alias_float for aarch64.
Joseph Myers [Tue, 28 Nov 2017 00:55:42 +0000 (00:55 +0000)]
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.

6 years agoUse libm_alias_double for alpha.
Joseph Myers [Tue, 28 Nov 2017 00:07:56 +0000 (00:07 +0000)]
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.

6 years agoSupport ldbl-opt libm_alias_double use from .S files.
Joseph Myers [Tue, 28 Nov 2017 00:01:11 +0000 (00:01 +0000)]
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.

6 years agoUse libm_alias_double for aarch64.
Joseph Myers [Mon, 27 Nov 2017 23:54:32 +0000 (23:54 +0000)]
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.

6 years agoImplement the mlock2 function
Florian Weimer [Mon, 27 Nov 2017 16:14:29 +0000 (17:14 +0100)]
Implement the mlock2 function

Fallback using mlock is provided if the flags argument is zero.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoAdd _Float64x function aliases.
Joseph Myers [Mon, 27 Nov 2017 14:16:47 +0000 (14:16 +0000)]
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.

6 years agoConsolidate link map sorting
Andreas Schwab [Tue, 7 Nov 2017 14:24:19 +0000 (15:24 +0100)]
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.

6 years agoUse libm_alias_float128 more in sysdeps/ieee754/float128.
Joseph Myers [Fri, 24 Nov 2017 23:53:54 +0000 (23:53 +0000)]
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.

6 years agoUse -mfloat128 for _Float64x tests for powerpc64le.
Joseph Myers [Fri, 24 Nov 2017 23:38:51 +0000 (23:38 +0000)]
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.

6 years agoSupport _Float64x in libm_alias macros.
Joseph Myers [Fri, 24 Nov 2017 23:33:14 +0000 (23:33 +0000)]
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.

6 years agoSupport strfromf64x alias.
Joseph Myers [Fri, 24 Nov 2017 23:12:30 +0000 (23:12 +0000)]
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.

6 years agoSupport strtof64x, wcstof64x aliases.
Joseph Myers [Fri, 24 Nov 2017 22:51:53 +0000 (22:51 +0000)]
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].

6 years agoSupport testing _Float64x libm functions.
Joseph Myers [Fri, 24 Nov 2017 22:25:03 +0000 (22:25 +0000)]
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)).

6 years agoMake min_of_type_ macros function-like.
Joseph Myers [Fri, 24 Nov 2017 22:03:35 +0000 (22:03 +0000)]
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.

6 years agoDefine __STDC_WANT_IEC_60559_TYPES_EXT__ in tst-strtod-round-skeleton.c.
Joseph Myers [Fri, 24 Nov 2017 21:42:55 +0000 (21:42 +0000)]
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.

6 years agoFix gen-tgmath-tests.py for _Float64, _Float64x testing.
Joseph Myers [Fri, 24 Nov 2017 21:22:34 +0000 (21:22 +0000)]
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.

6 years agoHandle more _FloatN, _FloatNx types in bits/libm-simd-decl-stubs.h.
Joseph Myers [Fri, 24 Nov 2017 21:11:37 +0000 (21:11 +0000)]
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.

6 years agoMove wcstof128 symbol versions to wcsmbs/Versions.
Joseph Myers [Fri, 24 Nov 2017 18:38:45 +0000 (18:38 +0000)]
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>.

6 years agoLinux: Introduce <bits/mman-shared.h>
Florian Weimer [Fri, 24 Nov 2017 16:55:59 +0000 (17:55 +0100)]
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>
6 years agoposix: Fix generic p{read,write}v buffer allocation (BZ#22457)
Adhemerval Zanella [Wed, 22 Nov 2017 20:02:20 +0000 (18:02 -0200)]
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.

6 years agopl_PL locale: Base collation on iso14651_t1
Mike FABIAN [Mon, 20 Nov 2017 12:25:33 +0000 (17:55 +0530)]
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.

6 years agoUse libm_alias_ldouble macros in sysdeps/ia64/fpu.
Joseph Myers [Thu, 23 Nov 2017 23:34:54 +0000 (23:34 +0000)]
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.

6 years agomalloc: Call tcache destructor in arena_thread_freeres
Florian Weimer [Thu, 23 Nov 2017 13:47:31 +0000 (14:47 +0100)]
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>
6 years agonss: Export nscd hash function as __nss_hash [BZ #22459]
Florian Weimer [Thu, 23 Nov 2017 13:08:11 +0000 (14:08 +0100)]
nss: Export nscd hash function as __nss_hash [BZ #22459]

6 years agosigwait: Do not fail with EINTR and return error code [BZ #22478]
Florian Weimer [Thu, 23 Nov 2017 10:20:53 +0000 (11:20 +0100)]
sigwait: Do not fail with EINTR and return error code [BZ #22478]

Since

commit 8b0e795aaa445e9167aa07b282c5720b35342c07
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>
6 years agoLinux: Add memfd_create system call wrapper
Florian Weimer [Thu, 23 Nov 2017 09:00:40 +0000 (10:00 +0100)]
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>
6 years agoFix typo in variable name in gen-locale.sh.
Joseph Myers [Wed, 22 Nov 2017 23:42:40 +0000 (23:42 +0000)]
Fix typo in variable name in gen-locale.sh.

* localedata/gen-locale.sh: Fix typo in variable name.

6 years agoObsolete p_secstodate.
Joseph Myers [Wed, 22 Nov 2017 22:21:10 +0000 (22:21 +0000)]
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.

6 years agoFix p_secstodate overflow handling (bug 22463).
Joseph Myers [Wed, 22 Nov 2017 22:12:07 +0000 (22:12 +0000)]
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.

6 years agoRemove unused sparc64/soft-fp libm function implementations.
Joseph Myers [Wed, 22 Nov 2017 21:11:00 +0000 (21:11 +0000)]
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.

This page took 0.109524 seconds and 5 git commands to generate.