platform/upstream/glibc.git
10 years agoRemove __ASSUME_ATFCTS conditionals in sysdeps/unix/sysv/linux/.
Joseph Myers [Fri, 20 Jun 2014 15:41:35 +0000 (15:41 +0000)]
Remove __ASSUME_ATFCTS conditionals in sysdeps/unix/sysv/linux/.

This patch cleans up for __ASSUME_ATFCTS now always being true for the
supported Linux kernel versions by removing conditional code in
sysdeps/unix/sysv/linux.  Several fchownat.c files that were only
present because of differences in the fallback syscalls used
(depending on the architecture-specific names of chown-related
syscalls for 32-bit uids) are removed.  Files that looks like they
could be replaced by syscalls.list entries have the standard "Consider
moving to syscalls.list." comment (see bug 14138) added.  Conditionals
on the relevant __NR_* syscall numbers being defined are also removed,
since my analysis indicated that the relevant syscalls are always
defined for all relevant kernel versions using any affected file.
Much of the removed fallback code had unbounded stack allocations, so
this reduces the number of cases to consider for anyone reviewing uses
of alloca and VLAs in glibc.

There remain tests of __ASSUME_ATFCTS in io/openat.c (to determine
whether to define __have_atfcts) and sysdeps/posix/getcwd.c (which
also uses __have_atfcts); thus, the definition of __ASSUME_ATFCTS
remains in kernel-features.h.  The logical condition relevant there is
whether openat64_not_cancel_3 is known to work.  Hurd doesn't use this
version of getcwd at all, so the conditionals in getcwd.c are always
true in glibc.  However, this code is also used in gnulib.  So the
best way to deal with the conditionals there may be for gnulib people
to deal with merging all relevant changes in both directions between
the glibc and gnulib versions of this file, at the end of which the
openat conditionals should be in whatever form is best for gnulib, and
hardcoded in the _LIBC case to having openat supported.

Tested by comparing before-and-after disassembly of installed
(stripped) shared libraries, on x86_64 and x86.  On x86 the patch made
no change to the disassembly; on x86_64, the only changes were in
readlinkat, where formerly the return value from the readlinkat
syscall was stored in an int variable before being converted to
ssize_t for the return, and now the return value is returned directly
without truncation to int.  I think it's clearly correct not to
truncate the return value (although I also think the truncation would
not have been a user-visible bug because the kernel would never have
returned a value it could have affected).

* include/fcntl.h (__atfct_seterrno): Remove prototype.
(__atfct_seterrno_2): Likewise.
* sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c: Do not include
<kernel-features.h>.
(__ASSUME_ATFCTS): Do not undefine and redefine.
* sysdeps/unix/sysv/linux/alpha/fxstatat.c [__ASSUME_ATFCTS]
(__have_atfcts): Remove conditional definition.
(__fxstatat([__NR_fstatat64]: Make code unconditional.
(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code and code
unreachable if [__ASSUME_ATFCTS].
* sysdeps/unix/sysv/linux/dl-fxstatat64.c (__ASSUME_ATFCTS): Do
not undefine and redefine.
* sysdeps/unix/sysv/linux/faccessat.c: Do not include
<kernel-features.h>.
(faccessat) [__NR_faccessat]: Make code unconditional.
(faccessat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/fchmodat.c: Do not include
<kernel-features.h>.
(fchmodat) [__NR_fchmodat]: Make code unconditional.
(fchmodat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/fchownat.c: Do not include
<kernel-features.h>.
(fchownat) [__NR_fchownat]: Make code unconditional.
(fchownat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/futimesat.c: Do not include
<kernel-features.h>.
(futimesat) [__NR_futimesat]: Make code unconditional.
(futimesat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/fxstatat.c: Do not include
<kernel-features.h>.
(__fxstatat) [__NR_newfstatat]: Make code unconditional.
(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/fxstatat64.c: Do not include
<kernel-features.h>.
(__fxstatat64) [__NR_fstatat64]: Make code unconditional.
(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/i386/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/i386/fxstatat.c: Do not include
<kernel-features.h>.
(__fxstatat) [__NR_fstatat64]: Make code unconditional.
(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/linkat.c: Do not include
<kernel-features.h>.
(linkat) [__NR_linkat]: Make code unconditional.
(linkat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/m68k/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c: Do not include
<kernel-features.h>.
(__fxstatat64) [__NR_newfstatat]: Make code unconditional.
(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/mkdirat.c: Do not include
<kernel-features.h>.
(mkdirat) [__NR_mkdirat]: Make code unconditional.
(mkdirat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/openat.c: Do not include
<kernel-features.h>.
[!__ASSUME_ATFCTS] (__atfct_seterrno): Remove function.
[!__ASSUME_ATFCTS] (__have_atfcts): Remove variable.
(OPENAT_NOT_CANCEL) [__NR_openat]: Make code unconditional.
(OPENAT_NOT_CANCEL) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/powerpc/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/readlinkat.c: Do not include
<kernel-features.h>.
(readlinkat) [__NR_readlinkat]: Make code unconditional.
(readlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.  Return
result of INLINE_SYSCALL directly, not via int variable.
* sysdeps/unix/sysv/linux/renameat.c: Do not include
<kernel-features.h>.
[!__ASSUME_ATFCTS] (__atfct_seterrno_2): Remove function.
(renameat) [__NR_renameat]: Make code unconditional.
(renameat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/sh/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c: Remove file.
* sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c
(__ASSUME_ATFCTS): Do not undefine and redefine.
* sysdeps/unix/sysv/linux/symlinkat.c: Do not include
<kernel-features.h>.
(symlinkat) [__NR_symlinkat]: Make code unconditional.
(symlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/unlinkat.c: Do not include
<kernel-features.h>.
(unlinkat) [__NR_unlinkat]: Make code unconditional.
(unlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/wordsize-64/dl-fxstatat64.c
(__ASSUME_ATFCTS): Do not undefine and redefine.
* sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Do not include
<kernel-features.h>.
(__fxstatat) [__NR_newfstatat]: Make code unconditional.
(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
* sysdeps/unix/sysv/linux/xmknodat.c: Do not include
<kernel-features.h>.
(__xmknodat) [__NR_mknodat]: Make code unconditional.
(__xmknodat) [!__ASSUME_ATFCTS]: Remove conditional code.

10 years agoRemove sysdeps/x86_64/multiarch/rtld-strlen.S
H.J. Lu [Fri, 20 Jun 2014 15:10:07 +0000 (08:10 -0700)]
Remove sysdeps/x86_64/multiarch/rtld-strlen.S

Since there is no sysdeps/x86_64/multiarch/strlen.S,
sysdeps/x86_64/rtld-strlen.S will be used.

* sysdeps/x86_64/multiarch/rtld-strlen.S: Removed.

10 years agoFix another memory leak in regexp compiler (BZ #17069)
Andreas Schwab [Fri, 20 Jun 2014 10:41:27 +0000 (12:41 +0200)]
Fix another memory leak in regexp compiler (BZ #17069)

10 years agoFix ChangeLog and NEWS goof-up
Siddhesh Poyarekar [Fri, 20 Jun 2014 11:42:10 +0000 (17:12 +0530)]
Fix ChangeLog and NEWS goof-up

The ChangeLog belonged to localedata and the bug is not completely
fixed, so it didn't deserve to enter the NEWS yet.

10 years ago[BZ #6803] Set errno for scalbln, scalbn
Stefan Liebler [Fri, 20 Jun 2014 02:18:20 +0000 (07:48 +0530)]
[BZ #6803] Set errno for scalbln, scalbn

Errno is not set and the testcases will fail.

Now the scalbln-aliases are removed in i386/m68
and the wrappers are used when calling the scalbln-functions.

On ia64 only scalblnf has its own implementation.
For scalbln and scalblnl the ieee754/dbl-64 and ieee754/ldbl-96 are used, thus
the wrappers are needed, too.

10 years agoGenerate en_GB.UTF-8 during testing
Stefan Liebler [Fri, 20 Jun 2014 02:14:42 +0000 (07:44 +0530)]
Generate en_GB.UTF-8 during testing

This patch generates en_GB.UTF-8, which is used in
tst-strcoll-overflow.  This solves the issue of failing xtests on
s390/s390x.

10 years agoUse 3 bytes for __pad1 in pthread_rwlock_t for x32
H.J. Lu [Thu, 19 Jun 2014 22:22:52 +0000 (15:22 -0700)]
Use 3 bytes for __pad1 in pthread_rwlock_t for x32

Since long is 4 bytes for x32, we should use 3 bytes for __pad1 when
a long __pad1 is replaced by a byte __rwelision and __pad1.

* sysdeps/x86/nptl/bits/pthreadtypes.h (pthread_rwlock_t): Use
3 bytes for __pad1 for x32.
(__PTHREAD_RWLOCK_ELISION_EXTRA): Likewise.

10 years agoAdd x86_64 memset optimized for AVX2
Ling Ma [Thu, 19 Jun 2014 20:00:56 +0000 (13:00 -0700)]
Add x86_64 memset optimized for AVX2

In this patch we take advantage of HSW memory bandwidth, manage to
reduce miss branch prediction by avoiding using branch instructions and
force destination to be aligned with avx & avx2 instruction.

The CPU2006 403.gcc benchmark indicates this patch improves performance
from 26% to 59%.

* sysdeps/x86_64/multiarch/Makefile: Add memset-avx2.
* sysdeps/x86_64/multiarch/memset-avx2.S: New file.
* sysdeps/x86_64/multiarch/memset.S: Likewise.
* sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
* sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.

10 years agoFix memory leak in regexp compiler (BZ #17069)
Andreas Schwab [Thu, 19 Jun 2014 13:38:03 +0000 (15:38 +0200)]
Fix memory leak in regexp compiler (BZ #17069)

10 years agomalloc/malloc.c: Avoid calling sbrk unnecessarily with zero
Will Newton [Fri, 13 Jun 2014 15:37:12 +0000 (16:37 +0100)]
malloc/malloc.c: Avoid calling sbrk unnecessarily with zero

Due to my bad review suggestion for the fix for BZ #15089 a check
was removed from systrim to prevent sbrk being called with a zero
argument. Add the check back to avoid this useless work.

ChangeLog:

2014-06-19  Will Newton  <will.newton@linaro.org>

* malloc/malloc.c (systrim): If extra is zero then return
early.

10 years agoRemove unnecessary $(.)
Siddhesh Poyarekar [Thu, 19 Jun 2014 11:32:48 +0000 (17:02 +0530)]
Remove unnecessary $(.)

The variable is not necessary, especially since it does not exist.

10 years ago[AArch64] Add optimized strchr.
Richard Earnshaw [Thu, 19 Jun 2014 09:40:49 +0000 (10:40 +0100)]
[AArch64] Add optimized strchr.

Implementation of strchr for AArch64.  Speedups taken from micro-bench
show the improvements relative to the standard C code.

The use of LD1 means we have identical code for both big- and
little-endian systems.

10 years agoFix __ieee754_logl (-LDBL_MAX) in FE_DOWNWARD mode (bug 17022).
Joseph Myers [Wed, 18 Jun 2014 12:32:01 +0000 (12:32 +0000)]
Fix __ieee754_logl (-LDBL_MAX) in FE_DOWNWARD mode (bug 17022).

This patch fixes __ieee754_logl (-LDBL_MAX) on x86_64 and x86 not to
subtract 1 from its argument and so cause spurious overflow in
FE_DOWNWARD mode.  (For any argument strictly less than -1, it doesn't
matter whether or not 1 is subtracted before computing log1p, as long
as the result doesn't overflow to -Inf.)

Tested x86_64 and x86.  (This particular case lacks test coverage,
since the testsuite doesn't cover -lieee, but it will be covered by
tests after the following patch to test pow in all rounding modes,
which was the context in which this bug was found.)

[BZ #17022]
* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Do not subtract 1
from arguments -2 or below.
* sysdeps/i386/i686/fpu/e_logl.S (__ieee754_logl): Likewise.
* sysdeps/x86_64/fpu/e_logl.S (__ieee754_logl): Likewise.

10 years agoDon't read past end of pattern in fnmatch (BZ #17062)
Andreas Schwab [Wed, 18 Jun 2014 09:58:45 +0000 (11:58 +0200)]
Don't read past end of pattern in fnmatch (BZ #17062)

10 years agoUse $(rtld-prefix) more consistently.
Joseph Myers [Wed, 18 Jun 2014 10:35:29 +0000 (10:35 +0000)]
Use $(rtld-prefix) more consistently.

The glibc makefiles have a standard variable, $(rtld-prefix), to run
the dynamic linker with a default --library-path option; this is used
as the basis of lots of other variables for running programs compiled
with the newly built library.

A few places however use $(elf-objpfx)ld.so or
$(elf-objpfx)${rtld-installed-name} directly, with such a
--library-path option.  This patch makes such places use
$(rtld-prefix) instead.  I'm not aware of any significance in these
cases to the choice of ld.so or ${rtld-installed-name} when running
the dynamic linker, or to whether $(patsubst
%,:%,$(sysdep-library-path)) is included in the library-path as it is
in $(rtld-prefix) and just one of the places being changed.

Tested x86_64.

* elf/Makefile ($(objpfx)tst-unused-dep.out): Use $(rtld-prefix).
* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Likewise.
* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Likewise.

localedata/ChangeLog:
* Makefile (LOCALEDEF): Use $(rtld-prefix).

10 years agoPowerPC: Fix nearbyintl failure for few inputs
Rajalakshmi Srinivasaraghavan [Tue, 17 Jun 2014 13:46:25 +0000 (08:46 -0500)]
PowerPC: Fix nearbyintl failure for few inputs

This patch fixes few failures in nearbyintl() where the fraction part is
close to 0.5.i  The new tests added report few extra failures in
nearbyint_downward and nearbyint_towardzero which is a known issue.

Fixes #17031.

10 years agoPowerPC: Move powerpc code out of nptl/ subdirectory
Adhemerval Zanella [Thu, 12 Jun 2014 14:32:53 +0000 (09:32 -0500)]
PowerPC: Move powerpc code out of nptl/ subdirectory

10 years agoFix ChangeLog indentation.
Adhemerval Zanella [Tue, 17 Jun 2014 12:48:41 +0000 (07:48 -0500)]
Fix ChangeLog indentation.

10 years agoAdd CFI to x86 ceil / floor / trunc (bug 16681).
Joseph Myers [Mon, 16 Jun 2014 22:54:46 +0000 (22:54 +0000)]
Add CFI to x86 ceil / floor / trunc (bug 16681).

This patch adds CFI to the sysdeps/i386/fpu/ implementations of ceil,
floor and trunc functions, for consistency with other x86 .S files in
glibc which have CFI for stack adjustments.

Tested x86.

[BZ #16681]
* sysdeps/i386/fpu/s_ceil.S (__ceil): Add CFI.
* sysdeps/i386/fpu/s_ceilf.S (__ceilf): Likewise.
* sysdeps/i386/fpu/s_ceill.S (__ceill): Likewise.
* sysdeps/i386/fpu/s_floor.S (__floor): Likewise.
* sysdeps/i386/fpu/s_floorf.S (__floorf): Likewise.
* sysdeps/i386/fpu/s_floorl.S (__floorl): Likewise.
* sysdeps/i386/fpu/s_trunc.S (__trunc): Likewise.
* sysdeps/i386/fpu/s_truncf.S (__truncf): Likewise.
* sysdeps/i386/fpu/s_truncl.S (__truncl): Likewise.

10 years agom68k: update libm test ULPs
Andreas Schwab [Mon, 16 Jun 2014 22:21:06 +0000 (00:21 +0200)]
m68k: update libm test ULPs

10 years agoFix typo in preprocessor conditional
Andreas Schwab [Mon, 16 Jun 2014 21:43:57 +0000 (23:43 +0200)]
Fix typo in preprocessor conditional

10 years agoPass $TIMEOUTFACTOR to tests also in cross testing
Andreas Schwab [Sat, 14 Jun 2014 20:29:43 +0000 (22:29 +0200)]
Pass $TIMEOUTFACTOR to tests also in cross testing

10 years agoFix tautological comparison in non-executed part of tst-setuid2 (BZ #17058)
Florian Weimer [Mon, 16 Jun 2014 16:00:09 +0000 (18:00 +0200)]
Fix tautological comparison in non-executed part of tst-setuid2 (BZ #17058)

This part never runs with the current implementation
because the setresuid call currently aborts (as intended).

10 years agoUpdate feature guard for strdup/strndup in <bits/string2.h>
Andreas Schwab [Thu, 12 Jun 2014 12:42:57 +0000 (14:42 +0200)]
Update feature guard for strdup/strndup in <bits/string2.h>

10 years agoUpdate Sparc ULPs.
David S. Miller [Sat, 14 Jun 2014 20:14:54 +0000 (13:14 -0700)]
Update Sparc ULPs.

* sysdeps/sparc/fpu/libm-test-ulps: Update.

10 years agom68k: Consolidate NPTL/non versions of clone
Andreas Schwab [Sat, 14 Jun 2014 13:04:16 +0000 (15:04 +0200)]
m68k: Consolidate NPTL/non versions of clone

10 years agom68k: Consolidate NPTL/non versions of vfork
Andreas Schwab [Sat, 14 Jun 2014 12:47:09 +0000 (14:47 +0200)]
m68k: Consolidate NPTL/non versions of vfork

10 years agoAdd fallback file for elide.h
Andi Kleen [Fri, 13 Jun 2014 22:50:45 +0000 (15:50 -0700)]
Add fallback file for elide.h

Add the missing fallback file for elide.h to fix non x86 builds.
Sorry about that. This is just a noop macro file that makes
all elision code to be optimized out.

10 years agoFix pthread.h in installed-headers list.
Stefan Liebler [Fri, 13 Jun 2014 23:39:23 +0000 (16:39 -0700)]
Fix pthread.h in installed-headers list.

10 years agoS390: Move NPTL public headers to sysdeps/s390/nptl/.
Roland McGrath [Fri, 13 Jun 2014 23:27:11 +0000 (16:27 -0700)]
S390: Move NPTL public headers to sysdeps/s390/nptl/.

10 years agoMove S390 code out of nptl/sysdeps/s390/.
Roland McGrath [Fri, 13 Jun 2014 23:26:56 +0000 (16:26 -0700)]
Move S390 code out of nptl/sysdeps/s390/.

10 years agoS390: Convert fork.c to arch-fork.h
Roland McGrath [Fri, 13 Jun 2014 23:26:38 +0000 (16:26 -0700)]
S390: Convert fork.c to arch-fork.h

10 years agoConsolidate sparc clone, fork, and vfork implementations.
David S. Miller [Fri, 13 Jun 2014 21:41:58 +0000 (14:41 -0700)]
Consolidate sparc clone, fork, and vfork implementations.

* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Delete.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: Delete.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: ... here.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Delete.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Delete.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Moved ...
* sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: ... here.
* sysdeps/unix/sysv/linux/sparc/fork.S: Delete.
* sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__thread_start):
Remove RESET_PID cpp guards.
* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (__thread_start):
Remove RESET_PID cpp guards.
* sysdeps/unix/sysv/linux/sparc/vfork.S: Delete.

10 years agom68k: avoid pointer to integer conversion warning
Andreas Schwab [Fri, 13 Jun 2014 21:31:36 +0000 (23:31 +0200)]
m68k: avoid pointer to integer conversion warning

10 years agoChangeLog fix
Andreas Schwab [Fri, 13 Jun 2014 21:29:50 +0000 (23:29 +0200)]
ChangeLog fix

10 years agoRemove x86 assembler rwlock code
Andi Kleen [Mon, 3 Mar 2014 15:06:11 +0000 (07:06 -0800)]
Remove x86 assembler rwlock code

With the recent tuning the C version of rwlocks is basically the same
performance as the x86 assembler version for uncontended locks (with a
a few cycles near the run-to-run variability). For others it should not
matter anyways.

So remove the assembler code and use the C version like other
architectures.

10 years agoAdd adaptive elision to rwlocks
Andi Kleen [Mon, 31 Mar 2014 15:07:46 +0000 (08:07 -0700)]
Add adaptive elision to rwlocks

This patch relies on the C version of the rwlocks posted earlier.
With C rwlocks it is very straight forward to do adaptive elision
using TSX. It is based on the infrastructure added earlier
for mutexes, but uses its own elision macros. The macros
are fairly general purpose and could be used for other
elision purposes too.

This version is much cleaner than the earlier assembler based
version, and in particular implements adaptation which makes
it safer.

I changed the behavior slightly to not require any changes
in the test suite and fully conform to all expected
behaviors (generally at the cost of not eliding in
various situations). In particular this means the timedlock
variants are not elided.  Nested trylock aborts.

10 years agoAdd a fast path for C rd/wrlock v2
Andi Kleen [Mon, 17 Mar 2014 12:48:28 +0000 (05:48 -0700)]
Add a fast path for C rd/wrlock v2

One difference of the C versions to the assembler wr/rdlock
is that the C compiler saves some registers which are unnecessary
for the fast path in the prologue of the functions. Split the
uncontended fast path out into a separate function. Only when contention is
detected is the full featured function called. This makes
the fast path code (nearly) identical to the assembler version,
and gives uncontended performance within a few cycles.

v2: Rename some functions and add space.

10 years agoget_nprocs: Only return explictly set cache values (BZ #16996)
Meador Inge [Fri, 13 Jun 2014 08:32:04 +0000 (14:02 +0530)]
get_nprocs: Only return explictly set cache values (BZ #16996)

The implementation of __get_nprocs uses a stactic variable to cache
the value of the current number of processors.  The caching breaks when
'time (NULL) == 0':

  $ cat nproc.c
  #include <stdio.h>
  #include <time.h>
  #include <sys/time.h>

  int main(int argc, char *argv[])
  {
    time_t t;
    struct timeval tv = {0, 0};
    printf("settimeofday({0, 0}, NULL) = %d\n", settimeofday(&tv, NULL));
    t = time(NULL);
    printf("Time: %d, CPUs: %d\n", (unsigned int)t, get_nprocs());
    return 0;
  }
  $ gcc -O3 nproc.c
  $ ./a.out
  settimeofday({0, 0}, NULL) = -1
  Time: 1401311578, CPUs: 4
  $ sudo ./a.out
  settimeofday({0, 0}, NULL) = 0
  Time: 0, CPUs: 0

The problem is with the condition used to check whether a cached
value should be returned or not:

  static int cached_result;
  static time_t timestamp;

  time_t now = time (NULL);
  time_t prev = timestamp;
  atomic_read_barrier ();
  if (now == prev)
    return cached_result;

This patch fixes the problem by ensuring that 'cached_result' has
been set at least once before returning it.

10 years agoMove SPARC public headers out of nptl/
Roland McGrath [Thu, 12 Jun 2014 22:04:34 +0000 (15:04 -0700)]
Move SPARC public headers out of nptl/

10 years agoMove SPARC code out of nptl/sysdeps/sparc/.
Roland McGrath [Thu, 12 Jun 2014 21:33:59 +0000 (14:33 -0700)]
Move SPARC code out of nptl/sysdeps/sparc/.

10 years agoSPARC: Define TLS_DEFINE_INIT_TP
Roland McGrath [Thu, 12 Jun 2014 21:33:43 +0000 (14:33 -0700)]
SPARC: Define TLS_DEFINE_INIT_TP

10 years agoSPARC: Convert fork.c to arch-fork.h
Roland McGrath [Thu, 12 Jun 2014 21:19:50 +0000 (14:19 -0700)]
SPARC: Convert fork.c to arch-fork.h

10 years agoUse list.h in posix-timer code.
Roland McGrath [Thu, 12 Jun 2014 21:17:14 +0000 (14:17 -0700)]
Use list.h in posix-timer code.

10 years agoGet rid of nptl/sysdeps/pthread/ subdirectory
Roland McGrath [Thu, 12 Jun 2014 20:48:47 +0000 (13:48 -0700)]
Get rid of nptl/sysdeps/pthread/ subdirectory

10 years agoConsolidate NPTL sigprocmask.
Roland McGrath [Thu, 12 Jun 2014 17:32:18 +0000 (10:32 -0700)]
Consolidate NPTL sigprocmask.

10 years agoMove i386 code out of nptl/ subdirectory.
Roland McGrath [Thu, 12 Jun 2014 17:08:24 +0000 (10:08 -0700)]
Move i386 code out of nptl/ subdirectory.

10 years agoMove SH code out of nptl/ subdirectory.
Roland McGrath [Thu, 12 Jun 2014 16:05:54 +0000 (09:05 -0700)]
Move SH code out of nptl/ subdirectory.

10 years agoposix_spawn_faction_addopen: Add missing string.h include directive
Stefan Liebler [Thu, 12 Jun 2014 12:15:25 +0000 (14:15 +0200)]
posix_spawn_faction_addopen: Add missing string.h include directive

This is needed to avoid a PLT call on s390.

10 years agoMove x86_64 code out of nptl/ subdirectory.
Roland McGrath [Thu, 12 Jun 2014 04:33:32 +0000 (21:33 -0700)]
Move x86_64 code out of nptl/ subdirectory.

10 years agoUpdate powerpc-fpu ULPs.
Adhemerval Zanella [Thu, 12 Jun 2014 02:22:49 +0000 (21:22 -0500)]
Update powerpc-fpu ULPs.

10 years agoconformtest: clean up POSIX expectations for sys/mman.h, sys/stat.h, sys/types.h.
Joseph Myers [Wed, 11 Jun 2014 23:16:23 +0000 (23:16 +0000)]
conformtest: clean up POSIX expectations for sys/mman.h, sys/stat.h, sys/types.h.

Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for sys/mman.h, sys/stat.h
and sys/types.h.  Tested x86_64; no new XFAILs needed.

* conform/data/sys/mman.h-data [POSIX] (size_t): Do not require
type.
[POSIX] (off_t): Likewise.
* conform/data/sys/stat.h-data (S_IRGRP): Require constant.
[POSIX] (S_ISBLK): Require macro.
[POSIX] (S_ISCHR): Likewise.
[POSIX] (S_ISDIR): Likewise.
[POSIX] (S_ISFIFO): Likewise.
[POSIX] (S_ISREG): Likewise.
[POSIX || XPG3 || XPG4 || UNIX98] (S_TYPEISTMO): Do not list
optional-macro.
* conform/data/sys/types.h-data [POSIX] (blkcnt_t): Do not require
type.
[POSIX] (time_t): Likewise.
[POSIX] (timer_t): Likewise.

10 years agoposix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
Florian Weimer [Wed, 11 Jun 2014 21:12:52 +0000 (23:12 +0200)]
posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)

POSIX requires that we make a copy, so we allocate a new string
and free it in posix_spawn_file_actions_destroy.

Reported by David Reid, Alex Gaynor, and Glyph Lefkowitz.  This bug
may have security implications.

10 years agotile: Consolidate NPTL/non versions of vfork
Chris Metcalf [Wed, 11 Jun 2014 19:52:53 +0000 (15:52 -0400)]
tile: Consolidate NPTL/non versions of vfork

10 years agoTile: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 20:45:09 +0000 (13:45 -0700)]
Tile: Define TLS_DEFINE_INIT_TP

10 years agoS390: Define TLS_DEFINE_INIT_TP
Roland McGrath [Wed, 11 Jun 2014 19:23:56 +0000 (12:23 -0700)]
S390: Define TLS_DEFINE_INIT_TP

10 years agoAlpha: Define TLS_DEFINE_INIT_TP
Roland McGrath [Wed, 11 Jun 2014 19:23:35 +0000 (12:23 -0700)]
Alpha: Define TLS_DEFINE_INIT_TP

10 years agoPowerPC: Define TLS_DEFINE_INIT_TP
Roland McGrath [Wed, 11 Jun 2014 19:23:17 +0000 (12:23 -0700)]
PowerPC: Define TLS_DEFINE_INIT_TP

10 years agoAArch64: Define TLS_DEFINE_INIT_TP
Roland McGrath [Wed, 11 Jun 2014 19:23:01 +0000 (12:23 -0700)]
AArch64: Define TLS_DEFINE_INIT_TP

10 years agoPowerPC: Optimized strcmp for PPC64/POWER7
Vidya Ranganathan [Fri, 6 Jun 2014 12:56:07 +0000 (07:56 -0500)]
PowerPC: Optimized strcmp for PPC64/POWER7

Optimization is achieved on 8 byte aligned strings with double word
comparison using cmpb instruction. On unaligned strings loop unrolling
is applied for Power7 gain.

10 years agoValidate bench.out against a JSON schema
Siddhesh Poyarekar [Wed, 11 Jun 2014 08:46:29 +0000 (14:16 +0530)]
Validate bench.out against a JSON schema

This patch adds a JSON schema for the benchmark output file and also
adds a script that validates the generated output against the schema.

10 years agoFix ChangeLog indentation.
Adhemerval Zanella [Tue, 10 Jun 2014 19:13:12 +0000 (14:13 -0500)]
Fix ChangeLog indentation.

10 years agotile: move sysdeps/unix/sysv/linux/tile nptl files.
Chris Metcalf [Tue, 10 Jun 2014 17:45:36 +0000 (13:45 -0400)]
tile: move sysdeps/unix/sysv/linux/tile nptl files.

10 years agoAdd FE_NOMASK_ENV return value test.
Wilco [Tue, 10 Jun 2014 14:50:25 +0000 (15:50 +0100)]
Add FE_NOMASK_ENV return value test.

10 years agoFix log2 (1) in round-downward mode (bug 17042).
Joseph Myers [Tue, 10 Jun 2014 12:07:15 +0000 (12:07 +0000)]
Fix log2 (1) in round-downward mode (bug 17042).

As with other issues of this kind, bug 17042 is log2 (1) wrongly
returning -0 instead of +0 in round-downward mode because of
implementations effectively in terms of log1p (x - 1).  This patch
fixes the issue in the same way used for log and log10.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 to confirm a fix was needed for ldbl-128 and to validate that
fix (also applied to ldbl-128ibm since that version of log2l is
essentially the same as the ldbl-128 one).

[BZ #17042]
* sysdeps/i386/fpu/e_log2.S (__ieee754_log2): Take absolete value
when x - 1 is zero.
* sysdeps/i386/fpu/e_log2f.S (__ieee754_log2f): Likewise.
* sysdeps/i386/fpu/e_log2l.S (__ieee754_log2l): Likewise.
* sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Return
0.0L for an argument of 1.0L.
* sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l):
Likewise.
* sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Take absolute
value when x - 1 is zero.
* math/libm-test.inc (log2_test): Use ALL_RM_TEST.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agohppa: Remove lowlevellock.c.
Bernard Ogden [Tue, 10 Jun 2014 03:22:20 +0000 (23:22 -0400)]
hppa: Remove lowlevellock.c.

The hppa port has no need of a custom lowlevellock.c, it should
use the generic version which is updated and correct. This
similarly fixes bug 15119 for hppa.

10 years agoSH: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 20:09:52 +0000 (13:09 -0700)]
SH: Define TLS_DEFINE_INIT_TP

10 years agom68k: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 22:54:19 +0000 (15:54 -0700)]
m68k: Define TLS_DEFINE_INIT_TP

10 years agoHPPA: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 21:04:45 +0000 (14:04 -0700)]
HPPA: Define TLS_DEFINE_INIT_TP

10 years agoMIPS: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 20:47:38 +0000 (13:47 -0700)]
MIPS: Define TLS_DEFINE_INIT_TP

10 years agoARM: Define TLS_DEFINE_INIT_TP
Roland McGrath [Mon, 9 Jun 2014 19:53:16 +0000 (12:53 -0700)]
ARM: Define TLS_DEFINE_INIT_TP

10 years agoStart cleaning up TLS initial value for pthread_create.
Roland McGrath [Mon, 9 Jun 2014 19:52:55 +0000 (12:52 -0700)]
Start cleaning up TLS initial value for pthread_create.

10 years agoRemove special makefile rules / .sh files for some localedata tests.
Joseph Myers [Mon, 9 Jun 2014 18:19:44 +0000 (18:19 +0000)]
Remove special makefile rules / .sh files for some localedata tests.

The localedata tests tst-mbswcs and tst-wctype use custom .sh scripts
and makefile rules, but have no need to do so.  tst-mbswcs.sh runs a
series of test programs in succession (and nothing special is done
with the output of the programs); this patch makes the separate tests
into ordinary tests run directly by the usual makefile rules.
tst-wctype.sh runs one test with an environment variable and input
redirection; generic makefile rules also cover that, so again this
patch converts it into an ordinary test.  (The makefile dependency of
tst-wctype.out on sort-test.out that this patch removes appears to be
a cut-and-paste error; the test does not appear to use that file.
There is already a generic dependency of ordinary tests in this
directory on $(addprefix $(objpfx),$(CTYPE_FILES)).)

Tested x86_64.

localedata/ChangeLog:
* Makefile (test-srcs): Remove tst-mbswcs1, tst-mbswcs2,
tst-mbswcs3, tst-mbswcs4, tst-mbswcs5 and tst-wctype.
(generated): Remove tst-mbswcs.out.
(tests): Add tst-mbswcs1, tst-mbswcs2, tst-mbswcs3, tst-mbswcs4,
tst-mbswcs5 and tst-wctype.
(tests-special): Remove $(objpfx)tst-mbswcs.out and
$(objpfx)tst-wctype.out.
($(objpfx)tst-mbswcs.out): Remove rule.
($(objpfx)tst-wctype.out): Likewise.
(tst-wctype-ENV): New variable.
* tst-mbswcs.sh: Remove file.
* tst-wctype.sh: Likewise.

10 years agoconformtest: clean up POSIX expectations for termios.h, time.h.
Joseph Myers [Mon, 9 Jun 2014 11:39:33 +0000 (11:39 +0000)]
conformtest: clean up POSIX expectations for termios.h, time.h.

Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for termios.h and time.h.
Tested x86_64; no new XFAILs needed.

* conform/data/termios.h-data [POSIX] (IUCLC): Do not expect
constant.
[POSIX] (IXANY): Likewise.
[POSIX] (OLCUC): Likewise.
[POSIX || POSIX2008] (CBAUD): Do not allow.
[POSIX || POSIX2008] (DEFECHO): Likewise.
[POSIX || POSIX2008] (ECHOCTL): Likewise.
[POSIX || POSIX2008] (ECHOKE): Likewise.
[POSIX || POSIX2008] (ECHOPRT): Likewise.
[POSIX || POSIX2008] (EXTA): Likewise.
[POSIX || POSIX2008] (EXTB): Likewise.
[POSIX || POSIX2008] (FLUSHO): Likewise.
[POSIX || POSIX2008] (LOBLK): Likewise.
[POSIX || POSIX2008] (PENDIN): Likewise.
[POSIX || POSIX2008] (SWTCH): Likewise.
[POSIX || POSIX2008] (VDISCARD): Likewise.
[POSIX || POSIX2008] (VDSUSP): Likewise.
[POSIX || POSIX2008] (VLNEXT): Likewise.
[POSIX || POSIX2008] (VREPRINT): Likewise.
[POSIX || POSIX2008] (VSTATUS): Likewise.
[POSIX || POSIX2008] (VWERASE): Likewise.
(B*): Change to B[0123456789]*.
* conform/data/time.h-data [POSIX || UNIX98]
(CLOCK_PROCESS_CPUTIME_ID): Do not expect constant.
[POSIX || UNIX98] (CLOCK_THREAD_CPUTIME_ID): Likewise.
[POSIX || UNIX98] (CLOCK_MONOTONIC): Likewise.
[POSIX] (tm_*): Do not allow.

10 years agoRemove redundant C locale settings.
Joseph Myers [Sat, 7 Jun 2014 19:58:36 +0000 (19:58 +0000)]
Remove redundant C locale settings.

Various glibc build / install / test code has C locale settings that
are redundant with LC_ALL=C.

LC_ALL takes precedence over LANG, so anywhere that sets LC_ALL=C
(explicitly, or through it being in the default environment for
running tests) does not need to set LANG=C.  LC_ALL=C also takes
precedence over LANGUAGE, since

2001-01-02  Ulrich Drepper  <drepper@redhat.com>

* intl/dcigettext.c (guess_category_value): Rewrite so that LANGUAGE
value is ignored if the selected locale is the C locale.
* intl/tst-gettext.c: Set locale for above change.
* intl/tst-translit.c: Likewise.

and so settings of LANGUAGE=C are also redundant when LC_ALL=C is
set.  One test also had LC_ALL=C in its -ENV setting, although it's
part of the default environment used for tests.

This patch removes the redundant settings.  It removes a suggestion in
install.texi of setting LANGUAGE=C LC_ALL=C for "make install"; the
Makefile.in target "install" already sets LC_ALL_C so there's no need
for the user to set it (and nor should there be any need for the user
to set it).

If some build machine tool used by "make install" uses a version of
libintl predating that 2001 change, and the user has LANGUAGE set, the
removal of LANGUAGE=C from the Makefile.in "install" rule could in
principle affect the user's installation.  However, I don't think we
need to be concerned about pre-2001 build tools.

Tested x86_64.

* Makefile (install): Don't set LANGUAGE.
* Makefile.in (install): Likewise.
* assert/Makefile (test-assert-ENV): Remove variable.
(test-assert-perr-ENV): Likewise.
* elf/Makefile (neededtest4-ENV): Likewise.
* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Don't set LANGUAGE.
* io/ftwtest-sh (LANG): Remove variable.
* libio/Makefile (tst-widetext-ENV): Likewise.
* manual/install.texi (Running make install): Don't refer to
environment settings for make install.
* INSTALL: Regenerated.
* nptl/tst-tls6.sh: Don't set LANG.
* posix/globtest.sh (LANG): Remove variable.
* string/Makefile (tester-ENV): Likewise.
(inl-tester-ENV): Likewise.
(noinl-tester-ENV): Likewise.
* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
[$(cross-compiling) = no]: Don't set LANGUAGE.
* timezone/Makefile (build-testdata): Use $(built-program-cmd)
without explicit environment settings.

localedata/ChangeLog:
* tst-fmon.sh: Don't set LANGUAGE.
* tst-locale.sh: Likewise.

10 years agoMove NPTL public ABI headers for SH to sysdeps/sh/nptl/.
Roland McGrath [Fri, 6 Jun 2014 22:09:56 +0000 (15:09 -0700)]
Move NPTL public ABI headers for SH to sysdeps/sh/nptl/.

10 years agocrypt: don't include ufc-crypt.h multiple times
Chris Metcalf [Fri, 6 Jun 2014 22:25:31 +0000 (18:25 -0400)]
crypt: don't include ufc-crypt.h multiple times

The file has no inclusion guards, and contains typedefs that
cause errors when included multiple times with older (pre-C11)
compilers such as gcc 4.4.

Save the "#ifdef DOS" content to crypt-private.h even though
it's likely not particularly useful.

10 years agoDon't require test wrappers to preserve environment variables, use more consistent...
Joseph Myers [Fri, 6 Jun 2014 22:19:27 +0000 (22:19 +0000)]
Don't require test wrappers to preserve environment variables, use more consistent environment.

One wart in the original support for test wrappers for cross testing,
as noted in
<https://sourceware.org/ml/libc-alpha/2012-10/msg00722.html>, is the
requirement for test wrappers to pass a poorly-defined set of
environment variables from the build system to the system running the
glibc under test.  Although some variables are passed explicitly via
$(test-wrapper-env), including LD_* variables that simply can't be
passed implicitly because of the side effects they'd have on the build
system's dynamic linker, others are passed implicitly, including
variables such as GCONV_PATH and LOCPATH that could potentially affect
the build system's libc (so effectively relying on any such effects
not breaking the wrappers).  In addition, the code in
cross-test-ssh.sh for preserving environment variables is fragile (it
depends on how bash formats a list of exported variables, and could
well break for multi-line variable definitions where the contents
contain things looking like other variable definitions).

This patch moves to explicitly passing environment variables via
$(test-wrapper-env).  Makefile variables that previously used
$(test-wrapper) are split up into -before-env and -after-env parts
that can be passed separately to the various .sh files used in
testing, so those files can then insert environment settings between
the two parts.

The common default environment settings in make-test-out are made into
a separate makefile variable that can also be passed to scripts,
rather than many scripts duplicating those settings (for testing an
installed glibc, it is desirable to have the GCONV_PATH setting on
just one place, so just that one place needs to support it pointing to
an installed sysroot instead of the build tree).  The default settings
are included in the variables such as $(test-program-prefix), so that
if tests do not need any non-default settings they can continue to use
single variables rather than the split-up variables.

Although this patch cleans up LC_ALL=C settings (that being part of
the common defaults), various LANG=C and LANGUAGE=C settings remain.
Those are generally unnecessary and I propose a subsequent cleanup to
remove them.  LC_ALL takes precedence over LANG, and while LANGUAGE
takes precedence over LC_ALL, it only does so for settings other than
LC_ALL=C.  So LC_ALL=C on its own is sufficient to ensure the C
locale, and anything that gets LC_ALL=C does not need the other
settings.

While preparing this patch I noticed some tests with .sh files that
appeared to do nothing beyond what the generic makefile support for
tests can do (localedata/tst-wctype.sh - the makefiles support -ENV
variables and .input files - and localedata/tst-mbswcs.sh - just runs
five tests that could be run individually from the makefile).  So I
propose another subsequent cleanup to move those to using the generic
support instead of special .sh files.

Tested x86_64 (native) and powerpc32 (cross).

* Makeconfig (run-program-env): New variable.
(run-program-prefix-before-env): Likewise.
(run-program-prefix-after-env): Likewise.
(run-program-prefix): Define in terms of new variables.
(built-program-cmd-before-env): New variable.
(built-program-cmd-after-env): Likewise.
(built-program-cmd): Define in terms of new variables.
(test-program-prefix-before-env): New variable.
(test-program-prefix-after-env): Likewise.
(test-program-prefix): Define in terms of new variables.
(test-program-cmd-before-env): New variable.
(test-program-cmd-after-env): Likewise.
(test-program-cmd): Define in terms of new variables.
* Rules (make-test-out): Use $(run-program-env).
* scripts/cross-test-ssh.sh (env_blacklist): Remove variable.
(help): Do not mention environment variables.  Mention
--timeoutfactor option.
(timeoutfactor): New variable.
(blacklist_exports): Remove function.
(exports): Remove variable.
(command): Do not include ${exports}.
* manual/install.texi (Configuring and compiling): Do not mention
test wrappers preserving environment variables.  Mention that last
assignment to a variable must take precedence.
* INSTALL: Regenerated.
* benchtests/Makefile (run-bench): Use $(run-program-env).
* catgets/Makefile ($(objpfx)test1.cat): Use
$(built-program-cmd-before-env), $(run-program-env) and
$(built-program-cmd-after-env).
($(objpfx)test2.cat): Do not specify environment variables
explicitly.
($(objpfx)de/libc.cat): Use $(built-program-cmd-before-env),
$(run-program-env) and $(built-program-cmd-after-env).
($(objpfx)test-gencat.out): Use $(test-program-cmd-before-env),
$(run-program-env) and $(test-program-cmd-after-env).
($(objpfx)sample.SJIS.cat): Do not specify environment variables
explicitly.
* catgets/test-gencat.sh: Use test_program_cmd_before_env,
run_program_env and test_program_cmd_after_env arguments.
* elf/Makefile ($(objpfx)tst-pathopt.out): Use $(run-program-env).
* elf/tst-pathopt.sh: Use run_program_env argument.
* iconvdata/Makefile ($(objpfx)iconv-test.out): Use
$(test-wrapper-env) and $(run-program-env).
* iconvdata/run-iconv-test.sh: Use test_wrapper_env and
run_program_env arguments.
* iconvdata/tst-table.sh: Do not set GCONV_PATH explicitly.
* intl/Makefile ($(objpfx)tst-gettext.out): Use
$(test-program-prefix-before-env), $(run-program-env) and
$(test-program-prefix-after-env).
($(objpfx)tst-gettext2.out): Likewise.
* intl/tst-gettext.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
* intl/tst-gettext2.sh: Likewise.
* intl/tst-gettext4.sh: Do not set environment variables
explicitly.
* intl/tst-gettext6.sh: Likewise.
* intl/tst-translit.sh: Likewise.
* malloc/Makefile ($(objpfx)tst-mtrace.out): Use
$(test-program-prefix-before-env), $(run-program-env) and
$(test-program-prefix-after-env).
* malloc/tst-mtrace.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
* math/Makefile (run-regen-ulps): Use $(run-program-env).
* nptl/Makefile ($(objpfx)tst-tls6.out): Use $(run-program-env).
* nptl/tst-tls6.sh: Use run_program_env argument.  Set LANG=C
explicitly with each use of ${test_wrapper_env}.
* posix/Makefile ($(objpfx)wordexp-tst.out): Use
$(test-program-prefix-before-env), $(run-program-env) and
$(test-program-prefix-after-env).
* posix/tst-getconf.sh: Do not set environment variables
explicitly.
* posix/wordexp-tst.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
* stdio-common/tst-printf.sh: Do not set environment variables
explicitly.
* stdlib/Makefile ($(objpfx)tst-fmtmsg.out): Use
$(test-program-prefix-before-env), $(run-program-env) and
$(test-program-prefix-after-env).
* stdlib/tst-fmtmsg.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
Split $test calls into $test_pre and $test.
* timezone/Makefile (build-testdata): Use
$(built-program-cmd-before-env), $(run-program-env) and
$(built-program-cmd-after-env).

localedata/ChangeLog:
* Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use
$(built-program-cmd-before-env), $(run-program-env) and
$(built-program-cmd-after-env).
($(objpfx)sort-test.out): Use $(test-program-prefix-before-env),
$(run-program-env) and $(test-program-prefix-after-env).
($(objpfx)tst-fmon.out): Use $(run-program-prefix-before-env),
$(run-program-env) and $(run-program-prefix-after-env).
($(objpfx)tst-locale.out): Use $(built-program-cmd-before-env),
$(run-program-env) and $(built-program-cmd-after-env).
($(objpfx)tst-trans.out): Use $(run-program-prefix-before-env),
$(run-program-env), $(run-program-prefix-after-env),
$(test-program-prefix-before-env) and
$(test-program-prefix-after-env).
($(objpfx)tst-ctype.out): Use $(test-program-cmd-before-env),
$(run-program-env) and $(test-program-cmd-after-env).
($(objpfx)tst-wctype.out): Likewise.
($(objpfx)tst-langinfo.out): Likewise.
($(objpfx)tst-langinfo-static.out): Likewise.
* gen-locale.sh: Use localedef_before_env, run_program_env and
localedef_after_env arguments.
* sort-test.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
* tst-ctype.sh: Use tst_ctype_before_env, run_program_env and
tst_ctype_after_env arguments.
* tst-fmon.sh: Use run_program_prefix_before_env, run_program_env
and run_program_prefix_after_env arguments.
* tst-langinfo.sh: Use tst_langinfo_before_env, run_program_env
and tst_langinfo_after_env arguments.
* tst-locale.sh: Use localedef_before_env, run_program_env and
localedef_after_env arguments.
* tst-mbswcs.sh: Do not set environment variables explicitly.
* tst-numeric.sh: Likewise.
* tst-rpmatch.sh: Likewise.
* tst-trans.sh: Use run_program_prefix_before_env,
run_program_env, run_program_prefix_after_env,
test_program_prefix_before_env and test_program_prefix_after_env
arguments.
* tst-wctype.sh: Use tst_wctype_before_env, run_program_env and
tst_wctype_after_env arguments.

10 years agoPowerPC: Fix optimized strncat strlen call
Adhemerval Zanella [Fri, 6 Jun 2014 14:37:07 +0000 (09:37 -0500)]
PowerPC: Fix optimized strncat strlen call

This patch fixes the optimized ppc64/power7 strncat strlen call for
static build without ifunc enabled.  The strlen symbol to call in such
situation is just strlen, instead of __GI_strlen (since the __GI_
alias is just created for shared objects).

10 years agoInline nested function check_list
Siddhesh Poyarekar [Thu, 5 Jun 2014 21:29:49 +0000 (02:59 +0530)]
Inline nested function check_list

10 years agoFix memory overrun in getifaddrs_internal. Fixes bug 15698.
Ondřej Bílka [Thu, 5 Jun 2014 17:21:32 +0000 (19:21 +0200)]
Fix memory overrun in getifaddrs_internal. Fixes bug 15698.

10 years agoInstall uz_UZ.UTF-8 locale (BZ #16095)
Andreas Schwab [Tue, 12 Nov 2013 10:16:14 +0000 (11:16 +0100)]
Install uz_UZ.UTF-8 locale (BZ #16095)

10 years agoInclude LOCPATH in default test environment.
Joseph Myers [Wed, 4 Jun 2014 23:37:25 +0000 (23:37 +0000)]
Include LOCPATH in default test environment.

Tests run using the default $(make-test-out) automatically get
GCONV_PATH and LC_ALL set, whether or not those environment variables
are actually needed for the individual test.  However, they do not get
LOCPATH set, meaning that a large number of tests have -ENV settings
just to set LOCPATH.

This patch moves LOCPATH into the default environment used for all
tests, on the principle that like GCONV_PATH any settings needed to
use files associated with the newly built library, rather than any old
installed files, are appropriate to use by default.

A further motivation is that various tests using .sh files also set
some combination of LC_ALL, GCONV_PATH and LOCPATH.  Preferably .sh
files should also use the default environment with any additions
required for the individual test.  Now, it was suggested in
<https://sourceware.org/ml/libc-alpha/2014-05/msg00715.html> that
various Makefile variables used in testing should be derived by
composing the -before-env and -after-env variables used when explicit
environment settings are required.  With such a change, it's also
natural for those variables to include the default settings (via some
intermediate makefile variable also used in make-test-out).

Because some .sh files only set variables that correspond to the
default settings, or a subset thereof, and this applies to more of the
.sh files once LOCPATH is in the default settings, doing so reduces
the size of a revised version of
<https://sourceware.org/ml/libc-alpha/2014-05/msg00596.html>: scripts
only needing the (expanded) default settings will not need to receive
the separate -before-env and -after-env variables, only the single
variable they do at present.  So moving LOCPATH into the default
settings can reduce churn caused by subsequent patches.

Tested x86_64 and x86.

* Rules (make-test-out): Include
LOCPATH=$(common-objpfx)localedata in default environment.
* debug/Makefile (tst-chk1-ENV): Remove variable.
(tst-chk2-ENV): Likewise.
(tst-chk3-ENV): Likewise.
(tst-chk4-ENV): Likewise.
(tst-chk5-ENV): Likewise.
(tst-chk6-ENV): Likewise.
(tst-lfschk1-ENV): Likewise.
(tst-lfschk2-ENV): Likewise.
(tst-lfschk3-ENV): Likewise.
(tst-lfschk4-ENV): Likewise.
(tst-lfschk5-ENV): Likewise.
(tst-lfschk6-ENV): Likewise.
* iconvdata/Makefile (bug-iconv6-ENV): Likewise.
(tst-iconv7-ENV): Likewise.
* intl/Makefile (LOCPATH-ENV): Likewise.
(tst-codeset-ENV): Likewise.
(tst-gettext3-ENV): Likewise.
(tst-gettext5-ENV): Likewise.
* libio/Makefile (tst-widetext-ENV): Don't set LOCPATH.
(tst-fopenloc-ENV): Likewise.
(tst-fgetws-ENV): Remove variable.
(tst-ungetwc1-ENV): Likewise.
(tst-ungetwc2-ENV): Likewise.
(bug-ungetwc2-ENV): Likewise.
(tst-swscanf-ENV): Likewise.
(bug-ftell-ENV): Likewise.
(tst-fgetwc-ENV): Likewise.
(tst-fseek-ENV): Likewise.
(tst-ftell-partial-wide-ENV): Likewise.
(tst-ftell-active-handler-ENV): Likewise.
(tst-ftell-append-ENV): Likewise.
* posix/Makefile (tst-fnmatch-ENV): Likewise.
(tst-regexloc-ENV): Likewise.
(bug-regex1-ENV): Likewise.
(tst-regex-ENV): Likewise.
(tst-regex2-ENV): Likewise.
(bug-regex5-ENV): Likewise.
(bug-regex6-ENV): Likewise.
(bug-regex17-ENV): Likewise.
(bug-regex18-ENV): Likewise.
(bug-regex19-ENV): Likewise.
(bug-regex20-ENV): Likewise.
(bug-regex22-ENV): Likewise.
(bug-regex23-ENV): Likewise.
(bug-regex25-ENV): Likewise.
(bug-regex26-ENV): Likewise.
(bug-regex30-ENV): Likewise.
(bug-regex32-ENV): Likewise.
(bug-regex33-ENV): Likewise.
(bug-regex34-ENV): Likewise.
(bug-regex35-ENV): Likewise.
(tst-rxspencer-ENV): Likewise.
(tst-rxspencer-no-utf8-ENV): Likewise.
* stdio-common/Makefile (tst-sprintf-ENV): Likewise.
(tst-sscanf-ENV): Likewise.
(tst-swprintf-ENV): Likewise.
(tst-swscanf-ENV): Likewise.
(test-vfprintf-ENV): Likewise.
(scanf13-ENV): Likewise.
(bug14-ENV): Likewise.
(tst-grouping-ENV): Likewise.
* stdlib/Makefile (tst-strtod-ENV): Likewise.
(tst-strtod3-ENV): Likewise.
(tst-strtod4-ENV): Likewise.
(tst-strtod5-ENV): Likewise.
(testmb2-ENV): Likewise./
* string/Makefile (tst-strxfrm-ENV): Likewise.
(tst-strxfrm2-ENV): Likewise.
(bug-strcoll1-ENV): Likewise.
(test-strcasecmp-ENV): Likewise.
(test-strncasecmp-ENV): Likewise.
* time/Makefile (tst-strptime-ENV): Likewise.
(tst-ftime_l-ENV): Likewise.
* wcsmbs/Makefile (tst-btowc-ENV): Likewise.
(tst-mbrtowc-ENV): Likewise.
(tst-wcrtomb-ENV): Likewise.
(tst-mbrtowc2-ENV): Likewise.
(tst-c16c32-1-ENV): Likewise.
(tst-mbsnrtowcs-ENV): Likewise.

localedata/ChangeLog:
* Makefile (TEST_MBWC_ENV): Remove variable.
(tst_iswalnum-ENV): Likewise.
(tst_iswalpha-ENV): Likewise.
(tst_iswcntrl-ENV): Likewise.
(tst_iswctype-ENV): Likewise.
(tst_iswdigit-ENV): Likewise.
(tst_iswgraph-ENV): Likewise.
(tst_iswlower-ENV): Likewise.
(tst_iswprint-ENV): Likewise.
(tst_iswpunct-ENV): Likewise.
(tst_iswspace-ENV): Likewise.
(tst_iswupper-ENV): Likewise.
(tst_iswxdigit-ENV): Likewise.
(tst_mblen-ENV): Likewise.
(tst_mbrlen-ENV): Likewise.
(tst_mbrtowc-ENV): Likewise.
(tst_mbsrtowcs-ENV): Likewise.
(tst_mbstowcs-ENV): Likewise.
(tst_mbtowc-ENV): Likewise.
(tst_strcoll-ENV): Likewise.
(tst_strfmon-ENV): Likewise.
(tst_strxfrm-ENV): Likewise.
(tst_swscanf-ENV): Likewise.
(tst_towctrans-ENV): Likewise.
(tst_towlower-ENV): Likewise.
(tst_towupper-ENV): Likewise.
(tst_wcrtomb-ENV): Likewise.
(tst_wcscat-ENV): Likewise.
(tst_wcschr-ENV): Likewise.
(tst_wcscmp-ENV): Likewise.
(tst_wcscoll-ENV): Likewise.
(tst_wcscpy-ENV): Likewise.
(tst_wcscspn-ENV): Likewise.
(tst_wcslen-ENV): Likewise.
(tst_wcsncat-ENV): Likewise.
(tst_wcsncmp-ENV): Likewise.
(tst_wcsncpy-ENV): Likewise.
(tst_wcspbrk-ENV): Likewise.
(tst_wcsrtombs-ENV): Likewise.
(tst_wcsspn-ENV): Likewise.
(tst_wcsstr-ENV): Likewise.
(tst_wcstod-ENV): Likewise.
(tst_wcstok-ENV): Likewise.
(tst_wcstombs-ENV): Likewise.
(tst_wcswidth-ENV): Likewise.
(tst_wcsxfrm-ENV): Likewise.
(tst_wctob-ENV): Likewise.
(tst_wctomb-ENV): Likewise.
(tst_wctrans-ENV): Likewise.
(tst_wctype-ENV): Likewise.
(tst_wcwidth-ENV): Likewise.
(tst-digits-ENV): Likewise.
(tst-mbswcs6-ENV): Likewise.
(tst-xlocale1-ENV): Likewise.
(tst-xlocale2-ENV): Likewise.
(tst-strfmon1-ENV): Likewise.
(tst-strptime-ENV): Likewise.
(tst-setlocale-ENV): Don't set LOCPATH.
(bug-iconv-trans-ENV): Remove variable.
(tst-sscanf-ENV): Likewise.
(tst-leaks-ENV): Don't set LOCPATH.
(bug-setlocale1-ENV): Remove variable.
(bug-setlocale1-static-ENV): Likewise.
(tst-setlocale2-ENV): Likewise.

10 years agoFix typo in manual.
Ondřej Bílka [Wed, 4 Jun 2014 22:40:01 +0000 (00:40 +0200)]
Fix typo in manual.

10 years agoFixup ChangeLog and add missing NEWS entry for previous commits.
David S. Miller [Tue, 3 Jun 2014 23:14:06 +0000 (16:14 -0700)]
Fixup ChangeLog and add missing NEWS entry for previous commits.

10 years agoNew test for pthread_spin_lock (bug 16882)
Guo Yixuan [Fri, 30 May 2014 04:53:16 +0000 (21:53 -0700)]
New test for pthread_spin_lock (bug 16882)

* nptl/tst-spin4.c: New test.
* nptl/Makefile (tests): Add tst-spin4.

10 years agoFixed pthread_spin_lock on sparc32/64 (bug 16882)
Guo Yixuan [Fri, 30 May 2014 04:43:15 +0000 (21:43 -0700)]
Fixed pthread_spin_lock on sparc32/64 (bug 16882)

[BZ #16882]
* nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S
(pthread_spin_lock): Branch out of spin loop to proper location.
* nptl/sysdeps/sparc/sparc64/pthread_spin_lock.S
(pthread_spin_lock): Likewise.

10 years agoFix invalid file descriptor reuse while sending DNS query (BZ #15946)
Andreas Schwab [Mon, 26 May 2014 16:01:31 +0000 (18:01 +0200)]
Fix invalid file descriptor reuse while sending DNS query (BZ #15946)

10 years agoaarch64: Remove nptl/vfork.S
Richard Henderson [Tue, 3 Jun 2014 15:27:32 +0000 (11:27 -0400)]
aarch64: Remove nptl/vfork.S

10 years agoS/390: Regenerate ULPs.
Stefan Liebler [Tue, 3 Jun 2014 15:27:13 +0000 (17:27 +0200)]
S/390: Regenerate ULPs.

10 years agoaarch64: Consolidate NPTL/non versions of vfork
Richard Henderson [Fri, 23 May 2014 20:23:32 +0000 (16:23 -0400)]
aarch64: Consolidate NPTL/non versions of vfork

At the same time, incorporate the 0 -> 0x80000000 mapping
of the pid expected by raise.c.

10 years agoaarch64: Consolidate NPTL/non versions of clone
Richard Henderson [Fri, 23 May 2014 19:44:23 +0000 (15:44 -0400)]
aarch64: Consolidate NPTL/non versions of clone

At the same time, rely on non-clobbered registers across syscall
so that we eliminate the stack frame that we previously ignored
in the unwind info.

10 years ago[AArch64] Regenerate libm-test-ulps
Marcus Shawcroft [Tue, 3 Jun 2014 12:25:34 +0000 (12:25 +0000)]
[AArch64] Regenerate libm-test-ulps

10 years ago[AArch64] Switch from FE_TOWARDZERO to _FPU_FPCR_RM_MASK
Wilco [Tue, 3 Jun 2014 08:10:39 +0000 (08:10 +0000)]
[AArch64] Switch from FE_TOWARDZERO to _FPU_FPCR_RM_MASK

10 years ago[AArch64] Cleanup declarations in math_private.h.
Wilco [Tue, 3 Jun 2014 08:08:36 +0000 (08:08 +0000)]
[AArch64] Cleanup declarations in math_private.h.

10 years agoRemove redundant nested function b64_from_24bit
Konstantin Serebryany [Tue, 3 Jun 2014 11:09:08 +0000 (16:39 +0530)]
Remove redundant nested function b64_from_24bit

Move multiple definitions of the nested function b64_from_24bit into a
single function __b64_from_24bit.

10 years agoSH: Consolidate NPTL/non versions of vfork
Roland McGrath [Mon, 2 Jun 2014 21:29:19 +0000 (14:29 -0700)]
SH: Consolidate NPTL/non versions of vfork

10 years agoFix format specifier for n_mmaps
Siddhesh Poyarekar [Mon, 2 Jun 2014 18:05:09 +0000 (23:35 +0530)]
Fix format specifier for n_mmaps

10 years ago[AArch64] Remove ISB after FPCR write.
Wilco [Mon, 2 Jun 2014 11:44:21 +0000 (12:44 +0100)]
[AArch64] Remove ISB after FPCR write.

10 years ago[AArch64] Rewrite feupdateenv (BZ 17009).
Wilco [Mon, 2 Jun 2014 11:20:17 +0000 (12:20 +0100)]
[AArch64] Rewrite feupdateenv (BZ 17009).