]> sourceware.org Git - glibc.git/log
glibc.git
6 years ago[BZ #17078] arm: remove prelinker support for R_ARM_TLS_DESC
Szabolcs Nagy [Fri, 20 Oct 2017 16:10:50 +0000 (17:10 +0100)]
[BZ #17078] arm: remove prelinker support for R_ARM_TLS_DESC

This patch reverts

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

    [BZ #17078] ARM: R_ARM_TLS_DESC prelinker support

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

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

[BZ #17078]
* sysdeps/arm/dl-machine.h (elf_machine_rela): Remove the
R_ARM_TLS_DESC case.
(elf_machine_lazy_rel): Remove the prelink check.

6 years agoaarch64: Remove barriers from TLS descriptor functions
Szabolcs Nagy [Wed, 27 Sep 2017 17:14:21 +0000 (18:14 +0100)]
aarch64: Remove barriers from TLS descriptor functions

Remove ldar synchronization and most lazy TLSDESC initialization
related code.

* sysdeps/aarch64/dl-machine.h (elf_machine_runtime_setup): Remove
DT_TLSDESC_GOT initialization.
* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_return_lazy): Remove.
(_dl_tlsdesc_resolve_rela): Likewise.
(_dl_tlsdesc_resolve_hold): Likewise.
(_dl_tlsdesc_undefweak): Remove ldar.
(_dl_tlsdesc_dynamic): Likewise.
* sysdeps/aarch64/dl-tlsdesc.h (_dl_tlsdesc_return_lazy): Remove.
(_dl_tlsdesc_resolve_rela): Likewise.
(_dl_tlsdesc_resolve_hold): Likewise.
* sysdeps/aarch64/tlsdesc.c (_dl_tlsdesc_resolve_rela_fixup): Remove.
(_dl_tlsdesc_resolve_hold_fixup): Likewise.
(_dl_tlsdesc_resolve_rela): Likewise.
(_dl_tlsdesc_resolve_hold): Likewise.

6 years agoaarch64: Disable lazy symbol binding of TLSDESC
Szabolcs Nagy [Wed, 27 Sep 2017 15:55:14 +0000 (16:55 +0100)]
aarch64: Disable lazy symbol binding of TLSDESC

Always do TLS descriptor initialization at load time during relocation
processing to avoid barriers at every TLS access. In non-dlopened shared
libraries the overhead of tls access vs static global access is > 3x
bigger when lazy initialization is used (_dl_tlsdesc_return_lazy)
compared to bind-now (_dl_tlsdesc_return) so the barriers dominate tls
access performance.

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

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

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

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

* sysdeps/aarch64/dl-machine.h (elf_machine_lazy_rel): Do symbol
binding and initialization non-lazily for R_AARCH64_TLSDESC.

6 years agoMark lazy tlsdesc helper functions unused to avoid warnings
Szabolcs Nagy [Mon, 23 Oct 2017 11:15:40 +0000 (12:15 +0100)]
Mark lazy tlsdesc helper functions unused to avoid warnings

These static functions are not needed if a target does not do lazy
tlsdesc initialization.

* elf/tlsdeschtab.h (_dl_tls_resolve_early_return_p): Mark unused.
(_dl_tlsdesc_wake_up_held_fixups): Likewise.

6 years agoDeclare wcstof functions for more _FloatN, _FloatNx types.
Joseph Myers [Thu, 2 Nov 2017 23:36:00 +0000 (23:36 +0000)]
Declare wcstof functions for more _FloatN, _FloatNx types.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch arranges for <wchar.h> to declare wcstof functions
for all such types, similarly to the declarations already present for
_Float128.

Tested for x86_64.

* wcsmbs/wchar.h [__HAVE_FLOAT16 && __USE_GNU] (wcstof16):
Declare.
[__HAVE_FLOAT32 && __USE_GNU] (wcstof32): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (wcstof64): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (wcstof32x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (wcstof64x): Likewise.
[__HAVE_FLOAT128X && __USE_GNU] (wcstof128x): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (wcstof16_l): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (wcstof32_l): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (wcstof64_l): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (wcstof32x_l): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (wcstof64x_l): Likewise.
[__HAVE_FLOAT128X && __USE_GNU] (wcstof128x_l): Likewise.

6 years agotpi_PG locale: fix syntax error [BZ #22382]
Mike FABIAN [Thu, 2 Nov 2017 12:21:01 +0000 (13:21 +0100)]
tpi_PG locale: fix syntax error [BZ #22382]

[BZ #22382]
* localedata/locales/tpi_PG (LC_TIME): Fix syntax error.
* localedata/locales/tpi_PG: Add standard header.

6 years agotest-errno-linux: quotactl can fail with EPERM in containers
Florian Weimer [Thu, 2 Nov 2017 12:55:51 +0000 (13:55 +0100)]
test-errno-linux: quotactl can fail with EPERM in containers

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agostdio-common: Use array_length and array_end macros
Florian Weimer [Thu, 2 Nov 2017 11:14:51 +0000 (12:14 +0100)]
stdio-common: Use array_length and array_end macros

6 years ago<array_length.h>: New array_length and array_end macros
Florian Weimer [Thu, 2 Nov 2017 11:14:01 +0000 (12:14 +0100)]
<array_length.h>: New array_length and array_end macros

6 years agoFix ChangeLog typo
Rafal Luzynski [Thu, 2 Nov 2017 11:37:59 +0000 (12:37 +0100)]
Fix ChangeLog typo

It's been confirmed by the original author: "01-31" should be "10-31".

6 years agoposix/tst-glob-tilde.c: Add test for bug 22332
Florian Weimer [Thu, 2 Nov 2017 10:06:45 +0000 (11:06 +0100)]
posix/tst-glob-tilde.c: Add test for bug 22332

6 years agoInclude bits/cmathcalls.h for more _FloatN, _FloatNx types.
Joseph Myers [Wed, 1 Nov 2017 23:42:31 +0000 (23:42 +0000)]
Include bits/cmathcalls.h for more _FloatN, _FloatNx types.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch arranges for <bits/cmathcalls.h> to be included by
<complex.h> for each such type under conditions and with macros
defined corresponding to those used for _Float128.

Tested for x86_64.

* math/complex.h
[(__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC))
&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Include <bits/cmathcalls.h>
with appropriate macros defined and undefined.
[(__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC))
&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
[(__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC))
&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
[(__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC))
&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
[(__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC))
&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.
[(__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC))
&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Likewise.

6 years agoClean up complex.h handling of float128.
Joseph Myers [Wed, 1 Nov 2017 17:03:58 +0000 (17:03 +0000)]
Clean up complex.h handling of float128.

This patch cleans up the way complex.h handles inclusion of
bits/cmathcalls.h for float128.  The inclusion was between those for
the types float and long double; the patch moves it after that for
long double, matching how bits/mathcalls.h and bits/math-finite.h
inclusions are ordered.  There is no need for the undefine and define
of _Mdouble_complex_ to be conditional, since __CFLOAT128 is always
defined by bits/floatn.h when _Float128 is supported, so the patch
removes the unnecessary conditionals.

Tested for x86_64.

* math/complex.h
[(__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !LIBC))
&& __GLIBC_USE (IEC_60559_TYPES_EXT)]: Move conditional code after
that for long double.  Do not condition define and undefine of
_Mdouble_complex_ on [__CFLOAT128].

6 years agox86: Add sysdeps/x86/sysdep.h
H.J. Lu [Wed, 1 Nov 2017 12:37:10 +0000 (05:37 -0700)]
x86: Add sysdeps/x86/sysdep.h

Add a new header file, sysdeps/x86/sysdep.h, for common assembly code
macros between i386 and x86-64.  Tested on i686 and x86-64.  There are
no differences in outputs of "readelf -a" and "objdump -dw" on all glibc
shared objects before and after the patch.

* sysdeps/i386/sysdep.h: Include <sysdeps/x86/sysdep.h> instead
of <sysdeps/generic/sysdep.h>.
(ALIGNARG): Removed.
(ASM_SIZE_DIRECTIVE): Likewise.
(ENTRY): Likewise.
(END): Likewise.
(ENTRY_CHK): Likewise.
(END_CHK): Likewise.
(syscall_error): Likewise.
(mcount): Likewise.
(PSEUDO_END): Likewise.
(L): Likewise.
(atom_text_section): Likewise.
* sysdeps/x86/sysdep.h: New file.
* sysdeps/x86_64/sysdep.h: Include <sysdeps/x86/sysdep.h> instead
of <sysdeps/generic/sysdep.h>.
(ALIGNARG): Removed.
(ASM_SIZE_DIRECTIVE): Likewise.
(ENTRY): Likewise.
(END): Likewise.
(ENTRY_CHK): Likewise.
(END_CHK): Likewise.
(syscall_error): Likewise.
(mcount): Likewise.
(PSEUDO_END): Likewise.
(L): Likewise.
(atom_text_section): Likewise.

6 years agolocaledata: Once again correct and regenerate i18n_ctype.
Rafal Luzynski [Thu, 26 Oct 2017 20:12:23 +0000 (22:12 +0200)]
localedata: Once again correct and regenerate i18n_ctype.

Following the previous work by Carlos O'Donell the category of LC_CTYPE
is correctly set to "i18n:2012" rather than "unicode:2014" and the
i18n_ctype file is once again regenerated from scratch to make sure it
does not contain any manual additions except the copyright message.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* localedata/unicode-gen/gen_unicode_ctype.py (output_head):
category of LC_CTYPE set to "i18n:2012".
* localedata/locales/i18n_ctype: Regenerate.

6 years agoRemove useless #ifdefs from Linux sig*.c syscalls
Yury Norov [Tue, 31 Oct 2017 17:31:40 +0000 (15:31 -0200)]
Remove useless #ifdefs from Linux sig*.c  syscalls

sigprocmask.c, sigtimedwait.c, sigwait.c and sigwaitinfo.c files from
sysdeps/unix/sysv/linux include nptl-signals.h via nptl/pthreadP.h,
and so SIGCANCEL and SIGSETXID become defined unconditionally. But
later in the code, there are some checks weither symbols defined,
which is useless. This patch removes useless checks.

Checked on x86_64-linux-gnu.

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

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Reviewed-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoConsolidate Linux sigpending() implementation
Yury Norov [Tue, 31 Oct 2017 17:28:42 +0000 (15:28 -0200)]
Consolidate Linux sigpending() implementation

ia64, s390-64, sparc64 and x86_64 host their own implementation of
sigpending() in corresponding files, but they are identical to generic
linux file despite few comments. This patch removes that files, so the
implementation of sigpending() is taken from sysdeps/unix/sysv/linux
for all ports.

Build-tested on x86_64.

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

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoDefine CMPLX macros for more _FloatN, _FloatNx types.
Joseph Myers [Tue, 31 Oct 2017 17:04:30 +0000 (17:04 +0000)]
Define CMPLX macros for more _FloatN, _FloatNx types.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch defines CMPLX* macros for all such types, as
already done for _Float128.

Tested for x86_64.

* math/complex.h
[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (CMPLXF16):
New macro.
[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (CMPLXF32):
Likewise.
[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (CMPLXF64):
Likewise.
[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(CMPLXF32X): Likewise.
[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(CMPLXF64X): Likewise.
[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(CMPLXF128X): Likewise.

6 years agoAdjust __MATH_EVAL_FMT2 definition to handle _Float16 better.
Joseph Myers [Tue, 31 Oct 2017 16:01:51 +0000 (16:01 +0000)]
Adjust __MATH_EVAL_FMT2 definition to handle _Float16 better.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch adds an additional case in the definition of
__MATH_EVAL_FMT2, as used in defining iseqsig: when
__FLT_EVAL_METHOD__ is 0 or 32, it adds 0.0f to the arguments, so that
the correct function would be selected in the case of _Float16
arguments with excess precision (were glibc to support _Float16, which
of course __MATH_TG and other facilities do not at present - and
_Float16 support is not part of what this patch series is aiming for,
but this particular fix is simple so is included anyway).

Tested for x86_64.

* math/math.h
[__FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 32]
(__MATH_EVAL_FMT2): Define to add 0.0f.

6 years ago[PowerPC64] sysdep.h doesn't need to be included in multiarch files
Alan Modra [Mon, 23 Oct 2017 22:17:54 +0000 (08:47 +1030)]
[PowerPC64] sysdep.h doesn't need to be included in multiarch files

When the .c/.S file neither uses nor modifies macros defined in
sysdep.h there is no point to #include it.  The same goes for
math_ldbl_opt.h except that it includes shlib-compat.h, and if
compat_symbol is redefined we need to include shlib-compat.h first.

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

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

* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S: Don't
include sysdep.h and math_ldbl_opt.h.  Include shlib-compat.h.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power5.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power6x.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power7.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power6x.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power5+.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power6x.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_llroundf-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S: Likewise.

6 years ago[PowerPC64] strncase_l-power7.c should use strncase_l.c
Alan Modra [Tue, 24 Oct 2017 10:06:05 +0000 (20:36 +1030)]
[PowerPC64] strncase_l-power7.c should use strncase_l.c

This is another one where we'll be wanting the base symbols for
powerpc64le rather than just a power7 variant.

* sysdeps/powerpc/powerpc64/multiarch/strncase_l-power7.c: Include
string/strncase_l.c, not string/strncase.c.
(USE_IN_EXTENDED_LOCALE_MODEL): Don't define.
(libc_hidden_def): Redefine.

6 years ago[PowerPC64] Tidy strcasecmp_l-power7.S symbols
Alan Modra [Tue, 24 Oct 2017 09:54:59 +0000 (20:24 +1030)]
[PowerPC64] Tidy strcasecmp_l-power7.S symbols

The routine being assembled here is strcasecmp_l, so ask for that via
__STRCMP and STRCMP defines.  That change means tweaking the power7
override.  Needed for later powerpc64le changes where we want the base
symbols, not just a power7 variant.

* sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S:
(__STRCMP, STRCMP, __strcasecmp_l): Define.
(__strcasecmp): Don't define.

6 years ago[PowerPC64] Wrap str{,n}cmp-power{8,9}.S in IS_IN(libc)
Alan Modra [Tue, 24 Oct 2017 10:01:16 +0000 (20:31 +1030)]
[PowerPC64] Wrap str{,n}cmp-power{8,9}.S in IS_IN(libc)

These functions aren't used in ld.so at the moment since we don't have
strcmp or strncmp ifuncs for them there.  Remove the ld.so bloat.

* sysdeps/powerpc/powerpc64/multiarch/strcmp-power8.S: Wrap in
IS_IN (libc).
* sysdeps/powerpc/powerpc64/multiarch/strcmp-power9.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S: Likewise.
* sysdeps/powerpc/powerpc64/multiarch/strncmp-power9.S: Likewise.

6 years ago[PowerPC64] Remove duplicate define in stpncpy-power8.S
Alan Modra [Tue, 24 Oct 2017 09:50:54 +0000 (20:20 +1030)]
[PowerPC64] Remove duplicate define in stpncpy-power8.S

USE_AS_STPNCPY is defined by sysdeps/powerpc/powerpc64/power8/stpncpy.S,
included by this file.

* sysdeps/powerpc/powerpc64/multiarch/stpncpy-power8.S: Don't define
USE_AS_STPNCPY.

6 years ago[PowerPC64] Don't define __GI_ variant of isnan for static lib
Alan Modra [Mon, 23 Oct 2017 06:57:30 +0000 (17:27 +1030)]
[PowerPC64] Don't define __GI_ variant of isnan for static lib

It seems to me that libc.a should not contain any of the __GI_
symbols, and certainly --enable-multi-arch ought to not add to the
list.  At the end of this patch series we have the following in both
--enable-multi-arch and --disable-multi-arch libc.a:
0000000000000000 T __GI___readdir64
0000000000000000 T __GI___fxstatat64
0000000000000000 T __GI_getrlimit
0000000000000000 T __GI___getrlimit

* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-ppc64.S (hidden_def):
Redefine only when SHARED.

6 years agoInclude bits/math-finite.h for more _FloatN, _FloatNx types.
Joseph Myers [Mon, 30 Oct 2017 22:15:40 +0000 (22:15 +0000)]
Include bits/math-finite.h for more _FloatN, _FloatNx types.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch extends the includes of <bits/math-finite.h> to
cover all such types, under conditions analogous to those for
_Float128.

Tested for x86_64.

* math/math.h [__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC)]:
Include <bits/math-finite.h> with appropriate macros defined and
undefined.
[__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC)]: Likewise.

6 years agoRemove _Mlong_double_ etc. macros.
Joseph Myers [Mon, 30 Oct 2017 20:58:51 +0000 (20:58 +0000)]
Remove _Mlong_double_ etc. macros.

math.h has a macro _Mlong_double_ for the type to use when declaring
long double functions, and similar macros for other types.
math/Makefile uses -D_Mlong_double_=double in the case of long double
having the same ABI as double.

This originates with:

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

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

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

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

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

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

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

* math/math.h [!_Mfloat_] (_Mfloat_): Do not define.
[!_Mlong_double_] (_Mlong_double_): Likewise.
[!_Mfloat16_] (_Mfloat16_): Likewise.
[!_Mfloat32_] (_Mfloat32_): Likewise.
[!_Mfloat64_] (_Mfloat64_): Likewise.
[!_Mfloat128_] (_Mfloat128_): Likewise.
[!_Mfloat32x_] (_Mfloat32x_): Likewise.
[!_Mfloat64x_] (_Mfloat64x_): Likewise.
[!_Mfloat128x_] (_Mfloat128x_): Likewise.
(_Mdouble_): Define without indirection through those macros.
* math/complex.h [!_Mfloat_] (_Mfloat_): Do not define.
[!_Mfloat128_] (_Mfloat128_): Likewise.
[_Mlong_double_] (_Mlong_double_): Likewise.
(_Mdouble_): Define without indirection through those macros.
* math/Makefile [$(long-double-fcts) != yes] (math-CPPFLAGS): Do
not add -D_Mlong_double_=double.
* include/math.h [_ISOMAC] (_Mlong_double_): Do not undefine.
* math/test-signgam-finite-c99.c (_Mlong_double_): Likewise.

6 years agosysdeps/x86/libc-start.c: Add /* !SHARED */
H.J. Lu [Mon, 30 Oct 2017 20:39:31 +0000 (13:39 -0700)]
sysdeps/x86/libc-start.c: Add /* !SHARED */

* sysdeps/x86/libc-start.c: Add /* !SHARED */.

6 years agoReformat sysdeps/x86/libc-start.c
H.J. Lu [Mon, 30 Oct 2017 20:01:18 +0000 (13:01 -0700)]
Reformat sysdeps/x86/libc-start.c

* sysdeps/x86/libc-start.c: Reformat.

6 years agoi586: Use conditional branches in strcpy.S [BZ #22353]
H.J. Lu [Mon, 30 Oct 2017 17:02:16 +0000 (10:02 -0700)]
i586: Use conditional branches in strcpy.S [BZ #22353]

i586 strcpy.S used a clever trick with LEA to implement jump table:

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

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

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

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

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

L(Src0):

which have similar performance and work with any instruction lengths.

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

[BZ #22353]
* sysdeps/i386/i586/strcpy.S (STRCPY): Use conditional branches.
(1): Renamed to ...
(L(Src0)): This.
(L(Src1)): New.
(L(Src2)): Likewise.
(L(1)): Renamed to ...
(L(Src3)): This.

6 years agoAdd _FloatN, _FloatNx M_* constants.
Joseph Myers [Mon, 30 Oct 2017 16:42:28 +0000 (16:42 +0000)]
Add _FloatN, _FloatNx M_* constants.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch adds M_* constants for such types.  The decimal
expansions used are all the same as used for _Float128; there's no
need to reduce the precision used.  In the case of _Float128x, #error
is used because the constants would need additional precision, but how
much is needed would depend on the actual _Float128x format used, so
it's not possible to add header support simply as part of code that
handles all _FloatN / _FloatNx types similarly.

Tested for x86_64.

* math/math.h [__HAVE_FLOAT16 && __USE_GNU] (M_Ef16): New macro.
[__HAVE_FLOAT16 && __USE_GNU] (M_LOG2Ef16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_LOG10Ef16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_LN2f16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_LN10f16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_PIf16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_PI_2f16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_PI_4f16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_1_PIf16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_2_PIf16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_2_SQRTPIf16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_SQRT2f16): Likewise.
[__HAVE_FLOAT16 && __USE_GNU] (M_SQRT1_2f16): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_Ef32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_LOG2Ef32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_LOG10Ef32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_LN2f32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_LN10f32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_PIf32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_PI_2f32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_PI_4f32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_1_PIf32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_2_PIf32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_2_SQRTPIf32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_SQRT2f32): Likewise.
[__HAVE_FLOAT32 && __USE_GNU] (M_SQRT1_2f32): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_Ef64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_LOG2Ef64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_LOG10Ef64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_LN2f64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_LN10f64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_PIf64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_PI_2f64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_PI_4f64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_1_PIf64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_2_PIf64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_2_SQRTPIf64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_SQRT2f64): Likewise.
[__HAVE_FLOAT64 && __USE_GNU] (M_SQRT1_2f64): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_Ef32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_LOG2Ef32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_LOG10Ef32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_LN2f32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_LN10f32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_PIf32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_PI_2f32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_PI_4f32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_1_PIf32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_2_PIf32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_2_SQRTPIf32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_SQRT2f32x): Likewise.
[__HAVE_FLOAT32X && __USE_GNU] (M_SQRT1_2f32x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_Ef64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_LOG2Ef64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_LOG10Ef64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_LN2f64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_LN10f64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_PIf64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_PI_2f64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_PI_4f64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_1_PIf64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_2_PIf64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_2_SQRTPIf64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_SQRT2f64x): Likewise.
[__HAVE_FLOAT64X && __USE_GNU] (M_SQRT1_2f64x): Likewise.
[__HAVE_FLOAT128X && __USE_GNU]: Use #error.

6 years agoAssume that _DIRENT_HAVE_D_TYPE is always defined.
Florian Weimer [Mon, 30 Oct 2017 14:48:33 +0000 (15:48 +0100)]
Assume that _DIRENT_HAVE_D_TYPE is always defined.

References remain in io/fts.c, io/ftw.c, posix/glob.c,
sysdeps/posix/getcwd.c.  These files are (potentially) externally
shared.

6 years agoffsl, ffsll: Declare under __USE_MISC, not just __USE_GNU
Florian Weimer [Mon, 30 Oct 2017 12:59:59 +0000 (13:59 +0100)]
ffsl, ffsll: Declare under __USE_MISC, not just __USE_GNU

Recent BSDs declare these functions, too.

6 years agotst-gnuglob64: New test for glob64 based on tst-gnuglob
Florian Weimer [Mon, 30 Oct 2017 12:31:30 +0000 (13:31 +0100)]
tst-gnuglob64: New test for glob64 based on tst-gnuglob

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agocsb_PL locale: Fix “abmon” for March and use a better translation for March in “mon...
Mike FABIAN [Mon, 30 Oct 2017 11:48:43 +0000 (12:48 +0100)]
csb_PL locale: Fix “abmon” for March and use a better translation for March in “mon” [BZ #19485]

[BZ #19485]
* localedata/locales/csb_PL (LC_TIME): Fix “abmon” for March
and use a better translation for March in “mon”.
* localedata/locales/csb_PL: Use more ASCII to improve the
readability of the source.

6 years agokm_KH locale: remove tags which were using Lao characters [BZ #13953]
Mike FABIAN [Mon, 30 Oct 2017 10:46:05 +0000 (11:46 +0100)]
km_KH locale: remove tags which were using Lao characters [BZ #13953]

[BZ #13953]
* localedata/locales/km_KH: Use ASCII as much
as possible for better readability of the source and
remove useless comments.
* localedata/locales/km_KH (LC_TIME): Remove era stuff, it
was commented out and apparently wrong anyway because it was
using Lao characters. If Buddhist era should be used
for km_KH, a native speaker should write the correct formaat
for Khmer.
* localedata/locales/km_KH (LC_TIME): Add first_weekday 1
(According to CLDR, the first weekday for Cambodia is Sunday).
* localedata/locales/km_KH (LC_NAME): Remove name_mr and name_mrs
(These were using Lao characters which must be wrong. If we get
the correct data from a native speaker, we could add it back, until
then it is better not to have name_mr and name_mrs at all than
having it wrong).

6 years agoCorrect the size of _nl_value_type_LC_... arrays.
Rafal Luzynski [Tue, 11 Jul 2017 23:32:33 +0000 (01:32 +0200)]
Correct the size of _nl_value_type_LC_... arrays.

There were several problems with checking the array size in the past,
for example BZ#356, caused by incorrectly assuming that every locale
token represents one element.  In fact, if a token represented
a subarray, for example an array of month names or characters category
and it appeared at the end of the array the compiler assumed that
the array ends just after the first element of the subarray.
A workaround used in the past was to skip some categories while testing,
for example LC_CTYPE.  Now when we are about to add alternative month
names to LC_TIME (BZ#10871) this will fail again.

* locale/loadlocale.c: Correct size of
_nl_value_type_LC_<category> arrays.

Reviewed-by: Zack Weinberg <zackw@panix.com>
6 years agoInclude bits/mathcalls.h for more _FloatN, _FloatNx types.
Joseph Myers [Fri, 27 Oct 2017 22:43:46 +0000 (22:43 +0000)]
Include bits/mathcalls.h for more _FloatN, _FloatNx types.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch arranges for <bits/mathcalls.h> and
<bits/mathcalls-helper-functions.h> to be included for each such type
under conditions and with macros defined corresponding to those
already present for _Float128.

Tested for x86_64.

* math/math.h [__HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC)]:
Include <bits/mathcalls-helper-functions.h> and <bits/mathcalls.h>
with appropriate macros defined and undefined.
[__HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC)]: Likewise.
[__HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC)]: Likewise.

6 years agoi386: Regenerate libm-test-ulps for for gcc 7
H.J. Lu [Fri, 27 Oct 2017 21:09:01 +0000 (14:09 -0700)]
i386: Regenerate libm-test-ulps for for gcc 7

Regenerate libm-test-ulps for gcc 7 with "-m32 -O2 -march=i586".

* sysdeps/i386/fpu/libm-test-ulps: Regenerated for GCC 7 with
"-O2 -march=i586".

6 years agott_RU locale: make yesstr and nostr agree with CLDR by starting with lower case letters
Mike FABIAN [Fri, 27 Oct 2017 08:55:44 +0000 (10:55 +0200)]
tt_RU locale: make yesstr and nostr agree with CLDR by starting with lower case letters

* localedata/locales/tt_RU (LC_MESSAGES): Start yesstr and nostr
with lowercase letters to make it agree with CLDR.

6 years agoFix all remaining issues of [BZ #15260]
Mike FABIAN [Fri, 27 Oct 2017 08:53:35 +0000 (10:53 +0200)]
Fix all remaining issues of [BZ #15260]

[BZ #15260]
* localedata/locales/doi_IN (LC_MESSAGES): Match only for the
first letters of yesstr and nostr in yesexpr and noexpr,
not for the full words.
* localedata/locales/hne_IN (LC_MESSAGES): Likewise.
* localedata/locales/kok_IN (LC_MESSAGES): Likewise.
* localedata/locales/mr_IN (LC_MESSAGES): Likewise.
* localedata/locales/sat_IN (LC_MESSAGES): Likewise.
* localedata/locales/km_KH (LC_MESSAGES): Match also for the
first letters of yesstr and nostr in yesexpr and noexpr,
until now only English was matched in yesexpr and noexpr.
* localedata/locales/tl_PH (LC_MESSAGES): Use “copy "fil_PH"”
instead of “copy "en_US"”. CLDR has yesstr and nostr data for
fil but not for tl. As tl and fil are very similar, using fil
is probably better than using English.

6 years agobr_FR locale: Use all lowercase in yesstr and nostr.
Mike FABIAN [Fri, 27 Oct 2017 07:38:00 +0000 (09:38 +0200)]
br_FR locale: Use all lowercase in yesstr and nostr.

[BZ #21706]
* localedata/locales/br_FR (LC_MESSAGES): Use all lowercase
in yesstr and nostr.

6 years agoAdd SNAN macros for more _FloatN, _FloatNx types.
Joseph Myers [Thu, 26 Oct 2017 23:34:55 +0000 (23:34 +0000)]
Add SNAN macros for more _FloatN, _FloatNx types.

This patch continues the preparation for additional _FloatN / _FloatNx
type support by adding appropriately conditional definitions of SNAN*
macros, corresponding to the SNANF128 definition already present.

Tested for x86_64.

* math/math.h [__HAVE_FLOAT16 && __GLIBC_USE
(IEC_60559_TYPES_EXT)] (SNANF16): New macro.
[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (SNANF32):
Likewise.
[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (SNANF64):
Likewise.
[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (SNANF32X):
Likewise.
[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (SNANF64X):
Likewise.
[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(SNANF128X): Likewise.

6 years agoAdd HUGE_VAL macros for more _FloatN, _FloatNx types.
Joseph Myers [Thu, 26 Oct 2017 23:11:18 +0000 (23:11 +0000)]
Add HUGE_VAL macros for more _FloatN, _FloatNx types.

This patch continues the preparation for additional _FloatN / _FloatNx
type support by adding appropriately conditional definitions of
HUGE_VAL_* macros, corresponding to the HUGE_VAL_F128 definition
already present.

Tested for x86_64.

* math/math.h [__HAVE_FLOAT16 && __GLIBC_USE
(IEC_60559_TYPES_EXT)] (HUGE_VAL_F16): New macro.
[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(HUGE_VAL_F32): Likewise.
[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(HUGE_VAL_F64): Likewise.
[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(HUGE_VAL_F32X): Likewise.
[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(HUGE_VAL_F64X): Likewise.
[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(HUGE_VAL_F128X): Likewise.

6 years agoadd myself as contact for "br" locale
Thierry Vignaud [Thu, 26 Oct 2017 10:00:15 +0000 (12:00 +0200)]
add myself as contact for "br" locale

Pablo was l10n/i18n coordinator back in the old days but MandrakeSoft is
dead now

* localedata/locales/br_FR (LC_IDENTIFICATON): Add
Thierry Vignaud <thierry.vignaud@gmail.com> as the contact
for the br_FR locale.

6 years agofix nostr for "br" [BZ #21706]
Thierry Vignaud [Wed, 25 Oct 2017 20:12:31 +0000 (22:12 +0200)]
fix nostr for "br" [BZ #21706]

"Ket" is the the most used negative answer, as it's the negative answer
to a positively phrased question
It's used as it or with the verb ("Ne ran ket", ...)
As such, "Ket" is used in most translations.
"Nann" is less used as it's the negative answer to a negatively phrased
question

See https://en.wikipedia.org/wiki/Yes_and_no for explanations about
languages with 3 or 4 form systems.

We still keep "Nn" for short answers as:
- new learners are used to "Non" in french
- and they often misuses "Nann"
- for compatibility with english

[BZ #21706]
* localedata/locales/br_FR (LC_MESSAGES): Fix nostr.

6 years agolocaledef: Add --no-warnings/--warnings option
Carlos O'Donell [Tue, 17 Oct 2017 08:33:42 +0000 (01:33 -0700)]
localedef: Add --no-warnings/--warnings option

From localedef --help:

Output control:
...
      --no-warnings=<warnings>   Comma-separated list of warnings to disable;
                             supported warnings are: ascii, intcurrsym
...
      --warnings=<warnings>  Comma-separated list of warnings to enable;
                             supported warnings are: ascii, intcurrsym

Locales using SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII
compatible. In order to build locales using these character maps, and
have localedef exit with a status of 0, we add new option to localedef
to disable or enable specific warnings. The options are --no-warnings
and --warnings, to disable and enable specific warnings respectively.
The options take a comma-separated list of warning names. The warning
names are taken directly from the generated warning.  When a warning
that can be disabled is issued it will print something like this: foo is
not defined [--no-warnings=foo]

For the initial implementation we add two controllable warnings; first
'ascii' which is used by the localedata installation makefile target to
install SHIFT_JIS and SHIFT_JISX0213-using locales without error; second
'intcurrsym' which allows a program to use a non-standard international
currency symbol without triggering a warning.  The 'intcurrsym' is
useful in the future if country codes are added that are not in our
current ISO 4217 list, and the user wants to avoid the warning. Having
at least two warnings to control gives an example for how the changes
can be extended to more warnings if required in the future.

These changes allow ja_JP.SHIFT_JIS and ja_JP.SHIFT_JISX0213 to be
compiled without warnings using --no-warnings=ascii. The
localedata/Makefile $(INSTALL-SUPPORTED-LOCALES) target is adjusted to
automatically add `--no-warnings=ascii` for such charmaps, and likewise
localedata/gen-locale.sh is adjusted with similar logic.

v2: Bring verbose, be_quiet, and all warning control booleans into
record-status.c, and compile this object file to be used by locale,
iconv, and localedef. Any users include record-status.h.
v3: Fix an instance of boolean coercion in set_warning().

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
6 years agolocaledata: Locale and test name are the same.
Carlos O'Donell [Sat, 14 Oct 2017 05:44:44 +0000 (22:44 -0700)]
localedata: Locale and test name are the same.

The localedata collation test data is encoded in a particular
character set. We rename the test data to match the full locale
name with encoding, and adjust the Makefile and sort-test.sh
script. This allows us to have a future C.UTF-8 test that is
disambiguated from the built-in C locale.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
6 years agolocaledata: Fix unicode-gen check target.
Carlos O'Donell [Wed, 25 Oct 2017 16:06:45 +0000 (09:06 -0700)]
localedata: Fix unicode-gen check target.

After the transition to generating a distinct file for Unicode ctype
information e.g. i18n_ctype, the check target was left with the wrong
target name. This patch fixes the check target and regenerates the
files with more information than previously used, filling in the the
LC_IDENTIFICATION data.

Tested on x86_64 by regenerating from Unicode source files, and
running checks. Tested by subsequently rebuilding all locales.
No regressions in testsuite.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Reported-by: Rafal Luzynski <digitalfreak@lingonborough.com>
6 years agopowerpc: Replace lxvd2x/stxvd2x with lvx/stvx in P7's memcpy/memmove
Rajalakshmi Srinivasaraghavan [Wed, 25 Oct 2017 15:13:53 +0000 (13:13 -0200)]
powerpc: Replace lxvd2x/stxvd2x with lvx/stvx in P7's memcpy/memmove

POWER9 DD2.1 and earlier has an issue where some cache inhibited
vector load traps to the kernel, causing a performance degradation.  To
handle this in memcpy and memmove, lvx/stvx is used for aligned
addresses instead of lxvd2x/stxvd2x.

Reference: https://patchwork.ozlabs.org/patch/814059/

* sysdeps/powerpc/powerpc64/power7/memcpy.S: Replace
lxvd2x/stxvd2x with lvx/stvx.
* sysdeps/powerpc/powerpc64/power7/memmove.S: Likewise.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoReplace "if if " with "if " in comments
H.J. Lu [Wed, 25 Oct 2017 15:05:51 +0000 (08:05 -0700)]
Replace "if if " with "if " in comments

* include/alloc_buffer.h: Replace "if if " with "if " in
comments.
* sysdeps/mips/memcpy.S: Likkewise.
* sysdeps/mips/memset.S: Likewise.
* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S:
Likewise.
* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S:
Likewise.
* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S:
Likewise.

6 years agoCJK locales: Add fullwidth yYnN to yesexpr and noexpr [BZ #15261]
Mike FABIAN [Wed, 25 Oct 2017 11:47:59 +0000 (13:47 +0200)]
CJK locales: Add fullwidth yYnN to yesexpr and noexpr [BZ #15261]

[BZ #15261]
* localedata/locales/cmn_TW (LC_MESSAGES): Add fullwidth yYnN to
yesexpr and noexpr.
* localedata/locales/hak_TW (LC_MESSAGES): Likewise.
* localedata/locales/ko_KR (LC_MESSAGES): Likewise.
* localedata/locales/lzh_TW (LC_MESSAGES): Likewise.
* localedata/locales/nan_TW (LC_MESSAGES): Likewise.
* localedata/locales/zh_CN (LC_MESSAGES): Likewise.
* localedata/locales/zh_HK (LC_MESSAGES): Likewise.
* localedata/locales/zh_TW (LC_MESSAGES): Likewise.

6 years agoSync LC_MESSAGES of several locales with CLDR
Mike FABIAN [Wed, 25 Oct 2017 11:28:31 +0000 (13:28 +0200)]
Sync LC_MESSAGES of several locales with CLDR

* localedata/locales/am_ET (LC_MESSAGES): Sync with CLDR.
* localedata/locales/az_AZ (LC_MESSAGES): Likewise.
* localedata/locales/el_GR (LC_MESSAGES): Likewise.
* localedata/locales/ha_NG (LC_MESSAGES): Likewise.
* localedata/locales/ln_CD (LC_MESSAGES): Likewise.
* localedata/locales/mfe_MU (LC_MESSAGES): Likewise.
* localedata/locales/ml_IN (LC_MESSAGES): Likewise.
* localedata/locales/mt_MT (LC_MESSAGES): Likewise.
* localedata/locales/os_RU (LC_MESSAGES): Likewise.
* localedata/locales/tg_TJ (LC_MESSAGES): Likewise.
* localedata/locales/tt_RU (LC_MESSAGES): Likewise.
* localedata/locales/wo_SN (LC_MESSAGES): Likewise.

6 years agoUse ASCII as much as possible in LC_MESSAGES of all locales to improve readability...
Mike FABIAN [Wed, 25 Oct 2017 08:47:23 +0000 (10:47 +0200)]
Use ASCII as much as possible in LC_MESSAGES of all locales to improve readability of the source

* localedata/locales/aa_ET (LC_MESSAGES): Use ASCII as much
as possible for better readability of the source.
* localedata/locales/af_ZA (LC_MESSAGES): Likewise.
* localedata/locales/ak_GH (LC_MESSAGES): Likewise.
* localedata/locales/am_ET (LC_MESSAGES): Likewise.
* localedata/locales/anp_IN (LC_MESSAGES): Likewise.
* localedata/locales/ar_EG (LC_MESSAGES): Likewise.
* localedata/locales/as_IN (LC_MESSAGES): Likewise.
* localedata/locales/ast_ES (LC_MESSAGES): Likewise.
* localedata/locales/ayc_PE (LC_MESSAGES): Likewise.
* localedata/locales/az_AZ (LC_MESSAGES): Likewise.
* localedata/locales/az_IR (LC_MESSAGES): Likewise.
* localedata/locales/be_BY (LC_MESSAGES): Likewise.
* localedata/locales/be_BY@latin (LC_MESSAGES): Likewise.
* localedata/locales/bem_ZM (LC_MESSAGES): Likewise.
* localedata/locales/ber_MA (LC_MESSAGES): Likewise.
* localedata/locales/bg_BG (LC_MESSAGES): Likewise.
* localedata/locales/bhb_IN (LC_MESSAGES): Likewise.
* localedata/locales/bi_VU (LC_MESSAGES): Likewise.
* localedata/locales/bo_CN (LC_MESSAGES): Likewise.
* localedata/locales/br_FR (LC_MESSAGES): Likewise.
* localedata/locales/bs_BA (LC_MESSAGES): Likewise.
* localedata/locales/ca_ES (LC_MESSAGES): Likewise.
* localedata/locales/ce_RU (LC_MESSAGES): Likewise.
* localedata/locales/crh_UA (LC_MESSAGES): Likewise.
* localedata/locales/cs_CZ (LC_MESSAGES): Likewise.
* localedata/locales/csb_PL (LC_MESSAGES): Likewise.
* localedata/locales/cv_RU (LC_MESSAGES): Likewise.
* localedata/locales/cy_GB (LC_MESSAGES): Likewise.
* localedata/locales/da_DK (LC_MESSAGES): Likewise.
* localedata/locales/de_DE (LC_MESSAGES): Likewise.
* localedata/locales/dv_MV (LC_MESSAGES): Likewise.
* localedata/locales/dz_BT (LC_MESSAGES): Likewise.
* localedata/locales/el_GR (LC_MESSAGES): Likewise.
* localedata/locales/en_CA (LC_MESSAGES): Likewise.
* localedata/locales/en_US (LC_MESSAGES): Likewise.
* localedata/locales/es_ES (LC_MESSAGES): Likewise.
* localedata/locales/et_EE (LC_MESSAGES): Likewise.
* localedata/locales/eu_ES (LC_MESSAGES): Likewise.
* localedata/locales/fa_IR (LC_MESSAGES): Likewise.
* localedata/locales/ff_SN (LC_MESSAGES): Likewise.
* localedata/locales/fi_FI (LC_MESSAGES): Likewise.
* localedata/locales/fil_PH (LC_MESSAGES): Likewise.
* localedata/locales/fo_FO (LC_MESSAGES): Likewise.
* localedata/locales/fr_BE (LC_MESSAGES): Likewise.
* localedata/locales/fr_CH (LC_MESSAGES): Likewise.
* localedata/locales/fr_FR (LC_MESSAGES): Likewise.
* localedata/locales/fr_LU (LC_MESSAGES): Likewise.
* localedata/locales/fur_IT (LC_MESSAGES): Likewise.
* localedata/locales/fy_DE (LC_MESSAGES): Likewise.
* localedata/locales/ga_IE (LC_MESSAGES): Likewise.
* localedata/locales/gd_GB (LC_MESSAGES): Likewise.
* localedata/locales/gl_ES (LC_MESSAGES): Likewise.
* localedata/locales/gu_IN (LC_MESSAGES): Likewise.
* localedata/locales/gv_GB (LC_MESSAGES): Likewise.
* localedata/locales/ha_NG (LC_MESSAGES): Likewise.
* localedata/locales/hak_TW (LC_MESSAGES): Likewise.
* localedata/locales/he_IL (LC_MESSAGES): Likewise.
* localedata/locales/hif_FJ (LC_MESSAGES): Likewise.
* localedata/locales/hne_IN (LC_MESSAGES): Likewise.
* localedata/locales/hr_HR (LC_MESSAGES): Likewise.
* localedata/locales/hsb_DE (LC_MESSAGES): Likewise.
* localedata/locales/ht_HT (LC_MESSAGES): Likewise.
* localedata/locales/hu_HU (LC_MESSAGES): Likewise.
* localedata/locales/hy_AM (LC_MESSAGES): Likewise.
* localedata/locales/ia_FR (LC_MESSAGES): Likewise.
* localedata/locales/id_ID (LC_MESSAGES): Likewise.
* localedata/locales/ig_NG (LC_MESSAGES): Likewise.
* localedata/locales/ik_CA (LC_MESSAGES): Likewise.
* localedata/locales/is_IS (LC_MESSAGES): Likewise.
* localedata/locales/it_CH (LC_MESSAGES): Likewise.
* localedata/locales/it_IT (LC_MESSAGES): Likewise.
* localedata/locales/iu_CA (LC_MESSAGES): Likewise.
* localedata/locales/ja_JP (LC_MESSAGES): Likewise.
* localedata/locales/kk_KZ (LC_MESSAGES): Likewise.
* localedata/locales/kl_GL (LC_MESSAGES): Likewise.
* localedata/locales/ko_KR (LC_MESSAGES): Likewise.
* localedata/locales/ks_IN (LC_MESSAGES): Likewise.
* localedata/locales/ku_TR (LC_MESSAGES): Likewise.
* localedata/locales/kw_GB (LC_MESSAGES): Likewise.
* localedata/locales/ky_KG (LC_MESSAGES): Likewise.
* localedata/locales/lb_LU (LC_MESSAGES): Likewise.
* localedata/locales/lg_UG (LC_MESSAGES): Likewise.
* localedata/locales/li_NL (LC_MESSAGES): Likewise.
* localedata/locales/lij_IT (LC_MESSAGES): Likewise.
* localedata/locales/ln_CD (LC_MESSAGES): Likewise.
* localedata/locales/lo_LA (LC_MESSAGES): Likewise.
* localedata/locales/lt_LT (LC_MESSAGES): Likewise.
* localedata/locales/lv_LV (LC_MESSAGES): Likewise.
* localedata/locales/lzh_TW (LC_MESSAGES): Likewise.
* localedata/locales/mg_MG (LC_MESSAGES): Likewise.
* localedata/locales/mhr_RU (LC_MESSAGES): Likewise.
* localedata/locales/mi_NZ (LC_MESSAGES): Likewise.
* localedata/locales/mk_MK (LC_MESSAGES): Likewise.
* localedata/locales/ml_IN (LC_MESSAGES): Likewise.
* localedata/locales/mn_MN (LC_MESSAGES): Likewise.
* localedata/locales/ms_MY (LC_MESSAGES): Likewise.
* localedata/locales/mt_MT (LC_MESSAGES): Likewise.
* localedata/locales/my_MM (LC_MESSAGES): Likewise.
* localedata/locales/nan_TW (LC_MESSAGES): Likewise.
* localedata/locales/nan_TW@latin (LC_MESSAGES): Likewise.
* localedata/locales/nb_NO (LC_MESSAGES): Likewise.
* localedata/locales/nds_DE (LC_MESSAGES): Likewise.
* localedata/locales/nds_NL (LC_MESSAGES): Likewise.
* localedata/locales/ne_NP (LC_MESSAGES): Likewise.
* localedata/locales/nhn_MX (LC_MESSAGES): Likewise.
* localedata/locales/niu_NU (LC_MESSAGES): Likewise.
* localedata/locales/nl_NL (LC_MESSAGES): Likewise.
* localedata/locales/nn_NO (LC_MESSAGES): Likewise.
* localedata/locales/nr_ZA (LC_MESSAGES): Likewise.
* localedata/locales/nso_ZA (LC_MESSAGES): Likewise.
* localedata/locales/oc_FR (LC_MESSAGES): Likewise.
* localedata/locales/om_ET (LC_MESSAGES): Likewise.
* localedata/locales/or_IN (LC_MESSAGES): Likewise.
* localedata/locales/os_RU (LC_MESSAGES): Likewise.
* localedata/locales/pa_IN (LC_MESSAGES): Likewise.
* localedata/locales/pa_PK (LC_MESSAGES): Likewise.
* localedata/locales/pap_AW (LC_MESSAGES): Likewise.
* localedata/locales/pap_CW (LC_MESSAGES): Likewise.
* localedata/locales/pl_PL (LC_MESSAGES): Likewise.
* localedata/locales/ps_AF (LC_MESSAGES): Likewise.
* localedata/locales/pt_BR (LC_MESSAGES): Likewise.
* localedata/locales/quz_PE (LC_MESSAGES): Likewise.
* localedata/locales/raj_IN (LC_MESSAGES): Likewise.
* localedata/locales/ro_RO (LC_MESSAGES): Likewise.
* localedata/locales/ru_RU (LC_MESSAGES): Likewise.
* localedata/locales/ru_UA (LC_MESSAGES): Likewise.
* localedata/locales/rw_RW (LC_MESSAGES): Likewise.
* localedata/locales/sa_IN (LC_MESSAGES): Likewise.
* localedata/locales/sc_IT (LC_MESSAGES): Likewise.
* localedata/locales/sd_IN@devanagari (LC_MESSAGES): Likewise.
* localedata/locales/se_NO (LC_MESSAGES): Likewise.
* localedata/locales/sgs_LT (LC_MESSAGES): Likewise.
* localedata/locales/si_LK (LC_MESSAGES): Likewise.
* localedata/locales/sk_SK (LC_MESSAGES): Likewise.
* localedata/locales/sl_SI (LC_MESSAGES): Likewise.
* localedata/locales/sm_WS (LC_MESSAGES): Likewise.
* localedata/locales/so_DJ (LC_MESSAGES): Likewise.
* localedata/locales/sq_AL (LC_MESSAGES): Likewise.
* localedata/locales/sr_RS (LC_MESSAGES): Likewise.
* localedata/locales/sr_RS@latin (LC_MESSAGES): Likewise.
* localedata/locales/ss_ZA (LC_MESSAGES): Likewise.
* localedata/locales/st_ZA (LC_MESSAGES): Likewise.
* localedata/locales/sv_SE (LC_MESSAGES): Likewise.
* localedata/locales/sw_KE (LC_MESSAGES): Likewise.
* localedata/locales/szl_PL (LC_MESSAGES): Likewise.
* localedata/locales/tcy_IN (LC_MESSAGES): Likewise.
* localedata/locales/tg_TJ (LC_MESSAGES): Likewise.
* localedata/locales/th_TH (LC_MESSAGES): Likewise.
* localedata/locales/the_NP (LC_MESSAGES): Likewise.
* localedata/locales/ti_ER (LC_MESSAGES): Likewise.
* localedata/locales/tk_TM (LC_MESSAGES): Likewise.
* localedata/locales/tn_ZA (LC_MESSAGES): Likewise.
* localedata/locales/to_TO (LC_MESSAGES): Likewise.
* localedata/locales/tr_TR (LC_MESSAGES): Likewise.
* localedata/locales/ts_ZA (LC_MESSAGES): Likewise.
* localedata/locales/tt_RU (LC_MESSAGES): Likewise.
* localedata/locales/tt_RU@iqtelif (LC_MESSAGES): Likewise.
* localedata/locales/uk_UA (LC_MESSAGES): Likewise.
* localedata/locales/unm_US (LC_MESSAGES): Likewise.
* localedata/locales/ur_IN (LC_MESSAGES): Likewise.
* localedata/locales/ur_PK (LC_MESSAGES): Likewise.
* localedata/locales/uz_UZ (LC_MESSAGES): Likewise.
* localedata/locales/uz_UZ@cyrillic (LC_MESSAGES): Likewise.
* localedata/locales/ve_ZA (LC_MESSAGES): Likewise.
* localedata/locales/vi_VN (LC_MESSAGES): Likewise.
* localedata/locales/wa_BE (LC_MESSAGES): Likewise.
* localedata/locales/wo_SN (LC_MESSAGES): Likewise.
* localedata/locales/xh_ZA (LC_MESSAGES): Likewise.
* localedata/locales/yi_US (LC_MESSAGES): Likewise.
* localedata/locales/yo_NG (LC_MESSAGES): Likewise.
* localedata/locales/yue_HK (LC_MESSAGES): Likewise.
* localedata/locales/zh_CN (LC_MESSAGES): Likewise.
* localedata/locales/zh_HK (LC_MESSAGES): Likewise.
* localedata/locales/zh_TW (LC_MESSAGES): Likewise.
* localedata/locales/zu_ZA (LC_MESSAGES): Likewise.

6 years agobrx_IN locale: Fix yesexpr and noexpr
Mike FABIAN [Wed, 25 Oct 2017 08:40:20 +0000 (10:40 +0200)]
brx_IN locale: Fix yesexpr and noexpr

* localedata/locales/brx_IN (LC_MESSAGES): Fix yesexpr and noexpr
(Use first letters of yesstr and nostr correctly instead of using
full words).

6 years agota_IN locale: Fix yesexpr and noexpr
Mike FABIAN [Wed, 25 Oct 2017 08:35:19 +0000 (10:35 +0200)]
ta_IN locale: Fix yesexpr and noexpr

* localedata/locales/ta_IN (LC_MESSAGES): Fix yesexpr and noexpr
(Use first letters of yesstr and nostr correctly).

6 years agohi_IN, kn_IN, ks_IN@devanagari locales: In yesexpr and noexpr, also check for the...
Mike FABIAN [Wed, 25 Oct 2017 08:06:31 +0000 (10:06 +0200)]
hi_IN, kn_IN, ks_IN@devanagari locales:  In yesexpr and noexpr, also check for the first characters of yesstr and nostr

* localedata/locales/hi_IN (LC_MESSAGES): In yesexpr and noexpr,
also check for the first characters of yesstr and nostr.
* localedata/locales/kn_IN (LC_MESSAGES): Likewise.
* localedata/locales/ks_IN@devanagari (LC_MESSAGES): Likewise.

6 years agocmn_TW locale: Improve yesexpr and noexpr
Mike FABIAN [Wed, 25 Oct 2017 07:58:59 +0000 (09:58 +0200)]
cmn_TW locale: Improve yesexpr and noexpr

* localedata/locales/cmn_TW (LC_MESSAGES): In yesexpr and noexpr,
also check for Chinese characters.

6 years agochr_US locale: Fix yesexpr and noexpr
Mike FABIAN [Wed, 25 Oct 2017 07:56:21 +0000 (09:56 +0200)]
chr_US locale: Fix yesexpr and noexpr

* localedata/locales/chr_US (LC_MESSAGES): In yesexpr and noexpr,
match also for the contents of yesstr and nostr. As the first letter
of yesstr and nostr is equal, checking only for the first letter
is not enough.

6 years agober_DZ locale: Use copy “"kab_DZ"” in LC_MESSAGES.
Mike FABIAN [Wed, 25 Oct 2017 07:31:26 +0000 (09:31 +0200)]
ber_DZ locale: Use copy “"kab_DZ"” in LC_MESSAGES.

* localedata/locales/ber_DZ (LC_MESSAGES): Use copy "kab_DZ",
it is the same according to  Belkacem Mohammed <belkacem77@gmail.com>.

6 years agokab_DZ locale: Add e-mail of main contributor
Mike FABIAN [Wed, 25 Oct 2017 07:25:11 +0000 (09:25 +0200)]
kab_DZ locale: Add e-mail of main contributor

* localedata/locales/kab_DZ (LC_IDENTIFICATION): Add e-mail
of main contributor.

6 years agozh_SG locale: Use copy "zh_CN" in LC_MESSAGES instead of English
Mike FABIAN [Wed, 25 Oct 2017 07:15:33 +0000 (09:15 +0200)]
zh_SG locale: Use copy "zh_CN" in LC_MESSAGES instead of English

* localedata/locales/zh_SG (LC_MESSAGES): Use copy "zh_CN"
instead of using English.

6 years agoug_CN locale: Fix noexpr and yesexpr
Mike FABIAN [Wed, 25 Oct 2017 06:34:21 +0000 (08:34 +0200)]
ug_CN locale: Fix noexpr and yesexpr

* localedata/locales/ug_CN (LC_MESSAGES): Fix noexpr and yesexpr
by including the first letters of nostr and yesexpr in the regexp.
Also make it more readable by using ASCII where possible.

6 years agoti_IN locale: Fix noexpr
Mike FABIAN [Wed, 25 Oct 2017 06:17:24 +0000 (08:17 +0200)]
ti_IN locale: Fix noexpr

* localedata/locales/te_IN (LC_MESSAGES): Fix noexpr by including
the first letter of nostr in the regexp. It agrees with CLDR now.
Also make it more readable by using ASCII where possible.

6 years agokm_KH locale: Fix yesstr and nostr.
Mike FABIAN [Tue, 24 Oct 2017 14:37:36 +0000 (16:37 +0200)]
km_KH locale: Fix yesstr and nostr.

* localedata/locales/km_KH (LC_MESSAGES): Fix yestr and nostr.
The yesstr and nostr apparently came from CLDR. And CLDR has a bug there:
these strings contain a U+17D6 (which somewhat looks like a colon)
instead of a real colon to separate the full words for “yes”
and “no” from the single letter responses.

6 years agoka_GE locale: Fix yesexp to make it agree with CLDR.
Mike FABIAN [Tue, 24 Oct 2017 14:20:55 +0000 (16:20 +0200)]
ka_GE locale: Fix yesexp to make it agree with CLDR.

* localedata/locales/ka_GE (LC_MESSAGES): Fix yesexp to make
it agree with CLDR (include the first letter of yesstr).
Also make it more readable by using ASCII where possible.

6 years agomr_IN locale: Fix yesstr and nostr and improve yesexpr and noexpr.
Mike FABIAN [Tue, 24 Oct 2017 12:06:05 +0000 (14:06 +0200)]
mr_IN locale: Fix yesstr and nostr and improve yesexpr and noexpr.

* localedata/locales/mr_IN (LC_MESSAGES): Fix yesstr and nostr
and improve yesexpr and noexpr. The yesstr and nostr apparently
came from CLDR. And CLDR has a bug there: these strings contain
a U+0903 (which looks like a colon) instead of a real colon
to separate the full words for “yes” and “no” from the single
letter responses.

6 years agobn_BD locale: Use only the first letters of the full yesstr and nostr in yesexpr...
Mike FABIAN [Tue, 24 Oct 2017 09:56:18 +0000 (11:56 +0200)]
bn_BD locale: Use only the first letters of the full yesstr and nostr in yesexpr and noexpr

Using all characters of the full words for yes and no in yesexpr and noexpr
makes no sense here, especially not because the words for yes and no
share one character.

* localedata/locales/bn_BD (LC_MESSAGES): Use only the first
letters of the full yesstr and nostr in yesexpr and noexpr.

6 years agoAdd yesstr, nostr, lang_term, lang_lib to an_ES locale
Mike FABIAN [Tue, 24 Oct 2017 07:07:18 +0000 (09:07 +0200)]
Add yesstr, nostr, lang_term, lang_lib to an_ES locale

* localedata/locales/an_ES (LC_MESSAGES): Add yesstr and nostr.
* localedata/locales/an_ES (LC_ADDRESS): Add lang_term and lang_lib.
* localedata/locales/an_ES: Make source more readable by using ASCII
where possible.

6 years agoAdd new locale yuw_PG [BZ #20952]
Mike FABIAN [Mon, 23 Oct 2017 17:03:23 +0000 (19:03 +0200)]
Add new locale yuw_PG [BZ #20952]

[BZ #20952]
* localedata/locales/yuw_PG: New file.
* localedata/SUPPORTED: Add yuw_PG/UTF-8.
* locale/iso-639.def: Add Yau (Uruwa).

6 years agoAdd single-threaded path to _int_malloc
Wilco Dijkstra [Tue, 24 Oct 2017 11:43:05 +0000 (12:43 +0100)]
Add single-threaded path to _int_malloc

This patch adds single-threaded fast paths to _int_malloc.

* malloc/malloc.c (_int_malloc): Add SINGLE_THREAD_P path.

6 years agoAdd single-threaded path to malloc/realloc/calloc/memalloc
Wilco Dijkstra [Tue, 24 Oct 2017 11:39:24 +0000 (12:39 +0100)]
Add single-threaded path to malloc/realloc/calloc/memalloc

This patch adds a single-threaded fast path to malloc, realloc,
calloc and memalloc.  When we're single-threaded, we can bypass
arena_get (which always locks the arena it returns) and just use
the main arena.  Also avoid retrying a different arena since
there is just the main arena.

* malloc/malloc.c (__libc_malloc): Add SINGLE_THREAD_P path.
(__libc_realloc): Likewise.
(_mid_memalign): Likewise.
(__libc_calloc): Likewise.

6 years agoFixes for tpi_PG locale
Mike FABIAN [Mon, 23 Oct 2017 17:19:21 +0000 (19:19 +0200)]
Fixes for tpi_PG locale

* localedata/locales/tpi_PG (LC_MESSAGES): Fix yesexpr and noexpr
by adding the generic +1 and -0 as in all other locales.
* localedata/locales/tpi_PG (LC_TIME): Fix some typos in the month and
day names and make it more readable by using ASCII where possible.

6 years agoUpdate x86 fix-fp-int-compare-invalid.h for GCC 8.
Joseph Myers [Tue, 24 Oct 2017 00:33:08 +0000 (00:33 +0000)]
Update x86 fix-fp-int-compare-invalid.h for GCC 8.

The glibc implementation of iseqsig relies on ordered comparison
operators raising the "invalid" exception for quiet NaN operands, with
a workaround on platforms where a GCC bug means that exception is not
raised.  For x86, that bug has now been fixed for GCC 8, so this patch
disables the workaround in that case.  If and when the corresponding
bugs for powerpc and s390 are fixed, the headers for those platforms
should of course be updated similarly.

Tested for x86_64 and x86, including with GCC mainline.  Note that
other failures appear with GCC mainline because of spurious use of
ordered comparison instructions for unordered operations
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82692>.

* sysdeps/x86/fpu/fix-fp-int-compare-invalid.h
(FIX_COMPARE_INVALID): Define to 0 if [__GNUC_PREREQ (8, 0)].

6 years agoposix: Do not use WNOHANG in waitpid call for Linux posix_spawn
Adhemerval Zanella [Sat, 21 Oct 2017 13:33:27 +0000 (11:33 -0200)]
posix: Do not use WNOHANG in waitpid call for Linux posix_spawn

As shown in some buildbot issues on aarch64 and powerpc, calling
clone (VFORK) and waitpid (WNOHANG) does not guarantee the child
is ready to be collected.  This patch changes the call back to 0
as before fe05e1cb6d64 fix.

This change can lead to the scenario 4.3 described in the commit,
where the waitpid call can hang undefinitely on the call.  However
this is also a very unlikely and also undefinied situation where
both the caller is trying to terminate a pid before posix_spawn
returns and the race pid reuse is triggered.  I don't see how to
correct handle this specific situation within posix_spawn.

Checked on x86_64-linux-gnu, aarch64-linux-gnu and
powerpc64-linux-gnu.

* sysdeps/unix/sysv/linux/spawni.c (__spawnix): Use 0 instead of
WNOHANG in waitpid call.

6 years agoaarch64: Document _SC_LEVEL1_DCACHE_LINESIZE caveat
Siddhesh Poyarekar [Mon, 23 Oct 2017 14:52:42 +0000 (20:22 +0530)]
aarch64: Document _SC_LEVEL1_DCACHE_LINESIZE caveat

The _SC_LEVEL1_DCACHE_LINESIZE is reported using the contents of the
ctr_el0 register, which tells us the minimum observable cache line
size by userspace.  This typically is the same as the L1 cache line
size, but that may not always be true.  It could be a higher level
cache line size as long as cache cleaning and invalidation work
correctly with that line size in userspace.  The falkor core for
example reports the L2 line size as the dcache line size in CTR_EL0
while also reporting the correct L1 dcache line size via CCSIDR_EL1.

* manual/conf.texi (_SC_LEVEL1_DCACHE_LINESIZE,
_SC_LEVEL1_ICACHE_LINESIZE): Document aarch64 caveat.

Reviewed-by: Rical Jasan <ricaljasan@pacific.net>
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
6 years agoDocument cache information sysconf variables
Siddhesh Poyarekar [Mon, 23 Oct 2017 14:49:34 +0000 (20:19 +0530)]
Document cache information sysconf variables

Write short descriptions for each of the cache information sysconf
variables.

* manual/conf.texi (_SC_LEVEL1_ICACHE_SIZE,
_SC_LEVEL1_ICACHE_ASSOC, _SC_LEVEL1_ICACHE_LINESIZE,
_SC_LEVEL1_DCACHE_SIZE, _SC_LEVEL1_DCACHE_ASSOC,
_SC_LEVEL1_DCACHE_LINESIZE, _SC_LEVEL2_CACHE_SIZE,
_SC_LEVEL2_CACHE_ASSOC, _SC_LEVEL2_CACHE_LINESIZE,
_SC_LEVEL3_CACHE_SIZE, _SC_LEVEL3_CACHE_ASSOC,
_SC_LEVEL3_CACHE_LINESIZE, _SC_LEVEL4_CACHE_SIZE,
_SC_LEVEL4_CACHE_ASSOC, _SC_LEVEL4_CACHE_LINESIZE): New
variables.

Reviewed-by: Rical Jasan <ricaljasan@pacific.net>
6 years agoaarch64: Add missing math Makefile for recent commit
Szabolcs Nagy [Mon, 23 Oct 2017 14:31:37 +0000 (15:31 +0100)]
aarch64: Add missing math Makefile for recent commit

Without -fno-math-errno, the builtins just do a call instead of
inlining a single instruction.

6 years agoaarch64: Implement math acceleration via builtins
Michael Collison [Mon, 23 Oct 2017 09:28:01 +0000 (10:28 +0100)]
aarch64: Implement math acceleration via builtins

This patch converts asm statements into builtins for AArch64.  As an
example for the file sysdeps/aarch64/fpu/s_ceil.c, we convert the
function from

double
__ceil (double x)
{
  double result;
  asm ("frintp\t%d0, %d1" :
       "=w" (result) : "w" (x) );
  return result;
}

into

double
__ceil (double x)
{
  return __builtin_ceil (x);
}

Tested on aarch64-linux-gnu with gcc-4.9.4 and gcc-6.

* sysdeps/aarch64/fpu/e_sqrt.c (ieee754_sqrt): Replace asm statements
with __builtin_sqrt.
* sysdeps/aarch64/fpu/e_sqrtf.c (ieee754_sqrtf): Replace asm statements
with __builtin_sqrtf.
* sysdeps/aarch64/fpu/s_ceil.c (__ceil): Replace asm statements
with __builtin_ceil.
* sysdeps/aarch64/fpu/s_ceilf.c (__ceilf): Replace asm statements
with __builtin_ceilf.
* sysdeps/aarch64/fpu/s_floor.c (__floor): Replace asm statements
with __builtin_floor.
* sysdeps/aarch64/fpu/s_floorf.c (__floorf): Replace asm statements
with __builtin_floorf.
* sysdeps/aarch64/fpu/s_fma.c (__fma): Replace asm statements
with __builtin_fma.
* sysdeps/aarch64/fpu/s_fmaf.c (__fmaf): Replace asm statements
with __builtin_fmaf.
* sysdeps/aarch64/fpu/s_fmax.c (__fmax): Replace asm statements
with __builtin_fmax.
* sysdeps/aarch64/fpu/s_fmaxf.c (__fmaxf): Replace asm statements
with __builtin_fmaxf.
* sysdeps/aarch64/fpu/s_fmin.c (__fmin): Replace asm statements
with __builtin_fmin.
* sysdeps/aarch64/fpu/s_fminf.c (__fminf): Replace asm statements
with __builtin_fminf.
* sysdeps/aarch64/fpu/s_frint.c: Delete file.
* sysdeps/aarch64/fpu/s_frintf.c: Delete file.
* sysdeps/aarch64/fpu/s_llrint.c (__llrint): Replace asm statements
with builtin_rint and conversion to int.
* sysdeps/aarch64/fpu/s_llrintf.c (__llrintf): Likewise.
* sysdeps/aarch64/fpu/s_llround.c (__llround): Replace asm statements
with builtin_llround.
* sysdeps/aarch64/fpu/s_llroundf.c (__llroundf): Likewise.
* sysdeps/aarch64/fpu/s_lrint.c (__lrint): Replace asm statements
with builtin_rint and conversion to long int.
* sysdeps/aarch64/fpu/s_lrintf.c (__lrintf): Likewise.
* sysdeps/aarch64/fpu/s_lround.c (__lround): Replace asm statements
with builtin_lround.
* sysdeps/aarch64/fpu/s_lroundf.c (__lroundf): Replace asm statements
with builtin_lroundf.
* sysdeps/aarch64/fpu/s_nearbyint.c (__nearbyint): Replace asm
statements with __builtin_nearbyint.
* sysdeps/aarch64/fpu/s_nearbyintf.c (__nearbyintf): Replace asm
statements with __builtin_nearbyintf.
* sysdeps/aarch64/fpu/s_rint.c (__rint): Replace asm statements
with __builtin_rint.
* sysdeps/aarch64/fpu/s_rintf.c (__rintf): Replace asm statements
with __builtin_rintf.
* sysdeps/aarch64/fpu/s_round.c (__round): Replace asm statements
with __builtin_round.
* sysdeps/aarch64/fpu/s_roundf.c (__roundf): Replace asm statements
with __builtin_roundf.
* sysdeps/aarch64/fpu/s_trunc.c (__trunc): Replace asm statements
with __builtin_trunc.
* sysdeps/aarch64/fpu/s_truncf.c (__truncf): Replace asm statements
with __builtin_truncf.
* sysdeps/aarch64/fpu/Makefile: Build e_sqrt[f].c with -fno-math-errno.

6 years agoPowerPC64 power8 strncpy cfi fixes
Alan Modra [Sun, 22 Oct 2017 21:14:50 +0000 (07:44 +1030)]
PowerPC64 power8 strncpy cfi fixes

cfi info for stack adjust needs to be on the insn doing the adjust.
cfi describing register saves can be anywhere after the save insn but
before the reg is altered.  Fewer locations with cfi result in smaller
cfi programs and possibly slightly faster exception handling.  Thus
the LR cfi_offset move.

The idea behind ajusting sp after restoring regs is to break a
register dependency chain, in this case not be using r1 immediately
after it is modified.

The missing LR cfi_restore meant that code after the blr,
unaligned_lt_16 and other labels, would have cfi that said LR was at
cfa+16, but that code is reached without LR being saved.

* sysdeps/powerpc/powerpc64/power8/strncpy.S: Move LR cfi.
Adjust stack after restoring regs.  Add missing LR cfi_restore.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
6 years agoPowerPC64 power7 strncpy stack handling and cfi
Alan Modra [Sun, 22 Oct 2017 21:13:32 +0000 (07:43 +1030)]
PowerPC64 power7 strncpy stack handling and cfi

This patch moves the frame setup and teardown to immediately around
the single memset call, as has been done for power8.  I've also
decreased FRAMESIZE to that needed to save the two callee-saved
registers used.  Plus added cfi.

* sysdeps/powerpc/powerpc64/power7/strncpy.S: Decrease FRAMESIZE.
Move LR save and frame setup/teardown and LR restore to
immediately around memset call.  Provide cfi.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
6 years agoi386: Replace assembly versions of e_powf with generic e_powf.c
H.J. Lu [Sun, 22 Oct 2017 15:11:15 +0000 (08:11 -0700)]
i386: Replace assembly versions of e_powf with generic e_powf.c

This patch replaces i386 assembly versions of e_powf with generic
e_powf.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      230.855          78.3358       194%
latency                    231.685          94.1259       146%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      239.858          47.4713       405%
latency                    247.57           93.8798       163%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      269.078          63.3758       324%
latency                    271.473          102.091       165%

* sysdeps/i386/fpu/e_powf.S: Removed.
* sysdeps/i386/fpu/e_powf_log2_data.c: Likewise.
* sysdeps/i386/fpu/w_powf.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_powf.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_powf-sse2.
(CFLAGS-e_powf-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_powf.c: Likewise.

6 years agoi386: Replace assembly versions of e_log2f with generic e_log2f.c
H.J. Lu [Sun, 22 Oct 2017 15:09:08 +0000 (08:09 -0700)]
i386: Replace assembly versions of e_log2f with generic e_log2f.c

This patch replaces i386 assembly versions of e_log2f with generic
e_log2f.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      92.3845          30.8752       199%
latency                    112.855          54.8645       105%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      98.7488          22.7507       334%
latency                    118.01           51.6083       128%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      106.635          28.8596       269%
latency                    129.888          56.9187       128%

* sysdeps/i386/fpu/e_log2f.S: Removed.
* sysdeps/i386/fpu/e_log2f_data.c: Likewise.
* sysdeps/i386/fpu/w_log2f.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_log2f.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_log2f-sse2.
(CFLAGS-e_log2f-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_log2f.c: Likewise.

6 years agox86-64: Add powf with FMA
H.J. Lu [Sun, 22 Oct 2017 15:07:48 +0000 (08:07 -0700)]
x86-64: Add powf with FMA

For workload-spec2017.wrf, on Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      35.4713          27.3842       29%
latency                    82.4537          66.3175       24%

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

6 years agox86-64: Add log2f with FMA
H.J. Lu [Sun, 22 Oct 2017 15:06:46 +0000 (08:06 -0700)]
x86-64: Add log2f with FMA

For workload-spec2017.wrf, on Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      16.5937          14.0789       17%
latency                    41.7755          35.3586       18%

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

6 years agox86-64: Add logf with FMA
H.J. Lu [Sun, 22 Oct 2017 15:03:46 +0000 (08:03 -0700)]
x86-64: Add logf with FMA

For workload-spec2017.wrf, on Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      16.1534          13.8874       16%
latency                    41.9642          34.3072       22%

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

6 years agoi386: Replace assembly versions of e_logf with generic e_logf.c
H.J. Lu [Sun, 22 Oct 2017 15:01:38 +0000 (08:01 -0700)]
i386: Replace assembly versions of e_logf with generic e_logf.c

This patch replaces i386 assembly versions of e_logf with generic
e_logf.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      73.3865          40.0454       83%
latency                    90.0985          54.4479       65%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      75.1384          22.1452       239%
latency                    91.9441          50.7925       81%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      84.5575          28.7879       193%
latency                    103.971          57.5231       80%

* sysdeps/i386/fpu/e_logf.S: Removed.
* sysdeps/i386/fpu/e_logf_data.c: Likewise.
* sysdeps/i386/fpu/w_logf.c: Likewise.
* sysdeps/i386/i686/fpu/e_logf.S: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_logf.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_logf-sse2.
(CFLAGS-e_logf-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_logf.c: Likewise.

6 years agoi386: Replace assembly versions of e_exp2f with generic e_exp2f.c
H.J. Lu [Sun, 22 Oct 2017 14:58:54 +0000 (07:58 -0700)]
i386: Replace assembly versions of e_exp2f with generic e_exp2f.c

This patch replaces i386 assembly versions of e_exp2f with generic
e_exp2f.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      112.996          40.0454       182%
latency                    126.581          54.4479       132%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      113.14           39.447        186%
latency                    136.068          55.684        144%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      132.521          40.3759       228%
latency                    145.791          58.4587       149%

* sysdeps/i386/fpu/e_exp2f.S: Removed.
* sysdeps/i386/fpu/w_exp2f.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_exp2f.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_exp2f-sse2.
(CFLAGS-e_exp2f-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_exp2f.c: Likewise.

6 years agox86-64: Add exp2f with FMA
H.J. Lu [Sun, 22 Oct 2017 14:55:49 +0000 (07:55 -0700)]
x86-64: Add exp2f with FMA

For workload-spec2017.wrf, on Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      13.0291          11.2225       16%
latency                    44.5154          37.5766       18%

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

6 years agoi386: Replace assembly versions of e_expf with generic e_expf.c
H.J. Lu [Sun, 22 Oct 2017 14:54:38 +0000 (07:54 -0700)]
i386: Replace assembly versions of e_expf with generic e_expf.c

This patch replaces i386 assembly versions of e_expf with generic
e_expf.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      55.5724          40.2664       38%
latency                    80.0687          60.8517       31%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      62.4056          39.4188       58%
latency                    85.5496          59.6377       43%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      133.707          40.3778       231%
latency                    149.191          63.2515       135%

* sysdeps/i386/fpu/e_exp2f_data.c: Removed.
* sysdeps/i386/fpu/e_expf.S: Likewise.
* sysdeps/i386/fpu/math_errf.c: Likewise.
* sysdeps/i386/fpu/w_expf.c: Likewise.
* sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S: Likewise.
* sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S: Likewise.
* sysdeps/i386/i686/fpu/multiarch/w_expf.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_expf.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Remove e_expf-ia32.
(CFLAGS-e_expf-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_expf.c: Rewritten.

6 years agox86-64: Replace assembly versions of e_expf with generic e_expf.c
H.J. Lu [Sun, 22 Oct 2017 14:49:36 +0000 (07:49 -0700)]
x86-64: Replace assembly versions of e_expf with generic e_expf.c

This patch replaces x86-64 assembly versions of e_expf with generic
e_expf.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      36.039           20.7749       73%
latency                    58.8096          40.8715       43%

On Skylake, it improves

                           Before            After     Improvement
reciprocal-throughput      18.4436          11.1693       65%
latency                    47.5162          37.5411       26%

* sysdeps/x86_64/fpu/e_expf.S: Removed.
* sysdeps/x86_64/fpu/multiarch/e_expf-fma.S: Likewise.
* sysdeps/x86_64/fpu/w_expf.c: Likewise.
* sysdeps/x86_64/fpu/libm-test-ulps: Updated for generic
e_expf.c.
* sysdeps/x86_64/fpu/multiarch/Makefile (CFLAGS-e_expf-fma.c):
New.
* sysdeps/x86_64/fpu/multiarch/e_expf-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_expf.c (__redirect_ieee754_expf):
Renamed to ...
(__redirect_expf): This.
(SYMBOL_NAME): Changed to expf.
(__ieee754_expf): Renamed to ...
(__expf): This.
(__GI___expf): This.
(__ieee754_expf): Add strong_alias.
(__expf_finite): Likewise.
(__expf): New.
Include <sysdeps/ieee754/flt-32/e_expf.c>.

6 years agoglob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332]
Paul Eggert [Sun, 22 Oct 2017 08:00:57 +0000 (10:00 +0200)]
glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332]

6 years agoUpdate NEWS and ChangeLog for CVE-2017-15671
Florian Weimer [Sun, 22 Oct 2017 07:29:52 +0000 (09:29 +0200)]
Update NEWS and ChangeLog for CVE-2017-15671

6 years agoglob: Add new test tst-glob-tilde
Florian Weimer [Sat, 21 Oct 2017 16:03:30 +0000 (18:03 +0200)]
glob: Add new test tst-glob-tilde

The new test checks for memory leaks (see bug 22325) and attempts
to trigger the buffer overflow in bug 22320.

6 years agoAdd bits/floatn.h defines for more _FloatN / _FloatNx types.
Joseph Myers [Fri, 20 Oct 2017 21:42:51 +0000 (21:42 +0000)]
Add bits/floatn.h defines for more _FloatN / _FloatNx types.

The bits/floatn.h header currently only has defines relating to
_Float128.  This patch adds defines relating to other _FloatN /
_FloatNx types.

The approach taken is to add defines for all _FloatN / _FloatNx types
known to GCC, and to put them in a common bits/floatn-common.h header
included at the end of all the individual bits/floatn.h headers.  If
in future some defines become different for different glibc
configurations, they will move out into the separate bits/floatn.h
headers.

Some defines are expected always to be the same across glibc ports.
Corresponding defines are nevertheless put in this header.  The intent
is that where there are conditionals (in headers or in non-installed
files) that can just repeat the same or nearly the same logic for each
floating-point type, they should do so, even if in fact the cases for
some types could be unconditionally present or absent because the same
conditionals are true or false for all glibc configurations.  This
should make the glibc code with such conditionals easier to read,
because the reader can just see that the same conditionals are
repeated for each type, rather than seeing different conditionals for
different types and needing to reason, at each location with such
differences, why those differences are indeed correct there.  (Cases
involving per-format rather than per-type logic are more likely still
to need differences in how they handle different types.)

Having such defines and conditionals also helps in incremental
preparation for adding _Float32 / _Float64 / _Float32x / _Float64x
function aliases.  I intend subsequent patches to add such
conditionals corresponding to those already present for _Float128, as
well as making more architecture-specific function implementations use
common macros to define aliases in preparation for adding such _FloatN
/ _FloatNx aliases.

Tested for x86_64.

* bits/floatn-common.h: New file.
* math/Makefile (headers): Add bits/floatn-common.h.
* bits/floatn.h: Include <bits/floatn-common.h>.
* sysdeps/ia64/bits/floatn.h: Likewise.
* sysdeps/ieee754/ldbl-128/bits/floatn.h: Likewise.
* sysdeps/mips/ieee754/bits/floatn.h: Likewise.
* sysdeps/powerpc/bits/floatn.h: Likewise.
* sysdeps/x86/bits/floatn.h: Likewise.

6 years agoAvoid build multiarch if compiler warns about mismatched alias
Adhemerval Zanella [Tue, 10 Oct 2017 14:12:50 +0000 (11:12 -0300)]
Avoid build multiarch if compiler warns about mismatched alias

GCC 8 emits an warning for alias for functions with incompatible types
and it is used extensivelly for ifunc resolvers implementations in C
(for instance on weak_alias with the internal symbol name to the
external one or with the libc_hidden_def to set ifunc for internal
usage).

This breaks the build when the ifunc resolver is not defined using
gcc attribute extensions (HAVE_GCC_IFUNC being 0).  Although for
all currently architectures that have multiarch support this compiler
options is enabled for default, there is still the option where the
user might try build glibc with a compiler without support for such
extension.  In this case this patch just disable the multiarch folder
in sysdeps selections.

GCC 7 and before still builds IFUNCs regardless of compiler support
(although for the lack of attribute support debug information would
be optimal).

Checked with a build on multiarch support architectures (aarch64,
arm, sparc, s390, powerpc, x86_64, i386) with multiarch enable
and disable and with GCC 7 and GCC 8.

* configure.ac (libc_cv_gcc_incompatbile_alias): New define:
indicates whether compiler emits an warning for alias for
functions with incompatible types.

6 years agoposix: Fix improper assert in Linux posix_spawn (BZ#22273)
Adhemerval Zanella [Thu, 12 Oct 2017 18:20:57 +0000 (15:20 -0300)]
posix: Fix improper assert in Linux posix_spawn (BZ#22273)

As noted by Florian Weimer, current Linux posix_spawn implementation
can trigger an assert if the auxiliary process is terminated before
actually setting the err member:

    340   /* Child must set args.err to something non-negative - we rely on
    341      the parent and child sharing VM.  */
    342   args.err = -1;
    [...]
    362   new_pid = CLONE (__spawni_child, STACK (stack, stack_size), stack_size,
    363                    CLONE_VM | CLONE_VFORK | SIGCHLD, &args);
    364
    365   if (new_pid > 0)
    366     {
    367       ec = args.err;
    368       assert (ec >= 0);

Another possible issue is killing the child between setting the err and
actually calling execve.  In this case the process will not ran, but
posix_spawn also will not report any error:

    269
    270   args->err = 0;
    271   args->exec (args->file, args->argv, args->envp);

As suggested by Andreas Schwab, this patch removes the faulty assert
and also handles any signal that happens before fork and execve as the
spawn was successful (and thus relaying the handling to the caller to
figure this out).  Different than Florian, I can not see why using
atomics to set err would help here, essentially the code runs
sequentially (due CLONE_VFORK) and I think it would not be legal the
compiler evaluate ec without checking for new_pid result (thus there
is no need to compiler barrier).

Summarizing the possible scenarios on posix_spawn execution, we
have:

  1. For default case with a success execution, args.err will be 0, pid
     will not be collected and it will be reported to caller.

  2. For default failure case, args.err will be positive and the it will
     be collected by the waitpid.  An error will be reported to the
     caller.

  3. For the unlikely case where the process was terminated and not
     collected by a caller signal handler, it will be reported as succeful
     execution and not be collected by posix_spawn (since args.err will
     be 0). The caller will need to actually handle this case.

  4. For the unlikely case where the process was terminated and collected
     by caller we have 3 other possible scenarios:

     4.1. The auxiliary process was terminated with args.err equal to 0:
  it will handled as 1. (so it does not matter if we hit the pid
          reuse race since we won't possible collect an unexpected
          process).

     4.2. The auxiliary process was terminated after execve (due a failure
          in calling it) and before setting args.err to -1: it will also
          be handle as 1. but with the issue of not be able to report the
          caller a possible execve failures.

     4.3. The auxiliary process was terminated after args.err is set to -1:
          this is the case where it will be possible to hit the pid reuse
          case where we will need to collected the auxiliary pid but we
          can not be sure if it will be expected one.  I think for this
          case we need to actually change waitpid to use WNOHANG to avoid
          hanging indefinitely on the call and report an error to caller
          since we can't differentiate between a default failure as 2.
          and a possible pid reuse race issue.

Checked on x86_64-linux-gnu.

* sysdeps/unix/sysv/linux/spawni.c (__spawnix): Handle the case where
the auxiliary process is terminated by a signal before calling _exit
or execve.

6 years agox86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve [BZ #21265]
H.J. Lu [Fri, 20 Oct 2017 18:00:08 +0000 (11:00 -0700)]
x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve [BZ #21265]

In _dl_runtime_resolve, use fxsave/xsave/xsavec to preserve all vector,
mask and bound registers.  It simplifies _dl_runtime_resolve and supports
different calling conventions.  ld.so code size is reduced by more than
1 KB.  However, use fxsave/xsave/xsavec takes a little bit more cycles
than saving and restoring vector and bound registers individually.

Latency for _dl_runtime_resolve to lookup the function, foo, from one
shared library plus libc.so:

                             Before    After     Change

Westmere (SSE)/fxsave         345      866       151%
IvyBridge (AVX)/xsave         420      643       53%
Haswell (AVX)/xsave           713      1252      75%
Skylake (AVX+MPX)/xsavec      559      719       28%
Skylake (AVX512+MPX)/xsavec   145      272       87%
Ryzen (AVX)/xsavec            280      553       97%

This is the worst case where portion of time spent for saving and
restoring registers is bigger than majority of cases.  With smaller
_dl_runtime_resolve code size, overall performance impact is negligible.

On IvyBridge, differences in build and test time of binutils with lazy
binding GCC and binutils are noises.  On Westmere, differences in
bootstrap and "makc check" time of GCC 7 with lazy binding GCC and
binutils are also noises.

[BZ #21265]
* sysdeps/x86/cpu-features-offsets.sym (XSAVE_STATE_SIZE_OFFSET):
New.
* sysdeps/x86/cpu-features.c: Include <libc-pointer-arith.h>.
(get_common_indeces): Set xsave_state_size, xsave_state_full_size
and bit_arch_XSAVEC_Usable if needed.
(init_cpu_features): Remove bit_arch_Use_dl_runtime_resolve_slow
and bit_arch_Use_dl_runtime_resolve_opt.
* sysdeps/x86/cpu-features.h (bit_arch_Use_dl_runtime_resolve_opt):
Removed.
(bit_arch_Use_dl_runtime_resolve_slow): Likewise.
(bit_arch_Prefer_No_AVX512): Updated.
(bit_arch_MathVec_Prefer_No_AVX512): Likewise.
(bit_arch_XSAVEC_Usable): New.
(STATE_SAVE_OFFSET): Likewise.
(STATE_SAVE_MASK): Likewise.
[__ASSEMBLER__]: Include <cpu-features-offsets.h>.
(cpu_features): Add xsave_state_size and xsave_state_full_size.
(index_arch_Use_dl_runtime_resolve_opt): Removed.
(index_arch_Use_dl_runtime_resolve_slow): Likewise.
(index_arch_XSAVEC_Usable): New.
* sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)):
Support XSAVEC_Usable.  Remove Use_dl_runtime_resolve_slow.
* sysdeps/x86_64/Makefile (tst-x86_64-1-ENV): New if tunables
is enabled.
* sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup):
Replace _dl_runtime_resolve_sse, _dl_runtime_resolve_avx,
_dl_runtime_resolve_avx_slow, _dl_runtime_resolve_avx_opt,
_dl_runtime_resolve_avx512 and _dl_runtime_resolve_avx512_opt
with _dl_runtime_resolve_fxsave, _dl_runtime_resolve_xsave and
_dl_runtime_resolve_xsavec.
* sysdeps/x86_64/dl-trampoline.S (DL_RUNTIME_UNALIGNED_VEC_SIZE):
Removed.
(DL_RUNTIME_RESOLVE_REALIGN_STACK): Check STATE_SAVE_ALIGNMENT
instead of VEC_SIZE.
(REGISTER_SAVE_BND0): Removed.
(REGISTER_SAVE_BND1): Likewise.
(REGISTER_SAVE_BND3): Likewise.
(REGISTER_SAVE_RAX): Always defined to 0.
(VMOV): Removed.
(_dl_runtime_resolve_avx): Likewise.
(_dl_runtime_resolve_avx_slow): Likewise.
(_dl_runtime_resolve_avx_opt): Likewise.
(_dl_runtime_resolve_avx512): Likewise.
(_dl_runtime_resolve_avx512_opt): Likewise.
(_dl_runtime_resolve_sse): Likewise.
(_dl_runtime_resolve_sse_vex): Likewise.
(USE_FXSAVE): New.
(_dl_runtime_resolve_fxsave): Likewise.
(USE_XSAVE): Likewise.
(_dl_runtime_resolve_xsave): Likewise.
(USE_XSAVEC): Likewise.
(_dl_runtime_resolve_xsavec): Likewise.
* sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_avx512):
Removed.
(_dl_runtime_resolve_avx512_opt): Likewise.
(_dl_runtime_resolve_avx): Likewise.
(_dl_runtime_resolve_avx_opt): Likewise.
(_dl_runtime_resolve_sse): Likewise.
(_dl_runtime_resolve_sse_vex): Likewise.
(_dl_runtime_resolve_fxsave): New.
(_dl_runtime_resolve_xsave): Likewise.
(_dl_runtime_resolve_xsavec): Likewise.

6 years agoMention Tim Rühsen as the reporter for CVE-2017-15670
Florian Weimer [Fri, 20 Oct 2017 17:28:44 +0000 (19:28 +0200)]
Mention Tim Rühsen as the reporter for CVE-2017-15670

6 years agoCVE-2017-15670: glob: Fix one-byte overflow [BZ #22320]
Paul Eggert [Fri, 20 Oct 2017 16:41:14 +0000 (18:41 +0200)]
CVE-2017-15670: glob: Fix one-byte overflow [BZ #22320]

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