Commit Graph

21245 Commits

Author SHA1 Message Date
Siddhesh Poyarekar 29c933fb35 benchtests: Make memset benchmarks print json
Make the memset benchmarks (bench-memset and bench-memset-large) print
their output in JSON so that they can be evaluated using the
compare_strings.py script.

	* benchtests/bench-memset-large.c: Print output in JSON
	format.
	* benchtests/bench-memset.c: Likewise.
2017-09-14 22:54:23 +05:30
Mike FABIAN 799c8d6905 Add new codepage charmaps/IBM858 [BZ #21084]
This code page is identical to code page 850 except that X'D5'
has been changed from LI61 (dotless i) to SC20 (euro symbol).

The code points from /x01 to /x1f in the /localedata/charmaps/IBM858
file have the same mapping as those in localedata/charmaps/ANSI_X3.4-1968.
That means they disagree with with

ftp://ftp.software.ibm.com/software/globalization/gcoc/attachments/CP00858.txt

in that range.
For example, localedata/charmaps/IBM858 and localedata/charmaps/ANSI_X3.4-1968 have:

   “<U0001>     /x01         START OF HEADING (SOH)”

whereas CP00858.txt has:

   “01 SS000000        Smiling Face”

That means that CP00858.txt is not really ASCII-compatible and to make
it ASCII-compatible we deviate fro CP00858.txt in the code points from /x01
to /x1f.

	[BZ #21084]
	* benchtests/strcoll-inputs/filelist#en_US.UTF-8: Add IBM858 and ibm858.c.
	* iconvdata/Makefile: Add IBM858.
	* iconvdata/gconv-modules: Add IBM858.
	* iconvdata/ibm858.c: New file.
	* iconvdata/tst-tables.sh: Add IBM858
	* localedata/charmaps/IBM858: New file.
2017-09-14 15:50:57 +02:00
Akhilesh Kumar fcc82c06dc Removed redundant data (LC_TIME and LC_MESSAGES) for niu_NZ [BZ #22023]
[BZ #22023]
	* locales/niu_NZ (LC_TIME): copy "niu_NU".
	* locales/niu_NZ (LC_MESSAGES): copy "niu_NU".
2017-09-14 13:50:20 +02:00
Akhilesh Kumar f28a0926c5 Fix LC_TELEPHONE for az_AZ [BZ #22112]
[BZ #22112]
	* localedata/locales/az_AZ(LC_TELEPHONE): Fix int_select
	and add tel_int_fmt.
2017-09-14 12:37:13 +02:00
Joseph Myers 02093e6222 Define and use libm_alias_float128.
Continuing the process of setting up common macros for libm function
aliases, with a view to using them to define _FloatN / _FloatNx
aliases in future, this patch adds a libm_alias_float128 macro and
uses it in the type-generic templates.  (_Float128 functions will end
up with _Float64x aliases on powerpc64le, but not on x86_64/x86/ia64
because _Float64x has long double format there, and the macro will
provide a single place for the conditionals for that choice, as well
as for once ldbl-128 functions always build *f128 and need
conditionals for whether to have *l aliases.)

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

	* sysdeps/generic/libm-alias-float128.h: New file.
	* sysdeps/generic/math-type-macros-float128.h: Include
	<libm-alias-float128.h>.
	[!declare_mgen_alias] (declare_mgen_alias): Define macro.
2017-09-14 01:11:46 +00:00
Joseph Myers 1aae75ef80 Define and use libm_alias_ldouble.
Continuing the process of setting up common macros for libm function
aliases, with a view to using them to define _FloatN / _FloatNx
aliases in future, this patch adds a libm_alias_ldouble macro and uses
it in the type-generic templates.

Since math-type-macros-ldouble.h already did the appropriate thing for
each symbol (weak_alias or long_double_symbol), this is just a
straightforward rearrangement of code, to make the required logic
available in a place that can also be used outside of the type-generic
templates in future (in particular, to eliminate various wrappers for
functions in ldbl-opt and ldbl-64-128).

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

	* sysdeps/generic/libm-alias-ldouble.h: New file.
	* sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h: Likewise.
	* sysdeps/ieee754/ldbl-opt/math-type-macros-ldouble.h: Remove.
	* sysdeps/generic/math-type-macros-ldouble.h: Include
	<libm-alias-ldouble.h>.
	[!declare_mgen_alias] (declare_mgen_alias): Define to use
	libm_alias_ldouble.
2017-09-13 22:17:23 +00:00
Szabolcs Nagy bcea7ad608 Move exp compat wrappers under math/
Move exp compat wrappers to math/w_exp{,f,l}_compat.c to be
consistent with other wrappers.

	* sysdeps/ieee754/dbl-64/w_exp_compat.c: Move to...
	* math/w_exp_compat.c: ... here.
	* sysdeps/ieee754/flt-32/w_expf_compat.c: Move to...
	* math/w_expf_compat.c: ... here.
	* sysdeps/ieee754/ldbl-128/w_expl_compat.c: Move to...
	* math/w_expl_compat.c: ... here.
	* sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c: Remove.
	* sysdeps/ieee754/ldbl-96/w_expl_compat.c: Remove.
	* sysdeps/ieee754/ldbl-opt/w_exp_compat.c: Use the new path.
	* sysdeps/ieee754/ldbl-opt/w_expl_compat.c: Likewise.
2017-09-13 17:22:22 +01:00
Joseph Myers 0fc56478a9 Clear up log1p, ldexp, scalbn, scalbln compat handling.
This patch cleans up how compat symbols / long double versioning are
handled for log1p, ldexp, scalbn and scalbln functions.

The general principle is to do as much as possible through the
type-generic templates.  Previously, when errno-setting wrappers were
added the compat long double symbols were left pointing directly to
the underlying implementations; they are moved to point to the
errno-setting wrappers.  For the functions also present in libc,
compat symbol handling for the libc copies needs to go in ldbl-opt
wrappers, but the type-generic templates can handle it for the libm
copies.  There is no need for w_scalbln_template.c to disable the
creation of an unused internal alias (such code made sense in the
context of patches trying to avoid any changes to generated code for
ease of comparison, but can be removed in a change that specifically
does intend to change details of where symbols point).

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

	* math/w_scalbln_template.c (strong_alias): Do not undefine and
	redefine.
	* sysdeps/ieee754/ldbl-opt/s_ldexp.c (declare_mgen_alias): Remove
	macro.
	(ldexpl): Only define as compat symbol for libc, not libm.
	(scalbnl): Define as compat symbol for libc here.
	* sysdeps/ieee754/ldbl-opt/s_ldexpl.c (declare_mgen_alias): Only
	define for [IS_IN (libc)].
	(__ldexpl_2): Remove alias.
	(ldexpl): Only define with long_double_symbol if [IS_IN (libc)].
	(scalbnl): Likewise.  Use __wrap_scalbnl not __ldexpl_2 as base
	name in long_double_symbol call.
	* sysdeps/ieee754/ldbl-opt/s_log1p.c: Remove file.
	* sysdeps/ieee754/ldbl-opt/s_scalbln.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_scalbn.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_log1p.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_scalbln.c (declare_mgen_alias):
	Remove macro.
	[IS_IN (libc) && LONG_DOUBLE_COMPAT (libc, GLIBC_2_1)] (scalblnl):
	Define as compat symbol.
2017-09-13 15:47:26 +00:00
Adhemerval Zanella 3ca622e4d6 posix: Fix compat glob code on s390 and alpha
This patch fixes the compat glob implementation consolidation from
commit 116f1c64d with the following changes:

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

  - Remove the duplicate rule to build oldglob on alpha.

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

	* sysdeps/unix/sysv/linux/s390/s390-32/oldglob.c: New file.
	* sysdeps/unix/sysv/linux/alpha/Makefile
	[$(subdir) = csu] (sysdep_routines): Remove rule.
2017-09-13 09:24:12 -03:00
Joseph Myers 620ff9eea6 Define and use libm_alias_double.
Continuing the process of setting up common macros for libm function
aliases, with a view to using them to define _FloatN / _FloatNx
aliases in future, this patch adds a libm_alias_double macro and uses
it in the type-generic templates.

This macro handles defining aliases for double, and for long double in
the NO_LONG_DOUBLE case.  It also handles defining compat symbols for
long double = double for architectures that changed their long double
format.  By so doing, it eliminates the need for the
M_LIBM_NEED_COMPAT and declare_mgen_libm_compat macros; the single
declare_mgen_alias call in each template now suffices to define all
required compat symbols.  When used for more double functions (not
based on type-generic templates), I expect it will eliminate the need
for most ldbl-opt wrappers for such functions.

A few special cases are needed.  __clog10l is a public symbol (for
historical reasons) so needs to be given appropriate compat versions
for architectures that changed their long double format, but is not
defined as an alias using the normal macros since __clog10* are *not*
public symbols for _FloatN / _FloatNx types.  For scalbn, scalbln and
log1p, the changes adding errno setting support for those functions
left compat symbols pointing directly to the non-errno-setting
implementations.  There is no requirement for the compat symbols not
to set errno; that just made for the simplest patches at that time.
Now, with these common macros, it's natural to redirect the compat
symbols to the errno-setting wrappers, which I intend to do in a
separate patch.

Tested for x86_64, and with build-many-glibcs.py.  For ldbl-opt
platforms the stripped libm.so binaries are changed (disassembly
unchanged) because the details of how the clog10l compat symbol is
created mean it ceases to be weak as it was before; for other
platforms, stripped libm.so binaries are unchanged.

2017-09-13  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/generic/libm-alias-double.h: New file.
	* sysdeps/ieee754/ldbl-opt/libm-alias-double.h: Likewise.
	* sysdeps/generic/math-type-macros-double.h: Include
	<libm-alias-double.h>.
	[declare_mgen_alias] (declare_mgen_alias): Define to use
	libm_alias_double.
	* sysdeps/generic/math-type-macros.h [!M_LIBM_NEED_COMPAT]
	(M_LIBM_NEED_COMPAT): Remove macro.
	[!M_LIBM_NEED_COMPAT] (declare_mgen_libm_compat): Likewise.
	* sysdeps/ieee754/ldbl-opt/math-type-macros-double.h: Remove.
	* math/cabs_template.c [M_LIBM_NEED_COMPAT]: Remove conditional
	code.
	* math/carg_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/cimag_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/conj_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/creal_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_cacos_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_cacosh_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_casin_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_casinh_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_catan_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_catanh_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_ccos_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_ccosh_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_cexp_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_clog10_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_clog_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_cpow_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_cproj_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_csin_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_csinh_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_csqrt_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_ctan_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_ctanh_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_fdim_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_fmax_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_fmin_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/s_nan_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* math/w_ilogb_template.c [M_LIBM_NEED_COMPAT]: Likewise.
	* sysdeps/ieee754/ldbl-opt/s_clog10.c: New file.
	* sysdeps/ieee754/ldbl-opt/s_ldexp.c (M_LIBM_NEED_COMPAT): Remove
	macro.
	(declare_mgen_alias): New macro.
	* sysdeps/ieee754/ldbl-opt/w_log1p.c: New file.
	* sysdeps/ieee754/ldbl-opt/w_scalbln.c: Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c
	(M_LIBM_NEED_COMPAT): Remove macro.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
	[HAVE_AS_VIS3_SUPPORT]: Include <math_ldbl_opt.h> and
	<first-versions.h>.
	[HAVE_AS_VIS3_SUPPORT && LONG_DOUBLE_COMPAT (libm,
	FIRST_VERSION_libm_fdiml)]: Define fdiml as compat symbol.
2017-09-13 01:13:30 +00:00
Joseph Myers a891caff7a Remove declare_mgen_alias_2.
The libm template machinery includes a macro declare_mgen_alias_2, to
define two function aliases rather than one.  This macro is only used
in one place, to define ldexp and scalbn, and only has one nondefault
definition, for double in the case where long double has the same
format.  That definition is because declare_mgen_alias for double, in
that case, defines <internal-func>l as an alias of <internal-func>, so
cannot be called twice for aliases of the same function.

Now, I suspect the <internal-func>l aliases are generally not needed
(with maybe a few exceptions such as __clog10l, which is an exported
function).  But even in the presence of them, there is no need for a
special declare_mgen_alias_2 macro for this case.  This patch
eliminates the need for such a macro by defining __wrap_scalbn<suffix>
as an alias of __ldexp<suffix>, and then using that when defining the
scalbn public aliases.  This is similar to how such internal aliases
are created for functions with multiple symbol versions, for example.

Tested for x86_64, and with build-many-glibcs.py.  (There *are* some
cases where installed stripped shared libraries change - not in the
generated code but because such changes to static symbols on input to
ld, even nonexported symbols that don't affect the code or dynamic
symbols, can affect the particular representation in the output of
string tables, hash tables etc.)

	* sysdeps/generic/math-type-macros.h [!declare_mgen_alias_2]
	(declare_mgen_alias_2): Remove.
	* sysdeps/generic/math-type-macros-double.h
	[NO_LONG_DOUBLE && !declare_mgen_alias_2] (declare_mgen_alias_2):
	Likewise.
	* math/s_ldexp_template.c (M_SUF (__wrap_scalbn)): Define strong
	alias.
	(ldexp): Define with declare_mgen_alias.
	(scalbn): Likewise.
2017-09-12 20:00:00 +00:00
Steve Ellcey a1a7820416 Remove compat from DEFAULT_CONFIG lookup strings
* grp/initgroups.c: Include config.h.
	(DEFAULT_CONFIG): New macro.
	(internal_getgrouplist): Use DEFAULT_CONFIG.
	* nscd/initgrcache.c (addinitgroupsX): Likewise.
	* nss/nsswitch.c (__nss_disable_nscd): Likewise.
	(DEFAULT_DEFCONFIG): New macro.
	(__nss_database_lookup): Use DEFAULT_DEFCONFIG.
	* nss/grp-lookup.c: Include config.h
	(DEFAULT_CONFIG): Set definition based on LINK_OBSOLETE_NSL.
	* nss/pwd-lookup.c (DEFAULT_CONFIG): Likewise.
	* nss/spwd-lookup.c (DEFAULT_CONFIG): Likewise.
	* manual/nss.texi: Update default values section.
2017-09-12 10:21:48 -07:00
H.J. Lu ef8adeb041 x86: Add MathVec_Prefer_No_AVX512 to cpu-features [BZ #21967]
AVX512 functions in mathvec are used on machines with AVX512.  An AVX2
wrapper is also provided and it can be used when the AVX512 version
isn't profitable.  MathVec_Prefer_No_AVX512 is addded to cpu-features.
If glibc.tune.hwcaps=MathVec_Prefer_No_AVX512 is set in GLIBC_TUNABLES
environment variable, the AVX2 wrapper will be used.

Tested on x86-64 machines with and without AVX512.  Also verified
glibc.tune.hwcaps=MathVec_Prefer_No_AVX512 on AVX512 machine.

	[BZ #21967]
	* sysdeps/x86/cpu-features.h (bit_arch_MathVec_Prefer_No_AVX512):
	New.
	(index_arch_MathVec_Prefer_No_AVX512): Likewise.
	* sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)):
	Handle MathVec_Prefer_No_AVX512.
	* sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx512.h
	(IFUNC_SELECTOR): Return AVX2 version if MathVec_Prefer_No_AVX512
	is set.
2017-09-12 07:54:47 -07:00
Samuel Thibault a166531fdf hurd: Fix build without NO_HIDDEN
* posix/sched_primax.c (__sched_get_priority_max): Add
	libc_hidden_def.
	* posix/sched_primin.c (__sched_get_priority_min): Likewise.
	* sysdeps/mach/hurd/mmap.c (__mmap): Likewise.
	* sysdeps/mach/hurd/mmap64.c (__mmap64): Likewise.
	* sysdeps/mach/hurd/mprotect.c (__mprotect): Likewise.
	* sysdeps/mach/hurd/munmap.c (__munmap): Likewise.
	* sysdeps/mach/hurd/dl-sysdep.c (__GI___getpid,
	__GI___strtoul_internal, __GI_____strtoul_internal, __GI___chk_fail,
	__GI___fortify_fail, __GI___assert_fail, __GI___assert_perror_fail):
	Add aliases.
2017-09-12 01:34:19 +02:00
Joseph Myers 4b7d1efb51 Define and use a libm_alias_float macro.
Fully supporting TS 18661-3 _FloatN / _FloatNx types in the cases
where they have the same format as other supported types (in line with
the principles described at
<https://sourceware.org/ml/libc-alpha/2017-01/msg00333.html>) means
adding a lot of function aliases to libm (and a few to libc).  float
functions will have *f32 aliases, double functions will have *f32x and
*f64 aliases, long double functions may have *f64x, *f128 or both
aliases depending on the configuration, float128 functions have have
*f64x aliases depending on the configuration.

At present, most individual libm functions have their own weak_alias
calls to define the public names for those functions.  For TS 18661-3
support, it is desirable that functions not all need to duplicate the
logic for which alias names to define.

Thus, common macros for defining the public aliases to a libm function
make sense.  In the double and long double cases, such macros will
also help simplify existing code (with LONG_DOUBLE_COMPAT
etc. conditionals), by eliminating existing conditionals and ldbl-opt
/ ldbl-64-128 wrappers (using the generated ldbl-compat-choose.h to
allow a single macro definition to expand appropriately for each
symbol depending on LONG_DOUBLE_COMPAT for that symbol).

This patch starts the process of adding such macros with a
straightforward case: a libm_alias_float macro, initially only used in
the case of type-generic templates, to define aliases for float
functions (currently just the *f public names, in future also *f32).
Future patches are intended to add such macros for other types and to
extend the cases in which they are used, with a view to as many places
as possible using them before support for _FloatN / _FloatNx aliases
is enabled.  (I think it's inevitable that some places doing
architecture-specific things with aliases and symbol versioning may
end up needing to replicate logic for the new aliases, but hopefully
the number of such places can be kept to a minimum.)

The libm_alias_float macro takes unsuffixed names for both the
internal and public function names.  The need for unsuffixed public
names is obvious, since such macros will end up defining multiple
public names with different suffixes.  Unsuffixed internal names are
because I expect the ldbl-128 functions to end up in a form that
always defines *f128 names and sometimes also defines *l names - with
the main internal names being e.g. __ieee754_<func>f128 (so many
macros in float128_private.h can go away).  But __ieee754_<func>l
aliases will still be needed for e.g. use from math/ complex
functions, meaning the alias macro needs to see just __ieee754_<func>
as internal name so it can create an alias based on that name.  Since
libm_alias_float128 will thus need the unsuffixed internal name, it
seems to make sense for all such macros to receive the unsuffixed
name.

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

	* sysdeps/generic/libm-alias-float.h: New file.
	* sysdeps/generic/math-type-macros-float.h: Include
	<libm-alias-float.h>.
	[!declare_mgen_alias] (declare_mgen_alias): Define macro.
2017-09-11 23:21:25 +00:00
H.J. Lu 45ff34638f x86: Add x86_64 to x86-64 HWCAP [BZ #22093]
Before glibc 2.26, ld.so set dl_platform to "x86_64" and searched the
"x86_64" subdirectory when loading a shared library.  ld.so in glibc
2.26 was changed to set dl_platform to "haswell" or "xeon_phi", based
on supported ISAs.  This led to shared library loading failure for
shared libraries placed under the "x86_64" subdirectory.

This patch adds "x86_64" to x86-64 dl_hwcap so that ld.so will always
search the "x86_64" subdirectory when loading a shared library.

NB: We can't set x86-64 dl_platform to "x86-64" since ld.so will skip
the "haswell" and "xeon_phi" subdirectories on "haswell" and "xeon_phi"
machines.

Tested on i686 and x86-64.

	[BZ #22093]
	* sysdeps/x86/cpu-features.c (init_cpu_features): Initialize
	GLRO(dl_hwcap) to HWCAP_X86_64 for x86-64.
	* sysdeps/x86/dl-hwcap.h (HWCAP_COUNT): Updated.
	(HWCAP_IMPORTANT): Likewise.
	(HWCAP_X86_64): New enum.
	(HWCAP_X86_AVX512_1): Updated.
	* sysdeps/x86/dl-procinfo.c (_dl_x86_hwcap_flags): Add "x86_64".
	* sysdeps/x86_64/Makefile (tests): Add tst-x86_64-1.
	(modules-names): Add x86_64/tst-x86_64mod-1.
	(LDFLAGS-tst-x86_64mod-1.so): New.
	($(objpfx)tst-x86_64-1): Likewise.
	($(objpfx)x86_64/tst-x86_64mod-1.os): Likewise.
	(tst-x86_64-1-clean): Likewise.
	* sysdeps/x86_64/tst-x86_64-1.c: New file.
	* sysdeps/x86_64/tst-x86_64mod-1.c: Likewise.
2017-09-11 08:18:32 -07:00
Siddhesh Poyarekar 891abfd3c0 Update translations 2017-09-11 05:50:49 +05:30
Samuel Thibault 3bdfd9fbed sunrpc/tst-udp-nonblocking: Fix timeout value
This a follow-up to 00c3da4 ('sunrpc/tst-udp-timeout: Fix timeout value')

* sunrpc/tst-udp-nonblocking.c (do_test): Increase timeout to 0.75
seconds.
2017-09-10 21:09:28 +02:00
Samuel Thibault 65b22ebc61 Fix $(error) use in Makefile
* elf/rtld-Rules: Fix $(error) use.
2017-09-10 17:39:39 +02:00
Samuel Thibault 00c3da43ac sunrpc/tst-udp-timeout: Fix timeout value
2.3 is not representable with double, and thus leads to rounding issues if
the clock is not very precise and the measured delay is then exactly 2.3.

	* sunrpc/tst-udp-timeout.c (test_udp_server): Increase timeout to 2.5
	seconds.
2017-09-10 14:37:28 +02:00
Mike FABIAN 96480903ab Finish change from “Bengali” to “Bangla”
“Bengali” still remained in some comments in the bn_BD locale file,
in iso-639.def and in a test input file. Change it there as well.
“Bangla” is now used as the English name for this language in CLDR.

	[BZ #14925]
	* libio/tst-widetext.input: Change “Bengali” to “Bangla”.
	* locale/iso-639.def: Change “Bengali” to “Bangla”.
	* localedata/locales/bn_BD: “Bengali” was still used in some
	comments. Change it to “Bangla”.
2017-09-09 12:41:54 +02:00
Markus Trippelsdorf 4c03a69680 Update x86_64 ulps for AMD Ryzen.
* sysdeps/x86_64/fpu/libm-test-ulps: Update for AMD Ryzen.
2017-09-08 19:57:12 +00:00
Steve Ellcey 9c9ec58197 Add thunderx2t99 and thunderx2t99p1 CPU names to tunables list
* manual/tunables.texi (glibc.tune.cpu): Add thunderx2t99 and
	thunderx2t99p1 to list of cpu names.
	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (cpu_list):
	Add thunderx2t99 and thunderx2t99p1 entries to cpu_list.
2017-09-08 11:02:09 -07:00
Steve Ellcey f00bce744e Fix glibc.tune.cpu tunable handling
* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (get_midr_from_mcpu):
	Use strcmp instead of tunable_is_name.
2017-09-08 10:59:53 -07:00
Joseph Myers af1b7c8ca2 Add Linux 4.13 constants to bits/fcntl-linux.h.
This patch adds new interfaces (F_GET_RW_HINT etc., and associated
RW[FH]_WRITE_LIFE_*) from Linux 4.13 to bits/fcntl-linux.h
(conditional on __USE_GNU).

Tested for x86_64.

	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]
	(F_GET_RW_HINT): New macro.
	[__USE_GNU] (F_SET_RW_HINT): Likewise.
	[__USE_GNU] (F_GET_FILE_RW_HINT): Likewise.
	[__USE_GNU] (F_SET_FILE_RW_HINT): Likewise.
	[__USE_GNU] (RWF_WRITE_LIFE_NOT_SET): Likewise.
	[__USE_GNU] (RWH_WRITE_LIFE_NONE): Likewise.
	[__USE_GNU] (RWH_WRITE_LIFE_SHORT): Likewise.
	[__USE_GNU] (RWH_WRITE_LIFE_MEDIUM): Likewise.
	[__USE_GNU] (RWH_WRITE_LIFE_LONG): Likewise.
	[__USE_GNU] (RWH_WRITE_LIFE_EXTREME): Likewise.
2017-09-08 16:20:23 +00:00
Joseph Myers 27342d1783 Add fcntl sealing interfaces from Linux 3.17 to bits/fcntl-linux.h.
While reviewing Linux 4.13 for glibc header changes needed, I noticed
that bits/fcntl-linux.h was missing F_ADD_SEALS etc. from Linux 3.17.

I didn't find any discussion indicating this omission is deliberate.
Now, these interfaces can only be used with file descriptors created
with memfd_create, and we don't have a memfd_create wrapper in glibc
(a patch was submitted in October 2014, albeit without documentation /
tests, and discussions continued over the next few months, but without
consensus on whether to add the interface - and we still lack any
general consensus on syscall wrappers), but I don't think that's a
reason to exclude the constants from bits/fcntl-linux.h (especially as
the header does not look compatible with simultaneously including
linux/fcntl.h).

(Some of those 2014/2015 discussions raised concerns about difficulty
using the memfd_create / sealing interface, but those seem to me more
like a question of whether it should be part of the OS-independent GNU
API - in my view, even fairly specialized syscalls ought to have
wrappers added to glibc if not obsolescent, but there may be cases
where we only want to include them in the Linux-specific API and
anything in the OS-independent GNU API should be different - rather
than being relevant to whether constants for use with fcntl should
appear in headers.)

	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]
	(F_ADD_SEALS): New macro.
	[__USE_GNU] (F_GET_SEALS): Likewise.
	[__USE_GNU] (F_SEAL_SEAL): Likewise.
	[__USE_GNU] (F_SEAL_SHRINK): Likewise.
	[__USE_GNU] (F_SEAL_GROW): Likewise.
	[__USE_GNU] (F_SEAL_WRITE): Likewise.
2017-09-08 16:19:21 +00:00
Adhemerval Zanella 07b4f49db2 posix: Use enum for __glob_pattern_type result
This patch replaces the internal integer constant from
__glob_pattern_type return with a proper enum.

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

	* posix/glob_internal.h (glob_pattern_type_t): New enumeration.
	(__glob_pattern_type): Use __glob_pat_types.
	* posix/glob_pattern_p.c (__glob_pattern_p): Likewise.
	* posix/glob.c (glob): Likewise.
	(glob_in_dir): Likewise.
2017-09-08 16:34:04 +02:00
Adhemerval Zanella 116f1c64d8 posix: Consolidate Linux glob implementation
This patch consolidates the glob implementation.  The main changes are:

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

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

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

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

	* sysdeps/unix/sysv/linux/arm/glob64.c: Remove file.
	* sysdeps/unix/sysv/linux/i386/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/glob.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise.
	* sysdeps/wordsize-64/glob.c: Likewise.
	* sysdeps/wordsize-64/glob64.c: Likewise.
	* sysdeps/wordsize-64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/glob.c: New file.
	* sysdeps/unix/sysv/linux/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/globfree.c: Likewise.
	* sysdeps/unix/sysv/linux/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/glob64.c: Likewise.
	* sysdeps/unix/sysv/linux/oldglob.c [SHLIB_COMPAT]: Also
	adds !GLOB_NO_OLD_VERSION as an extra condition.
	* sysdeps/unix/sysv/linux/i386/alphasort64.c: Include olddirent.h
	using relative path instead of absolute one.
	* sysdeps/unix/sysv/linux/i386/getdents64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/readdir64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/versionsort64.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/olddirent.h: Move to ...
	* sysdeps/unix/sysv/linux//olddirent.h: ... here.
2017-09-08 16:34:02 +02:00
Adhemerval Zanella ffca890177 posix: fix glob bugs with long login names
Current glob implementation allows unlimited user name for home
directory construction on GLOB_TILDE case.  To accomplish it glob
either construct a name on stack if size are small enough (based
on current alloca_used) or in heap otherwise.

This patch simplifies storage allocation by using the same scratch
buffer for both get_rlogin_r and getpwnam_r.

This also syncs with gnulib commit 064df0b (glob: fix bugs with long
login names).

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

	* posix/glob.c (GET_LOGIN_NAME_MAX): Remove.
	(glob): Use the same scratch buffer for both getlogin_r and
	getpwnam_r.  Don’t require preallocation of the login name.  This
	simplifies storage allocation, and corrects the handling of
	long login names.
2017-09-08 16:33:39 +02:00
Adhemerval Zanella 5a79f97554 posix: Fix getpwnam_r usage (BZ #1062)
This patch fixes longstanding misuse of errno after getpwnam_r,
which returns an error number rather than setting errno.  This is
sync with gnulib commit 5db9301.

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

	[BZ #1062]
	* posix/glob.c (glob): Port recent patches to platforms
	lacking getpwnam_r.
	(glob): Fix longstanding misuse of errno after getpwnam_r, which
	returns an error number rather than setting errno.
2017-09-08 15:51:34 +02:00
Adhemerval Zanella e00f242599 Sync scratch_buffer with gnulib
This patch syncs the scratch_buffer grom gnulib commit 3866ef6 with
GLIBC code.

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

	* include/scratch_buffer.h (scratch_buffer): Use a C99 align method
	instead of GCC extension.
	* malloc/scratch_buffer_grow.c [!_LIBC]: Include libc-config.h.
	* malloc/scratch_buffer_grow_preserve.c [!_LIBC]: Likewise.
	* malloc/scratch_buffer_set_array_size.c [!_LIBC]: Likewise.
2017-09-08 15:51:34 +02:00
Adhemerval Zanella 5554304f0d posix: Allow glob to match dangling symlinks [BZ #866]
This patch makes glob match dangling symlinks.  Compared to other glob
implementation (*BSD, bash, musl, and other shells as well), GLIBC seems
the be the only one that does not match dangling symlinks.  As for
comment #5 in BZ #866, POSIX does not have any strict specification for
dangling symlinks match and it is reasonable that trying to glob everything
in a path should return all types of files (such as for a 'rm *').  Also,
comment #7 shows even more example where GLIBC current behavior is
unexepected.

I avoided adding another GNU specific flag to set this behavior and
instead make it the default.  Although this change the semanthic from
previous implementation, I think adding another compat symbol to be
really unecessary as from aforementioned reasons (current behavior not
defined in any standard, general idea of different implementation is
to list dangling symbols).

This also sync glob with gnulib commit fd1daf4 (glob: match dangling
symlinks).

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

	[BZ #866]
	[BZ #1062]
	* posix/Makefile (tests): Remove bug-glob1 and tst-glob_symlinks.
	* posix/bug-glob1.c: Remove file.
	* posix/tst-glob_symlinks.c: New file.
	* posix/glob.c (__lstat64): New macro.
	(is_dir): New function.
	(glob, glob_in_dir): Match symlinks even if they are dangling.
	(link_stat, link_exists_p): Remove.  All uses removed.
2017-09-08 15:51:25 +02:00
Adhemerval Zanella 686f2ea183 posix: accept inode 0 is a valid inode number (BZ #19971)
According to this kernel commit 2adc376c55194, d_ino 0 is a regular inode
number on Linux (which also matches POSIX, as it does not treat the value
as special).  This patch makes glob accept is a valid inode number.

This is also a sync with gnulib commit c8e57c1.

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

	[BZ #1062]
	[BZ #19971]
	* posix/glob.c (struct readdir_result): Remove skip_entry member.
	(readdir_result_skip_entry, D_INO_TO_RESULT): Remove.
	All uses removed.
2017-09-08 09:39:13 +02:00
Adhemerval Zanella c66c908230 posix: Sync glob with gnulib [BZ #1062]
This patch syncs posix/glob.c implementation with gnulib version
b5ec983 (glob: simplify symlink detection).  The only difference
to gnulib code is

  * DT_UNKNOWN, DT_DIR, and DT_LNK definition in the case there
    were not already defined.  Gnulib code which uses
    HAVE_STRUCT_DIRENT_D_TYPE will redefine them wrongly because
    GLIBC does not define HAVE_STRUCT_DIRENT_D_TYPE.  Instead
    the patch check for each definition instead.

Also, the patch requires additional globfree and globfree64 files
for compatibility version on some architectures.  Also the code
simplification leads to not macro simplification (not need for
NO_GLOB_PATTERN_P anymore).

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

	[BZ #1062]
	* posix/Makefile (routines): Add globfree, globfree64, and
	glob_pattern_p.
	* posix/flexmember.h: New file.
	* posix/glob_internal.h: Likewise.
	* posix/glob_pattern_p.c: Likewise.
	* posix/globfree.c: Likewise.
	* posix/globfree64.c: Likewise.
	* sysdeps/gnu/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/oldglob.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise.
	* sysdeps/wordsize-64/globfree.c: Likewise.
	* sysdeps/wordsize-64/globfree64.c: Likewise.
	* posix/glob.c (HAVE_CONFIG_H): Use !_LIBC instead.
	[NDEBUG): Remove comments.
	(GLOB_ONLY_P, _AMIGA, VMS): Remove define.
	(dirent_type): New type.  Use uint_fast8_t not
	uint8_t, as C99 does not require uint8_t.
	(DT_UNKNOWN, DT_DIR, DT_LNK): New macros.
	(struct readdir_result): Use dirent_type.  Do not define skip_entry
	unless it is needed; this saves a byte on platforms lacking d_ino.
	(readdir_result_type, readdir_result_skip_entry):
	New functions, replacing ...
	(readdir_result_might_be_symlink, readdir_result_might_be_dir):
	 these functions, which were removed.  This makes the callers
	easier to read.  All callers changed.
	(D_INO_TO_RESULT): Now empty if there is no d_ino.
	(size_add_wrapv, glob_use_alloca): New static functions.
	(glob, glob_in_dir): Check for size_t overflow in several places,
	and fix some size_t checks that were not quite right.
	Remove old code using SHELL since Bash no longer
	uses this.
	(glob, prefix_array): Separate MS code better.
	(glob_in_dir): Remove old Amiga and VMS code.
	(globfree, __glob_pattern_type, __glob_pattern_p): Move to
	separate files.
	(glob_in_dir): Do not rely on undefined behavior in accessing
	struct members beyond their bounds.  Use a flexible array member
	instead
	(link_stat): Rename from link_exists2_p and return -1/0 instead of
	0/1.  Caller changed.
	(glob): Fix memory leaks.
	* posix/glob64 (globfree64): Move to separate file.
	* sysdeps/gnu/glob64.c (NO_GLOB_PATTERN_P): Remove define.
	(globfree64): Remove hidden alias.
	* sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Add
	oldglob.
	* sysdeps/unix/sysv/linux/alpha/glob.c (__new_globfree): Move to
	separate file.
	* sysdeps/unix/sysv/linux/i386/glob64.c (NO_GLOB_PATTERN_P): Remove
	define.
	Move compat code to separate file.
	* sysdeps/wordsize-64/glob.c (globfree): Move definitions to
	separate file.
2017-09-08 09:39:13 +02:00
H.J. Lu 78bfa877b3 Use "static const char domain[] ="
* resolv/tst-resolv-qtypes.c (domain): Changed to
	"const char domain[] =".
2017-09-07 13:57:15 -07:00
Joseph Myers 85bec0f2a0 Use MPFR 3.1.6 in build-many-glibcs.py.
* scripts/build-many-glibcs.py (Context.checkout): Default MPFR
	version to 3.1.6.
2017-09-07 14:50:32 +00:00
Joseph Myers 5c23ee6eb8 Update netinet/tcp.h from Linux 4.13.
This patch updates sysdeps/gnu/netinet/tcp.h to include new
definitions from include/uapi/linux/tcp.h in Linux 4.13.

Tested for x86_64.

	* sysdeps/gnu/netinet/tcp.h (TCP_ULP): New macro.
	(TCP_MD5SIG_EXT): Likewise.
	(TCP_MD5SIG_FLAG_PREFIX): Likewise.
	(struct tcp_md5sig): Replace __tcpm_pad1 by tcpm_flags and
	tcpm_prefixlen.  Rename __tcpm_pad2 to __tcpm_pad.
2017-09-07 14:29:38 +00:00
Joseph Myers 05f0011fb0 Add SOL_TLS definition from Linux 4.13.
This patch adds the new SOL_TLS constant from Linux 4.13 to the Linux
bits/socket.h.

Tested for x86_64.

	* sysdeps/unix/sysv/linux/bits/socket.h (SOL_TLS): New macro.
2017-09-07 14:28:36 +00:00
Mike FABIAN 7c9c5be96f Use ASCII in LC_TIME of om_ET for better readability
* localedata/locales/om_ET (LC_TIME): use ASCII for better readability.
2017-09-07 09:44:50 +02:00
Akhilesh Kumar ae214523ee Remove redundant LC_TIME data in om_KE which is identical to the data in om_ET
[BZ #22100]
	* locales/om_KE (LC_TIME): copy "om_ET".
2017-09-07 09:44:49 +02:00
Samuel Thibault 507fe02799 hurd: fix gethostname(NULL, 0)
* hurd/get-host.c (_hurd_get_host_config): Also check that more == 0
	before assuming that the file is empty.  Avoid testing buffer content
	when nread == 0.
2017-09-07 00:51:17 +02:00
Adhemerval Zanella 7bbbb4b9f7 Add ChangeLog bugzilla mark for previous commit 2017-09-06 14:53:03 -03:00
Adhemerval Zanella 65687ac76c Remove remaining _HAVE_STRING_ARCH_* definitions (BZ #18858)
Since the removal of bits/string.h, _HAVE_STRING_ARCH_* are no
longer used.  This patch removes the unused macros from i686
and x86_64 sysdeps folder.

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

	* sysdeps/i386/i686/multiarch/strncpy.c (_HAVE_STRING_ARCH_strncpy):
	Remove define.
	* sysdeps/x86_64/multiarch/stpcpy.c (_HAVE_STRING_ARCH_stpcpy):
	Likewise.
	* sysdeps/x86_64/multiarch/strcspn.c (_HAVE_STRING_ARCH_strcspn):
	Likewise.
	* sysdeps/x86_64/multiarch/strncat.c (_HAVE_STRING_ARCH_strncat):
	Likewise.
	* sysdeps/x86_64/multiarch/strncpy.c (_HAVE_STRING_ARCH_strncpy):
	Likewise.
	* sysdeps/x86_64/multiarch/strpbrk.c (_HAVE_STRING_ARCH_strpbrk):
	Likewise.
	* sysdeps/x86_64/multiarch/strspn.c (_HAVE_STRING_ARCH_strspn):
	Likewise.
2017-09-06 14:35:23 -03:00
Florian Weimer ab5ac271e6 __libc_dynarray_emplace_enlarge: Add missing else
Before, arrays of small elements received a starting allocation size of
8, not 16.
2017-09-06 16:03:28 +02:00
Florian Weimer a830473081 resolv: __resolv_conf_attach must not free passed conf object [BZ #22096] 2017-09-06 15:32:43 +02:00
Florian Weimer 5670c4ab25 resolv: Fix memory leak with OOM during resolv.conf parsing [BZ #22095] 2017-09-06 15:20:25 +02:00
Florian Weimer c77eb96925 nss_dns: Remove dead PTR IPv4-to-IPv6 mapping code 2017-09-06 15:11:44 +02:00
Florian Weimer 5e9c4d17fe tst-res_use_inet6: Enhance test to cover IPv4-to-IPv6 address mapping
This requires more control over the response data, so it is now
determined by flags embedded in the query name.
2017-09-06 13:45:19 +02:00
Mike FABIAN 2ae5be041d Improve utf8_gen.py to set the width for characters with Prepended_Concatenation_Mark property to 1
[BZ #22070]
	* localedata/unicode-gen/utf8_gen.py: Set the width for
	characters with Prepended_Concatenation_Mark property to 1
	* localedata/charmaps/UTF-8: Updated using the improved script.
2017-09-06 12:39:49 +02:00
Mike FABIAN af83ed5c46 Write all ranges of neighbouring characters with the same width using the range notation in charmaps/UTF-8
Writing ranges of neighbouring characters with the same with like this

    <U000E0100>...<U000E01EF>	0

in charmaps/UTF-8 is more efficient than writing many single character lines
like:

    <U000E0100>	0
    <U000E0101>	0
    ...

	[BZ #21750]
	* unicode-gen/utf8_gen.py: Write all ranges of neighbouring characters
	with the same width using the range notation in charmaps/UTF-8.
2017-09-06 12:37:49 +02:00
Joseph Myers 4f3647e46e Prefer new libm function wrappers for !LIBM_SVID_COMPAT.
The initial obsoletion of SVID libm error handling left the old
wrappers and __kernel_standard still being used for new ports and
static linking, just with macro definitions of _LIB_VERSION and
matherr that meant symbols with those names were never actually used
and the code for different error handling variants could be optimized
out.

This patch cleans things up further by eliminating the
__kernel_standard use for new ports and static linking.  Now, the old
wrappers no longer generate any code in the !LIBM_SVID_COMPAT case,
while the new errno-only wrappers that were added for float128 support
are now also used for float, double and long double in that case.

The changes are generally straightforward.  The w_scalb*_compat
wrappers continue to be used (scalb is obsolescent in the sense of not
being supported for float128, but is present in supported standards -
the 2001 edition of POSIX and earlier XSI versions - so remains
supported for static linking and new ports, as do the float and long
double variants that are existing GNU extensions).  Those wrappers
would only call __kernel_standard in the _LIB_VERSION == _SVID_ case.
Since we would like to be able to compile most of glibc without
optimization, relying on a static function whose only use is under an
if (0) condition being optimized away to avoid an undefined
__kernel_standard reference may not be a good idea.  Thus, the
relevant code in the scalb wrappers has LIBM_SVID_COMPAT conditionals
added to guarantee it's not built at all in the case where
__kernel_standard does not exist.

Just as i386 has its own w_sqrt_compat.c, so w_sqrt.c is also added.
ia64 gets dummy w_*.c to prevent those files being built where they
would conflict with the ia64 libm, as with its existing w_*_compat.c.

Conditions disabling code for !LIBM_SVID_COMPAT are needed in both the
math/ wrappers and in the long double wrappers in ldbl-opt (to avoid
them setting up aliases and symbol versions for undefined symbols).  I
hope that future cleanups to how libm function aliases and symbol
versioning are done will eliminate the need for most of the ldbl-opt
wrappers.

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

	* sysdeps/generic/math-type-macros-double.h: Include
	<math-svid-compat.h>.
	(__USE_WRAPPER_TEMPLATE): Define to !LIBM_SVID_COMPAT.
	* sysdeps/generic/math-type-macros-float.h: Include
	<math-svid-compat.h>.
	(__USE_WRAPPER_TEMPLATE): Define to !LIBM_SVID_COMPAT.
	* sysdeps/generic/math-type-macros-ldouble.h: Include
	<math-svid-compat.h>.
	(__USE_WRAPPER_TEMPLATE): Define to !LIBM_SVID_COMPAT.
	* math/lgamma-compat.h (BUILD_LGAMMA): Include LIBM_SVID_COMPAT
	condition.
	* math/w_acos_compat.c: Condition contents on [LIBM_SVID_COMPAT].
	* math/w_acosf_compat.c: Likewise.
	* math/w_acosh_compat.c: Likewise.
	* math/w_acoshf_compat.c: Likewise.
	* math/w_acoshl_compat.c: Likewise.
	* math/w_acosl_compat.c: Likewise.
	* math/w_asin_compat.c: Likewise.
	* math/w_asinf_compat.c: Likewise.
	* math/w_asinl_compat.c: Likewise.
	* math/w_atan2_compat.c: Likewise.
	* math/w_atan2f_compat.c: Likewise.
	* math/w_atan2l_compat.c: Likewise.
	* math/w_atanh_compat.c: Likewise.
	* math/w_atanhf_compat.c: Likewise.
	* math/w_atanhl_compat.c: Likewise.
	* math/w_cosh_compat.c: Likewise.
	* math/w_coshf_compat.c: Likewise.
	* math/w_coshl_compat.c: Likewise.
	* math/w_exp10_compat.c: Likewise.
	* math/w_exp10f_compat.c: Likewise.
	* math/w_exp10l_compat.c: Likewise.
	* math/w_exp2_compat.c: Likewise.
	* math/w_exp2f_compat.c: Likewise.
	* math/w_exp2l_compat.c: Likewise.
	* math/w_fmod_compat.c: Likewise.
	* math/w_fmodf_compat.c: Likewise.
	* math/w_fmodl_compat.c: Likewise.
	* math/w_hypot_compat.c: Likewise.
	* math/w_hypotf_compat.c: Likewise.
	* math/w_hypotl_compat.c: Likewise.
	* math/w_j0_compat.c: Likewise.
	* math/w_j0f_compat.c: Likewise.
	* math/w_j0l_compat.c: Likewise.
	* math/w_j1_compat.c: Likewise.
	* math/w_j1f_compat.c: Likewise.
	* math/w_j1l_compat.c: Likewise.
	* math/w_jn_compat.c: Likewise.
	* math/w_jnf_compat.c: Likewise.
	* math/w_jnl_compat.c: Likewise.
	* math/w_lgamma_r_compat.c: Likewise.
	* math/w_lgammaf_r_compat.c: Likewise.
	* math/w_lgammal_r_compat.c: Likewise.
	* math/w_log10_compat.c: Likewise.
	* math/w_log10f_compat.c: Likewise.
	* math/w_log10l_compat.c: Likewise.
	* math/w_log2_compat.c: Likewise.
	* math/w_log2f_compat.c: Likewise.
	* math/w_log2l_compat.c: Likewise.
	* math/w_log_compat.c: Likewise.
	* math/w_logf_compat.c: Likewise.
	* math/w_logl_compat.c: Likewise.
	* math/w_pow_compat.c: Likewise.
	* math/w_powf_compat.c: Likewise.
	* math/w_powl_compat.c: Likewise.
	* math/w_remainder_compat.c: Likewise.
	* math/w_remainderf_compat.c: Likewise.
	* math/w_remainderl_compat.c: Likewise.
	* math/w_sinh_compat.c: Likewise.
	* math/w_sinhf_compat.c: Likewise.
	* math/w_sinhl_compat.c: Likewise.
	* math/w_sqrt_compat.c: Likewise.
	* math/w_sqrtf_compat.c: Likewise.
	* math/w_sqrtl_compat.c: Likewise.
	* math/w_tgamma_compat.c: Likewise.
	* math/w_tgammaf_compat.c: Likewise.
	* math/w_tgammal_compat.c: Likewise.
	* math/w_scalb_compat.c (sysv_scalb): Condition definition on
	[LIBM_SVID_COMPAT].
	(__scalb): Condition call to sysv_scalb on [LIBM_SVID_COMPAT].
	* math/w_scalbf_compat.c (sysv_scalbf): Condition definition on
	[LIBM_SVID_COMPAT].
	(__scalbf): Condition call to sysv_scalbf on [LIBM_SVID_COMPAT].
	* math/w_scalbl_compat.c (sysv_scalbl): Condition definition on
	[LIBM_SVID_COMPAT].
	(__scalbl): Condition call to sysv_scalbl on [LIBM_SVID_COMPAT].
	* sysdeps/i386/fpu/w_sqrt.c: New file.
	* sysdeps/ia64/fpu/w_acos.c: Likewise.
	* sysdeps/ia64/fpu/w_acosf.c: Likewise.
	* sysdeps/ia64/fpu/w_acosh.c: Likewise.
	* sysdeps/ia64/fpu/w_acoshf.c: Likewise.
	* sysdeps/ia64/fpu/w_acoshl.c: Likewise.
	* sysdeps/ia64/fpu/w_acosl.c: Likewise.
	* sysdeps/ia64/fpu/w_asin.c: Likewise.
	* sysdeps/ia64/fpu/w_asinf.c: Likewise.
	* sysdeps/ia64/fpu/w_asinl.c: Likewise.
	* sysdeps/ia64/fpu/w_atan2.c: Likewise.
	* sysdeps/ia64/fpu/w_atan2f.c: Likewise.
	* sysdeps/ia64/fpu/w_atan2l.c: Likewise.
	* sysdeps/ia64/fpu/w_atanh.c: Likewise.
	* sysdeps/ia64/fpu/w_atanhf.c: Likewise.
	* sysdeps/ia64/fpu/w_atanhl.c: Likewise.
	* sysdeps/ia64/fpu/w_cosh.c: Likewise.
	* sysdeps/ia64/fpu/w_coshf.c: Likewise.
	* sysdeps/ia64/fpu/w_coshl.c: Likewise.
	* sysdeps/ia64/fpu/w_exp.c: Likewise.
	* sysdeps/ia64/fpu/w_exp10.c: Likewise.
	* sysdeps/ia64/fpu/w_exp10f.c: Likewise.
	* sysdeps/ia64/fpu/w_exp10l.c: Likewise.
	* sysdeps/ia64/fpu/w_exp2.c: Likewise.
	* sysdeps/ia64/fpu/w_exp2f.c: Likewise.
	* sysdeps/ia64/fpu/w_exp2l.c: Likewise.
	* sysdeps/ia64/fpu/w_expf.c: Likewise.
	* sysdeps/ia64/fpu/w_expl.c: Likewise.
	* sysdeps/ia64/fpu/w_fmod.c: Likewise.
	* sysdeps/ia64/fpu/w_fmodf.c: Likewise.
	* sysdeps/ia64/fpu/w_fmodl.c: Likewise.
	* sysdeps/ia64/fpu/w_hypot.c: Likewise.
	* sysdeps/ia64/fpu/w_hypotf.c: Likewise.
	* sysdeps/ia64/fpu/w_hypotl.c: Likewise.
	* sysdeps/ia64/fpu/w_lgamma_r.c: Likewise.
	* sysdeps/ia64/fpu/w_lgammaf_r.c: Likewise.
	* sysdeps/ia64/fpu/w_lgammal_r.c: Likewise.
	* sysdeps/ia64/fpu/w_log.c: Likewise.
	* sysdeps/ia64/fpu/w_log10.c: Likewise.
	* sysdeps/ia64/fpu/w_log10f.c: Likewise.
	* sysdeps/ia64/fpu/w_log10l.c: Likewise.
	* sysdeps/ia64/fpu/w_log2.c: Likewise.
	* sysdeps/ia64/fpu/w_log2f.c: Likewise.
	* sysdeps/ia64/fpu/w_log2l.c: Likewise.
	* sysdeps/ia64/fpu/w_logf.c: Likewise.
	* sysdeps/ia64/fpu/w_logl.c: Likewise.
	* sysdeps/ia64/fpu/w_pow.c: Likewise.
	* sysdeps/ia64/fpu/w_powf.c: Likewise.
	* sysdeps/ia64/fpu/w_powl.c: Likewise.
	* sysdeps/ia64/fpu/w_remainder.c: Likewise.
	* sysdeps/ia64/fpu/w_remainderf.c: Likewise.
	* sysdeps/ia64/fpu/w_remainderl.c: Likewise.
	* sysdeps/ia64/fpu/w_sinh.c: Likewise.
	* sysdeps/ia64/fpu/w_sinhf.c: Likewise.
	* sysdeps/ia64/fpu/w_sinhl.c: Likewise.
	* sysdeps/ia64/fpu/w_sqrt.c: Likewise.
	* sysdeps/ia64/fpu/w_sqrtf.c: Likewise.
	* sysdeps/ia64/fpu/w_sqrtl.c: Likewise.
	* sysdeps/ia64/fpu/w_tgamma.c: Likewise.
	* sysdeps/ia64/fpu/w_tgammaf.c: Likewise.
	* sysdeps/ia64/fpu/w_tgammal.c: Likewise.
	* sysdeps/ieee754/dbl-64/w_exp_compat.c: Condition contents on
	[LIBM_SVID_COMPAT].
	* sysdeps/ieee754/flt-32/w_expf_compat.c: Likewise.
	* sysdeps/ieee754/k_standard.c: Likewise.
	* sysdeps/ieee754/k_standardf.c: Likewise.
	* sysdeps/ieee754/k_standardl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/w_expl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-96/w_expl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/w_expl_compat.c: Condition
	long_double_symbol call on [LIBM_SVID_COMPAT].
	* sysdeps/ieee754/ldbl-opt/w_acoshl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_acosl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_asinl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_atan2l_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_atanhl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_coshl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_fmodl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_hypotl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_j0l_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_j1l_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_jnl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_lgammal_r_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_log10l_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_log2l_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_logl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_powl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_remainderl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_sinhl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_sqrtl_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_tgammal_compat.c: Likewise.
	* sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c: Condition
	long_double_symbol and compat_symbol calls on [LIBM_SVID_COMPAT].
2017-09-05 23:35:55 +00:00
Steve Ellcey 05b38d64b1 Fix tests that are testing obsoleted functionality
* include/shlib-compat.h (TEST_COMPAT): New Macro.
	* malloc/tst-mallocstate.c: Convert from test-skeleton
	to test-driver.  Ifdef code using TEST_COMPAT macro.
	* math/test-matherr-2.c: Ifdef test using TEST_COMPAT macro.
	* math/test-matherr.c: Likewise.
2017-09-05 12:24:00 -07:00
Joseph Myers 99d6791899 Fix pcprofiledump cross-endian condition (bug 22086).
debug/pcprofiledump.c contains code that tries to handle other-endian
data.  This uses a condition "(word & 0xfffffff0) == bswap_32
(0xdeb00000)".  This condition is always false (the LHS always has the
low four bits zero, the RHS doesn't); a correct comparison would use
0x0fffffff.  This results in -Werror=tautological-compare build
failures with the tile version of bits/byteswap.h and mainline GCC.

https://sourceware.org/ml/libc-testresults/2017-q3/msg00400.html

pcprofiledump.c: In function 'main':
pcprofiledump.c:118:39: error: bitwise comparison always evaluates to false
[-Werror=tautological-compare]
   int must_swap = (word & 0xfffffff0) == bswap_32 (0xdeb00000);
                                       ^~

This patch fixes the condition.  Tested for x86_64, and with
build-many-glibcs.py that it fixes the build for tilegx-linux-gnu.
(Note that I have not tested the actual pcprofiledump functionality,
native or cross endian, which lacks any testsuite coverage.)

	[BZ #22086]
	* debug/pcprofiledump.c (main): Use byte-swapped mask when
	comparing word with byte-swapped constant.
2017-09-05 15:14:09 +00:00
Mike FABIAN 3f802aeb34 Add miq_NI locale for Miskito
[BZ #20498]
	* locale/iso-639.def: add Miskito.
	* localedata/SUPPORTED: Add miq_NI/UTF-8.
	* localedata/locales/miq_NI: New file.
2017-09-05 15:04:23 +02:00
H.J. Lu 0a587a8a98 Hide __chmod and __mkdir [BZ #18822]
Hide internal __chmod and __mkdir functions to allow direct access
within libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* include/sys/stat.h (__chmod): Add libc_hidden_proto.
	(__mkdir): Likewise.
	* io/chmod.c (__chmod): Add libc_hidden_def.
	* io/mkdir.c (__mkdir): Likewise.
	* sysdeps/mach/hurd/chmod.c (__chmod): Likewise.
	* sysdeps/mach/hurd/mkdir.c (__mkdir): Likewise.
	* sysdeps/unix/sysv/linux/generic/chmod.c (__chmod): Likewise.
	* sysdeps/unix/sysv/linux/generic/mkdir.c (__mkdir): Likewise.
2017-09-04 13:38:51 -07:00
Joseph Myers 1650e19265 Update kernel version in syscall-names.list to 4.13.
As far as I can tell Linux 4.13 does not add any new syscalls not
included in syscall-names.list.  This patch updates the version number
in that file accordingly.

	* sysdeps/unix/sysv/linux/syscall-names.list: Update kernel
	version to 4.13.
2017-09-04 20:16:07 +00:00
Joseph Myers f3a129b872 Fix bits/math-finite.h exp10 condition (bug 22082).
bits/math-finite.h handles exp10 if __USE_GNU.  It should use the
condition __GLIBC_USE (IEC_60559_FUNCS_EXT), as in bits/mathcalls.h.
This patch fixes the condition.

Tested for x86_64.

	[BZ #22082]
	* math/bits/math-finite.h (exp10): Redirect if [__GLIBC_USE
	(IEC_60559_FUNCS_EXT)], not [__USE_GNU].
2017-09-04 16:28:23 +00:00
Florian Weimer b38042f514 math.h: Warn about an already-defined log macro
This is a common programming error, and the cause of the problem is not
always obvious.

<tgmath.h> defines a log macro, but it includes <math.h> before that, so
that is compatible with the warning.
2017-09-04 17:56:31 +02:00
Joseph Myers 059b64046e Use Linux 4.13 in build-many-glibcs.py.
* scripts/build-many-glibcs.py (Context.checkout): Default Linux
	kernel version to 4.13.
2017-09-04 15:34:58 +00:00
Samuel Thibault 6547ec0ad8 hurd: fix resolv/tst-resolv-res_init-skeleton.c build
* resolv/tst-resolv-res_init-skeleton.c (run_res_init)
	[!CLONE_NEWUTS]: Fail as unsupported if hostname is not NULL.
2017-09-03 19:44:07 +02:00
Samuel Thibault 492cbbed86 hurd: Fix build ot misc/tst-preadvwritev2-common.c
* misc/tst-preadvwritev2-common.c (RWF_HIPRI, RWF_DSYNC, RWF_SYNC,
	RWF_NOWAIT): Define to 0 if undefined already.
	(do_test_with_invalid_flags): Set invalid_flag to 2 if RWF_SUPPORTED
	boils down to 0.
2017-09-03 17:51:15 +02:00
Samuel Thibault cae3d71212 hurd: Fix rtld's strtoul_internal use through hurdlookup
* sysdeps/mach/hurd/dl-sysdep.c (__strtoul_internal): New
	function.
2017-09-03 14:33:35 +02:00
Samuel Thibault 2ce1f9efd6 hurd: mach/hurd/x86 also needs x86 tunables
* sysdeps/mach/hurd/x86/dl-sysdep.c: New file.
2017-09-03 13:39:33 +02:00
Samuel Thibault 56bf5497c5 hurd: mach/hurd/i386 also needs mach/hurd/x86
* sysdeps/mach/hurd/i386/Implies: Add mach/hurd/x86.
2017-09-03 13:38:09 +02:00
Samuel Thibault 1946d950f2 hurd: fix libm link
* sysdeps/x86/fpu/include/bits/fenv.h [NO_HIDDEN]: Redirect
	__feraiseexcept_renamed to feraiseexcept instead of
	__GI_feraiseexcept.
2017-09-03 05:32:10 +02:00
Samuel Thibault f85958a74d hurd: Fix libc link
This follows db3d848 ('Build divdi3 only for architecture that required
it').

	* sysdeps/mach/hurd/i386/Makefile
	[$(subdir) = csu] (sysdep_routines): New rule: divdi3 object.
	[$(subdir) = csu] (sysdep-only-routines): Likewise.
	[$(subdir) = csu] (CFLAGS-divdi3.c): Likewise.
2017-09-03 04:58:00 +02:00
Samuel Thibault 127e7773b4 hurd: Fix libc link
* sysdeps/posix/pause.c: Include <sigsetops.h>.
	* sysdeps/posix/system.c: Include <sigsetops.h>.
2017-09-03 04:36:29 +02:00
Samuel Thibault b96aca4d05 hurd: Fix rtld link
* sysdeps/mach/hurd/dl-sysdep.c (__sbrk): New function.
2017-09-03 04:26:31 +02:00
Samuel Thibault 819ea3347e hurd: Fix rtld link
dl-tunables.c now uses __access_noerrno in addition to __access.

	* sysdeps/mach/hurd/dl-sysdep.c (__access_noerrno): New function.
2017-09-03 04:09:54 +02:00
Samuel Thibault 2263ca7ce8 hurd: Fix p{read,write}{,v64}v2.c build
* misc/preadv2.c: Include <errno.h>.
	* misc/preadv64v2.c: Include <errno.h>.
	* misc/pwritev2.c: Include <errno.h>.
	* misc/pwritev64v2.c: Include <errno.h>.
	* sysdeps/posix/preadv2.c: Include <errno.h>.
	* sysdeps/posix/preadv64v2.c: Include <errno.h>.
	Fix <unistd.h> inclusion.
	* sysdeps/posix/pwritev2.c: Include <errno.h>.
	* sysdeps/posix/pwritev64v2.c: Include <errno.h>.
2017-09-03 03:03:40 +02:00
Samuel Thibault ed95bf5638 hurd: Fix p{read,write}v64v2.c build
* sysdeps/posix/preadv64v2.c: Use off64_t instead of off_t.
	* sysdeps/posix/pwritev64v2.c: Use off64_t instead of off_t.
2017-09-03 03:00:55 +02:00
Samuel Thibault dd2b31dec0 hurd: Fix p{read,write}{,v64}v2.c build
* sysdeps/posix/preadv2.c: Use off_t instead of OFF_T.
	* sysdeps/posix/preadv64v2.c: Use off_t instead of OFF_T.
	* sysdeps/posix/pwritev2.c: Use off_t instead of OFF_T.
	* sysdeps/posix/pwritev64v2.c: Use off_t instead of OFF_T.
2017-09-03 02:45:06 +02:00
Samuel Thibault 01969395db hurd: Fix getting ssize_t for <sys/socket.h>
* sysdeps/mach/hurd/bits/socket.h: Include <sys/types.h> instead of
	just <bits/types.h>.
2017-09-03 02:22:00 +02:00
Samuel Thibault 06cf9d31d7 hurd: Fix sigsetops.h macros
* sysdeps/generic/sigsetops.h: Remove spurious #endif.
	(__sigismember, __sigaddset, __sigdelset): Fix referencing set
	parameter.
2017-09-03 01:45:19 +02:00
Samuel Thibault b794e16bcc sysdeps/generic/sigsetops.h: Remove spurious #endif 2017-09-03 01:08:49 +02:00
Joseph Myers 5a80d39d0d Obsolete pow10 functions.
This patch obsoletes the pow10, pow10f and pow10l functions (makes
them into compat symbols, not available for new ports or static
linking).  The exp10 names for these functions are standardized (in TS
18661-4) and were added in the same glibc version (2.1) as pow10 so
source code can change to use them without any loss of portability.
Since pow10 is deliberately not provided for _Float128, only exp10,
this slightly simplifies moving to the new wrapper templates in the
!LIBM_SVID_COMPAT case, by avoiding needing to arrange for pow10,
pow10f and pow10l to be defined by those templates.

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

	* manual/math.texi (pow10): Do not document.
	(pow10f): Likewise.
	(pow10l): Likewise.
	* math/bits/mathcalls.h [__USE_GNU] (pow10): Do not declare.
	* math/bits/math-finite.h [__USE_GNU] (pow10): Likewise.
	* math/libm-test-exp10.inc (pow10_test): Remove.
	(do_test): Do not call pow10.
	* math/w_exp10_compat.c (pow10): Make into compat symbol.
	[NO_LONG_DOUBLE] (pow10l): Likewise.
	* math/w_exp10f_compat.c (pow10f): Likewise.
	* math/w_exp10l_compat.c (pow10l): Likewise.
	* sysdeps/ia64/fpu/e_exp10.S: Include <shlib-compat.h>.
	(pow10): Make into compat symbol.
	* sysdeps/ia64/fpu/e_exp10f.S: Include <shlib-compat.h>.
	(pow10f): Make into compat symbol.
	* sysdeps/ia64/fpu/e_exp10l.S: Include <shlib-compat.h>.
	(pow10l): Make into compat symbol.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Remove
	pow10.
	(CFLAGS-nldbl-pow10.c): Remove variable..
	* sysdeps/ieee754/ldbl-opt/nldbl-pow10.c: Remove file.
	* sysdeps/ieee754/ldbl-opt/w_exp10_compat.c (pow10l): Condition on
	[SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)].
	* sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c (compat_symbol):
	Undefine and redefine.
	(pow10l): Make into compat symbol.
	* sysdeps/aarch64/libm-test-ulps: Remove pow10 ulps.
	* sysdeps/alpha/fpu/libm-test-ulps: Likewise.
	* sysdeps/arm/libm-test-ulps: Likewise.
	* sysdeps/hppa/fpu/libm-test-ulps: Likewise.
	* sysdeps/i386/fpu/libm-test-ulps: Likewise.
	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
	* sysdeps/microblaze/libm-test-ulps: Likewise.
	* sysdeps/mips/mips32/libm-test-ulps: Likewise.
	* sysdeps/mips/mips64/libm-test-ulps: Likewise.
	* sysdeps/nios2/libm-test-ulps: Likewise.
	* sysdeps/powerpc/fpu/libm-test-ulps: Likewise.
	* sysdeps/powerpc/nofpu/libm-test-ulps: Likewise.
	* sysdeps/s390/fpu/libm-test-ulps: Likewise.
	* sysdeps/sh/libm-test-ulps: Likewise.
	* sysdeps/sparc/fpu/libm-test-ulps: Likewise.
	* sysdeps/tile/libm-test-ulps: Likewise.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2017-09-01 21:13:18 +00:00
Paul Pluzhnikov 3824fc3891 2017-09-01 Paul Pluzhnikov <ppluzhnikov@google.com>
* stdlib/tst-atexit-common.c (crumbs): Ensure correct size.
2017-09-01 11:35:55 -07:00
H.J. Lu b30082799d Update tst-regex.c/tst-regex2.c for old ChangeLog move
* posix/tst-regex.c (do_test): Replace "../ChangeLog.8" with
	"../ChangeLog.old/ChangeLog.8".
	* posix/tst-regex2.c (do_test): Replace "../ChangeLog.14" with
	"../ChangeLog.old/ChangeLog.14".
2017-09-01 10:20:49 -07:00
H.J. Lu 136fa185fd Credit Ulrich Drepper for libpthread in contrib.texi
* manual/contrib.texi: Credit Ulrich Drepper for the POSIX
	Threads Library.
2017-09-01 10:19:07 -07:00
Joseph Myers c18d50a23b Include <string.h> for strcmp call from sysdeps/unix/sysv/linux/gentempfd.c.
* sysdeps/unix/sysv/linux/gentempfd.c: Include <string.h>.
2017-09-01 17:14:43 +00:00
H.J. Lu bedbd85972 Remove Roland McGrath/Ulrich Drepper et al. from DSO banner
* csu/version.c (banner): Remove "by Roland McGrath et al.".
	* nptl/Banner: Remove "by Ulrich Drepper et al.".
2017-09-01 10:09:21 -07:00
Paul Pluzhnikov 50c66c7acd 2017-09-01 Paul Pluzhnikov <ppluzhnikov@google.com>
* stdlib/tst-atexit-common.c (do_test): Test support for at least
	32 atexit handlers.
2017-09-01 09:31:13 -07:00
Zack Weinberg a617bd119f math/math.h (HUGE_VAL): Improve commentary. 2017-09-01 11:19:47 -04:00
Adhemerval Zanella e0d2eb5a79 linux: Implement tmpfile with O_TMPFILE (BZ#21530)
This patch adds O_TMPFILE support to tmpfile on Linux.  This is
similar to the previous suggestion by Andreas Schwab [1] with the
difference the file descriptor creation is parameterized to
compartmentalize Linux only open flags (O_TMPFILE) on sysdeps.

Checked on x86_64-linux-gnu.

	Adhemerval Zanella  <adhemerval.zanella@linaro.org>
	Andreas Schwab  <schwab@suse.de>

	[BZ #21530]
	* include/stdio.h (__gen_tempfd): New function.
	* stdio-common/Makefile (routines): Add gentempfd.
	* stdio-common/gentempfd.c: New file.
	* sysdeps/unix/sysv/linux/gentempfd.c: Likewise.
	* stdio-common/tmpfile.c (tmpfile): First try to use a system specific
	unnamed file first.

[1] https://sourceware.org/ml/libc-alpha/2017-06/msg01293.html
2017-09-01 09:52:47 -03:00
Florian Weimer f4a6be2582 getaddrinfo: Fix error handling in gethosts [BZ #21915] [BZ #21922]
The old code uses errno as the primary indicator for success or
failure.  This is wrong because errno is only set for specific
combinations of the status return value and the h_errno variable.
2017-09-01 09:34:29 +02:00
Florian Weimer 5f8340f583 getaddrinfo: Return EAI_NODATA if gethostbyname2_r reports NO_DATA [BZ #21922] 2017-09-01 09:15:36 +02:00
Florian Weimer 65329bd233 support_chroot_create: Add support for /etc/hosts, /etc/host.conf 2017-09-01 08:58:07 +02:00
Florian Weimer a2881ef014 getaddrinfo: In gaih_inet, use h_errno for certain status values only
h_errno is not set for NSS_STATUS_SUCCESS, so its value might not be
accurate at this point.
2017-09-01 08:57:52 +02:00
Florian Weimer ad816a5e00 getaddrinfo: Properly set errno for NSS function lookup failure 2017-09-01 08:57:28 +02:00
Florian Weimer 53250a21b8 getaddrinfo: Use &h_errno has the h_errno pointer
This simplifies the code because it is not necessary to propagate the
temporary h_errno value to the thread-local variable.  It also increases
compatibility with NSS modules which update only one of the two places.
2017-09-01 08:57:07 +02:00
Florian Weimer 924b121c59 getaddrinfo: Use &errno has the errno pointer
Similar code in nss/getXXbyYY_r.c is already using &errno as the
argument.
2017-09-01 08:56:46 +02:00
Steve Ellcey d9ff799a5b ILP32 math changes
* sysdeps/aarch64/fpu/s_llrint.c (OREG_SIZE): New macro.
	* sysdeps/aarch64/fpu/s_llround.c (OREG_SIZE): Likewise.
	* sysdeps/aarch64/fpu/s_llrintf.c (OREGS, IREGS): Remove.
	(IREG_SIZE, OREG_SIZE): New macros.
	* sysdeps/aarch64/fpu/s_llroundf.c: (OREGS, IREGS): Remove.
	(IREG_SIZE, OREG_SIZE): New macros.
	* sysdeps/aarch64/fpu/s_lrintf.c (IREGS): Remove.
	(IREG_SIZE): New macro.
	* sysdeps/aarch64/fpu/s_lroundf.c (IREGS): Remove.
	(IREG_SIZE): New macro.
	* sysdeps/aarch64/fpu/s_lrint.c (get-rounding-mode.h, stdint.h):
	New includes.
	(IREG_SIZE, OREG_SIZE): Initialize if not already set.
	(OREGS, IREGS): Set based on IREG_SIZE and OREG_SIZE.
	(__CONCATX): Handle exceptions correctly on large values that may
	set FE_INVALID.
	* sysdeps/aarch64/fpu/s_lround.c (IREG_SIZE, OREG_SIZE):
	Initialize if not already set.
        (OREGS, IREGS): Set based on IREG_SIZE and OREG_SIZE.
2017-08-31 13:38:11 -07:00
Adhemerval Zanella 102dde842a Remove NO_CANCELLATION macro
The NO_CANCELLATION macro is used currently on generic headers to
define non cancellable syscalls and on Linux fcntl to implement the non
cancellable variation.  Former should be single-handled by not-cancel.h
header and former could be simplified build both cancellable and non
cancellable for default objects and alias the non-cancellable to default
one for rtld ones (since Linux already support cancellation as default).

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

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

	* sysdeps/generic/not-cancel.h (NO_CANCELLATION): Remove macro.
	* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
	(NO_CANCELLATION): Likewise.
	* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
	(NO_CANCELLATION): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
	(NO_CANCELLATION): Likewise.
	* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (NO_CANCELLATION):
	Likewise
	* sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/tile/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (NO_CANCELLATION):
	Likewise.
	* sysdeps/unix/sysv/linux/not-cancel.h (__fcntl_nocancel): Add
	hidden prototype.
	* sysdeps/unix/sysv/linux/fcntl.c (__fcntl_nocancel): Define only
	for !IS_IN (rtld) and remove NO_CANCELLATION usage.
2017-08-31 16:10:34 -03:00
Steve Ellcey 9eee633b68 Change argument type passed to ifunc resolvers
* sysdeps/aarch64/dl-irel.h: (elf_ifunc_invoke): Change argument type
	in resolver call.
2017-08-31 10:34:55 -07:00
Florian Weimer 65284eb7a8 libc-symbols.h: Remove definition of internal_function 2017-08-31 18:52:00 +02:00
Florian Weimer 41ad5ca60e stdlib: Remove internal_function attribute 2017-08-31 18:52:00 +02:00
Florian Weimer 2fa6d086d1 stdio-common: Remove internal_function attribute 2017-08-31 18:52:00 +02:00
Florian Weimer b41bd5bc83 posix: Remove internal_function attribute 2017-08-31 18:52:00 +02:00
Florian Weimer 83b09837ed nptl: Remove internal_function attribute 2017-08-31 18:52:00 +02:00
Florian Weimer 116ac301b1 io: Remove internal_function attribute 2017-08-31 18:52:00 +02:00
Florian Weimer 9da93bd7c6 inet: Remove internal_function attribute 2017-08-31 18:52:00 +02:00
Joseph Myers c0c49d60cf Simplify NAN definitions.
Similar to my patches for HUGE_VAL and INFINITY. this patch eliminates
the bits/nan.h headers.  __builtin_nanf ("") is used to define NAN for
GCC 3.3 and later; the fallback is (0.0f / 0.0f), which is a constant
expression for a quiet NaN of type float, but raises a spurious
"invalid" exception outside static initializers, which seems the best
that can be done purely in standard C.  Again, if anyone actually uses
a compiler with its own incompatible extension for producing a
constant quiet NaN, we can add compiler conditionals.

Tested for x86_64.

	*  math/math.h [__USE_ISOC99] (NAN): Define directly here.  Do not
	include <bits/nan.h>.
	* math/Makefile (headers): Remove bits/nan.h.
	* bits/nan.h: Remove.
	* sysdeps/ieee754/bits/nan.h: Likewise.
	* sysdeps/mips/bits/nan.h: Likewise.
2017-08-31 16:39:25 +00:00
Joseph Myers 5ef1b2138d Simplify INFINITY definitions.
Similar to my patch for HUGE_VAL, this patch eliminates the bits/inf.h
headers and just unconditionally uses the same definitions as the
sysdeps/ieee754 version did (__builtin_inff () for GCC >= 3.3,
otherwise HUGE_VALF), directly in math.h, so removing an unnecessary
level of indirection.

Tested for x86_64.

	* math/math.h [__USE_ISOC99] (INFINITY): Define directly here.  Do
	not include <bits/inf.h>.
	* math/Makefile (headers): Remove bits/inf.h.
	* bits/inf.h: Remove.
	* sysdeps/ieee754/bits/inf.h: Likewise.
2017-08-31 16:12:46 +00:00
Joseph Myers a60eca2e55 Simplify HUGE_VAL definitions.
There are various bits/huge_val*.h headers to define HUGE_VAL and
related macros.  All of them use __builtin_huge_val etc. for GCC 3.3
and later.  Then there are various fallbacks, such as using a large
hex float constant for GCC 2.96 and later, or using unions (with or
without compound literals) to construct the bytes of an infinity, with
this last being the reason for having architecture-specific files.
Supporting TS 18661-3 _FloatN / _FloatNx types that have the same
format as other supported types will mean adding more such macros;
needing to add more headers for them doesn't seem very desirable.

The fallbacks based on bytes of the representation of an infinity do
not meet the standard requirements for a constant expression.  At
least one of them is also wrong: sysdeps/sh/bits/huge_val.h is
producing a mixed-endian representation which does not match what GCC
does.

This patch eliminates all those headers, defining the macros directly
in math.h.  For GCC 3.3 and later, the built-in functions are used as
now.  For other compilers, a large constant 1e10000 (with appropriate
suffix) is used.  This is like the fallback for GCC 2.96 and later,
but without using hex floats (which have no apparent advantage here).
It is unambiguously valid standard C for all floating-point formats
with infinities, which covers all formats supported by glibc or likely
to be supported by glibc in future (C90 DR#025 said that if a
floating-point format represents infinities, all real values lie
within the range of representable values, so the constraints for
constant expressions are not violated), but may generate compiler
warnings and wouldn't handle the TS 18661-1 FENV_ROUND pragma
correctly.  If someone is actually using a compiler with glibc that
does not claim to be GCC 3.3 or later, but which has a better way to
define the HUGE_VAL macros, we can always add compiler conditionals in
with alternative definitions.

I intend to make similar changes for INF and NAN.  The SNAN macros
already just use __builtin_nans etc. with no fallback for compilers
not claiming to be GCC 3.3 or later.

Tested for x86_64.

	* math/math.h: Do not include bits/huge_val.h, bits/huge_valf.h,
	bits/huge_vall.h or bits/huge_val_flt128.h.
	(HUGE_VAL): Define directly here.
	[__USE_ISOC99] (HUGE_VALF): Likewise.
	[__USE_ISOC99] (HUGE_VALL): Likewise.
	[__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(HUGE_VAL_F128): Likewise.
	* math/Makefile (headers): Remove bits/huge_val.h,
	bits/huge_valf.h, bits/huge_vall.h and bits/huge_val_flt128.h.
	* bits/huge_val.h: Remove.
	* bits/huge_val_flt128.h: Likewise.
	* bits/huge_valf.h: Likewise.
	* bits/huge_vall.h: Likewise.
	* sysdeps/ia64/bits/huge_vall.h: Likewise.
	* sysdeps/ieee754/bits/huge_val.h: Likewise.
	* sysdeps/ieee754/bits/huge_valf.h: Likewise.
	* sysdeps/m68k/m680x0/bits/huge_vall.h: Likewise.
	* sysdeps/sh/bits/huge_val.h: Likewise.
	* sysdeps/sparc/bits/huge_vall.h: Likewise.
	* sysdeps/x86/bits/huge_vall.h: Likewise.
2017-08-31 15:50:50 +00:00
Florian Weimer 17e00cc69e elf: Remove internal_function attribute 2017-08-31 16:59:37 +02:00
Florian Weimer 8d2f9410d5 gmon: Remove internal_function attribute 2017-08-31 16:16:07 +02:00
Florian Weimer 86e4919f57 dlfcn: Remove internal_function attribute 2017-08-31 16:12:03 +02:00
Florian Weimer 59bd52b087 resolv: Remove internal_function attribute 2017-08-31 16:07:52 +02:00
Florian Weimer fc3d94979e dirent: Remove internal_function attribute 2017-08-31 16:02:40 +02:00
Florian Weimer 18c54facf1 Linux getcwd: Remove internal_function attribute 2017-08-31 15:59:07 +02:00
Florian Weimer 7e01f080e8 time: Remove the internal_function attribute 2017-08-31 15:59:07 +02:00
Florian Weimer d7ccc6c983 iconv, intl, locale, wcsmbs: Remove internal_function
Also adjust parts of the time subdirectory.
2017-08-31 15:59:06 +02:00
Florian Weimer dab0eecef6 aio: Remove internal_function function attribute 2017-08-31 15:59:06 +02:00
Florian Weimer ab5bf7cf76 misc: Remove internal_function function attribute 2017-08-31 15:59:06 +02:00
Florian Weimer 75b3047eac NSS: Remove internal_function function attribute 2017-08-31 15:59:06 +02:00
Florian Weimer 0c71122c0c malloc: Remove the internal_function attribute 2017-08-31 15:59:06 +02:00
Florian Weimer ca4ec80396 sunrpc: Remove internal_function attribute 2017-08-31 15:59:02 +02:00
Florian Weimer 24cffce736 malloc: Resolve compilation failure in NDEBUG mode
In _int_free, the locked variable is not used if NDEBUG is defined.
2017-08-31 15:34:22 +02:00
H.J. Lu ecd0747df3 Place $(elf-objpfx)sofini.os last [BZ #22051]
Since sofini.os terminates .eh_frame section, it should be placed last.

	[BZ #22051]
	* Makerules (build-module-helper-objlist): Filter out
	$(elf-objpfx)sofini.os.
	(build-shlib-objlist): Append $(elf-objpfx)sofini.os if it is
	needed.
2017-08-31 06:28:46 -07:00
Florian Weimer 5f0704b66c libio: Assume _LIBC, weak_alias, errno, (__set_)errno &c are defined
Do not define _POSIX_SOURCE.
2017-08-31 14:48:25 +02:00
Florian Weimer 5129873a8e malloc: Change top_check return type to void
After commit ec2c1fcefb,
(malloc: Abort on heap corruption, without a backtrace), the function
always returns 0.
2017-08-31 14:16:52 +02:00
Joseph Myers 4fa9b3bfe6 Fix mcontext_t sigcontext namespace (bug 21457).
This patch completes the ucontext.h namespace fixes by fixing issues
related to the use of struct sigcontext as mcontext_t, and inclusion
of <bits/sigcontext.h> even when struct sigcontext is not so used.

Inclusion of <bits/sigcontext.h> by <sys/ucontext.h> is removed; the
way to get the sigcontext structure is by including <signal.h> (in a
context where __USE_MISC is defined); the sysdeps/generic version of
sys/ucontext.h keeps the inclusion by necessity, with a comment about
how this is not namespace-clean, but the only configuration that used
it, MicroBlaze, gets its own version of the header in this patch.
Where mcontext_t was typedefed to struct sigcontext, the contents of
struct sigcontext are inserted (with appropriate namespace handling to
prefix fields with __ when __USE_MISC is not defined); review should
check that this has been done correctly in each case, whether the
definition of struct sigcontext comes from glibc headers or from the
Linux kernel.  This changes C++ name mangling on affected
architectures (which do not include x86_64/x86).

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

2017-08-14  Joseph Myers  <joseph@codesourcery.com>

	[BZ #21457]
	* sysdeps/arm/sys/ucontext.h: Do not include <bits/sigcontext.h>.
	* sysdeps/generic/sys/ucontext.h: Add comment about use of struct
	sigcontext and namespace requirements.
	* sysdeps/i386/sys/ucontext.h: Do not include <bits/sigcontext.h>.
	* sysdeps/m68k/sys/ucontext.h: Likewise.
	* sysdeps/mips/sys/ucontext.h: Likewise.  Include <bits/types.h>.
	* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	(__ctx): Define earlier.
	(mcontext_t): Define structure contents rather than using struct
	sigcontext.
	* sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym (oEXTENSION): Use
	__glibc_reserved1 instead of __reserved.
	* sysdeps/unix/sysv/linux/alpha/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	(__ctx): Define earlier.
	(mcontext_t): Define structure contents rather than using struct
	sigcontext.
	* sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym: Use
	mcontext_t instead of struct sigcontext.
	* sysdeps/unix/sysv/linux/arm/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	(__ctx): Define earlier.
	(mcontext_t): Define structure contents rather than using struct
	sigcontext.
	* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	(__ctx): Define earlier.
	(mcontext_t): Define structure contents rather than using struct
	sigcontext.
	* sysdeps/unix/sysv/linux/ia64/makecontext.c (__makecontext): Use
	mcontext_t instead of struct sigcontext.
	* sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym: Use
	mcontext_t instead of struct sigcontext.
	* sysdeps/unix/sysv/linux/ia64/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	(__ctx): New macro.
	(struct __ia64_fpreg_mcontext): New type.
	(mcontext_t): Define structure contents rather than using struct
	sigcontext.
	(_SC_GR0_OFFSET): Use mcontext_t instead of struct sigcontext.
	(uc_sigmask): Define using __ctx.
	(uc_stack): Likewise.
	* sysdeps/unix/sysv/linux/ia64/sys/procfs.h: Include
	<bits/sigcontext.h>.
	* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	* sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h: New file.
	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	* sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	* sysdeps/unix/sysv/linux/sh/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	* sysdeps/unix/sysv/linux/tile/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.
	(__ctx): Define earlier.
	(mcontext_t): Define structure contents rather than using struct
	sigcontext.
	* sysdeps/unix/sysv/linux/x86/sys/ucontext.h: Do not include
	<bits/sigcontext.h>.  Include <bits/types.h>.
	* conform/Makefile (test-xfail-XPG42/signal.h/conform): Remove.
	(test-xfail-XPG42/sys/wait.h/conform): Likewise.
	(test-xfail-XPG42/ucontext.h/conform): Likewise.
	(test-xfail-UNIX98/signal.h/conform): Likewise.
	(test-xfail-UNIX98/sys/wait.h/conform): Likewise.
	(test-xfail-UNIX98/ucontext.h/conform): Likewise.
	(test-xfail-XOPEN2K/signal.h/conform): Likewise.
	(test-xfail-XOPEN2K/sys/wait.h/conform): Likewise.
	(test-xfail-XOPEN2K/ucontext.h/conform): Likewise.
	(test-xfail-POSIX2008/signal.h/conform): Likewise.
	(test-xfail-POSIX2008/sys/wait.h/conform): Likewise.
	(test-xfail-XOPEN2K8/signal.h/conform): Likewise.
	(test-xfail-XOPEN2K8/sys/wait.h/conform): Likewise.
2017-08-30 22:02:04 +00:00
Florian Weimer 5898f4548e dynarray: Set errno on overflow-induced allocation failure
This allows the caller to return directly on such an error, with an
appropriate errno value.
2017-08-30 20:10:56 +02:00
Florian Weimer a9da0bb266 malloc: Remove corrupt arena flag
This is no longer needed because we now abort immediately
once heap corruption is detected.
2017-08-30 20:08:34 +02:00
Florian Weimer ac3ed168d0 malloc: Remove check_action variable [BZ #21754]
Clean up calls to malloc_printerr and trim its argument list.

This also removes a few bits of work done before calling
malloc_printerr (such as unlocking operations).

The tunable/environment variable still enables the lightweight
additional malloc checking, but mallopt (M_CHECK_ACTION)
no longer has any effect.
2017-08-30 20:08:34 +02:00
Steve Ellcey 44bcba80f3 aarch64: Fix tst-makecontext3 in ILP32 mode.
* sysdeps/unix/sysv/linux/aarch64/makecontext.c (__makecontext):
	Use pointer to uint64_t instead of long int for sp.
2017-08-30 09:25:51 -07:00
Florian Weimer ec2c1fcefb malloc: Abort on heap corruption, without a backtrace [BZ #21754]
The stack trace printing caused deadlocks and has been itself been
targeted by code execution exploits.
2017-08-30 16:39:41 +02:00
Florian Weimer 9ce673b69e Do not scale NPTL tests with available number of CPUs
On very large multi-processor systems, creating hundreds of threads
runs into a test time out.  The tests do not seem to benefit from
massive over-scheduling.
2017-08-30 16:20:31 +02:00
Joseph Myers 2f1aef1959 Fix m68k bits/math-inline.h macro namespace (bug 22035).
As shown by build bot failures
<https://sourceware.org/ml/libc-testresults/2017-q3/msg00349.html> the
m68k bits/mathinline.h is not namespace-clean: it fails to compile if
the user has defined macros f or l before it is included, because of
expansions of those arguments to __inline_functions.  This patch
changes the __inline_functions definitions to take not the suffix but
a macro that concatenates it with the function name, to avoid the
spurious macro expansions.

Tested for m68k with build-many-glibcs.py.

	[BZ #22035]
	* sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__inline_functions):
	Define to take a second argument that is a macro that
	concatentates a suffix, not the suffix itself.
	(__CONCAT_d): New macro.
	(__CONCAT_f): Likewise.
	(__CONCAT_l): Likewise.
2017-08-29 21:07:51 +00:00
Paul Pluzhnikov 8325b477b1 2017-08-29 Paul Pluzhnikov <ppluzhnikov@google.com>
* stdlib/tst-atexit-common.c (do_test): Test handler inheritance
	by child.
2017-08-29 10:46:44 -07:00
Adhemerval Zanella 319cbbf633 MIPS/o32: Fix internal_syscall5/6/7
Fix a commit cc25c8b4c1 ("New pthread rwlock that is more scalable.")
regression and prevent uncontrolled stack space usage from happening
when a 5-, 6- or 7-argument syscall wrapper is placed in a loop.

The cause of the problem is the use of `alloca' in regular MIPS/Linux
wrappers to force the use of the frame pointer register in any function
using one or more of these wrappers.  Using the frame pointer register
is required so as not to break frame unwinding as the the stack pointer
is lowered within the inline asm used by these wrappers to make room for
the stack arguments, which 5-, 6- and 7-argument syscalls use with the
o32 ABI.

The regular MIPS/Linux wrappers are macros however, expanded inline, and
stack allocations made with `alloca' are not discarded until the return
of the function they are made in.  Consequently if called in a loop,
then virtual memory is wasted, and if the loop goes through enough
iterations, then ultimately available memory can get exhausted causing
the program to crash.

Address the issue by replacing the inline code with standalone assembly
functions, which rely on the compiler arranging syscall arguments
according to the o32 function calling convention, which MIPS/Linux
syscalls also use, except for the syscall number passed and the error
flag returned.  This way there is no need to fiddle with the stack
pointer anymore and all that has to be handled in the new standalone
functions is the special handling of the syscall number and the error
flag.

Redirect 5-, 6- or 7-argument MIPS16/Linux syscall wrappers to these new
functions as well, so as to avoid an unnecessary double call the
existing wrappers would cause with the new arrangement.

	[BZ #21956]
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile
	[subdir = misc] (sysdep_routines): Remove `mips16-syscall5',
	`mips16-syscall6' and `mips16-syscall7'.
	(CFLAGS-mips16-syscall5.c, CFLAGS-mips16-syscall6.c)
	(CFLAGS-mips16-syscall7.c): Remove.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions (libc):
	Remove `__mips16_syscall5', `__mips16_syscall6' and
	`__mips16_syscall7'.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c
	(__mips16_syscall0): Rename `__mips16_syscall_return' to
	`__mips_syscall_return'.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c
	(__mips16_syscall1): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c
	(__mips16_syscall2): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c
	(__mips16_syscall3): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c
	(__mips16_syscall4): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c:
	Remove.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c:
	Remove.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c:
	Remove.
	* sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h
	(__mips16_syscall5): Expand to `__mips_syscall5' rather than
	`__mips16_syscall5'.  Remove prototype.
	(__mips16_syscall6): Expand to `__mips_syscall6' rather than
	`__mips16_syscall6'.  Remove prototype.
	(__mips16_syscall7): Expand to `__mips_syscall7' rather than
	`__mips16_syscall7'.  Remove prototype.
	(__nomips16, __mips16_syscall_return): Move to...
	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
	(__nomips16, __mips_syscall_return): ... here.
	[__mips16] (INTERNAL_SYSCALL_NCS): Rename
	`__mips16_syscall_return' to `__mips_syscall_return'.
	[__mips16] (INTERNAL_SYSCALL_MIPS16): Pass `number' to
	`internal_syscall##nr'.
	[!__mips16] (INTERNAL_SYSCALL): Pass `SYS_ify (name)' to
	`internal_syscall##nr'.
	(FORCE_FRAME_POINTER): Remove.
	(__mips_syscall5): New prototype.
	(internal_syscall5): Rewrite to call `__mips_syscall5'.
	(__mips_syscall6): New prototype.
	(internal_syscall6): Rewrite to call `__mips_syscall6'.
	(__mips_syscall7): New prototype.
	(internal_syscall7): Rewrite to call `__mips_syscall7'.
	* sysdeps/unix/sysv/linux/mips/mips32/mips-syscall5.S: New file.
	* sysdeps/unix/sysv/linux/mips/mips32/mips-syscall6.S: New file.
	* sysdeps/unix/sysv/linux/mips/mips32/mips-syscall7.S: New file.
	* sysdeps/unix/sysv/linux/mips/mips32/Makefile [subdir = misc]
	(sysdep_routines): Add libc-do-syscall.
	* sysdeps/unix/sysv/linux/mips/mips32/Versions (libc): Add
	`__mips_syscall5', `__mips_syscall6' and `__mips_syscall7'.
2017-08-29 18:31:08 +01:00
Adhemerval Zanella 01b87c656f ia64: Fix thread stack allocation permission set (BZ #21672)
This patch fixes ia64 failures on thread exit by madvise the required
area taking in consideration its disjoing stacks
(NEED_SEPARATE_REGISTER_STACK).  Also the snippet that setup the
madvise call to advertise kernel the area won't be used anymore in
near future is reallocated in allocatestack.c (for consistency to
put all stack management function in one place).

Checked on x86_64-linux-gnu and i686-linux-gnu for sanity (since
it is not expected code changes for architecture that do not
define NEED_SEPARATE_REGISTER_STACK) and also got a report that
it fixes ia64-linux-gnu failures from Sergei Trofimovich
<slyfox@gentoo.org>.

	[BZ #21672]
	* nptl/allocatestack.c [_STACK_GROWS_DOWN] (setup_stack_prot):
	Set to use !NEED_SEPARATE_REGISTER_STACK as well.
	(advise_stack_range): New function.
	* nptl/pthread_create.c (START_THREAD_DEFN): Move logic to mark
	stack non required to advise_stack_range at allocatestack.c
2017-08-29 13:29:19 -03:00
Szabolcs Nagy 16f138a49a [AArch64] Fix procfs.h not to expose stdint.h types
Commit 39e7a5a668 added stdint.h
to sys/procfs.h, but it is included into signal.h by default and
there is code that does not expect stdint.h to be visible there,
so use __uint64_t instead of uint64_t.
2017-08-29 16:54:33 +01:00
Florian Weimer 251bccfa1f iconv_open: Fix heap corruption on gconv_init failure [BZ #22026]
Also mangle the __end_fct function pointer on the error handling
path.
2017-08-29 17:33:58 +02:00
Florian Weimer e7c18b9d0a iconv: Mangle __btowc_fct even without __init_fct [BZ #22025] 2017-08-29 17:16:09 +02:00
Joseph Myers 7daada0319 Fix bits/math-finite.h _MSUF_ expansion namespace (bug 22028).
The current bits/math-finite.h approach to defining functions for
different types, involving math.h defining _MSUF_ and _MSUFTO_ for the
function suffixes involved, is not namespace-clean if one of those
suffixes (f, l, f128) is defined as a macro by the user before math.h
is included; too many levels of macro expansion occur.  Instead, those
suffixes should appear directly in the expansion of the macro using ##
so they don't get expanded even if defined as macros by the user (that
is, math.h should be defining __REDIRFROM_X and __REDIRTO_X directly
to use those suffixes rather than suffixes being passed as an argument
by macro callers).  This patch makes that change.

Tested for x86_64.

	[BZ #22028]
	* math/math.h [__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0]
	(_MSUF_): Remove macro.
	[__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0] (_MSUFTO_):
	Likewise.
	[__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0]
	(__REDIRFROM_X): New macro.
	[__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0] (__REDIRTO_X):
	Likewise.
	* math/bits/math-finite.h (__REDIRFROM_X): Remove macro.
	(__REDIRTO_X): Likewise.
	(__MATH_REDIRCALL): Do not pass _MSUF_ or _MSUFTO_ macro
	arguments.
	(__MATH_REDIRCALL_2): Likewise.
	(__MATH_REDIRCALL_INTERNAL): Likewise.
	(__REDIRFROM (lgamma, , _MSUF_)): Likewise.
	(__REDIRFROM (gamma, , _MSUF_)): Likweise.
	(__REDIRFROM (__gamma, _r_finite, _MSUF_)): Likewise.
	(__REDIRFROM (tgamma, , _MSUF_)): Likewise.
	* math/test-finite-macros.c: New file.
	* math/Makefile (tests): Add test-finite-macros.
	(CFLAGS-test-finite-macros.c): New variable.
2017-08-29 14:15:37 +00:00
Patsy Franklin 1cf1232cd4 gconv: Consistently mangle NULL function pointers [BZ #22025]
Not mangling NULL pointers is not safe because with very low
probability, a non-NULL function pointer can turn into a NULL pointer
after mangling.
2017-08-29 15:53:28 +02:00
Akhilesh Kumar f8de9568d8 Add locale for mfe_MU
Add locale for “Morisyen” which is also called “Mauritian Creole”
and is spoken in Mauritius.

	[BZ #21971]
	* localedata/SUPPORTED: Add mfe_MU/UTF-8.
	* localedata/locales/mfe_MU: New File.

	[BZ #21971]
	* locale/iso-639.def: add Morisyen.
2017-08-29 13:56:41 +02:00
Gabriel F. T. Gomes 42496114ec Provide a C++ version of iszero that does not use __MATH_TG (bug 21930)
When signaling nans are enabled (with -fsignaling-nans), the C++ version
of iszero uses the fpclassify macro, which is defined with __MATH_TG.
However, when support for float128 is available, __MATH_TG uses the
builtin __builtin_types_compatible_p, which is only available in C mode.

This patch refactors the C++ version of iszero so that it uses function
overloading to select between the floating-point types, instead of
relying on fpclassify and __MATH_TG.

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

	[BZ #21930]
	* math/math.h [defined __cplusplus && defined __SUPPORT_SNAN__]
	(iszero): New C++ implementation that does not use
	fpclassify/__MATH_TG/__builtin_types_compatible_p, when
	signaling nans are enabled, since __builtin_types_compatible_p
	is a C-only feature.
	* math/test-math-iszero.cc: When __HAVE_DISTINCT_FLOAT128 is
	defined, include ieee754_float128.h for access to the union and
	member ieee854_float128.ieee.
	[__HAVE_DISTINCT_FLOAT128] (do_test): Call check_float128.
	[__HAVE_DISTINCT_FLOAT128] (check_float128): New function.
	* sysdeps/powerpc/powerpc64le/Makefile [subdir == math]
	(CXXFLAGS-test-math-iszero.cc): Add -mfloat128 to the build
	options of test-math-zero on powerpc64le.
2017-08-28 15:22:37 -03:00
H.J. Lu 5e2bc4ff33 x86_64 __redirect_ieee754_expf: Change double to float
__redirect_ieee754_expf has type float, not double.

	* sysdeps/x86_64/fpu/multiarch/e_expf.c (__redirect_ieee754_expf):
	Change double to float.
2017-08-28 08:45:53 -07:00
Joseph Myers a48c0fb4b4 Simplify math-svid-compat code.
Now there are no more assembly wrappers using _LIB_VERSION or
__kernel_standard, the math-svid-compat code can be slighly
simplified.  math-svid-compat.h no longer needs __ASSEMBLER__
conditionals, and the _LIB_VERSION variable no longer needs to be
built for static libm, since all references are now in C code that
includes math-svid-compat.h and so gets the macro definition of
_LIB_VERSION to _POSIX_ outside the compat case.  This patch makes
those cleanups.

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

	* math/math-svid-compat.h [!__ASSEMBLER__]: Make code
	unconditional.
	* sysdeps/ieee754/s_lib_version.c [!defined SHARED]: Remove
	conditional code; define contents only for [LIBM_SVID_COMPAT].
2017-08-28 15:19:52 +00:00
Florian Weimer ee17d4e99a Remove abi-*-options compiler flags
These options are no longer needed since commit
2dba5ce7b8 (<bits/syscall.h>: Use an
arch-independent system call list on Linux).
2017-08-28 17:16:53 +02:00
Samuel Thibault 45a4f49ee5 hurd: Remove duplicate symbol version
* hurd/Versions (GLIBC_2.4): Remove __stack_chk_fail.
* mach/Versions (GLIBC_2.4): Remove __stack_chk_fail.
2017-08-28 14:19:55 +02:00
Florian Weimer 2dba5ce7b8 <bits/syscall.h>: Use an arch-independent system call list on Linux
This commit changes the way the list of SYS_* system call macros is
created on Linux.  glibc now contains a list of all known system
calls, and the generated <bits/syscall.h> file defines the SYS_ macro
only if the correspnding __NR_ macro is defined by the kernel headers.

As a result, glibc does not have to be rebuilt to pick up system calls
if the glibc sources already know about them.  This means that glibc
can be built with older kernel headers, and if the installed kernel
headers are upgraded afterwards, additional SYS_ macros become
available as long as glibc has a record for those system calls.
2017-08-28 11:58:52 +02:00
Paul Pluzhnikov 5f3b183d19 2017-08-27 Paul Pluzhnikov <ppluzhnikov@google.com>
* stdlib/Makefile (tst-atexit, tst-at_quick_exit): New tests.
	(tst-cxa_atexit, tst-on_exit): Likewise.
	* stdlib/Makefile (tests): Add tst-atexit, tst-at_quick_exit,
	tst-cxa_atexit, and tst-on_exit.
	* stdlib/tst-atexit-common.c: New file.
	* stdlib/tst-atexit.c: New file.
	* stdlib/tst-at_quick_exit.c: New file.
	* stdlib/tst-cxa_atexit.c: New file.
	* stdlib/tst-on_exit.c: New file.
2017-08-27 19:10:40 -07:00
Samuel Thibault 99ee4d26dc hurd: Fix static initialization with -fstack-protector-strong
When linked statically, TLS initialization is not achieved before
mach_init and alike, so ssp accesses to tcbhead's stack_guard would
crash.  We can just avoid using ssp in the few functions needed before
TLS is set up.

	* mach/Makefile (CFLAGS-mach_init.o, CFLAGS-RPC_vm_statistics.o,
	CFLAGS-RPC_vm_map.o, CFLAGS-RPC_vm_protect.o,
	CFLAGS-RPC_i386_set_gdt.o, CFLAGS-RPC_i386_set_ldt.o,
	CFLAGS-RPC_task_get_special_port.o): Add $(no-stack-protector).
	* hurd/Makefile (CFLAGS-hurdstartup.o,
	CFLAGS-RPC_exec_startup_get_info.o): Add $(no-stack-protector).
2017-08-27 22:29:43 +02:00
Samuel Thibault 97e02ad233 hurd: fix build with -fstack-protector-strong
libmachuser and libhurduser also need stack_chk_fail_local and they do not
link against libc_nonshared.

       * mach/stack_chk_fail_local.c: New file.
       * hurd/stack_chk_fail_local.c: New file.
       * mach/Machrules ($(interface-library)-routines): Add
       stack_chk_fail_local.
       * mach/Versions (GLIBC_2.4): Add __stack_chk_fail.
       * hurd/Versions (GLIBC_2.4): Add __stack_chk_fail.
2017-08-27 22:10:17 +02:00
Samuel Thibault 2ef8d46913 hurd: Add system-specific sysmacros.h
* sysdeps/mach/hurd/bits/sysmacros.h: New file.
2017-08-27 22:00:23 +02:00
H.J. Lu 7ab70c98e8 x86: Remove assembly versions of index_cpu_*/index_arch_*
Since assembly versions of HAS_CPU_FEATURE and HAS_ARCH_FEATURE have
been removed,  assembly versions of index_cpu_* and index_arch_* can
also be removed.

Tested on i686 and x86-64 with and without --disable-multi-arch.

	* sysdeps/x86/cpu-features.h [__ASSEMBLER__]
	(index_cpu_*, index_arch_*): Removed.
2017-08-25 10:51:04 -07:00
Szabolcs Nagy 39e7a5a668 [AArch64] Fix elf_greg_t on ILP32
Use uint64_t instead of unsigned long.
2017-08-25 18:21:35 +01:00