Commit Graph

32699 Commits

Author SHA1 Message Date
Florian Weimer
8adfb0eeff support_create_temp_directory: Align behavior with create_temp_file
create_temp_file automatically supplies the test directory and the
XXXXXX suffix.  support_create_temp_directory required the caller to
specify them, which was confusing.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Checked on aarch64-linux-gnu with GCC 5.3.1.

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

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

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

Tested for x86_64.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This check appears in several places.

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

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

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

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

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

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

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

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

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

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

Tested for x86_64.

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

Tested for x86_64.

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

Checked on x86_64-linux-gnu.

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

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

Checked on x86_64-linux-gnu.

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

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

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

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

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

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

Tested for x86_64 (with GCC mainline).

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

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

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

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

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

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

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

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

Tested with build-many-glibcs.py.

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

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

Also fix res_mailok, res_ownok.
2017-11-11 11:51:08 +01:00
Florian Weimer
9e0ad3049d resolv: ns_name_pton should report trailing \ as error [BZ #22413] 2017-11-11 11:41:45 +01:00
Florian Weimer
e2a9fca810 resolv: Add tst-ns_name_pton 2017-11-11 11:33:32 +01:00
Florian Weimer
5c1a69238f resolv: Add tst-res_hnok 2017-11-11 11:23:40 +01:00
Florian Weimer
a19c0a1db5 resolv: Use test framework in tst-resolv-network
The main function was left in place by accident when the
test was imported.
2017-11-11 10:54:56 +01:00
H.J. Lu
8cb5295d3f Add jmp_buf-macros.h
Verify that sizes, alignments and field offsets of jmp_buf as well as
sigjmp_buf are unchanged regardless how struct __jmp_buf_tag is defined.
Since jmp_buf is target specific, jmp_buf-macros.h is added for each
Linux target.  A new target must provides its own jmp_buf-macros.h.

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

Tested with build-many-glibcs.py.

	* include/setjmp.h [!_ISOMAC]: Include <stddef.h> and
	<jmp_buf-macros.h>.
	[!_ISOMAC] (STR_HELPER): New.
	[!_ISOMAC] (STR): Likewise.
	[!_ISOMAC] (TEST_SIZE): Likewise.
	[!_ISOMAC] (TEST_ALIGN): Likewise.
	[!_ISOMAC] (TEST_OFFSET): Likewise.
	[!_ISOMAC] Add _Static_assert to check sizes, alignments and
	field offsets of jmp_buf as well as sigjmp_buf.
	* sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/nios2/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/jmp_buf-macros.h:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/jmp_buf-macros.h: Likewise.
2017-11-09 05:10:03 -08:00
Joseph Myers
3683b423a4 Handle more _FloatN, _FloatNx types in include/float.h.
Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch adds support in include/float.h.  This header
defines macros for _Float128 properties when using compilers before
GCC 7 that lack those macros in <float.h>.  For testing _Float32 /
_Float64 / _Float32x / _Float64x functions with older compilers, such
macros need to be defined for those types as well; for the older
compilers, those types will always be typedefs for another type, so
the definitions can be in terms of the macros for that other type.

Tested for x86_64.

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

Tested for x86_64.

	* stdlib/tst-strtod.h (F16): New macro.
	(F32): Likewise.
	(F64): Likewise.
	(F32X): Likewise.
	(F64X): Likewise.
	(F128X): Likewise.
	(IF_FLOAT16): Likewise.
	(IF_FLOAT32): Likewise.
	(IF_FLOAT64): Likewise.
	(IF_FLOAT32X): Likewise.
	(IF_FLOAT64X): Likewise.
	(IF_FLOAT128X): Likewise.
	(GEN_TEST_STRTOD_FOREACH): Conditionally call macros for _Float16,
	_Float32, _Float64, _Float32x, _Float64x and _Float128x.
	(STRTOD_TEST_FOREACH): Likewise.
	* stdlib/tst-strtod-round-skeleton.c (CHOOSE_f32): New macro.
	(CHOOSE_f64): Likewise.
	(CHOOSE_f32x): Likewise.
	(CHOOSE_f64x): Likewise.
2017-11-07 18:08:44 +00:00
Andreas Schwab
feda96a178 Remove traces of tst-typesizes 2017-11-07 16:17:18 +01:00
Mike FABIAN
1bd0cbb8cf mfe_MU, miq_NI locales: Escape slashes in d_fmt [BZ #22403]
[BZ #22403]
	* localedata/locales/mfe_MU (LC_TIME): Fix wrong d_fmt, / needs
	to be escaped.
	* localedata/locales/miq_NI (LC_TIME): Fix wrong d_fmt, / needs
	to be escaped.
2017-11-07 15:28:59 +01:00