platform/upstream/glibc.git
6 years agoAdd Linux 4.14 ARPHRD_RAWIP to net/if_arp.h.
Joseph Myers [Thu, 16 Nov 2017 17:52:43 +0000 (17:52 +0000)]
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.

6 years agoUpdate kernel version in syscall-names.list to 4.14.
Joseph Myers [Thu, 16 Nov 2017 17:51:54 +0000 (17:51 +0000)]
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.

6 years agoFix botched up regeneration in the last commit
Siddhesh Poyarekar [Thu, 16 Nov 2017 06:38:52 +0000 (12:08 +0530)]
Fix botched up regeneration in the last commit

6 years agoPrefer https for Sourceware links
Siddhesh Poyarekar [Thu, 16 Nov 2017 06:19:26 +0000 (11:49 +0530)]
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.

6 years agoThe -Wstringop-truncation option new in GCC 8 detects common misuses
Martin Sebor [Thu, 16 Nov 2017 00:39:59 +0000 (17:39 -0700)]
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.

6 years agolinux ttyname{_r}: Add tests
Luke Shumaker [Wed, 15 Nov 2017 19:39:22 +0000 (20:39 +0100)]
linux ttyname{_r}: Add tests

Add a new tst-ttyname test that includes several named sub-testcases.

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

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

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

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

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

Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolinux ttyname{_r}: Don't bail prematurely [BZ #22145]
Luke Shumaker [Wed, 15 Nov 2017 19:36:44 +0000 (20:36 +0100)]
linux ttyname{_r}: Don't bail prematurely [BZ #22145]

Commit 15e9a4f378c8607c2ae1aa465436af4321db0e23 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>
6 years agolinux ttyname{_r}: Make tty checks consistent
Luke Shumaker [Wed, 15 Nov 2017 19:34:30 +0000 (20:34 +0100)]
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 15e9a4f378c8607c2ae1aa465436af4321db0e23
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>
6 years agolinux ttyname: Change return type of is_pty from int to bool
Luke Shumaker [Wed, 15 Nov 2017 19:33:11 +0000 (20:33 +0100)]
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>
6 years agolinux ttyname: Update a reference to kernel docs for kernel 4.10
Luke Shumaker [Wed, 15 Nov 2017 19:31:32 +0000 (20:31 +0100)]
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
15e9a4f378c8607c2ae1aa465436af4321db0e23) was submitted and the time
it was applied (in February, January, and March 2017; respectively).

Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agomanual: Update to mention ENODEV for ttyname and ttyname_r
Luke Shumaker [Wed, 15 Nov 2017 19:28:40 +0000 (20:28 +0100)]
manual: Update to mention ENODEV for ttyname and ttyname_r

Commit 15e9a4f378c8607c2ae1aa465436af4321db0e23 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>
6 years agoAdd MSG_ZEROCOPY from Linux 4.14 to bits/socket.h.
Joseph Myers [Wed, 15 Nov 2017 18:41:32 +0000 (18:41 +0000)]
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.

6 years agoAdd MADV_WIPEONFORK, MADV_KEEPONFORK from Linux 4.14.
Joseph Myers [Wed, 15 Nov 2017 18:40:29 +0000 (18:40 +0000)]
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.

6 years agoOptimize sigrelse implementation
Adhemerval Zanella [Mon, 6 Nov 2017 11:31:37 +0000 (09:31 -0200)]
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>
6 years agoCleanup sigpause implementation
Adhemerval Zanella [Fri, 3 Nov 2017 12:55:09 +0000 (10:55 -0200)]
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>
6 years agoUse Linux 4.14 in build-many-glibcs.py.
Joseph Myers [Wed, 15 Nov 2017 17:10:03 +0000 (17:10 +0000)]
Use Linux 4.14 in build-many-glibcs.py.

* scripts/build-many-glibcs.py (Context.checkout): Default Linux
kernel version to 4.14.

6 years agoCheck length of ifname before copying it into to ifreq structure.
Steve Ellcey [Wed, 15 Nov 2017 16:58:48 +0000 (08:58 -0800)]
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.

6 years agolinux: Include <sysdep-cancel.h> for epoll_wait
Luke Shumaker [Wed, 15 Nov 2017 16:36:25 +0000 (14:36 -0200)]
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 b62c3815912bc679a966134affdedd3f35ae8621,
when epoll_wait changed from being in syscalls.list to always having a C
wrapper.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoka_GE locale: Add “X” back to yesexpr.
Mike FABIAN [Wed, 15 Nov 2017 12:19:43 +0000 (13:19 +0100)]
ka_GE locale: Add “X” back to yesexpr.

* localedata/locales/ka_GE (LC_MESSAGES): Add “X” back to yesexpr,
was accidentally lost.

6 years agoaz_IR locale: Add standard copyright header
Mike FABIAN [Wed, 15 Nov 2017 12:16:47 +0000 (13:16 +0100)]
az_IR locale: Add standard copyright header

* localedata/locales/az_IR: Add standard copyright header.

6 years agomalloc: Account for all heaps in an arena in malloc_info [BZ #22439]
Florian Weimer [Wed, 15 Nov 2017 10:40:41 +0000 (11:40 +0100)]
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>
6 years agomalloc: Add missing arena lock in malloc_info [BZ #22408]
Florian Weimer [Wed, 15 Nov 2017 10:39:01 +0000 (11:39 +0100)]
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.

6 years agoUse __builtin_tgmath in tgmath.h with GCC 8 (bug 21660).
Joseph Myers [Wed, 15 Nov 2017 02:08:56 +0000 (02:08 +0000)]
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.

6 years agoFix string/tester.c build with GCC 8.
Joseph Myers [Tue, 14 Nov 2017 17:52:26 +0000 (17:52 +0000)]
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.

6 years agoFix string/bug-strncat1.c build with GCC 8.
Joseph Myers [Tue, 14 Nov 2017 17:50:36 +0000 (17:50 +0000)]
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.

6 years agoReplaced unicode sequences in the ASCII printable range
Claude Paroz [Thu, 2 Nov 2017 14:10:42 +0000 (15:10 +0100)]
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.

6 years agosupport: Add <support/next_to_fault.h>
Florian Weimer [Mon, 13 Nov 2017 16:55:12 +0000 (17:55 +0100)]
support: Add <support/next_to_fault.h>

Based on the implementation in resolv/tst-inet_pton.c.

6 years agoAdd missing ChangeLog sub-entries
Florian Weimer [Mon, 13 Nov 2017 16:58:10 +0000 (17:58 +0100)]
Add missing ChangeLog sub-entries

6 years agold.so: Add architecture specific fields
H.J. Lu [Mon, 13 Nov 2017 16:02:39 +0000 (08:02 -0800)]
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.

6 years agotimezone: pacify GCC -Wstringop-truncation
Paul Eggert [Mon, 13 Nov 2017 06:00:28 +0000 (22:00 -0800)]
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.

6 years agosupport: Add xstrndup, xunlink, xreadlink, support_create_temp_directory
Florian Weimer [Sun, 12 Nov 2017 08:53:06 +0000 (09:53 +0100)]
support: Add xstrndup, xunlink, xreadlink, support_create_temp_directory

6 years agoFix clog10_downward ulps on hppa.
John David Anglin [Sat, 11 Nov 2017 17:12:28 +0000 (12:12 -0500)]
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.

6 years agoresolv: More precise checks in res_hnok, res_dnok [BZ #22409] [BZ #22412]
Florian Weimer [Sat, 11 Nov 2017 10:51:08 +0000 (11:51 +0100)]
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.

6 years agoresolv: ns_name_pton should report trailing \ as error [BZ #22413]
Florian Weimer [Sat, 11 Nov 2017 10:41:45 +0000 (11:41 +0100)]
resolv: ns_name_pton should report trailing \ as error [BZ #22413]

6 years agoresolv: Add tst-ns_name_pton
Florian Weimer [Sat, 11 Nov 2017 10:33:32 +0000 (11:33 +0100)]
resolv: Add tst-ns_name_pton

6 years agoresolv: Add tst-res_hnok
Florian Weimer [Sat, 11 Nov 2017 10:23:40 +0000 (11:23 +0100)]
resolv: Add tst-res_hnok

6 years agoresolv: Use test framework in tst-resolv-network
Florian Weimer [Sat, 11 Nov 2017 09:54:16 +0000 (10:54 +0100)]
resolv: Use test framework in tst-resolv-network

The main function was left in place by accident when the
test was imported.

6 years agoAdd jmp_buf-macros.h
H.J. Lu [Thu, 9 Nov 2017 13:09:49 +0000 (05:09 -0800)]
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.

6 years agoHandle more _FloatN, _FloatNx types in include/float.h.
Joseph Myers [Tue, 7 Nov 2017 23:47:53 +0000 (23:47 +0000)]
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.

6 years agoHandle more _FloatN, _FloatNx types in type-generic strtod tests.
Joseph Myers [Tue, 7 Nov 2017 18:08:44 +0000 (18:08 +0000)]
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.

6 years agoRemove traces of tst-typesizes
Andreas Schwab [Tue, 7 Nov 2017 15:04:56 +0000 (16:04 +0100)]
Remove traces of tst-typesizes

6 years agomfe_MU, miq_NI locales: Escape slashes in d_fmt [BZ #22403]
Mike FABIAN [Tue, 7 Nov 2017 13:24:51 +0000 (14:24 +0100)]
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.

6 years agoan_ES, kab_DZ, om_ET locales: Escape slashes in d_fmt [BZ #22403]
Claude Paroz [Mon, 6 Nov 2017 13:14:28 +0000 (14:14 +0100)]
an_ES, kab_DZ, om_ET locales: Escape slashes in d_fmt [BZ #22403]

[BZ #22403]
* localedata/locales/an_ES (LC_TIME): Fix wrong d_fmt, / needs
to be escaped.
* localedata/locales/kab_DZ (LC_TIME): Fix wrong d_fmt, / needs
to be escaped.
* localedata/locales/om_ET (LC_TIME): Fix wrong d_fmt, / needs
to be escaped.

6 years agonptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION}
Adhemerval Zanella [Thu, 19 Oct 2017 12:11:57 +0000 (10:11 -0200)]
nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION}

This patch adds two new internal defines to set the internal
pthread_mutex_t layout required by the supported ABIS:

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

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

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

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

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agonptl: Change tst-typesizes to _Static_assert
Adhemerval Zanella [Mon, 16 Oct 2017 14:25:35 +0000 (12:25 -0200)]
nptl: Change tst-typesizes to _Static_assert

Instead of rely on runtime check to assure correct pthread types
size a better strategy would use _Static_assert to trigger an error
on build time (and thus allowing to check to potentially ABI breakage
on cross-compiling make check).

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

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

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

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agonptl: Add tests for internal pthread_mutex_t offsets
Adhemerval Zanella [Mon, 16 Oct 2017 16:27:29 +0000 (14:27 -0200)]
nptl: Add tests for internal pthread_mutex_t offsets

This patch adds a new build test to check for internal fields
offsets for user visible internal field.  Although currently
the only field which is statically initialized to a non zero value
is pthread_mutex_t.__data.__kind value, the tests also check the
offset of __kind, __spins, __elision (if supported), and __list
internal member.  A internal header (pthread-offset.h) is added
to each major ABI with the reference value.

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

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

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoMove <bits/mman-linux.h> to the Linux sysdeps directory
Florian Weimer [Tue, 7 Nov 2017 11:11:42 +0000 (12:11 +0100)]
Move <bits/mman-linux.h> to the Linux sysdeps directory

The header file is no longer used on anything but Linux.

6 years agopowerpc: Use latest optimization for internal function calls
Rajalakshmi Srinivasaraghavan [Tue, 7 Nov 2017 04:37:48 +0000 (10:07 +0530)]
powerpc: Use latest optimization for internal function calls

Update strcasestr-power8 to use power8 version of strnlen for
calculating length.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
6 years agoOptimize sighold implementation
Adhemerval Zanella [Wed, 1 Nov 2017 13:56:53 +0000 (11:56 -0200)]
Optimize sighold implementation

This patch simplifies sighold a bit by removing an extra sigprocmask
and using SIG_BLOCK (which union of the current set and the set argument).

Checked on x86_64-linux-gnu.

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

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Zack Weinberg <zackw@panix.com>
6 years agoCleanup Linux sigqueue implementation
Adhemerval Zanella [Wed, 1 Nov 2017 13:53:12 +0000 (11:53 -0200)]
Cleanup Linux sigqueue implementation

This patch simplify Linux sigqueue implementation by assuming
__NR_rt_sigqueueinfo existence due minimum kernel requirement
(it pre-dates Linux git inclusion for Linux 2.6.12).

Checked on x86_64-linux-gnu.

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

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Zack Weinberg <zackw@panix.com>
6 years agoSimplify Linux sig{timed}wait{info} implementations
Adhemerval Zanella [Wed, 1 Nov 2017 13:49:05 +0000 (11:49 -0200)]
Simplify Linux sig{timed}wait{info} implementations

This patch simplifies sig{timed}wait{info} by:

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

  - Call __sigtimedwait on both sigwait and sigwaitinfo.

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

Checked on x86_64-linux-gnu.

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

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Zack Weinberg <zackw@panix.com>
6 years agoarm: Implement memchr ifunc selection in C
Adhemerval Zanella [Fri, 6 Oct 2017 15:59:32 +0000 (12:59 -0300)]
arm: Implement memchr ifunc selection in C

This patch refactor ARM memchr ifunc selector to a C implementation.
No functional change is expected, including ifunc resolution rules.

It also reorganize the ifunc options code:

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

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

  3. Same as 2. for loader object.

Alongside the aforementioned changes, it also some cleanus:

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

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

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

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoarm: Implement memcpy ifunc selection in C
Adhemerval Zanella [Wed, 4 Oct 2017 20:44:08 +0000 (17:44 -0300)]
arm: Implement memcpy ifunc selection in C

This patch refactor ARM memcpy ifunc selector to a C implementation.
No functional change is expected, including ifunc resolution rules.

It also adds some cleanup:

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

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

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

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

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoUse newly built crt*.o files to build shared objects [BZ #22362]
H.J. Lu [Mon, 6 Nov 2017 16:29:48 +0000 (08:29 -0800)]
Use newly built crt*.o files to build shared objects [BZ #22362]

When multi-lib GCC is used to build glibc, the search order of GCC driver
for crt*.o is -B*/`gcc -print-multi-directory`, the installed diretory,
-B*/.  This patch adds multi-lib support to csu/Makefile so that
-B/glibc-build-directory/csu/ will pick up the newly built crt*.o.

Tested on x86-64 for i686 and x32.

[BZ #22362]
* Makerules (make-link-multidir): New.
* config.make.in (multidir): New.
* configure.ac (libc_cv_multidir): New.  AC_SUBST.
* configure: Regenerated.
* csu/Makefile [$(multidir) != .](multilib-extra-objs): New.
[$(multidir) != .](extra-objs): Add $(multilib-extra-objs).
[$(multidir) != .]($(addprefix $(objpfx)$(multidir)/, $(install-lib))):
New target.

6 years agoDo not declare _Float128 support for powerpc64le -mlong-double-64 (bug 22402).
Joseph Myers [Mon, 6 Nov 2017 13:26:15 +0000 (13:26 +0000)]
Do not declare _Float128 support for powerpc64le -mlong-double-64 (bug 22402).

The powerpc bits/floatn.h declares _Float128 support to be present
when the compiler supports it for powerpc64le.  However, in the case
where -mlong-double-64 is used, __MATH_TG does not actually support
_Float128; it only supports _Float128 in the distinct-long-double
case.

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

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

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

[BZ #22402]
* sysdeps/powerpc/bits/floatn.h: Include <bits/long-double.h>.
[__NO_LONG_DOUBLE_MATH] (__HAVE_FLOAT128): Define to 0.

6 years agotpi_PG locale: Fix wrong d_fmt
Mike FABIAN [Sat, 4 Nov 2017 13:57:13 +0000 (14:57 +0100)]
tpi_PG locale: Fix wrong d_fmt

6 years agomanual: Document the O_TMPFILE flag
Florian Weimer [Fri, 3 Nov 2017 23:57:19 +0000 (00:57 +0100)]
manual: Document the O_TMPFILE flag

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
6 years agoHandle more _FloatN, _FloatNx types in __MATH_TG.
Joseph Myers [Fri, 3 Nov 2017 23:50:00 +0000 (23:50 +0000)]
Handle more _FloatN, _FloatNx types in __MATH_TG.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch prepares __MATH_TG to handle more such types.

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

Tested for x86_64.

* math/math.h [__HAVE_DISTINCT_FLOAT16
|| __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64
|| __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X
|| __HAVE_DISTINCT_FLOAT128X]: Use #error.
[__NO_LONG_DOUBLE_MATH && __HAVE_DISTINCT_FLOAT128]: Likewise.
[__HAVE_DISTINCT_FLOAT128 && !__HAVE_GENERIC_SELECTION
&& __HAVE_FLOATN_NOT_TYPEDEF]: Likewise.
[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
(__MATH_TG_F32): New macro.
[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
(__MATH_TG_F64X): Likewise.
[__HAVE_DISTINCT_FLOAT128 && __HAVE_GENERIC_SELECTION]
(__MATH_TG): Use __MATH_TG_F32 and __MATH_TG_F64X.

6 years agoUpdate translations from the Translation Project
Dmitry V. Levin [Fri, 3 Nov 2017 23:19:36 +0000 (23:19 +0000)]
Update translations from the Translation Project

* po/de.po: Update translations.
* po/ru.po: Likewise.

6 years agomanual: Document the linkat function
Florian Weimer [Fri, 3 Nov 2017 21:31:54 +0000 (22:31 +0100)]
manual: Document the linkat function

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
6 years agoHandle more _FloatN, _FloatNx types in tgmath.h.
Joseph Myers [Fri, 3 Nov 2017 21:11:50 +0000 (21:11 +0000)]
Handle more _FloatN, _FloatNx types in tgmath.h.

Continuing the preparation for additional _FloatN / _FloatNx type
support, this patch improves how <tgmath.h> handles such types.

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

Tested for x86_64.

* math/tgmath.h [__HAVE_DISTINCT_FLOAT16
|| __HAVE_DISTINCT_FLOAT32 || __HAVE_DISTINCT_FLOAT64
|| __HAVE_DISTINCT_FLOAT32X || __HAVE_DISTINCT_FLOAT64X
|| __HAVE_DISTINCT_FLOAT128X]: Use #error.
[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
&& __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
&& __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_F128): Handle _Float64x
the same as _Float128.
[__HAVE_DISTINCT_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
&& __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
&& __HAVE_FLOATN_NOT_TYPEDEF] (__TGMATH_CF128): Likewise.

6 years agoDeclare strtof, strfromf functions for more _FloatN, _FloatNx types.
Joseph Myers [Fri, 3 Nov 2017 17:09:21 +0000 (17:09 +0000)]
Declare strtof, strfromf functions for more _FloatN, _FloatNx types.

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

Tested for x86_64.

* stdlib/stdlib.h
[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof16):
Declare.
[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof32):
Likewise.
[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof64):
Likewise.
[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(strtof32x): Likewise.
[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(strtof64x): Likewise.
[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(strtof128x): Likewise.
[__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(strfromf16): Likewise.
[__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(strfromf32): Likewise.
[__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(strfromf64): Likewise.
[__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(strfromf32x): Likewise.
[__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(strfromf64x): Likewise.
[__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)]
(strfromf128x): Likewise.
[__USE_GNU && __HAVE_FLOAT16] (strtof16_l): Likewise.
[__USE_GNU && __HAVE_FLOAT32] (strtof32_l): Likewise.
[__USE_GNU && __HAVE_FLOAT64] (strtof64_l): Likewise.
[__USE_GNU && __HAVE_FLOAT32X] (strtof32x_l): Likewise.
[__USE_GNU && __HAVE_FLOAT64X] (strtof64x_l): Likewise.
[__USE_GNU && __HAVE_FLOAT128X] (strtof128x_l): Likewise.

6 years agoaarch64: Guess L1 cache linesize for aarch64
Richard Henderson [Fri, 3 Nov 2017 16:38:16 +0000 (16:38 +0000)]
aarch64: Guess L1 cache linesize for aarch64

Using the cache hierarchy linesize minimum in CTR_EL0.
See the comment within the code for rationale.

* sysdeps/unix/sysv/linux/aarch64/sysconf.c: New file.

6 years agoaarch64: optimize _dl_tlsdesc_dynamic fast path
Szabolcs Nagy [Tue, 24 Oct 2017 16:49:14 +0000 (17:49 +0100)]
aarch64: optimize _dl_tlsdesc_dynamic fast path

Remove some load/store instructions from the dynamic tlsdesc resolver
fast path.  This gives around 20% faster tls access in dlopened shared
libraries (assuming glibc ran out of static tls space).

* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Optimize.

6 years agoarm: Remove lazy tlsdesc initialization related code
Szabolcs Nagy [Fri, 20 Oct 2017 16:53:44 +0000 (17:53 +0100)]
arm: Remove lazy tlsdesc initialization related code

Lazy tlsdesc initialization is no longer used in the dynamic linker
so all related code can be removed.

* sysdeps/arm/dl-machine.h (elf_machine_runtime_setup): Remove
DT_TLSDESC_GOT initialization.
* sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_lazy_resolver): Remove.
(_dl_tlsdesc_resolve_hold): Likewise.
* sysdeps/aarch64/dl-tlsdesc.h (_dl_tlsdesc_lazy_resolver): Remove.
(_dl_tlsdesc_resolve_hold): Likewise.
* sysdeps/aarch64/tlsdesc.c (_dl_tlsdesc_lazy_resolver_fixup): Remove.
(_dl_tlsdesc_resolve_hold_fixup): Likewise.

6 years agoarm: Remove unnecessary volatile qualifier
Szabolcs Nagy [Fri, 20 Oct 2017 16:44:18 +0000 (17:44 +0100)]
arm: Remove unnecessary volatile qualifier

There is no reason to treat tlsdesc entries as volatile objects.

* sysdeps/arm/dl-machine.h (elf_machine_rel): Remove volatile.

6 years ago[BZ #18572] arm: Disable lazy initialization of tlsdesc entries
Szabolcs Nagy [Fri, 20 Oct 2017 16:35:12 +0000 (17:35 +0100)]
[BZ #18572] arm: Disable lazy initialization of tlsdesc entries

Follow up to
https://sourceware.org/ml/libc-alpha/2015-11/msg00272.html

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

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

[BZ #18572]
* sysdeps/arm/dl-machine.h (elf_machine_lazy_rel): Do symbol binding
non-lazily for R_ARM_TLS_DESC.

6 years ago[BZ #17078] arm: remove prelinker support for R_ARM_TLS_DESC
Szabolcs Nagy [Fri, 20 Oct 2017 16:10:50 +0000 (17:10 +0100)]
[BZ #17078] arm: remove prelinker support for R_ARM_TLS_DESC

This patch reverts

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

    [BZ #17078] ARM: R_ARM_TLS_DESC prelinker support

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

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

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

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

Remove ldar synchronization and most lazy TLSDESC initialization
related code.

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

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

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

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

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

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

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

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

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

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

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

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

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

Tested for x86_64.

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

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

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

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

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

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

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

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

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

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

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

Tested for x86_64.

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

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

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

Tested for x86_64.

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

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

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

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

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

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

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

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

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

Checked on x86_64-linux-gnu.

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

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

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

Build-tested on x86_64.

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

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

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

Tested for x86_64.

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

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

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

Tested for x86_64.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Tested for x86_64.

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

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

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

This originates with:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

L(Src0):

which have similar performance and work with any instruction lengths.

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

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

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

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

Tested for x86_64.

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

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

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

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

Recent BSDs declare these functions, too.