]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
9 years agoUpdate README and NEWS for ports directory removal.
Joseph Myers [Wed, 25 Jun 2014 12:55:21 +0000 (12:55 +0000)] 
Update README and NEWS for ports directory removal.

This patch updates README to remove a mention of the ports directory.
It also adds a NEWS item for the merge of ports into the main sysdeps
tree (I think it's NEWS-worthy, although not strictly a user-visible
feature).

Other remaining ports references to resolve: a comment in
manual/signal.texi (not giving a literal path, but maybe should change
anyway); a comment in config.h.in (path should be updated);
scripts/list-sources.sh (appears to date back to ports being a
separate repository).

* README: Do not mention ports directory.

9 years agoRemove __ASSUME_UTIMENSAT.
Joseph Myers [Wed, 25 Jun 2014 11:36:10 +0000 (11:36 +0000)] 
Remove __ASSUME_UTIMENSAT.

This patch removes the __ASSUME_UTIMENSAT macro, now it can be
unconditionally assumed to be true.

This shows that the only live uses of __ASSUME_UTIMES are in utimes.c
and they are only live for hppa.  I intend a followup patch to make
__ASSUME_UTIMES into an hppa-specific macro (not used or defined
outside sysdeps/unix/sysv/linux/hppa/).

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_UTIMENSAT):
Remove macro.
* sysdeps/unix/sysv/linux/futimes.c: Do not include
<kernel-features.h>.
[__NR_utimensat && !__ASSUME_UTIMENSAT] (miss_utimensat): Remove
conditional variable definition.
(__futimes): Update comment.
(__futimes) [__ASSUME_UTIMENSAT]: Make code unconditional.
(__futimes) [!__ASSUME_UTIMENSAT]: Remove conditional code.

9 years agoFix exp10 spurious underflows (bug 16560).
Joseph Myers [Wed, 25 Jun 2014 11:33:22 +0000 (11:33 +0000)] 
Fix exp10 spurious underflows (bug 16560).

This patch fixes spurious underflows from exp10 for arguments near 0
(part of bug 16560; that bug also includes spurious underflows from
exp2, which are not fixed by this patch).  The problem is underflows
in the internal computation converting the exp10 argument to arguments
for exp (with extra precision), and the fix is simply to return 1
early for arguments near enough to 0 (just as arguments with large
enough magnitude have their own overflow / underflow logic at the
start of the function).

Tested x86_64 and x86 and ulps updated accordingly; also tested for
powerpc32 and mips64 to validate the ldbl-128ibm and ldbl-128 changes.

[BZ #16560]
* sysdeps/ieee754/dbl-64/e_exp10.c (__ieee754_exp10): Return 1 for
arguments close to 0.
* sysdeps/ieee754/ldbl-128/e_exp10l.c (__ieee754_exp10l):
Likewise.
* sysdeps/ieee754/ldbl-128ibm/e_exp10l.c (__ieee754_exp10l):
Likewise.
* math/auto-libm-test-in: Add more tests of exp10.
* math/auto-libm-test-out: Regenerated.
* sysdeps/x86_64/fpu/libm-test-ulps: Update.

9 years agoRemove __ASSUME_COMPLETE_READV_WRITEV.
Joseph Myers [Wed, 25 Jun 2014 11:31:51 +0000 (11:31 +0000)] 
Remove __ASSUME_COMPLETE_READV_WRITEV.

This patch removes the __ASSUME_COMPLETE_READV_WRITEV
kernel-features.h macro, now that it can be unconditionally assumed to
be true.  (The relevant kernel feature was added some time between 2.0
and 2.2, and this macro is only used in sysdeps/unix/sysv/linux/.)

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_COMPLETE_READV_WRITEV): Remove macro.
* sysdeps/unix/sysv/linux/readv.c: Do not include
<kernel-features.h>.
[!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code.
[!UIO_FASTIOV] (UIO_FASTIOV): Remove macro.
(__libc_readv) [__ASSUME_COMPLETE_READV_WRITEV]: Make code
unconditional.
(__libc_readv) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove
conditional code.
* sysdeps/unix/sysv/linux/writev.c: Do not include
<kernel-features.h>.
[!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code.
[!UIO_FASTIOV] (UIO_FASTIOV): Remove macro.
(__libc_writev) [__ASSUME_COMPLETE_READV_WRITEV]: Make code
unconditional.
(__libc_writev) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove
conditional code.

9 years agosysdeps/posix/tempname.c: Merge from gnulib
Will Newton [Tue, 24 Jun 2014 13:19:36 +0000 (14:19 +0100)] 
sysdeps/posix/tempname.c: Merge from gnulib

Partial merge from gnulib which fixes a number of -Wundef warnings.
The parts that differ from gnulib are the header comment, use of
__glibc_unlikely, a #define of __secure_getenv and the use of tabs.
The majority of the patch is cosmetic comment changes, the only runtime
change is an abort if an unknown kind is passed to __gen_tempname.

ChangeLog:

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

* sysdeps/posix/tempname.c: Merge from gnulib, cosmetic
comment changes throughout the file.  Remove checks
for HAVE_*_H definitions that are not required.
(__gen_tempname): Call abort if an unknown kind value is
passed.

10 years agom68k: Add compat symbols for scalbln*
Andreas Schwab [Tue, 24 Jun 2014 07:41:02 +0000 (09:41 +0200)] 
m68k: Add compat symbols for scalbln*

10 years agoAdd compat symbols for scalb* in i386
Siddhesh Poyarekar [Wed, 25 Jun 2014 03:17:13 +0000 (08:47 +0530)] 
Add compat symbols for scalb* in i386

Bring back symbols into libc.so for scalb* functions.  They are no
longer used but unfortunately they're now part of the ABI.

10 years agox86: Consolidate unnecessary nptl/ subdirectories.
Roland McGrath [Wed, 25 Jun 2014 02:17:43 +0000 (19:17 -0700)] 
x86: Consolidate unnecessary nptl/ subdirectories.

10 years agoFix x86/x86_64 expm1l spurious underflow exceptions (bug 16539).
Joseph Myers [Tue, 24 Jun 2014 21:00:08 +0000 (21:00 +0000)] 
Fix x86/x86_64 expm1l spurious underflow exceptions (bug 16539).

This patch fixes bug 16539, spurious underflow exceptions from x86 /
x86-64 expm1l.  The problem is that the computation of a base-2
exponent with extra precision involves spurious underflows for
arguments that are small but not subnormal, so a check is added to
just return the argument in those cases.  (If the argument *is*
subnormal, underflowing is correct and the existing code will always
underflow, so it suffices to keep using the existing code in that
case; some expm1 implementations have a bug (bug 16353) with missing
underflow exceptions, but I don't think there's such a bug in this
particular version.)

Tested x86_64 and x86; no ulps updates needed.

(auto-libm-test-out diffs omitted below.)

[BZ #16539]
* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]: Just
return the argument for normal arguments with exponent below -64.
* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]:
Likewise.
* math/auto-libm-test-in: Add another test of expm1.
* math/auto-libm-test-out: Regenerated.

10 years agoFix ldbl-128 erfl spurious underflows (bug 16287).
Joseph Myers [Tue, 24 Jun 2014 20:56:56 +0000 (20:56 +0000)] 
Fix ldbl-128 erfl spurious underflows (bug 16287).

This patch fixes bug 16287, spurious underflows from ldbl-128 erfl
arising from it calling erfcl for arguments with absolute value at
least 1.0, although for large positive arguments erfcl correctly
underflows but erfl shouldn't.  The fix is simply to avoid calling
erfcl, and just return 1, for arguments above a cut-off large enough
that erfl correctly rounds to-nearest as 1 but not so large that erfcl
underflows.

Tested mips64.  Also tested x86_64 and x86 to confirm the new tests
(taken from the tests of erfc) don't cause any problems there; no ulps
updates needed.

[BZ #16287]
* sysdeps/ieee754/ldbl-128/s_erfl.c (__erfl): Return 1 without
calling __erfcl for arguments at least 16.
* math/auto-libm-test-in: Add more tests of erf.
* math/auto-libm-test-out: Regenerated.

10 years agoMove architecture cases out of sysdeps/unix/sysv/linux/configure.ac.
Joseph Myers [Tue, 24 Jun 2014 20:53:03 +0000 (20:53 +0000)] 
Move architecture cases out of sysdeps/unix/sysv/linux/configure.ac.

Continuing the process of making non-ex-ports architectures follow the
preferred sysdeps practices followed by ex-ports architectures - that
is, putting things in architecture-specific sysdeps files rather than
having architecture-specific cases in architecture-independent files -
this patch moves architecture cases out of
sysdeps/unix/sysv/linux/configure.ac into (new or existing) configure
fragments for each architecture.  (In the case of the
arch_minimum_kernel setting for x32,
sysdeps/unix/sysv/linux/x86_64/x32/configure already has such a
setting so the setting in sysdeps/unix/sysv/linux/configure.ac was a
duplicate that could just be removed - though I haven't tested for
x32.)

Tested for x86_64 and x86 that the patch causes no changes to the
installed shared libraries or ldd (or any part of the installation
except for the parts that always change because the files contain
timestamps - nscd and static libraries).

* sysdeps/unix/sysv/linux/configure.ac: Remove cases for
individual architectures.
* sysdeps/unix/sysv/linux/configure: Regenerated.
* sysdeps/unix/sysv/linux/i386/configure.ac: New file.
* sysdeps/unix/sysv/linux/i386/configure: New generated file.
* sysdeps/unix/sysv/linux/powerpc/configure.ac
(ldd_rewrite_script): Define variable.
* sysdeps/unix/sysv/linux/powerpc/configure: Regenerated.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/configure.ac: New
file.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/configure: New
generated file.
* sysdeps/unix/sysv/linux/s390/configure.ac: New file.
* sysdeps/unix/sysv/linux/s390/configure: New generated file.
* sysdeps/unix/sysv/linux/sh/configure.ac: New file.
* sysdeps/unix/sysv/linux/sh/configure: New generated file.
* sysdeps/unix/sysv/linux/sparc/configure.ac: New file.
* sysdeps/unix/sysv/linux/sparc/configure: New generated file.
* sysdeps/unix/sysv/linux/x86_64/configure.ac: New file.
* sysdeps/unix/sysv/linux/x86_64/configure: New generated file.

10 years agoFix namespace violation in pthreadtypes.h (BZ #17084)
Siddhesh Poyarekar [Tue, 24 Jun 2014 17:10:07 +0000 (22:40 +0530)] 
Fix namespace violation in pthreadtypes.h (BZ #17084)

This was causing conformtest failures on i386.

10 years agoAdd bug 16918 to NEWS.
Wilco [Tue, 24 Jun 2014 15:40:29 +0000 (15:40 +0000)] 
Add bug 16918 to NEWS.

10 years agoRevert "Add bug 16918 to NEWS."
Marcus Shawcroft [Tue, 24 Jun 2014 15:28:06 +0000 (16:28 +0100)] 
Revert "Add bug 16918 to NEWS."

This reverts commit 222b787a6fd36601f5c5d22378176798327fcf31.

10 years agoOptimize fesetenv
Wilco [Tue, 24 Jun 2014 15:05:23 +0000 (15:05 +0000)] 
Optimize fesetenv

Improve fesetenv to use an optimized implementation similar to
feupdateenv.

2014-06-24  Wilco  <wdijkstr@arm.com>

* sysdeps/arm/fesetenv.c (fesetenv): Optimize implementation.

10 years agoAdd _FPU_MASK_RM and use it instead of FE_TOWARDZERO.
Wilco [Tue, 24 Jun 2014 15:02:51 +0000 (15:02 +0000)] 
Add _FPU_MASK_RM and use it instead of FE_TOWARDZERO.

2014-06-24  Wilco  <wdijkstr@arm.com>

* sysdeps/arm/fpu_control.h (_FPU_MASK_RM): Define.
* sysdeps/arm/fenv_private.h (libc_fesetround_vfp)
(libc_feholdexcept_setround_vfp) (libc_feholdsetround_vfp)
(libc_feresetround_vfp) (libc_feholdsetround_vfp_ctx)
(libc_feresetround_vfp_ctx): Use _FPU_MASK_RM.
* sysdeps/arm/fesetround.c (fesetround): Use _FPU_MASK_RM.
* sysdeps/arm/get-rounding-mode.h (get_rounding_mode):
Use _FPU_MASK_RM.

10 years agoRemove an unused include.
Wilco [Tue, 24 Jun 2014 15:00:01 +0000 (15:00 +0000)] 
Remove an unused include.

2014-06-24  Wilco  <wdijkstr@arm.com>

* sysdeps/arm/fsetexcptflg.c (fesetexceptflag): Remove unused include.

10 years agoCleanup fenv implementation
Wilco [Tue, 24 Jun 2014 14:57:32 +0000 (14:57 +0000)] 
Cleanup fenv implementation

Remove some spaces before libm_hidden_def.

2014-06-24  Wilco  <wdijkstr@arm.com>

* sysdeps/arm/feholdexcpt.c (feholdexcept): Remove space.
* sysdeps/arm/fesetenv.c (fesetenv): Remove space.
* sysdeps/arm/fesetround.c (fesetround): Remove space.
* sysdeps/arm/fraiseexcpt.c (feraiseexcept): Remove space.

10 years agoAdd bug 16918 to NEWS.
Wilco [Tue, 24 Jun 2014 14:48:05 +0000 (14:48 +0000)] 
Add bug 16918 to NEWS.

10 years agoRewrite feupdateenv
Wilco [Tue, 24 Jun 2014 13:53:04 +0000 (13:53 +0000)] 
Rewrite feupdateenv

This patch rewrites feupdateenv to improve performance by avoiding
unnecessary FPSCR reads/writes. It fixes bug 16918 by passing the
correct return value.

2014-06-24  Wilco  <wdijkstr@arm.com>

[BZ #16918]
* sysdeps/arm/feupdateenv.c (feupdateenv):
Rewrite to reduce FPSCR accesses and fix return value.

10 years agoSpeed up the ARM fenv implementation by avoiding unnecessary FPSCR
Wilco [Tue, 24 Jun 2014 12:04:27 +0000 (12:04 +0000)] 
Speed up the ARM fenv implementation by avoiding unnecessary FPSCR
writes if the FPSCR remains unchanged.

2014-06-24  Wilco  <wdijkstr@arm.com>

* sysdeps/arm/fclrexcpt.c (feclearexcept):
Optimize to avoid unnecessary FPSCR writes.
* sysdeps/arm/fedisblxcpt.c (fedisableexcept): Likewise.
* sysdeps/arm/feenablxcpt.c (feenableexcept): Likewise.
* sysdeps/arm/fsetexcptflg.c (fesetexceptflag): Likewise.
* sysdeps/arm/setfpucw.c (__setfpucw): Likewise.

10 years agoUse libc calls defined by fenv_private.h to implement several fenv functions
Wilco [Tue, 24 Jun 2014 11:04:31 +0000 (11:04 +0000)] 
Use libc calls defined by fenv_private.h to implement several fenv functions
rather than duplicating functionality. To make this work for softfp builds,
ensure functions in fenv_private are not conditionally compiled.

2014-06-24  Wilco  <wdijkstr@arm.com>

* sysdeps/arm/fegetround.c (fegetround): Call get_rounding_mode.
* sysdeps/arm/feholdexcpt.c (feholdexcept): Call libc_feholdexcept_vfp.
* sysdeps/arm/fesetround.c (fesetround): Call libc_fesetround_vfp.
* sysdeps/arm/fgetexcptflg.c (fegetexceptflag):
Call libc_fetestexcept_vfp.
* sysdeps/arm/ftestexcept.c (fetestexcept): Call libc_fetestexcept_vfp.
* sysdeps/arm/fenv_private.h: Move libc_*_vfp functions outside of
__SOFTFP__ ifdef so that they can be built for softfp.

10 years agoFix build warning in pthread_rwlock_*
Siddhesh Poyarekar [Tue, 24 Jun 2014 10:42:43 +0000 (16:12 +0530)] 
Fix build warning in pthread_rwlock_*

The first argument of elision_adapt and that of ELISION_*LOCK have
different signs since __elision_rwcount is signed char * and the
argument of elision_adapt is uint8_t *.  Modified elision_adapt to
accept signed char * instead of uint8_t *.

10 years agoPrint offending diff when check-abi fails
Siddhesh Poyarekar [Tue, 24 Jun 2014 07:51:20 +0000 (13:21 +0530)] 
Print offending diff when check-abi fails

The earlier version of check-abi would print a diff of the expected
ABI vs the built ABI when there was a difference.  Bring back this
behaviour.

10 years agoAdd missing #include in get-rounding-mode.h
Roland McGrath [Mon, 23 Jun 2014 21:07:59 +0000 (14:07 -0700)] 
Add missing #include in get-rounding-mode.h

10 years agoRemove an unused variable in fstatvfs.
Roland McGrath [Mon, 23 Jun 2014 21:05:14 +0000 (14:05 -0700)] 
Remove an unused variable in fstatvfs.

10 years agoFix cosh spurious underflows from expm1 (bug 16354), inaccurate results near 0 (bug...
Joseph Myers [Mon, 23 Jun 2014 20:20:10 +0000 (20:20 +0000)] 
Fix cosh spurious underflows from expm1 (bug 16354), inaccurate results near 0 (bug 17061).

This patch fixes bug 16354, spurious underflows from cosh when a tiny
argument is passed to expm1 and expm1 correctly underflows although
the final result of cosh should be 1.  As noted in that bug, some
cases are latent because of expm1 implementations not raising
underflow (bug 16353), but all the implementations are fixed
similarly.  They already contained checks for tiny arguments, but the
checks were too late to avoid underflow from expm1 (although they
would avoid underflow from subsequent squaring of the result of
expm1); they are moved before the expm1 calls.

The thresholds used for considering arguments tiny are not
particularly consistent in how they relate to the precision of the
floating-point format in question.  They are, however, all sufficient
to ensure that the round-to-nearest result of cosh is indeed 1 below
the threshold (although sometimes they are smaller than necessary).
But the previous logic did not return 1, but the previously computed 1
+ expm1(abs(x)) value.  And the thresholds in the ldbl-128 and
ldbl-128ibm code (0x1p-71L - I suspect 0x3f8b was intended in the code
instead of 0x3fb8 - and (roughly) 0x1p-55L) are not sufficient for
that value to be 1.  So by moving the test for tiny arguments, and
consequently returning 1 directly now the expm1 value hasn't been
computed by that point, this patch also fixes bug 17061, the (large
number of ulps) inaccuracy for small arguments in those
implementations.  Tests for that bug are duly added.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 and powerpc32 to validate the ldbl-128 and ldbl-128ibm changes.

[BZ #16354]
[BZ #17061]
* sysdeps/ieee754/dbl-64/e_cosh.c (__ieee754_cosh): Check for
small arguments before calling __expm1.
* sysdeps/ieee754/flt-32/e_coshf.c (__ieee754_coshf): Check for
small arguments before calling __expm1f.
* sysdeps/ieee754/ldbl-128/e_coshl.c (__ieee754_coshl): Check for
small arguments before calling __expm1l.
* sysdeps/ieee754/ldbl-128ibm/e_coshl.c (__ieee754_coshl):
Likewise.
* sysdeps/ieee754/ldbl-96/e_coshl.c (__ieee754_coshl): Likewise.
* math/auto-libm-test-in: Add more cosh tests.  Do not allow
spurious underflow for some cosh tests.
* math/auto-libm-test-out: Regenerated.
* sysdeps/i386/fpu/libm-test-ulps: Update.

10 years agoSet errno for y1 overflow (bug 17050).
Joseph Myers [Mon, 23 Jun 2014 20:17:13 +0000 (20:17 +0000)] 
Set errno for y1 overflow (bug 17050).

This patch fixes bug 17050, missing errno setting for y1 overflow (for
small positive arguments).  An appropriate check is added for overflow
directly in the __ieee754_y1 implementation, similar to the check
present for yn (doing it there rather than in the wrapper also avoids
yn needing to repeat the check when called for order 1 or -1 and it
uses __ieee754_y1).

Tested x86_64 and x86; no ulps update needed.  Also tested for mips64
to verify the ldbl-128 fix (the ldbl-128ibm code just #includes the
ldbl-128 file).

[BZ #17050]
* sysdeps/ieee754/dbl-64/e_j1.c: Include <errno.h>.
(__ieee754_y1): Set errno if return value overflows.
* sysdeps/ieee754/flt-32/e_j1f.c: Include <errno.h>.
(__ieee754_y1f): Set errno if return value overflows.
* sysdeps/ieee754/ldbl-128/e_j1l.c: Include <errno.h>.
(__ieee754_y1l): Set errno if return value overflows.
* sysdeps/ieee754/ldbl-96/e_j1l.c: Include <errno.h>.
(__ieee754_y1l): Set errno if return value overflows.
* math/auto-libm-test-in: Add more tests of y0, y1 and yn.
* math/auto-libm-test-out: Regenerated.

10 years agoTest cpow in all rounding modes.
Joseph Myers [Mon, 23 Jun 2014 20:15:14 +0000 (20:15 +0000)] 
Test cpow in all rounding modes.

This patch enables testing of cpow in all rounding modes using
ALL_RM_TEST.  There were two reasons this was previously deferred:

* MPC has complicated rounding-mode-dependent rules for the signs of
  exact zero real or imaginary parts in the result of mpc_pow.  Annex
  G does not impose any such requirements and I don't think glibc
  should try to implement any particular logic here.  This patch adds
  support for gen-auto-libm-tests passing the IGNORE_ZERO_INF_SIGN
  flag to libm-test.inc.

* Error accumulations in some tests in non-default rounding modes
  exceed the maximum error permitted in libm-test.inc.  This patch
  marks the problem tests with xfail-rounding.  (It might be possible
  to reduce the accumulations a bit by using round-to-nearest when
  cpow calls clog, but I don't think there's much point; the
  implementation approach for cpow is fundamentally deficient, as
  discussed in the existing bug for cpow inaccuracy which can
  reasonably be considered to cover these less-inaccurate cases as
  well.  It's possible that the test "cpow 2 0 10 0" will also need
  xfail-rounding on some platforms.)

Tested x86_64 and x86 and ulps updated accordingly.

* math/gen-auto-libm-tests.c: Document use of
ignore-zero-inf-sign.
(input_flag_type): Add value flag_ignore_zero_inf_sign.
(input_flags): Add ignore-zero-inf-sign.
(output_for_one_input_case): Handle flag_ignore_zero_inf_sign.
* math/gen-libm-test.pl (generate_testfile): Handle
ignore-zero-inf-sign.
* math/auto-libm-test-in: Mark some cpow tests with
ignore-zero-inf-sign and some with xfail-rounding.
* math/auto-libm-test-out: Regenerated.
* math/libm-test.inc (cpow_test): Use ALL_RM_TEST.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoFix pow overflow in non-default rounding modes (bug 16315).
Joseph Myers [Mon, 23 Jun 2014 20:12:33 +0000 (20:12 +0000)] 
Fix pow overflow in non-default rounding modes (bug 16315).

This patch fixes bug 16315, bad pow handling of overflow/underflow in
non-default rounding modes.  Tests of pow are duly converted to
ALL_RM_TEST to run all tests in all rounding modes.

There are two main issues here.  First, various implementations
compute a negative result by negating a positive result, but this
yields inappropriate overflow / underflow values for directed
rounding, so either overflow / underflow results need recomputing in
the correct sign, or the relevant overflowing / underflowing operation
needs to be made to have a result of the correct sign.  Second, the
dbl-64 implementation sets FE_TONEAREST internally; in the overflow /
underflow case, the result needs recomputing in the original rounding
mode.

Tested x86_64 and x86 and ulps updated accordingly.

[BZ #16315]
* sysdeps/i386/fpu/e_pow.S (__ieee754_pow): Ensure possibly
overflowing or underflowing operations take place with sign of
result.
* sysdeps/i386/fpu/e_powf.S (__ieee754_powf): Likewise.
* sysdeps/i386/fpu/e_powl.S (__ieee754_powl): Likewise.
* sysdeps/ieee754/dbl-64/e_pow.c: Include <math.h>.
(__ieee754_pow): Recompute overflowing and underflowing results in
original rounding mode.
* sysdeps/x86/fpu/powl_helper.c: Include <stdbool.h>.
(__powl_helper): Allow negative argument X and scale negated value
as needed.  Avoid passing value outside [-1, 1] to f2xm1.
* sysdeps/x86_64/fpu/e_powl.S (__ieee754_powl): Ensure possibly
overflowing or underflowing operations take place with sign of
result.
* sysdeps/x86_64/fpu/multiarch/e_pow.c [HAVE_FMA4_SUPPORT]:
Include <math.h>.
* math/auto-libm-test-in: Add more tests of pow.
* math/auto-libm-test-out: Regenerated.
* math/libm-test.inc (pow_test): Use ALL_RM_TEST.
(pow_tonearest_test_data): Remove.
(pow_test_tonearest): Likewise.
(pow_towardzero_test_data): Likewise.
(pow_test_towardzero): Likewise.
(pow_downward_test_data): Likewise.
(pow_test_downward): Likewise.
(pow_upward_test_data): Likewise.
(pow_test_upward): Likewise.
(main): Don't call removed functions.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agopowerpc: Consolidate nptl/ subdirectories under linux/....
Roland McGrath [Mon, 23 Jun 2014 16:38:36 +0000 (09:38 -0700)] 
powerpc: Consolidate nptl/ subdirectories under linux/....

10 years agoAdd generic HAVE_RM_CTX implementation
Wilco Dijkstra [Mon, 23 Jun 2014 16:15:41 +0000 (17:15 +0100)] 
Add generic HAVE_RM_CTX implementation

This patch adds a generic implementation of HAVE_RM_CTX using standard
fenv calls. As a result math functions using SET_RESTORE_ROUND* macros
do not suffer from a large slowdown on targets which do not implement
optimized libc_fe*_ctx inline functions. Most of the libc_fe* inline
functions are now unused and could be removed in the future (there are
a few math functions left which use a mixture of standard fenv calls
and libc_fe* inline functions - they could be updated to use
SET_RESTORE_ROUND or improved to avoid expensive fenv manipulations
across just a few FP instructions).

libc_feholdsetround*_noex_ctx is added to enable better optimization of
SET_RESTORE_ROUND_NOEX* implementations.

Performance measurements on ARM and x86 of sin() show significant gains
over the current default, fairly close to a highly optimized fenv_private:

                        ARM   x86
no fenv_private      : 100%  100%
generic HAVE_RM_CTX  : 250%  350%
fenv_private (CTX)   : 250%  450%

2014-06-23  Will Newton  <will.newton@linaro.org>
    Wilco  <wdijkstr@arm.com>

* sysdeps/generic/math_private.h: Add generic HAVE_RM_CTX
implementation.  Include get-rounding-mode.h.
[!HAVE_RM_CTX]: Define HAVE_RM_CTX to zero.
[!libc_feholdsetround_noex_ctx]: Define
libc_feholdsetround_noex_ctx.
[!libc_feholdsetround_noexf_ctx]: Define
libc_feholdsetround_noexf_ctx.
[!libc_feholdsetround_noexl_ctx]: Define
libc_feholdsetround_noexl_ctx.
(libc_feholdsetround_ctx): New function.
(libc_feresetround_ctx): New function.
(libc_feholdsetround_noex_ctx): New function.
(libc_feresetround_noex_ctx): New function.

10 years agoMIPS: Move NPTL public headers to sysdeps/mips/nptl/.
Roland McGrath [Mon, 23 Jun 2014 16:25:41 +0000 (09:25 -0700)] 
MIPS: Move NPTL public headers to sysdeps/mips/nptl/.

10 years agom68k: Consolidate nptl/ subdirectories under linux/...
Roland McGrath [Mon, 23 Jun 2014 16:24:18 +0000 (09:24 -0700)] 
m68k: Consolidate nptl/ subdirectories under linux/...

10 years agoSH: Consolidate nptl/ subdirectories under linux/.....
Roland McGrath [Mon, 23 Jun 2014 16:23:12 +0000 (09:23 -0700)] 
SH: Consolidate nptl/ subdirectories under linux/.....

10 years agoUpdate headers for Linux 3.15.
Joseph Myers [Mon, 23 Jun 2014 15:48:42 +0000 (15:48 +0000)] 
Update headers for Linux 3.15.

This patch updates glibc headers for changes / new definitions in
Linux 3.15.  In the course of my review I noticed that
IPV6_PMTUDISC_INTERFACE was absent from glibc despite the inclusion of
IP_PMTUDISC_INTERFACE; I added it along with IP_PMTUDISC_OMIT and
IPV6_PMTUDISC_OMIT.  I did not add FALLOC_FL_NO_HIDE_STALE given the
kernel header comment that it is reserved.

Tested x86_64.

* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]
(FALLOC_FL_COLLAPSE_RANGE): New macro.
[__USE_GNU] (FALLOC_FL_ZERO_RANGE): Likewise.
* sysdeps/unix/sysv/linux/bits/in.h (IP_PMTUDISC_OMIT): Likewise.
(IPV6_PMTUDISC_INTERFACE): Likewise.
(IPV6_PMTUDISC_OMIT): Likewise.

10 years agoRemove unused label
Andreas Schwab [Mon, 23 Jun 2014 15:11:24 +0000 (17:11 +0200)] 
Remove unused label

10 years agoPowerPC: sync hwcap.h capabilities
Adhemerval Zanella [Mon, 23 Jun 2014 14:38:47 +0000 (09:38 -0500)] 
PowerPC: sync hwcap.h capabilities

Linux commit dd58a092c4202f2bd490adab7285b3ff77f8e467 added the
PPC_FEATURE2_VEC_CRYPTO auvx capability to indicate whether to
hardware supports vector crypto hardware instructions.  This patch
adds its definition to powerpc hwcap bits.

10 years agoelf/dl-lookup.c: Use __glibc_likely and __glibc_unlikely
Will Newton [Fri, 11 Apr 2014 13:39:56 +0000 (14:39 +0100)] 
elf/dl-lookup.c: Use __glibc_likely and __glibc_unlikely

Convert all uses of __builtin_expect to __glibc_likely and
__glibc_unlikely. Most of these are trivial boolean expressions
but a few were not. In particular the use of __builtin_expect in
the switch expression in do_lookup_x has been removed. Verified
that there are no code changes on x86_64 and ARM aside from line
numbers.

ChangeLog:

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

* elf/dl-lookup.c: Use __glibc_unlikely and __glibc_likely
rather than __builtin_expect.

10 years agoelf/dl-lookup.c: Remove unnecessary static variable
Will Newton [Fri, 4 Apr 2014 08:56:42 +0000 (09:56 +0100)] 
elf/dl-lookup.c: Remove unnecessary static variable

undefined_msg is only used once contrary to the comment.

ChangeLog:

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

* elf/dl-lookup.c (undefined_msg): Remove variable.
(_dl_lookup_symbol_x): Replace undefined_msg with string
literal.

10 years agoelf/dl-lookup.c: Move STB_GNU_UNIQUE handling to a function
Will Newton [Wed, 2 Apr 2014 15:04:12 +0000 (16:04 +0100)] 
elf/dl-lookup.c: Move STB_GNU_UNIQUE handling to a function

Move handling of STB_GNU_UNIQUE symbols to a separate function
from do_lookup_x in order to make the code more readable.

The new function gets inlined with gcc 4.8 on ARM and the
do_lookup_x code becomes a few bytes smaller.

ChangeLog:

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

* elf/dl-lookup.c (do_lookup_unique): New function.
(do_lookup_x): Move STB_GNU_UNIQUE handling code
to a separate function.

10 years agoDon't ignore too long lines in nss_files (BZ #17079)
Andreas Schwab [Mon, 23 Jun 2014 08:24:45 +0000 (10:24 +0200)] 
Don't ignore too long lines in nss_files (BZ #17079)

10 years agotest-skeleton.c: Use stdout for error messages
Will Newton [Fri, 11 Apr 2014 14:21:23 +0000 (15:21 +0100)] 
test-skeleton.c: Use stdout for error messages

At the moment the test skeleton uses a mixture of stdout and
stderr for error message output. Using stdout for all test output
keeps all output correctly ordered and properly redirected to the
output file. The suggestion to use stdout is also made on the wiki:

https://sourceware.org/glibc/wiki/Testing/Testsuite#Writing_a_test_case

ChangeLog:

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

* test-skeleton.c (signal_handler): Use printf and %m
rather than perror.  Use printf rather than fprintf to
stderr.  Use puts rather than fputs to stderr.
(main): Likewise.

10 years agonscd: Remove unused typedef and variable.
Ludovic Courtès [Sun, 22 Jun 2014 09:55:43 +0000 (11:55 +0200)] 
nscd: Remove unused typedef and variable.

The attached patch removed the unused â€˜thread_info_t’ typedef and the
‘thread_info’ variable from nscd.c.  The former conflicts with a GNU Mach
typedef, and the latter conflicts with a GNU Mach function declaration:
<https://lists.gnu.org/archive/html/bug-hurd/2014-06/msg00101.html>.

Tested on x86_64-linux-gnu.

10 years agoMention CVE-2014-4043 in NEWS
Allan McRae [Sat, 21 Jun 2014 07:23:55 +0000 (17:23 +1000)] 
Mention CVE-2014-4043 in NEWS

10 years agoMove generic smp.h to nptl/
Roland McGrath [Sat, 21 Jun 2014 03:22:44 +0000 (20:22 -0700)] 
Move generic smp.h to nptl/

10 years agoRemove unused file rtld-lowlevel.h.
Roland McGrath [Sat, 21 Jun 2014 03:17:28 +0000 (20:17 -0700)] 
Remove unused file rtld-lowlevel.h.

10 years agoClean up HAVE_CONFIG_H and STDC_HEADERS.
Roland McGrath [Sat, 21 Jun 2014 03:04:47 +0000 (20:04 -0700)] 
Clean up HAVE_CONFIG_H and STDC_HEADERS.

10 years agoClean up stack-coloring macros.
Roland McGrath [Sat, 21 Jun 2014 02:50:16 +0000 (19:50 -0700)] 
Clean up stack-coloring macros.

10 years agoMove linux bits/ files out of nptl/.
Roland McGrath [Sat, 21 Jun 2014 01:36:49 +0000 (18:36 -0700)] 
Move linux bits/ files out of nptl/.

10 years agoRemove ARM __ASSUME_SIGFRAME_V2.
Joseph Myers [Sat, 21 Jun 2014 00:58:56 +0000 (00:58 +0000)] 
Remove ARM __ASSUME_SIGFRAME_V2.

This patch removes ARM __ASSUME_SIGFRAME_V2 now that the
2.6.18-and-later signal frame layout can be assumed, renaming the
affected functions accordingly now only one version of them is needed
in glibc.  (sigrestorer.S did not in fact include <kernel-features.h>
and it appears that, unlike other such cases, it didn't get the header
indirectly, so the v1 functions would have been compiled in even when
sigaction.c didn't reference them.)

(alpha and hppa also have architecture-specific __ASSUME_* macros that
should now be removed: __ASSUME_FDATASYNC and __ASSUME_LWS_CAS
respectively.  I don't have any plans to do anything on that myself.)

Tested on ARM.

* sysdeps/unix/sysv/linux/arm/kernel-features.h
(__ASSUME_SIGFRAME_V2): Remove macro.
* sysdeps/unix/sysv/linux/arm/sigrestorer.S: Update comment.
[!__ASSUME_SIGFRAME_V2]: Remove conditional code.
(__default_sa_restorer_v2): Rename to __default_sa_restorer.
(__default_rt_sa_restorer_v2): Rename to __default_rt_sa_restorer.
* sysdeps/unix/sysv/linux/arm/sigaction.c (__default_sa_restorer):
Declare as function.  Remove conditional macro definitions.
(__default_rt_sa_restorer): Likewise.
(__default_sa_restorer_v1): Remove declaration.
(__default_sa_restorer_v2): Likewise.
(__default_rt_sa_restorer_v1): Likewise.
(__default_rt_sa_restorer_v2): Likewise.
* sysdeps/unix/sysv/linux/arm/Versions (GLIBC_PRIVATE): Remove
__default_sa_restorer_v1, __default_rt_sa_restorer_v1,
__default_sa_restorer_v2 and __default_rt_sa_restorer_v2.

10 years agoMissing new file from last commit.
Roland McGrath [Sat, 21 Jun 2014 00:27:16 +0000 (17:27 -0700)] 
Missing new file from last commit.

10 years agoMove remaining SPARC code out of nptl/.
Roland McGrath [Sat, 21 Jun 2014 00:13:47 +0000 (17:13 -0700)] 
Move remaining SPARC code out of nptl/.

10 years agoInclude <kernel-features.h> explicitly where required.
Joseph Myers [Fri, 20 Jun 2014 23:24:00 +0000 (23:24 +0000)] 
Include <kernel-features.h> explicitly where required.

This patch makes files using __ASSUME_* macros include
<kernel-features.h> explicitly, rather than relying on some other
header (such as tls.h, lowlevellock.h or pthreadP.h) to include it
implicitly.  (I omitted cases where I've already posted or am testing
the patch that stops the file from needing __ASSUME_* at all.)  This
accords with the general principle of making source files include the
headers for anything they use, and also helps make it safe to remove
<kernel-features.h> includes from any file that doesn't use
__ASSUME_* (some of those may be stray includes left behind after
increasing the minimum kernel version, others may never have been
needed or may have become obsolete after some other change).

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

* nptl/pthread_cond_wait.c: Include <kernel-features.h>.
* nptl/pthread_rwlock_timedrdlock.c: Likewise.
* nptl/pthread_rwlock_timedwrlock.c: Likewise.
* nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
* nscd/nscd.c: Likewise.
* sysdeps/i386/nptl/tcb-offsets.sym: Likewise.
* sysdeps/powerpc/nptl/tcb-offsets.sym: Likewise.
* sysdeps/sh/nptl/tcb-offsets.sym: Likewise.
* sysdeps/x86_64/nptl/tcb-offsets.sym: Likewise.

10 years agoRemove __ASSUME_SOCK_CLOEXEC / SOCK_CLOEXEC conditionals in Linux-specific code.
Joseph Myers [Fri, 20 Jun 2014 23:22:08 +0000 (23:22 +0000)] 
Remove __ASSUME_SOCK_CLOEXEC / SOCK_CLOEXEC conditionals in Linux-specific code.

This patch removes conditionals on __ASSUME_SOCK_CLOEXEC, and on
SOCK_CLOEXEC being defined, in Linux-specific code, now that all
supported Linux kernel versions can be assumed to have this
functionality.  (The macro is also used in OS-independent code and is
not defined for Hurd.)

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

* nptl/sysdeps/unix/sysv/linux/mq_notify.c: Do not include
<kernel-features.h>.
(init_mq_netlink): Remove conditional have_sock_cloexec
definitions.  Remove code conditional on have_sock_cloexec < 0.
(init_mq_netlink) [!SOCK_CLOEXEC]: Remove conditional code.
(init_mq_netlink) [!__ASSUME_SOCK_CLOEXEC]: Likewise.
* sysdeps/unix/sysv/linux/opensock.c: Do not include
<kernel-features.h>.
(__opensock) [SOCK_CLOEXEC]: Make code unconditional.
(__opensock) [!__ASSUME_SOCK_CLOEXEC]: Remove conditional code.

10 years agoAdd ifunc tests for x86_64 memset_chk and memset
H.J. Lu [Fri, 20 Jun 2014 21:52:29 +0000 (14:52 -0700)] 
Add ifunc tests for x86_64 memset_chk and memset

This patch adds ifunc tests for x86_64 memset_chk and memset.  It also
defines HAS_AVX2 with AVX2_Usable since AVX2 may not be usable even if
processor has AVX2.

* sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list):
Add tests for memset_chk and memset.

* sysdeps/x86_64/multiarch/init-arch.h (HAS_AVX2): Defined
with AVX2_Usable.

10 years ago[BZ #16046] dl_iterate_phdr static executable test
Maciej W. Rozycki [Fri, 20 Jun 2014 20:52:53 +0000 (21:52 +0100)] 
[BZ #16046] dl_iterate_phdr static executable test

10 years agostdlib/tst-qsort2.c: Fix off-by-one argc interpretation error
Maciej W. Rozycki [Fri, 20 Jun 2014 20:29:33 +0000 (21:29 +0100)] 
stdlib/tst-qsort2.c: Fix off-by-one argc interpretation error

This fixes an off-by-one argc interpretation error (argv[0] is included
in the count) in stdlib/tst-qsort2.c causing a segfault if the program
is called with one command-line argument only (argv[2] is NULL in that
case).

10 years agoRemove __ASSUME_F_GETOWN_EX.
Joseph Myers [Fri, 20 Jun 2014 20:04:33 +0000 (20:04 +0000)] 
Remove __ASSUME_F_GETOWN_EX.

This patch removes __ASSUME_F_GETOWN_EX now it can be assumed to be
true unconditionally.

Tested x86_64 that disassembly of installed shared libraries is
unchanged by this patch.

* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_F_GETOWN_EX): Remove macro.
* sysdeps/unix/sysv/linux/fcntl.c: Do not include
<kernel-features.h>.
(miss_F_GETOWN_EX): Remove variable or macro.
(do_fcntl): Do not check miss_F_GETOWN_EX.
(do_fcntl) [!__ASSUME_F_GETOWN_EX]: Remove conditional code.

10 years agoRemove __ASSUME_AT_RANDOM.
Joseph Myers [Fri, 20 Jun 2014 20:02:34 +0000 (20:02 +0000)] 
Remove __ASSUME_AT_RANDOM.

This patch removes __ASSUME_AT_RANDOM now it can be assumed to be true
unconditionally.

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_AT_RANDOM):
Remove macro.
* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard)
[!__ASSUME_AT_RANDOM]: Remove conditional code.
(_dl_setup_pointer_guard) [!__ASSUME_AT_RANDOM]: Likewise.

10 years agoRemove __ASSUME_ADJ_OFFSET_SS_READ.
Joseph Myers [Fri, 20 Jun 2014 20:00:51 +0000 (20:00 +0000)] 
Remove __ASSUME_ADJ_OFFSET_SS_READ.

This patch removes the __ASSUME_ADJ_OFFSET_SS_READ macro (and
conditionals on whether ADJ_OFFSET_SS_READ is defined), now it can be
unconditionally assumed to be true and ADJ_OFFSET_SS_READ can be
assumed to be defined.

Tested x86_64 that the disassembly of installed shared libraries is
unchanged by this patch.

* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_ADJ_OFFSET_SS_READ): Remove macro.
* sysdeps/unix/sysv/linux/adjtime.c (ADJTIME)
[ADJ_OFFSET_SS_READ]: Make code unconditional.
(ADJTIME) [!ADJ_OFFSET_SS_READ]: Remove conditional code.

10 years ago[BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC
Maciej W. Rozycki [Fri, 20 Jun 2014 19:08:03 +0000 (20:08 +0100)] 
[BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC

This fixes the calculation of R_ARM_TLS_DESC relocations for lazy global
symbol references, i.e. created with `-z lazy' in effect with the static
linker, where immediate resolution is requested with LD_BIND_NOW.

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.