platform/upstream/glibc.git
10 years agoMake x86_64 fegetenv preserve exception mask (bug 16198).
Joseph Myers [Wed, 26 Mar 2014 18:59:08 +0000 (18:59 +0000)]
Make x86_64 fegetenv preserve exception mask (bug 16198).

Bug 16198 is x86_64 fegetenv wrongly masking exceptions for which
traps are enabled, because that's a side-effect of the fnstenv
instruction.  This patch fixes it to use fldenv immediately after
fnstenv, like the i386 version.  Tested x86_64 and x86.

[BZ #16198]
* sysdeps/x86_64/fpu/fegetenv.c (fegetenv): Use fldenv after
fnstenv.
* math/test-fenv-preserve.c: New file.
* math/Makefile (tests): Add test-fenv-preserve.

10 years agobenchtests/bench-strtod.c: Increase timeout value
Will Newton [Tue, 25 Mar 2014 15:27:22 +0000 (15:27 +0000)]
benchtests/bench-strtod.c: Increase timeout value

This benchmark can take longer than the default 2 seconds on slower
platforms, so increase it to 10 seconds.

ChangeLog:

2014-03-26  Will Newton <will.newton@linaro.org>

* benchtests/bench-strtod.c (TIMEOUT): Define to 10.

10 years agoKludge fix for Versions.def regression
Roland McGrath [Tue, 25 Mar 2014 18:16:51 +0000 (11:16 -0700)]
Kludge fix for Versions.def regression

10 years agoAdd empty GLIBC_2.2.5 version to elf/Versions.
Joseph Myers [Tue, 25 Mar 2014 21:54:09 +0000 (21:54 +0000)]
Add empty GLIBC_2.2.5 version to elf/Versions.

As needed for SHLIB_COMPAT calls using this version.

* elf/Versions (libc) [EXPORT_UNWIND_FIND_FDE]: Add empty
GLIBC_2.2.5 version.

10 years agoFix localplt check for GNU_IFUNC
Adhemerval Zanella [Wed, 19 Mar 2014 20:30:18 +0000 (15:30 -0500)]
Fix localplt check for GNU_IFUNC

GNU_IFUNC are shown by readelf in 'Relocation section' value as
"symbol()" instead of expected hexadecimal value. This causes the
check-localplt script to ignore potential PLT stub begin generated
by wrong IFUNC usage.  This patch changes the localplt script to
emit such PLT cases.

10 years agoPowerPC: Revert __PTHREAD_MUTEX_HAVE_ELISION change
Adhemerval Zanella [Tue, 25 Mar 2014 16:36:28 +0000 (11:36 -0500)]
PowerPC: Revert __PTHREAD_MUTEX_HAVE_ELISION change

This patch revert 449282f2e0e850c29f6a9666058503d4734964f0.

10 years agoUpdate powerpc-fpu ULPs.
Adhemerval Zanella [Tue, 25 Mar 2014 15:13:53 +0000 (10:13 -0500)]
Update powerpc-fpu ULPs.

10 years agoFix use of uninitialized variable
Andreas Schwab [Tue, 25 Mar 2014 07:51:59 +0000 (08:51 +0100)]
Fix use of uninitialized variable

10 years agoPowerPC: Fix -Wundef warning for __PTHREAD_MUTEX_HAVE_ELISION.
Adhemerval Zanella [Tue, 25 Mar 2014 13:21:24 +0000 (08:21 -0500)]
PowerPC: Fix -Wundef warning for __PTHREAD_MUTEX_HAVE_ELISION.

10 years agoRelax gen-auto-libm-tests may-underflow rules, test log1p in all rounding modes.
Joseph Myers [Tue, 25 Mar 2014 12:26:06 +0000 (12:26 +0000)]
Relax gen-auto-libm-tests may-underflow rules, test log1p in all rounding modes.

gen-auto-libm-tests presently allows but does not require underflow
exceptions for results with magnitude in the range (greatest
subnormal, least normal].

In some cases, the magnitude of the exact result is very slightly
above the least normal, but rounding in the implementation results in
it effectively computing an infinite-precision result that is slightly
below the least normal, so raising an underflow exception.  This is in
accordance with the documented accuracy goals, but results in
testsuite failures.

This patch changes the logic to allow underflows when the mathematical
result is up to 0.5ulp above the least normal (so in any case where
the round-to-nearest result is the least normal).  Ideally underflows
in all these cases would be accepted only when an underflow with the
actual result is consistent with the rounding mode (in FE_TOWARDZERO
mode, a return value of the least normal implies that the
infinite-precision result did not underflow so there should be no
underflow exception, for example), so as to match the documented goals
more precisely - whereas at present the tests for exceptions are
completely independent of the tests of the returned values.  (The same
applies to overflow exceptions as well - they too should be checked
for consistency with the result, as in FE_TOWARDZERO mode a result
1ulp below the largest finite value should be inconsistent with an
overflow exception and cause a failure with overflow rather than
simply being considered a 1ulp error when overflow is expected.)  But
the present patch at least deals with the cases causing spurious
failures so that (a) certain existing tests no longer need to be
marked as having spurious exceptions (such markings in
auto-libm-test-in end up applying to more cases than just those they
are needed for) and (b) log1p can be tested in all rounding modes
without introducing more such failures.  This patch duly moves tests
of log1p to ALL_RM_TEST.

Tested x86_64 and x86 and ulps updated accordingly.

[BZ #16357]
[BZ #16599]
* math/gen-auto-libm-tests.c (fp_format_desc): Add field
min_plus_half.
(fp_formats): Update initializers.
(init_fp_formats): Initialize new field.
(output_for_one_input_case): Allow underflow for results up to
min_plus_half.
* math/libm-test.inc (log1p_test): Use ALL_RM_TEST.
* math/auto-libm-test-in: Don't mark some underflows from asin and
atanh as spurious.
* math/auto-libm-test-out: Regenerated.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoSetup LOCPATH for tst-ftell-active-handler and tst-ftell-partial-wide in libio
Andreas Schwab [Tue, 25 Mar 2014 11:40:06 +0000 (12:40 +0100)]
Setup LOCPATH for tst-ftell-active-handler and tst-ftell-partial-wide in libio

10 years agoNEWS: Add 16712, 16713, 16714 to fixed bug list.
Stefan Liebler [Tue, 25 Mar 2014 09:16:08 +0000 (10:16 +0100)]
NEWS: Add 16712, 16713, 16714 to fixed bug list.

10 years agoAddress post-commit patch comments.
Paul Pluzhnikov [Tue, 25 Mar 2014 01:22:32 +0000 (18:22 -0700)]
Address post-commit patch comments.

2014-03-24  Paul Pluzhnikov  <ppluzhnikov@google.com>

* elf/tst-dlopen-aout.c: Adjust comments. Use test-skeleton.c

10 years agoFix implicit __isinf declarations in exp.
Joseph Myers [Mon, 24 Mar 2014 22:00:32 +0000 (22:00 +0000)]
Fix implicit __isinf declarations in exp.

My recent exp patch introduced warnings about implicit __isinf
declarations in exp because e_exp.c didn't include <math.h>.  This
patch fixes this.  Because <math.h> can't be included after
<math_private.h> (because of macro definitions of __nan*), it was
necessary to put an include in sysdeps/x86_64/fpu/multiarch/e_exp.c as
well.

Tested x86_64.

* sysdeps/ieee754/dbl-64/e_exp.c: Include <math.h>.
* sysdeps/x86_64/fpu/multiarch/e_exp.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.

10 years agoFix BZ #16634.
Paul Pluzhnikov [Mon, 24 Mar 2014 17:58:26 +0000 (10:58 -0700)]
Fix BZ #16634.

An application that erroneously tries to repeatedly dlopen("a.out", ...)
may hit assertion failure:

  Inconsistency detected by ld.so: dl-tls.c: 474: _dl_allocate_tls_init:
  Assertion `listp != ((void *)0)' failed!

dlopen() actually fails with  "./a.out: cannot dynamically load executable",
but it does so after incrementing dl_tls_max_dtv_idx.

Once we run out of TLS_SLOTINFO_SURPLUS (62), we exit with above assertion
failure.

2014-03-24  Paul Pluzhnikov  <ppluzhnikov@google.com>

[BZ #16634]

* elf/dl-load.c (open_verify): Add mode parameter.
        Error early when ET_EXEC and mode does not have __RTLD_OPENEXEC.
        (open_path): Change from boolean 'secure' to complete flag 'mode'
        (_dl_map_object): Adjust.
* elf/Makefile (tests): Add tst-dlopen-aout.
* elf/tst-dlopen-aout.c: New test.

10 years agoS390: Fix namespace violation in struct stat (BZ #16714).
Stefan Liebler [Mon, 24 Mar 2014 15:49:13 +0000 (16:49 +0100)]
S390: Fix namespace violation in struct stat (BZ #16714).

10 years agoS390: Define SIZE_MAX as unsigned long (BZ #16712).
Stefan Liebler [Mon, 24 Mar 2014 15:46:51 +0000 (16:46 +0100)]
S390: Define SIZE_MAX as unsigned long (BZ #16712).

10 years agoS390: Correct type of sa_flags in struct sigaction for POSIX conformance
Stefan Liebler [Mon, 24 Mar 2014 15:34:49 +0000 (16:34 +0100)]
S390: Correct type of sa_flags in struct sigaction for POSIX conformance
(BZ #16713).

10 years agoUse += before-compile instead of a :=.
Stefan Liebler [Mon, 24 Mar 2014 15:32:47 +0000 (16:32 +0100)]
Use += before-compile instead of a :=.

10 years agoS390: Fix -Wundef warning for __PTHREAD_MUTEX_HAVE_ELISION.
Stefan Liebler [Mon, 24 Mar 2014 15:31:13 +0000 (16:31 +0100)]
S390: Fix -Wundef warning for __PTHREAD_MUTEX_HAVE_ELISION.

10 years agoFix use of half-initialized result in getaddrinfo when using nscd (bug 16743)
Andreas Schwab [Thu, 20 Mar 2014 14:05:25 +0000 (15:05 +0100)]
Fix use of half-initialized result in getaddrinfo when using nscd (bug 16743)

This fixes a bug in the way the results from __nscd_getai are collected:
for every returned result a new entry is first added to the
gaih_addrtuple list, but if that result doesn't match the request this
entry remains uninitialized.  So for this non-matching result an extra
result with uninitialized content is returned.

To reproduce (with nscd running):

$ getent ahostsv4 localhost
127.0.0.1       STREAM localhost
127.0.0.1       DGRAM
127.0.0.1       RAW
(null)          STREAM
(null)          DGRAM
(null)          RAW

10 years agobenchtests: Move bench.py to benchtests/scripts/
Siddhesh Poyarekar [Mon, 24 Mar 2014 15:46:36 +0000 (21:16 +0530)]
benchtests: Move bench.py to benchtests/scripts/

It makes much more sense to have all benchmarking-related scripts in a
single place away from everything else.

10 years agoAccount for alloca use when collecting interface addresses (bug 16002)
Andreas Schwab [Mon, 24 Mar 2014 10:06:30 +0000 (11:06 +0100)]
Account for alloca use when collecting interface addresses (bug 16002)

To reproduce:

# ip li add name dummy0 type dummy
# site_id=$(head -c6 /dev/urandom | od -tx2 -An | tr ' ' ':')
# for ((i = 0; i < 65536; i++)) do
> ip ad ad $(printf fd80$site_id::%04x $i)/128 dev dummy0
> done
# (ulimit -s 900; getent ahosts localhost)
# ip li de dummy0

10 years agoFix dbl-64 exp overflow/underflow in non-default rounding modes (bug 16284).
Joseph Myers [Mon, 24 Mar 2014 12:18:45 +0000 (12:18 +0000)]
Fix dbl-64 exp overflow/underflow in non-default rounding modes (bug 16284).

The dbl-64 version of exp needs round-to-nearest mode for its internal
computations, but that has the consequence of inappropriate
overflowing and underflowing results in other rounding modes.  This
patch fixes this by recomputing the relevant results in cases where
the round-to-nearest result overflows to infinity or underflows to
zero (most of the diffs are actually just consequent reindentation).
Tests are enabled in all rounding modes for complex functions using
exp - but not for cexp because it turns out there are bugs causing
spurious underflows for cexp for some tests, which will need to be
fixed separately (I suspect ccos ccosh csin csinh ctan ctanh have
similar bugs, just not shown by the present set of test inputs).

Tested x86_64 and x86 and ulps updated accordingly.

[BZ #16284]
* sysdeps/ieee754/dbl-64/e_exp.c (__ieee754_exp): Use original
rounding mode to recompute results that overflow to infinity or
underflow to zero.
* math/auto-libm-test-in: Don't mark tests as expected to fail for
bug 16284.
* math/auto-libm-test-out: Regenerated.
* math/libm-test.inc (ccos_test): Use ALL_RM_TEST.
(ccosh_test): Likewise.
(csin_test_data): Use plus_oflow.
(csin_test): Use ALL_RM_TEST.
(csinh_test_data): Use plus_oflow.
(csinh_test): Use ALL_RM_TEST.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoFix -Wundef warnings for _ABI* on MIPS.
Joseph Myers [Fri, 21 Mar 2014 18:21:13 +0000 (18:21 +0000)]
Fix -Wundef warnings for _ABI* on MIPS.

This patch fixes -Wundef warnings related to the _ABI* macros on MIPS.
GCC predefines only the _ABI* macro related to the ABI actually in
use, meaning that a conditional such as "#if _MIPS_SIM == _ABI64" is
true only for the ABI in question (all the macros are nonzero), but
produces a -Wundef warning for the other ABIs.  The normal approach to
using these macros is to include <sgidefs.h>, which ensures that all
three _ABI* macros are defined rather than just one; this patch does
so in the places that caused warnings (the bulk of the warnings
arising from <bits/wordsize.h>).  Tested that the warnings are fixed.

* sysdeps/mips/bits/wordsize.h: Include <sgidefs.h>.
* sysdeps/unix/sysv/linux/mips/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/setrlimit64.c: Likewise.

10 years agoFix log (1) in round-downward mode (bug 16731).
Joseph Myers [Fri, 21 Mar 2014 18:13:58 +0000 (18:13 +0000)]
Fix log (1) in round-downward mode (bug 16731).

According to ISO C Annex F, log (1) should be +0 in all rounding
modes, but some implementations in glibc wrongly return -0 in
round-downward mode (mapping to log1p (x - 1) is problematic because 1
- 1 is -0 in round-downward mode, and log1p (-0) is -0).  This patch
fixes this.  (It helps with some implementations of other functions
such as acosh, log2 and log10 that call out to log, but not enough to
enable all-rounding-modes testing for those functions without further
fixes to other implementations of them.)

Tested x86_64 and x86 and ulps updated accordingly, and did spot tests
for mips64 for the ldbl-128 fix, and i586 for the sysdeps/i386/fpu
implementations shadowed by those in sysdeps/i386/i686/fpu.

[BZ #16731]
* sysdeps/i386/fpu/e_log.S (__ieee754_log): Take absolute value
when x - 1 is zero.
* sysdeps/i386/fpu/e_logf.S (__ieee754_logf): Likewise.
* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Likewise.
* sysdeps/i386/i686/fpu/e_logl.S (__ieee754_logl): Likewise.
* sysdeps/ieee754/dbl-64/e_log.c (__ieee754_log): Return +0 when
argument is 1.
* sysdeps/ieee754/ldbl-128/e_logl.c (__ieee754_logl): Likewise.
* sysdeps/x86_64/fpu/e_logl.S: Take absolute value when x - 1 is
zero.
* math/libm-test.inc (log_test): Use ALL_RM_TEST.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoChangeLog formatting fix
Siddhesh Poyarekar [Fri, 21 Mar 2014 12:41:52 +0000 (18:11 +0530)]
ChangeLog formatting fix

10 years agoImplement benchmarking script in python
Siddhesh Poyarekar [Fri, 6 Dec 2013 08:21:09 +0000 (13:51 +0530)]
Implement benchmarking script in python

Implemented the benchmark script in python since it is much cleaner
and simpler to maintain.

10 years agoFix -Wundef warnins for __FP_FAST_FMA*
Siddhesh Poyarekar [Tue, 18 Mar 2014 01:52:36 +0000 (07:22 +0530)]
Fix -Wundef warnins for __FP_FAST_FMA*

The macros are defined by the compiler, so we can only verify whether
they are defined or not.

10 years agoPowerPC: optimized strpbrk for POWER7
Adhemerval Zanella [Thu, 20 Mar 2014 20:28:07 +0000 (15:28 -0500)]
PowerPC: optimized strpbrk for POWER7

This patch add an optimized strpbrk for POWER7 by using a different
algorithm than default implementation: it constructs a table based on
the 'accept' argument and use this table to check for any occurance on
the input string. The idea is similar as x86_64 uses.
For PowerPC some tunings were added, such as unroll loops and memory
clear using VSX instructions.

10 years agoTest most libm functions in all rounding modes.
Joseph Myers [Fri, 21 Mar 2014 00:03:38 +0000 (00:03 +0000)]
Test most libm functions in all rounding modes.

This patch makes libm-test.inc tests of most functions use ALL_RM_TEST
unless there was some reason to defer that change for a particular
function.

I started out planning to defer the change for pow (bug 16315), cexp /
ccos / ccosh / csin / csinh (likely fallout from exp, bug 16284) and
cpow (exact expectations for signs of exact zero results not wanted).
Testing on x86_64 and x86 showed additional failures for acosh, cacos,
catan, catanh, clog, clog10, jn, log, log10, log1p, log2, tgamma, yn,
so making the change for those functions was deferred as well, pending
investigation to show which of these represent distinct bugs (some
such bugs may already be filed) and appropriate fixing / XFAILing.
Failures include wrong signs of zero results, errors slightly above
the 9ulp bound (in such cases it may make sense for functions to set
round-to-nearest internally to reduce error accumulation), large
errors and incorrect overflow/underflow for the rounding mode (with
consequent missing errno settings in some cases).  It's possible some
could be issues with test expectations, though I didn't notice any
that were obviously like that (I added NO_TEST_INLINE for cases that
were failing for ildoubl on x86 and where it seemed reasonable for
them to fail for the fast-math inlines).

There may of course be failures on other architectures for functions
that didn't fail on x86_64 or x86, in which case the usual rule
applies: file a bug (preferably identifying the underlying problem
function, in cases where function A calls function B and a problem
with function B may present in the test results for function A) if not
already in Bugzilla then fix or XFAIL.

Tested x86_64 and x86 and ulps updated accordingly.

* math/libm-test.inc (asinh_test): Use ALL_RM_TEST.
(atan_test): Likewise.
(atanh_test_data): Use NO_TEST_INLINE for two tests.
(atanh_test): Use ALL_RM_TEST.
(atan2_test_data): Likewise.
(cabs_test): Likewise.
(cacosh_test): Likewise.
(carg_test): Likewise.
(casin_test): Likewise.
(casinh_test): Likewise.
(cbrt_test): Likewise.
(csqrt_test): Likewise.
(erf_test): Likewise.
(erfc_test): Likewise.
(pow10_test): Likewise.
(exp2_test): Likewise.
(hypot_test): Likewise.
(j0_test): Likewise.
(j1_test): Likewise.
(lgamma_test): Likewise.
(gamma_test): Likewise.
(sincos_test): Likewise.
(tanh_test): Likewise.
(y0_test): Likewise.
(y1_test): Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoPowerPC: optimized strcspn for PPC64/POWER7
Adhemerval Zanella [Thu, 20 Mar 2014 16:24:52 +0000 (11:24 -0500)]
PowerPC: optimized strcspn for PPC64/POWER7

This patch add a optimized strcspn for POWER7 by using a different
algorithm than default implementation: it constructs a table based on
the 'accept' argument and use this table to check for any occurance
on the input string. The idea is similar as x86_64 uses.
For PowerPC some tunings were added, such as unroll loops and align
stack memory to table to 16 bytes (so VSX clean can ran without
alignment issues).

10 years agoMake libm-test support ALL_RM_TEST with AUTO_TESTS_*.
Joseph Myers [Thu, 20 Mar 2014 11:48:07 +0000 (11:48 +0000)]
Make libm-test support ALL_RM_TEST with AUTO_TESTS_*.

This patch continues improvements to all-rounding-mode libm testing by
making testing with ALL_RM_TEST support test results from
auto-libm-test-out.  gen-libm-test.pl is adapted to generate
appropriate output with results for each rounding mode, with
AUTO_TESTS_* calls no longer specifying a rounding mode.  Where there
were separate functions in libm-test.inc to test a function in each
rounding mode, using AUTO_TESTS_* to list the tests for each rounding
mode, those are converted to using ALL_RM_TEST (so generally this
patch doesn't change the sets of tests run in each rounding mode,
except that in various cases special-case tests given directly in
libm-test.inc were previously run only for round-to-nearest, and now
are run for all rounding modes).

Tested x86_64 and x86.

* math/gen-libm-test.pl (generate_testfile): Expect only function
name as argument to AUTO_TESTS_* and pass results for all rounding
modes to parse_args.
(parse_auto_input): Separate inputs of automatic tests from
outputs before storing in %auto_tests.
* math/libm-test.inc (acos_test_data): Update call to
AUTO_TESTS_f_f.
(acos_test): Use ALL_RM_TEST.
(acos_tonearest_test_data): Remove.
(acos_test_tonearest): Likewise.
(acos_towardzero_test_data): Likewise.
(acos_test_towardzero): Likewise.
(acos_downward_test_data): Likewise.
(acos_test_downward): Likewise.
(acos_upward_test_data): Likewise.
(acos_test_upward): Likewise.
(acosh_test_data): Update call to AUTO_TESTS_f_f.
(asin_test_data): Likewise.
(asin_test): Use ALL_RM_TEST.
(asin_tonearest_test_data): Remove.
(asin_test_tonearest): Likewise.
(asin_towardzero_test_data): Likewise.
(asin_test_towardzero): Likewise.
(asin_downward_test_data): Likewise.
(asin_test_downward): Likewise.
(asin_upward_test_data): Likewise.
(asin_test_upward): Likewise.
(asinh_test_data): Update call to AUTO_TESTS_f_f.
(atan_test_data): Likewise.
(atanh_test_data): Likewise.
(atan2_test_data): Update call to AUTO_TESTS_ff_f.
(cabs_test_data): Update call to AUTO_TESTS_c_f.
(carg_test_data): Likewise.
(cbrt_test_data): Update call to AUTO_TESTS_f_f.
(ccos_test_data): Update call to AUTO_TESTS_c_c.
(ccosh_test_data): Likewise.
(cexp_test_data): Likewise.
(clog_test_data): Likewise.
(clog10_test_data): Likewise.
(cos_test_data): Update call to AUTO_TESTS_f_f.
(cos_test): Use ALL_RM_TEST.
(cos_tonearest_test_data): Remove.
(cos_test_tonearest): Likewise.
(cos_towardzero_test_data): Likewise.
(cos_test_towardzero): Likewise.
(cos_downward_test_data): Likewise.
(cos_test_downward): Likewise.
(cos_upward_test_data): Likewise.
(cos_test_upward): Likewise.
(cosh_test_data): Update call to AUTO_TESTS_f_f.
(cosh_test): Use ALL_RM_TEST.
(cosh_tonearest_test_data): Remove.
(cosh_test_tonearest): Likewise.
(cosh_towardzero_test_data): Likewise.
(cosh_test_towardzero): Likewise.
(cosh_downward_test_data): Likewise.
(cosh_test_downward): Likewise.
(cosh_upward_test_data): Likewise.
(cosh_test_upward): Likewise.
(cpow_test_data): Update call to AUTO_TESTS_cc_c.
(csqrt_test_data): Update call to AUTO_TESTS_c_c.
(ctan_test_data): Likewise.
(ctan_test): Use ALL_RM_TEST.
(ctan_tonearest_test_data): Remove.
(ctan_test_tonearest): Likewise.
(ctan_towardzero_test_data): Likewise.
(ctan_test_towardzero): Likewise.
(ctan_downward_test_data): Likewise.
(ctan_test_downward): Likewise.
(ctan_upward_test_data): Likewise.
(ctan_test_upward): Likewise.
(ctanh_test_data): Update call to AUTO_TESTS_c_c.
(ctanh_test): Use ALL_RM_TEST.
(ctanh_tonearest_test_data): Remove.
(ctanh_test_tonearest): Likewise.
(ctanh_towardzero_test_data): Likewise.
(ctanh_test_towardzero): Likewise.
(ctanh_downward_test_data): Likewise.
(ctanh_test_downward): Likewise.
(ctanh_upward_test_data): Likewise.
(ctanh_test_upward): Likewise.
(erf_test_data): Update call to AUTO_TESTS_f_f.
(erfc_test_data): Likewise.
(exp_test_data): Likewise.
(exp_test): Use ALL_RM_TEST.
(exp_tonearest_test_data): Remove.
(exp_test_tonearest): Likewise.
(exp_towardzero_test_data): Likewise.
(exp_test_towardzero): Likewise.
(exp_downward_test_data): Likewise.
(exp_test_downward): Likewise.
(exp_upward_test_data): Likewise.
(exp_test_upward): Likewise.
(exp10_test_data): Update call to AUTO_TESTS_f_f.
(exp10_test): Use ALL_RM_TEST.
(exp10_tonearest_test_data): Remove.
(exp10_test_tonearest): Likewise.
(exp10_towardzero_test_data): Likewise.
(exp10_test_towardzero): Likewise.
(exp10_downward_test_data): Likewise.
(exp10_test_downward): Likewise.
(exp10_upward_test_data): Likewise.
(exp10_test_upward): Likewise.
(exp2_test_data): Update call to AUTO_TESTS_f_f.
(expm1_test_data): Likewise.
(expm1_test): Use ALL_RM_TEST.
(expm1_tonearest_test_data): Remove.
(expm1_test_tonearest): Likewise.
(expm1_towardzero_test_data): Likewise.
(expm1_test_towardzero): Likewise.
(expm1_downward_test_data): Likewise.
(expm1_test_downward): Likewise.
(expm1_upward_test_data): Likewise.
(expm1_test_upward): Likewise.
(fma_test_data): Update call to AUTO_TESTS_fff_f.
(fma_test): Use ALL_RM_TEST.
(fma_towardzero_test_data): Remove.
(fma_test_towardzero): Likewise.
(fma_downward_test_data): Likewise.
(fma_test_downward): Likewise.
(fma_upward_test_data): Likewise.
(fma_test_upward): Likewise.
(hypot_test_data): Update call to AUTO_TESTS_ff_f.
(j0_test_data): Update call to AUTO_TESTS_f_f.
(j1_test_data): Likewise.
(jn_test_data): Update call to AUTO_TESTS_if_f.
(lgamma_test_data): Update call to AUTO_TESTS_f_f1.
(log_test_data): Update call to AUTO_TESTS_f_f.
(log10_test_data): Likewise.
(log1p_test_data): Likewise.
(log2_test_data): Likewise.
(pow_test_data): Update call to AUTO_TESTS_ff_f.
(pow_tonearest_test_data): Likewise.
(sin_test_data): Update call to AUTO_TESTS_f_f.
(sin_test): Use ALL_RM_TEST.
(sin_tonearest_test_data): Remove.
(sin_test_tonearest): Likewise.
(sin_towardzero_test_data): Likewise.
(sin_test_towardzero): Likewise.
(sin_downward_test_data): Likewise.
(sin_test_downward): Likewise.
(sin_upward_test_data): Likewise.
(sin_test_upward): Likewise.
(sincos_test_data): Update call to AUTO_TESTS_fFF_11.
(sinh_test_data): Update call to AUTO_TESTS_f_f.
(sinh_test): Use ALL_RM_TEST.
(sinh_tonearest_test_data): Remove.
(sinh_test_tonearest): Likewise.
(sinh_towardzero_test_data): Likewise.
(sinh_test_towardzero): Likewise.
(sinh_downward_test_data): Likewise.
(sinh_test_downward): Likewise.
(sinh_upward_test_data): Likewise.
(sinh_test_upward): Likewise.
(sqrt_test_data): Update call to AUTO_TESTS_f_f.
(sqrt_test): Use ALL_RM_TEST.
(sqrt_tonearest_test_data): Remove.
(sqrt_test_tonearest): Likewise.
(sqrt_towardzero_test_data): Likewise.
(sqrt_test_towardzero): Likewise.
(sqrt_downward_test_data): Likewise.
(sqrt_test_downward): Likewise.
(sqrt_upward_test_data): Likewise.
(sqrt_test_upward): Likewise.
(tan_test_data): Update call to AUTO_TESTS_f_f.
(tan_test): Use ALL_RM_TEST.
(tan_tonearest_test_data): Remove.
(tan_test_tonearest): Likewise.
(tan_towardzero_test_data): Likewise.
(tan_test_towardzero): Likewise.
(tan_downward_test_data): Likewise.
(tan_test_downward): Likewise.
(tan_upward_test_data): Likewise.
(tan_test_upward): Likewise.
(tanh_test_data): Update call to AUTO_TESTS_f_f.
(tgamma_test_data): Likewise.
(y0_test_data): Likewise.
(y1_test_data): Likewise.
(yn_test_data): Update call to AUTO_TESTS_if_f.
(main): Do not call removed functions.

10 years agoUse ALL_RM_TEST for more libm tests.
Joseph Myers [Wed, 19 Mar 2014 16:17:22 +0000 (16:17 +0000)]
Use ALL_RM_TEST for more libm tests.

Continuing the move to using ALL_RM_TEST for tests in libm-test.inc,
this patch converts the tests of fdim, ldexp and scalb.  fdim and
scalb are cases where tests could depend on the rounding mode though
none of the present test inputs do; ldexp is such a case where the
function is equivalent to scalbn (for binary floating point) and the
tests used were a subset of those for scalbn, so this patch makes
ldexp testing use the scalbn tests, as done for other cases of libm
function aliases.

Tested x86_64 and x86.

* math/libm-test.inc (fdim_test): Use ALL_RM_TEST.
(ldexp_test_data): Remove.
(ldexp_test): Move to after scalbn_test.  Use ALL_RM_TEST with
scalbn_test_data.
(scalb_test): Use ALL_RM_TEST.

10 years agonscd: also invalidate netgroup cache on reload
Andreas Schwab [Wed, 19 Mar 2014 08:42:29 +0000 (09:42 +0100)]
nscd: also invalidate netgroup cache on reload

10 years agoFix __ASSUME_PREADV and __ASSUME_PWRITEV for Alpha and MicroBlaze (bug 16649).
Joseph Myers [Wed, 19 Mar 2014 13:10:52 +0000 (13:10 +0000)]
Fix __ASSUME_PREADV and __ASSUME_PWRITEV for Alpha and MicroBlaze (bug 16649).

Reviewing (for all architectures, with a baseline kernel version of
2.6.32) the kernel support for features for which __ASSUME_* macros
would be affected by a move to 2.6.32 as minimum kernel version showed
up that __ASSUME_PREADV and __ASSUME_PWRITEV were wrongly defined for
MicroBlaze (despite the corresponding syscall table entries not being
wired up in the kernel) and Alpha for 2.6.30 and above (although the
support on Alpha was added in 2.6.33).  This patch makes the
kernel-features.h files undefine those macros for appropriate
versions.

[BZ #16649]
* sysdeps/unix/sysv/linux/alpha/kernel-features.h
[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_PREADV): Undefine.
[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_PWRITEV): Likewise.
* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
(__ASSUME_PREADV): Undefine.
(__ASSUME_PWRITEV): Likewise.

10 years agoAdd comments about non-Linux use of bits/mman-linux.h.
Roland McGrath [Tue, 18 Mar 2014 21:58:15 +0000 (14:58 -0700)]
Add comments about non-Linux use of bits/mman-linux.h.

10 years agoMove bits/mman-linux.h out of sysdeps/unix/sysv/linux/.
Roland McGrath [Tue, 18 Mar 2014 21:48:09 +0000 (14:48 -0700)]
Move bits/mman-linux.h out of sysdeps/unix/sysv/linux/.

This way, non-Linux ports using the Linux values for bits/mman.h
constants need not duplicate the header.

10 years agoAdd stardard definition on conform processing
Adhemerval Zanella [Tue, 18 Mar 2014 13:54:04 +0000 (08:54 -0500)]
Add stardard definition on conform processing

This patch adds the -std=c99 option when preprocessing the data files
from the conform testcases. It fixes an issue where the compiler may
split the 'macro bool' defition from stdbool.h-data in two lines and
thus breaking the conform script.

10 years agoTest scalbn and scalbln in all rounding modes, add more tests of negative arguments.
Joseph Myers [Tue, 18 Mar 2014 18:47:46 +0000 (18:47 +0000)]
Test scalbn and scalbln in all rounding modes, add more tests of negative arguments.

Continuing the move to systematically testing libm functions in all
rounding modes with ALL_RM_TEST, this patch converts the tests of
scalbn and scalbln to use that macro.

Those tests include cases of underflow and overflow, meaning the
expected results depend on the rounding mode.  For convenience in
writing such tests manually, the patch adds the notation plus_oflow,
minus_oflow, plus_uflow and minus_uflow for overflowing / underflowing
results of each sign appropriate to the rounding mode being used, and
gen-libm-test.pl is made to substitute in the appropriate values.  The
tests of underflow and overflow are extended to include negative
arguments to provide better coverage (otherwise minus_oflow and
minus_uflow wouldn't have been used at all).

(A subsequent patch will make ldexp use the scalbn tests, as those
functions are equivalent for binary floating point.)

Tested x86_64 and x86.

* math/gen-libm-test.pl (parse_args): Handle plus_oflow,
minus_oflow, plus_uflow and minus_uflow in expected results.
* math/libm-test.inc (scalbn_test_data): Add more tests of
negative arguments.  Use plus_oflow, minus_oflow, plus_uflow and
minus_uflow.
(scalbn_test): Use ALL_RM_TEST.
(scalbln_test_data): Add more tests of negative arguments.  Use
plus_oflow, minus_oflow, plus_uflow and minus_uflow.
(scalbln_test): Use ALL_RM_TEST.

10 years agoWork around binutils bugs in 2.23 and older
Roland McGrath [Tue, 18 Mar 2014 02:14:00 +0000 (07:44 +0530)]
Work around binutils bugs in 2.23 and older

binutils versions up through at least 2.23 have some bugs that cause
STV_HIDDEN symbols to appear in .dynsyms.

10 years agomisc/sys/xattr.h: guard against linux uapi header inclusion
Serge Hallyn [Tue, 11 Mar 2014 04:17:07 +0000 (23:17 -0500)]
misc/sys/xattr.h: guard against linux uapi header inclusion

If the glibc xattr.h header is included after the uapi header,
compilation fails due to an enum re-using a #define from the
uapi header.  Protect against this by guarding the define and
enum inclusions against each other.

(A corresponding kernel patch has been sent here:
http://lkml.org/lkml/2014/3/7/331 )

(See https://lists.debian.org/debian-glibc/2014/03/msg00029.html
and https://sourceware.org/glibc/wiki/Synchronizing_Headers
for more information.)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoaarch64: Remove inaccurate comment from sysdep.h
Will Newton [Tue, 11 Mar 2014 14:14:32 +0000 (14:14 +0000)]
aarch64: Remove inaccurate comment from sysdep.h

This comment appears to have been copied from the ARM port where it
makes more sense.

2014-03-18  Will Newton  <will.newton@linaro.org>

* sysdeps/unix/sysv/linux/aarch64/sysdep.h: Remove
inaccurate comment.

10 years agoExit with error status on check-abi failure.
Joseph Myers [Tue, 18 Mar 2014 00:05:28 +0000 (00:05 +0000)]
Exit with error status on check-abi failure.

* Makerules [!subdir] (check-abi): Exit with error status if a
test failed.

10 years agoTest rint and nearbyint with same inputs, in all rounding modes.
Joseph Myers [Mon, 17 Mar 2014 21:18:18 +0000 (21:18 +0000)]
Test rint and nearbyint with same inputs, in all rounding modes.

This patch arranges for rint and nearbyint to be tested by
libm-test.inc with the same inputs (previously each had some test
inputs the other didn't, although there was a lot of overlap as well),
and for nearbyint to be tested in all rounding modes where previously
it was only tested in round-to-nearest mode.  The expected results are
the same for each function, except that rint is expected to have
"inexact" exceptions for non-integer input and nearbyint is expected
not to have those exceptions.

Tested x86_64 and x86.

* math/libm-test.inc (nearbyint_test_data): Include all tests used
for rint.  Include results for all rounding modes.
(nearbyint_test): Use ALL_RM_TEST.
(rint_test_data): Include all tests used for nearbyint.

10 years agoRevert "Fix __PTHREAD_MUTEX_HAVE_ELISION -Wundef warning"
Will Newton [Mon, 17 Mar 2014 20:40:33 +0000 (20:40 +0000)]
Revert "Fix __PTHREAD_MUTEX_HAVE_ELISION -Wundef warning"

This reverts commit 788bba368c2eaf8aa3fd2ca18d269395d6bc8afb.

10 years agoRevert "Fix HP_SMALL_TIMING_AVAIL -Wundef warnings"
Will Newton [Mon, 17 Mar 2014 20:39:24 +0000 (20:39 +0000)]
Revert "Fix HP_SMALL_TIMING_AVAIL -Wundef warnings"

This reverts commit 53f1bed39263541ef7f3d86f9701005524938016.

10 years agoRevert "Fix _IO_JUMPS_OFFSET -Wundef warnings"
Will Newton [Mon, 17 Mar 2014 20:37:42 +0000 (20:37 +0000)]
Revert "Fix _IO_JUMPS_OFFSET -Wundef warnings"

This reverts commit f7efd7c3dfffa3c417e9d3c4cb19d9954a3b1421.

10 years agoRevert "Fix HAVE_RM_CTX -Wundef warnings"
Will Newton [Mon, 17 Mar 2014 20:36:06 +0000 (20:36 +0000)]
Revert "Fix HAVE_RM_CTX -Wundef warnings"

This reverts commit 9290130a8de3f30970f741c79dfe8459f798e05f.

10 years agoFix HAVE_RM_CTX -Wundef warnings
Will Newton [Mon, 17 Mar 2014 12:07:10 +0000 (12:07 +0000)]
Fix HAVE_RM_CTX -Wundef warnings

ChangeLog:

2014-03-17  Will Newton  <will.newton@linaro.org>

* sysdeps/generic/math_private.h: Check whether
HAVE_RM_CTX is defined with #ifdef rather
than #if.

10 years agoFix __STRICT_ANSI__ -Wundef warnings
Will Newton [Mon, 17 Mar 2014 11:06:02 +0000 (11:06 +0000)]
Fix __STRICT_ANSI__ -Wundef warnings

ChangeLog:

2014-03-17  Will Newton  <will.newton@linaro.org>

* argp/argp-fmtstream.h: Check whether
__STRICT_ANSI__ is defined with #ifdef rather
than #if.
* argp/argp.h: Likewise.

10 years agoFix _IO_JUMPS_OFFSET -Wundef warnings
Will Newton [Mon, 17 Mar 2014 10:54:12 +0000 (10:54 +0000)]
Fix _IO_JUMPS_OFFSET -Wundef warnings

ChangeLog:

2014-03-17  Will Newton  <will.newton@linaro.org>

* libio/genops.c: Check whether
_IO_JUMPS_OFFSET is defined with #ifdef rather
than #if.
* libio/libioP.h: Likewise.
* stdio-common/vfprintf.c: Likewise.

10 years agoFix HP_SMALL_TIMING_AVAIL -Wundef warnings
Will Newton [Mon, 17 Mar 2014 10:44:13 +0000 (10:44 +0000)]
Fix HP_SMALL_TIMING_AVAIL -Wundef warnings

ChangeLog:

2014-03-17  Will Newton  <will.newton@linaro.org>

* sysdeps/generic/ldsodefs.h: Check whether
HP_SMALL_TIMING_AVAIL is defined with #ifdef rather
than #if.

10 years agoFix __PTHREAD_MUTEX_HAVE_ELISION -Wundef warning
Will Newton [Mon, 17 Mar 2014 10:16:53 +0000 (10:16 +0000)]
Fix __PTHREAD_MUTEX_HAVE_ELISION -Wundef warning

ChangeLog:

2014-03-17  Will Newton  <will.newton@linaro.org>

* nptl/sysdeps/pthread/pthread.h: Check
__PTHREAD_MUTEX_HAVE_ELISION is defined before testing
its value.

10 years agoChange offset in fdopen only if setting O_APPEND
Siddhesh Poyarekar [Mon, 17 Mar 2014 13:12:53 +0000 (18:42 +0530)]
Change offset in fdopen only if setting O_APPEND

fdopen should only be allowed to change the offset in the file it
attaches to if it is setting O_APPEND.  If O_APPEND is already set, it
should not change the state of the handle.

10 years agoFix offset caching for streams and use it for ftell (BZ #16680)
Siddhesh Poyarekar [Tue, 11 Mar 2014 11:34:49 +0000 (17:04 +0530)]
Fix offset caching for streams and use it for ftell (BZ #16680)

The ftell implementation was made conservative to ensure that
incorrectly cached offsets never affect it.  However, this causes
problems for append mode when a file stream is rewound.  Additionally,
the 'clever' trick of using stat to get position for append mode files
caused more problems than it solved and broke old behavior.  I have
described the various problems that it caused and then finally the
solution.

For a and a+ mode files, rewinding the stream should result in ftell
returning 0 as the offset, but the stat() trick caused it to
(incorrectly) always return the end of file.  Now I couldn't find
anything in POSIX that specifies the stream position after rewind()
for a file opened in 'a' mode, but for 'a+' mode it should be set to
0.  For 'a' mode too, it probably makes sense to keep it set to 0 in
the interest of retaining old behavior.

The initial file position for append mode files is implementation
defined, so the implementation could either retain the current file
position or move the position to the end of file.  The earlier ftell
implementation would move the offset to end of file for append-only
mode, but retain the old offset for a+ mode.  It would also cache the
offset (this detail is important).  My patch broke this and would set
the initial position to end of file for both append modes, thus
breaking old behavior.  I was ignorant enough to write an incorrect
test case for it too.

The Change:

I have now brought back the behavior of seeking to end of file for
append-only streams, but with a slight difference.  I don't cache the
offset though, since we would want ftell to query the current file
position through lseek while the stream is not active.  Since the
offset is moved to the end of file, we can rely on the file position
reported by lseek and we don't need to resort to the stat() nonsense.

Finally, the cache is always reliable, except when there are unflished
writes in an append mode stream (i.e. both a and a+).  In the latter
case, it is safe to just do an lseek to SEEK_END.  The value can be
safely cached too, since the file handle is already active at this
point.  Incidentally, this is the only state change we affect in the
file handle (apart from taking locks of course).

I have also updated the test case to correct my impression of the
initial file position for a+ streams to the initial behavior.  I have
verified that this does not break any existing tests in the testsuite
and also passes with the new tests.

10 years agoFix up return codes for tests in tst-ftell-active-handler
Siddhesh Poyarekar [Mon, 10 Mar 2014 10:50:01 +0000 (16:20 +0530)]
Fix up return codes for tests in tst-ftell-active-handler

The test functions used a variable ret to store failure codes for
individual tests, but the variable was incorrectly used to record
other failure codes too, resulting in overwriting of the tests status.
This is now fixed by making sure that the ret variable is used only
for recording test failures.

* libio/tst-ftell-active-handler.c (do_ftell_test): Don't mix
up test status with function return status.
(do_write_test): Likewise.
(do_append_test): Likewise.

10 years agoGet rid of __LT_SPINLOCK_INIT
Siddhesh Poyarekar [Mon, 17 Mar 2014 14:01:46 +0000 (19:31 +0530)]
Get rid of __LT_SPINLOCK_INIT

We got rid of LinuxThreads in 2005, but we didn't remove
__LT_SPINLOCK_INIT back then.  Do it now.

* nptl/sysdeps/pthread/bits/libc-lockP.h [defined NOT_IN_libc
&& !defined IS_IN_libpthread && __LT_SPINNOCK_INIT != 0]:
Remove.

10 years agoAdd libm-test support for per-rounding-mode manually specified results.
Joseph Myers [Mon, 17 Mar 2014 12:29:26 +0000 (12:29 +0000)]
Add libm-test support for per-rounding-mode manually specified results.

This patch continues the libm-test move towards automatic testing of
all test inputs in all rounding modes by adding gen-libm-test.pl
support for tests specifying results in each rounding mode manually.

Previously a TEST_* line could specify arguments and results, or
arguments, results and flags.  Now there is the option of (arguments,
results-rd, flags-rd, results-rn, flags-rn, results-rz, flags-rz,
results-ru, flags-ru).  This is used to replace the separate arrays of
results in each rounding mode for lrint, llrint and rint.  (In the
case of rint, some tests were only in rint_test_data and needed to
have expectations for non-default rounding modes added, which I did
manually.  In various cases there were slight differences in things
such as the ordering of tests in the arrays for each mode.)

Tested x86_64 and x86.

* math/gen-libm-test.pl (parse_args): Handle results specified for
each rounding mode separately.
* math/libm-test.inc (lrint_test_data): Merge in per-rounding-mode
tests and results from lrint_tonearest_test_data,
lrint_towardzero_test_data, lrint_downward_test_data and
lrint_upward_test_data.
(lrint_test): Use ALL_RM_TEST.
(lrint_tonearest_test_data): Remove.
(lrint_test_tonearest): Likewise.
(lrint_towardzero_test_data): Likewise.
(lrint_test_towardzero): Likewise.
(lrint_downward_test_data): Likewise.
(lrint_test_downward): Likewise.
(lrint_upward_test_data): Likewise.
(lrint_test_upward): Likewise.
(llrint_test_data): Merge in per-rounding-mode tests and results
from llrint_tonearest_test_data, llrint_towardzero_test_data,
llrint_downward_test_data and llrint_upward_test_data.
(llrint_test): Use ALL_RM_TEST.
(llrint_tonearest_test_data): Remove.
(llrint_test_tonearest): Likewise.
(llrint_towardzero_test_data): Likewise.
(llrint_test_towardzero): Likewise.
(llrint_downward_test_data): Likewise.
(llrint_test_downward): Likewise.
(llrint_upward_test_data): Likewise.
(llrint_test_upward): Likewise.
(rint_test_data): Merge in per-rounding-mode tests and results
from rint_tonearest_test_data, rint_towardzero_test_data,
rint_downward_test_data and rint_upward_test_data.  Add
per-rounding-mode results for tests not in those arrays.
(rint_test): Use ALL_RM_TEST.
(rint_tonearest_test_data): Remove.
(rint_test_tonearest): Likewise.
(rint_towardzero_test_data): Likewise.
(rint_test_towardzero): Likewise.
(rint_downward_test_data): Likewise.
(rint_test_downward): Likewise.
(rint_upward_test_data): Likewise.
(rint_test_upward): Likewise.
(main): Don't call removed functions.

10 years agoRemove "Compiled on ..." crapola from version text.
Roland McGrath [Fri, 14 Mar 2014 23:05:10 +0000 (16:05 -0700)]
Remove "Compiled on ..." crapola from version text.

10 years agoDo not terminate default test runs on test failure.
Joseph Myers [Fri, 14 Mar 2014 21:02:40 +0000 (21:02 +0000)]
Do not terminate default test runs on test failure.

This patch is an updated version of
<https://sourceware.org/ml/libc-alpha/2014-01/msg00198.html> and
<https://sourceware.org/ml/libc-alpha/2014-03/msg00180.html>.

Normal practice for software testsuites is that rather than
terminating immediately when a test fails, they continue running and
report at the end on how many tests passed or failed.

The principle behind the glibc testsuite stopping on failure was
probably that the expected state is no failures and so any failure
indicates a problem such as miscompilation.  In practice, while this
is fairly close to true for native testing on x86_64 and x86 (kernel
bugs and race conditions can still cause intermittent failures), it's
less likely to be the case on other platforms, and so people testing
glibc run the testsuite with "make -k" and then examine the logs to
determine whether the failures are what they expect to fail on that
platform, possibly with some automation for the comparison.

This patch switches the glibc testsuite to the normal convention of
not stopping on failure - unless you use stop-on-test-failure=y, in
which case it behaves essentially as it did before (and does not
generate overall test summaries on failure).  Instead, the summary
tests.sum may contain tests that FAILed.  At the end of the test run,
any FAIL or ERROR lines from tests.sum are printed, and then it exits
with error status if there were any such lines.  In addition, build
failures will also cause the test run to stop - this has the
justification that those *do* indicate serious problems that should be
promptly fixed and aren't generally hard to fix (but apart from that,
avoiding the build stopping on those failures seems harder).

Note that unlike the previous patches in this series, this *does*
require people with automation around testing glibc to change their
processes - either to start using tests.sum / xtests.sum to track
failures and compare them with expectations (with or without also
using "make -k" and examining "make" logs to identify build failures),
or else to use stop-on-test-failure=y and ignore the new tests.sum /
xtests.sum mechanism.  (If all you check is the exit status from "make
check", no changes are needed unless you want to avoid test runs
continuing after the first failure.)

Tested x86_64.

* scripts/evaluate-test.sh: Handle fourth argument to determine
whether test run should stop on failure.
* Makeconfig (stop-on-test-failure): New variable.
(evaluate-test): Pass fourth argument to evaluate-test.sh based on
$(stop-on-test-failure).
* Makefile (tests): Give a summary of results from testing and
exit with failure status if they include an ERROR or FAIL.
(xtests): Likewise.
* manual/install.texi (Configuring and compiling): Mention
stop-on-test-failure=y.
* INSTALL: Regenerated.

10 years agoGet rid of Versions.def source file
Roland McGrath [Fri, 14 Mar 2014 18:39:56 +0000 (11:39 -0700)]
Get rid of Versions.def source file

10 years agoCompile with -Wundef.
Roland McGrath [Fri, 14 Mar 2014 17:44:34 +0000 (10:44 -0700)]
Compile with -Wundef.

10 years agoPowerPC: remove wrong roundl implementation for PowerPC64
Adhemerval Zanella [Fri, 14 Mar 2014 17:49:45 +0000 (12:49 -0500)]
PowerPC: remove wrong roundl implementation for PowerPC64

The roundl assembly implementation
(sysdeps/powerpc/powerpc64/fpu/s_roundl.S)
returns wrong results for some inputs where first double is a exact
integer and the precision is determined by second long double.

Checking on implementation comments and history, I am very confident the
assembly implementation was based on a version before commit
5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in
long double (ldbl-128ibm) rounding functions in glibc-2.4).

By just removing the implementation and make the build select
sysdeps/ieee754/ldbl-128ibm/s_roundl.c instead fixes the failing math.

This fixes 16707.

10 years agoPowerPC: remove wrong nearbyintl implementation for PPC64
Adhemerval Zanella [Fri, 14 Mar 2014 17:27:52 +0000 (12:27 -0500)]
PowerPC: remove wrong nearbyintl implementation for PPC64

The nearbyintl assembly implementation
(sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S)
returns wrong results for some inputs where first double is a exact
integer and the precision is determined by second long double.

Checking on implementation comments and history, I am very confident the
assembly implementation was based on a version before commit
5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in
long double (ldbl-128ibm) rounding functions in glibc-2.4).

By just removing the implementation and make the build select
sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c instead fixes the failing
math.

Fixes BZ#16706.

10 years agoPowerPC: remove wrong ceill implementation for PowerPC64
Adhemerval Zanella [Fri, 14 Mar 2014 12:35:43 +0000 (07:35 -0500)]
PowerPC: remove wrong ceill implementation for PowerPC64

The ceill assembly implementation (sysdeps/powerpc/powerpc64/fpu/s_ceill.S)
returns wrong results for some inputs where first double is a exact
integer and the precision is determined by second long double.

Checking on implementation comments and history, I am very confident the
assembly implementation was based on a version before commit
5c68d401698a58cf7da150d9cce769fa6679ba5f that fixes BZ#2423 (Errors in
long double (ldbl-128ibm) rounding functions in glibc-2.4).

By just removing the implementation and make the build select
sysdeps/ieee754/ldbl-128ibm/s_ceill.c instead fixes the failing math.

Fixes BZ#16701.

10 years agoAdd truncl tests related to BZ#16414
Adhemerval Zanella [Fri, 14 Mar 2014 17:15:40 +0000 (12:15 -0500)]
Add truncl tests related to BZ#16414

10 years agoFix two stray cases using #ifdef vs #if for TLS_TCB_AT_TP.
Roland McGrath [Fri, 14 Mar 2014 17:46:38 +0000 (10:46 -0700)]
Fix two stray cases using #ifdef vs #if for TLS_TCB_AT_TP.

10 years agoCheck AVX-512 assembler support first
H.J. Lu [Fri, 14 Mar 2014 15:51:25 +0000 (08:51 -0700)]
Check AVX-512 assembler support first

It checks AVX-512 assembler support first and sets libc_cv_cc_avx512 to
$libc_cv_asm_avx512, instead of yes.  GCC won't support AVX-512 if
assembler doesn't support it.

* sysdeps/x86_64/configure.ac: Check AVX-512 assembler support
first.  Disable AVX-512 GCC support if assembler doesn't support
it.
* sysdeps/x86_64/configure: Regenerated.

10 years agohppa: Add _STACK_GROWS_* cases to pthread_attr_[sg]etstack.
Carlos O'Donell [Wed, 5 Mar 2014 05:11:01 +0000 (00:11 -0500)]
hppa: Add _STACK_GROWS_* cases to pthread_attr_[sg]etstack.

This is one of a several NPTL patches to build glibc on hppa.

The pthread_attr_[sg]etstack functions are defined by POSIX as
taking a stackaddr that is the lowest addressable byte of the
storage used for the stack. However, the internal iattr variable
of the same name in NPTL is actually the final stack address
as usable in the stack pointer for the machine. Therefore the
NPTL implementation must add and subtract stacksize for
_STACK_GROWS_DOWN architectures. HPPA is a _STACK_GROWS_UP
architecture and doesn't need to add or subtract anything,
the stack address *is* the lowest addressable byte of the
storage.

Tested on hppa-linux-gnu, with no regressions.

Can't impact any other targets because of the conditionals.

If nobody objects I'll check this in at the end of the week.

I can't see there being any objections to this patch except
that it introduces more code to maintain for an old architecture
(perhaps we'll get another _S_G_U target in the future?).

10 years agostop supporting bash-1.x
Mike Frysinger [Sat, 25 Jan 2014 05:44:37 +0000 (00:44 -0500)]
stop supporting bash-1.x

We've stopped supporting toolchain packages older than 2009, so punting
bash-1.x is reasonable when bash-2 was released almost 20 years ago.

10 years agodelete ksh checks
Mike Frysinger [Sat, 25 Jan 2014 05:39:31 +0000 (00:39 -0500)]
delete ksh checks

Nothing in the tree uses ksh anymore, so punt these checks.

10 years agosotruss: drop ksh support and add basic POSIX shell support
Mike Frysinger [Sat, 25 Jan 2014 05:33:48 +0000 (00:33 -0500)]
sotruss: drop ksh support and add basic POSIX shell support

This script works fine under bash as-is, so we don't need ksh anymore.

Once we tweak the function style, the code even works (for the most part)
under a POSIX shell.  The localized strings will be prepended with a $,
but it is otherwise functional.

10 years agomanual: time: fix typo in IST example
Mike Frysinger [Thu, 13 Mar 2014 21:48:14 +0000 (17:48 -0400)]
manual: time: fix typo in IST example

The current description says Tuesday when it meant to say Thursday
(since that comes before Friday).

10 years agotst-longjmp_chk2: add comments/sanity check
Mike Frysinger [Sun, 29 Dec 2013 21:30:35 +0000 (16:30 -0500)]
tst-longjmp_chk2: add comments/sanity check

If the longjmp checking code is slightly broken, this code can loop
forever which isn't too helpful.  Add a sanity check to keep that
from happening.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
10 years agoSave and restore AVX-512 zmm registers to x86-64 ld.so
Igor Zamyatin [Thu, 13 Mar 2014 18:10:22 +0000 (11:10 -0700)]
Save and restore AVX-512 zmm registers to x86-64 ld.so

AVX-512 ISA adds 512-bit zmm registers.  This patch updates
_dl_runtime_profile to pass zmm registers to run-time audit. It also
changes _dl_x86_64_save_sse and _dl_x86_64_restore_sse to upport zmm
registers, which are called when only when RTLD_PREPARE_FOREIGN_CALL
is used.  Its performance impact is minimum.

* config.h.in (HAVE_AVX512_SUPPORT): New #undef.
(HAVE_AVX512_ASM_SUPPORT): Likewise.
* sysdeps/x86_64/bits/link.h (La_x86_64_zmm): New.
(La_x86_64_vector): Add zmm.
* sysdeps/x86_64/Makefile (tests): Add tst-audit10.
(modules-names): Add tst-auditmod10a and tst-auditmod10b.
($(objpfx)tst-audit10): New target.
($(objpfx)tst-audit10.out): Likewise.
(tst-audit10-ENV): New.
(AVX512-CFLAGS): Likewise.
(CFLAGS-tst-audit10.c): Likewise.
(CFLAGS-tst-auditmod10a.c): Likewise.
(CFLAGS-tst-auditmod10b.c): Likewise.
* sysdeps/x86_64/configure.ac: Set config-cflags-avx512,
HAVE_AVX512_SUPPORT and HAVE_AVX512_ASM_SUPPORT.
* sysdeps/x86_64/configure: Regenerated.
* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Add
AVX-512 zmm register support.
(_dl_x86_64_save_sse): Likewise.
(_dl_x86_64_restore_sse): Likewise.
* sysdeps/x86_64/dl-trampoline.h: Updated to support different
size vector registers.
* sysdeps/x86_64/link-defines.sym (YMM_SIZE): New.
(ZMM_SIZE): Likewise.
* sysdeps/x86_64/tst-audit10.c: New file.
* sysdeps/x86_64/tst-auditmod10a.c: Likewise.
* sysdeps/x86_64/tst-auditmod10b.c: Likewise.

10 years agoUse __ehdr_start, when available, for rtld to get its own headers.
Roland McGrath [Thu, 13 Mar 2014 17:38:27 +0000 (10:38 -0700)]
Use __ehdr_start, when available, for rtld to get its own headers.

10 years agoChangeLog format fix.
Roland McGrath [Thu, 13 Mar 2014 17:36:14 +0000 (10:36 -0700)]
ChangeLog format fix.

10 years agoAdd missing elf/tst-pie2.c -- should have been in
Paul Pluzhnikov [Thu, 13 Mar 2014 15:19:18 +0000 (08:19 -0700)]
Add missing elf/tst-pie2.c -- should have been in
commit 798212a01311491d5e14fcda687460b75f8ca286

10 years agoRegenerate INSTALL.
Joseph Myers [Thu, 13 Mar 2014 15:01:15 +0000 (15:01 +0000)]
Regenerate INSTALL.

10 years agomanual/setjmp.texi: Improve clarity of Sys V context doc
Will Newton [Mon, 3 Mar 2014 06:28:33 +0000 (06:28 +0000)]
manual/setjmp.texi: Improve clarity of Sys V context doc

ChangeLog:

2014-03-13  Will Newton  <will.newton@linaro.org>

* manual/setjmp.texi (System V contexts): Improve
clarity and grammar of documentation.

10 years ago2014-03-12 Paul Pluzhnikov <ppluzhnikov@google.com>
Paul Pluzhnikov [Wed, 12 Mar 2014 22:58:39 +0000 (15:58 -0700)]
2014-03-12  Paul Pluzhnikov  <ppluzhnikov@google.com>

[BZ #16381]

* elf/Makefile (tests): Add tst-pie2.
        (tests-pie): Add tst-pie2.
* elf/tst-pie2.c: New file.
* elf/dl-load.c (_dl_map_object_from_fd): Assert correct l_type
for ET_EXEC.
* elf/rtld.c (map_doit): Load executable as lt_executable.
(dl_main): Likewise.

10 years agoFix __ASSUME_PSELECT for MicroBlaze (bug 16642).
Joseph Myers [Wed, 12 Mar 2014 17:29:24 +0000 (17:29 +0000)]
Fix __ASSUME_PSELECT for MicroBlaze (bug 16642).

Reviewing (for all architectures, with a baseline kernel version of
2.6.32) the kernel support for features for which __ASSUME_* macros
would be affected by a move to 2.6.32 as minimum kernel version showed
up that __ASSUME_PSELECT was wrongly defined for MicroBlaze, despite
the corresponding syscall table entry not being wired up in the
MicroBlaze kernel.

This patch makes the MicroBlaze kernel-features.h undefine
__ASSUME_PSELECT.  I'd also encourage wiring it up in the kernel (so
you can then make this #undef conditional, and eventually obsolete
once a recent-enough kernel is required).  I suspect it wasn't wired
up because of the mistaken comment in asm/unistd.h "obsolete ->
sys_pselect7" (there is no such syscall as pselect7).

[BZ #16642]
* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
(__ASSUME_PSELECT): Undefine.

10 years agoPowerPC: Fix bzero definition for static libc for PPC32
Adhemerval Zanella [Wed, 12 Mar 2014 13:55:50 +0000 (08:55 -0500)]
PowerPC: Fix bzero definition for static libc for PPC32

This patch fixes an issue for powerpc32-fpu static build which fails
with an 'bzero' undefined reference. This patch adds bzero ifunc selector
for static builds and fixes the '__bzero_ppc' reference to default
memset symbol (since static memset build does not provide ifunc
selector).

Fixes BZ#16689.

10 years agoProvide correct buffer length to netgroup queries in nscd (BZ #16695)
Siddhesh Poyarekar [Wed, 12 Mar 2014 11:57:22 +0000 (17:27 +0530)]
Provide correct buffer length to netgroup queries in nscd (BZ #16695)

The buffer to query netgroup entries is allocated sufficient space for
the netgroup entries and the key to be appended at the end, but it
sends in an incorrect available length to the NSS netgroup query
functions, resulting in overflow of the buffer in some special cases.
The fix here is to factor in the key length when sending the available
buffer and buffer length to the query functions.

10 years agoPowerPC: Fix strspn for static build
Adhemerval Zanella [Tue, 11 Mar 2014 21:17:50 +0000 (16:17 -0500)]
PowerPC: Fix strspn for static build

This patch makes the strspn ifunc selector build for static builds.

10 years agoFix MIPS libc_feresetround*_ctx to preserve exceptions.
Joseph Myers [Tue, 11 Mar 2014 22:30:40 +0000 (22:30 +0000)]
Fix MIPS libc_feresetround*_ctx to preserve exceptions.

Testing on mips64 showed missing underflow exceptions (from exp, for
example) in non-default rounding modes, caused by
libc_feresetround*_ctx wrongly restoring a saved environment without
preserving exceptions, when that's only valid for the _noex variants.
(I don't know why Steve didn't see this in his testing.)  This patch
fixes this by using libc_feupdateenv_mips_ctx for the relevant macros
and removing the problem definitions.

The problem definitions aren't suitable for the _noex macros either
because they only discard exceptions in non-default rounding modes,
and while for some uses of *_noex/*_NOEX it doesn't matter whether
exceptions are discarded, dbl-64/e_remainder.c requires
SET_RESTORE_ROUND_NOEX to cause exceptions to be discarded.  I think
the accumulated set of macros / functions for optimized exception /
rounding mode handling could do with a careful review by now, and
possible refactoring, and at least one new feature (extracting the
saved rounding mode from an environment / context variable - see
dbl-64/e_sqrt.c for a case where this could be used).

Tested mips64.

* sysdeps/mips/math_private.h [__mips_hard_float]
(libc_feresetround_ctx): Define to libc_feupdateenv_mips_ctx not
libc_feresetround_mips_ctx.
[__mips_hard_float] (libc_feresetroundf_ctx): Likewise.
[__mips_hard_float] (libc_feresetroundl_ctx): Likewise.
[__mips_hard_float] (libc_feresetround_mips_ctx): Remove.

10 years agoFix nextafter overflow in non-default rounding modes (bug 16677).
Joseph Myers [Tue, 11 Mar 2014 22:24:00 +0000 (22:24 +0000)]
Fix nextafter overflow in non-default rounding modes (bug 16677).

ISO C requires the result of nextafter to be independent of the
rounding mode, even when underflow or overflow occurs.  This patch
fixes the bug in various nextafter implementations that, having done
an overflowing computation to force an overflow exception (correct),
they then return the result of that computation rather than an
infinity computed some other way (incorrect, when the overflowing
result of arithmetic with that sign and rounding mode is finite but
the correct result is infinite) - generally by falling through to
existing code to return a value that in fact is correct for this case
(but was computed by an integer increment and so without generating
the exceptions required).  Having fixed the bug, the previously
deferred conversion of nextafter testing in libm-test.inc to
ALL_RM_TEST is also included.

Tested x86_64 and x86; also spot-checked results of nextafter tests
for powerpc32 and mips64 to test the ldbl-128ibm and ldbl-128
changes.  (The m68k change is untested.)

[BZ #16677]
* math/s_nextafter.c (__nextafter): Do not return value from
overflowing computation.
* sysdeps/i386/fpu/s_nextafterl.c (__nextafterl): Likewise.
* sysdeps/ieee754/flt-32/s_nextafterf.c (__nextafterf): Likewise.
* sysdeps/ieee754/ldbl-128/s_nextafterl.c (__nextafterl):
Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl):
Likewise.
* sysdeps/m68k/m680x0/fpu/s_nextafterl.c (__nextafterl): Likewise.
* math/libm-test.inc (nextafter_test): Use ALL_RM_TEST.

10 years agoARM: Fix up setjmp/longjmp changes sfi_* macro use.
Roland McGrath [Tue, 11 Mar 2014 17:59:01 +0000 (10:59 -0700)]
ARM: Fix up setjmp/longjmp changes sfi_* macro use.

10 years agoPowerPC: Fix bzero definition for static libc for PPC64
Adhemerval Zanella [Mon, 10 Mar 2014 20:26:20 +0000 (15:26 -0500)]
PowerPC: Fix bzero definition for static libc for PPC64

This patch fixes an issue for powerpc64[le] static build where __bzero
is definied in multiple places (memset-ppc64.o and bzero.o). It is now
defined only in bzero.o and memset-ppc64.o only defined __bzero_ppc for
both dynamic and static library.

Fixes BZ#16683.

10 years agoPowerPC: strspn optimization for PPC64/POWER7
Vidya Ranganathan [Mon, 10 Mar 2014 16:20:36 +0000 (12:20 -0400)]
PowerPC: strspn optimization for PPC64/POWER7

The optimization is achieved by following techniques:
  > hashing of needle.
  > hashing avoids scanning of duplicate entries in needle across the string.
  > initializing the hash table with Vector instructions (VSX) by quadword access.
  > unrolling when scanning for character in string across hash table.

10 years agoPowerPC: strncat optimization for PPC64
Adhemerval Zanella [Fri, 7 Mar 2014 12:09:47 +0000 (06:09 -0600)]
PowerPC: strncat optimization for PPC64

The optimization is achieved by following techniques:
1. Doubleword aligned memory access and compares using
   cmpb instruction.
2. Loop unrolling for byte load/store.
3. CPU pre-fetch to avoid cache miss.

10 years agoMark nscd service as forking in systemd service file (BZ #16639)
Siddhesh Poyarekar [Mon, 10 Mar 2014 07:47:54 +0000 (13:17 +0530)]
Mark nscd service as forking in systemd service file (BZ #16639)

Currently the nscd service is installed in systemd as a simple
service, which means that it is able to handle its own errors and does
not quit.  Since nscd does not fit that description, i.e. it can exit
on errors like, say, failing to parse nscd.conf, it should be declared
as forking instead.

10 years agoPowerPC: Fix modf/modff optimization return sign
Adhemerval Zanella [Sat, 8 Mar 2014 17:24:32 +0000 (11:24 -0600)]
PowerPC: Fix modf/modff optimization return sign

This patch fix the optimized powerpc-fpu modf/modff implementation
when using in non-default rounding mode where the zero sign is not
as expected. It fixes the libm testsuite tests

  modf_downward (0)  == 0.00000000000000000000e+00
  modf_downward (20) == 0.00000000000000000000e+00
  modf_downward (21) == 0.00000000000000000000e+00

Where the sign returned was negative.

10 years agoAdd libm-test.inc macro for all-rounding-modes testing.
Joseph Myers [Sat, 8 Mar 2014 14:08:38 +0000 (14:08 +0000)]
Add libm-test.inc macro for all-rounding-modes testing.

This patch adds support in libm-test.inc for automatically running
tests of a function in all rounding modes, in the form of a macro
ALL_RM_TEST to loop over all rounding modes when running tests of a
function, and uses it for functions whose results should always be
independent of the rounding mode.

Conversion of tests of nextafter to ALL_RM_TEST was deferred because
trying that conversion showed up bug 16677.  (Finding such a bug of
course illustrates the point of testing more systematically in all
rounding modes rather than only reactively when bugs get reported in a
particular function in a non-default mode.)  Conversion of tests where
results can depend on the rounding mode will follow once I add
gen-libm-test.pl support for using different initializers for the
expected results for different rounding modes (again, some conversions
may need deferring until bugs are fixed, depending on how
straightforward they are to XFAIL in a particular context).

Some existing tests get run five times rather than four, with
round-to-nearest tests both run in that as default rounding mode and
also with it explicitly set with fesetround (FE_TONEAREST).  This
duplication doesn't seem particularly useful, so ALL_RM_TEST only runs
tests four times.

Tested x86_64 and x86.

* math/libm-test.inc (ALL_RM_TEST): New macro.
(ceil_test): Use ALL_RM_TEST.
(cimag_test): Likewise.
(conj_test): Likewise.
(copysign_test): Likewise.
(cproj_test): Likewise.
(creal_test): Likewise.
(fabs_test): Likewise.
(floor_test): Likewise.
(fmax_test): Likewise.
(fmin_test): Likewise.
(fmod_test): Likewise.
(fpclassify_test): Likewise.
(frexp_test): Likewise.
(ilogb_test): Likewise.
(isfinite_test): Likewise.
(finite_test): Likewise.
(isgreater_test): Likewise.
(isgreaterequal_test): Likewise.
(isinf_test): Likewise.
(isless_test): Likewise.
(islessequal_test): Likewise.
(islessgreater_test): Likewise.
(isnan_test): Likewise.
(isnormal_test): Likewise.
(issignaling_test): Likewise.
(isunordered_test): Likewise.
(logb_test): Likewise.
(logb_downward_test_data): Remove.
(logb_test_downward): Likewise.
(lround_test): Use ALL_RM_TEST.
(llround_test): Likewise.
(modf_test): Likewise.
(nexttoward_test): Likewise.
(remainder_test): Likewise.
(drem_test): Likewise.
(remainder_tonearest_test_data): Likewise.
(remainder_test_tonearest): Likewise.
(drem_test_tonearest): Likewise.
(remainder_towardzero_test_data): Likewise.
(remainder_test_towardzero): Likewise.
(drem_test_towardzero): Likewise.
(remainder_downward_test_data): Likewise.
(remainder_test_downward): Likewise.
(drem_test_downward): Likewise.
(remainder_upward_test_data): Likewise.
(remainder_test_upward): Likewise.
(drem_test_upward): Likewise.
(remquo_test): Use ALL_RM_TEST.  Remove comment about x.
(round_test): Use ALL_RM_TEST.
(signbit_test): Likewise.
(trunc_test): Likewise.
(significand_test): Likewise.
(main): Don't call removed functions.

10 years agoFix POSIX namespace for <bits/siginfo.h> (bug 16674).
Joseph Myers [Fri, 7 Mar 2014 23:57:56 +0000 (23:57 +0000)]
Fix POSIX namespace for <bits/siginfo.h> (bug 16674).

<bits/siginfo.h> causes symbols ILL_*, FPE_*, SEGV_* BUS_*, CLD_*,
POLL_* and TRAP_* to be exposed in <signal.h> (and <sys/wait.h>), even
though those symbols are not in non-XSI POSIX before POSIX.1-2008 and
even in POSIX.1-2008 the TRAP_* symbols are XSI-only.  This patch
conditions the symbols appropriately in the various <bits/siginfo.h>
implementations (various <signal.h> and <sys/wait.h> conformtest
issues remain for standards other than POSIX (1995/6)).  Tested
x86_64.

[BZ #16674]
* bits/siginfo.h (ILL_ILLOPC): Condition on [__USE_XOPEN_EXTENDED
|| __USE_XOPEN2K8].
(ILL_ILLOPN): Likewise.
(ILL_ILLADR): Likewise.
(ILL_ILLTRP): Likewise.
(ILL_PRVOPC): Likewise.
(ILL_PRVREG): Likewise.
(ILL_COPROC): Likewise.
(ILL_BADSTK): Likewise.
(FPE_INTDIV): Likewise.
(FPE_INTOVF): Likewise.
(FPE_FLTDIV): Likewise.
(FPE_FLTOVF): Likewise.
(FPE_FLTUND): Likewise.
(FPE_FLTRES): Likewise.
(FPE_FLTINV): Likewise.
(FPE_FLTSUB): Likewise.
(SEGV_MAPERR): Likewise.
(SEGV_ACCERR): Likewise.
(BUS_ADRALN): Likewise.
(BUS_ADRERR): Likewise.
(BUS_OBJERR): Likewise.
(TRAP_BRKPT): Condition on [__USE_XOPEN_EXTENDED].
(TRAP_TRACE): Likewise.
(CLD_EXITED): Condition on [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(CLD_KILLED): Likewise.
(CLD_DUMPED): Likewise.
(CLD_TRAPPED): Likewise.
(CLD_STOPPED): Likewise.
(CLD_CONTINUED): Likewise.
(POLL_IN): Likewise.
(POLL_OUT): Likewise.
(POLL_MSG): Likewise.
(POLL_ERR): Likewise.
(POLL_PRI): Likewise.
(POLL_HUP): Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/siginfo.h (ILL_ILLOPC):
Likewise.
(ILL_ILLOPN): Likewise.
(ILL_ILLADR): Likewise.
(ILL_ILLTRP): Likewise.
(ILL_PRVOPC): Likewise.
(ILL_PRVREG): Likewise.
(ILL_COPROC): Likewise.
(ILL_BADSTK): Likewise.
(FPE_INTDIV): Likewise.
(FPE_INTOVF): Likewise.
(FPE_FLTDIV): Likewise.
(FPE_FLTOVF): Likewise.
(FPE_FLTUND): Likewise.
(FPE_FLTRES): Likewise.
(FPE_FLTINV): Likewise.
(FPE_FLTSUB): Likewise.
(SEGV_MAPERR): Likewise.
(SEGV_ACCERR): Likewise.
(BUS_ADRALN): Likewise.
(BUS_ADRERR): Likewise.
(BUS_OBJERR): Likewise.
(BUS_MCEERR_AR): Likewise.
(BUS_MCEERR_AO): Likewise.
(TRAP_BRKPT): Condition on [__USE_XOPEN_EXTENDED].
(TRAP_TRACE): Likewise.
(CLD_EXITED): Condition on [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(CLD_KILLED): Likewise.
(CLD_DUMPED): Likewise.
(CLD_TRAPPED): Likewise.
(CLD_STOPPED): Likewise.
(CLD_CONTINUED): Likewise.
(POLL_IN): Likewise.
(POLL_OUT): Likewise.
(POLL_MSG): Likewise.
(POLL_ERR): Likewise.
(POLL_PRI): Likewise.
(POLL_HUP): Likewise.
* sysdeps/unix/sysv/linux/bits/siginfo.h (ILL_ILLOPC): Likewise.
(ILL_ILLOPN): Likewise.
(ILL_ILLADR): Likewise.
(ILL_ILLTRP): Likewise.
(ILL_PRVOPC): Likewise.
(ILL_PRVREG): Likewise.
(ILL_COPROC): Likewise.
(ILL_BADSTK): Likewise.
(FPE_INTDIV): Likewise.
(FPE_INTOVF): Likewise.
(FPE_FLTDIV): Likewise.
(FPE_FLTOVF): Likewise.
(FPE_FLTUND): Likewise.
(FPE_FLTRES): Likewise.
(FPE_FLTINV): Likewise.
(FPE_FLTSUB): Likewise.
(SEGV_MAPERR): Likewise.
(SEGV_ACCERR): Likewise.
(BUS_ADRALN): Likewise.
(BUS_ADRERR): Likewise.
(BUS_OBJERR): Likewise.
(BUS_MCEERR_AR): Likewise.
(BUS_MCEERR_AO): Likewise.
(TRAP_BRKPT): Condition on [__USE_XOPEN_EXTENDED].
(TRAP_TRACE): Likewise.
(CLD_EXITED): Condition on [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(CLD_KILLED): Likewise.
(CLD_DUMPED): Likewise.
(CLD_TRAPPED): Likewise.
(CLD_STOPPED): Likewise.
(CLD_CONTINUED): Likewise.
(POLL_IN): Likewise.
(POLL_OUT): Likewise.
(POLL_MSG): Likewise.
(POLL_ERR): Likewise.
(POLL_PRI): Likewise.
(POLL_HUP): Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/siginfo.h (ILL_ILLOPC):
Likewise.
(ILL_ILLOPN): Likewise.
(ILL_ILLADR): Likewise.
(ILL_ILLTRP): Likewise.
(ILL_PRVOPC): Likewise.
(ILL_PRVREG): Likewise.
(ILL_COPROC): Likewise.
(ILL_BADSTK): Likewise.
(ILL_BADIADDR): Likewise.
(ILL_BREAK): Likewise.
(FPE_INTDIV): Likewise.
(FPE_INTOVF): Likewise.
(FPE_FLTDIV): Likewise.
(FPE_FLTOVF): Likewise.
(FPE_FLTUND): Likewise.
(FPE_FLTRES): Likewise.
(FPE_FLTINV): Likewise.
(FPE_FLTSUB): Likewise.
(FPE_DECOVF): Likewise.
(FPE_DECDIV): Likewise.
(FPE_DECERR): Likewise.
(FPE_INVASC): Likewise.
(FPE_INVDEC): Likewise.
(SEGV_MAPERR): Likewise.
(SEGV_ACCERR): Likewise.
(SEGV_PSTKOVF): Likewise.
(BUS_ADRALN): Likewise.
(BUS_ADRERR): Likewise.
(BUS_OBJERR): Likewise.
(BUS_MCEERR_AR): Likewise.
(BUS_MCEERR_AO): Likewise.
(TRAP_BRKPT): Condition on [__USE_XOPEN_EXTENDED].
(TRAP_TRACE): Likewise.
(TRAP_BRANCH): Likewise.
(TRAP_HWBKPT): Likewise.
(CLD_EXITED): Condition on [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(CLD_KILLED): Likewise.
(CLD_DUMPED): Likewise.
(CLD_TRAPPED): Likewise.
(CLD_STOPPED): Likewise.
(CLD_CONTINUED): Likewise.
(POLL_IN): Likewise.
(POLL_OUT): Likewise.
(POLL_MSG): Likewise.
(POLL_ERR): Likewise.
(POLL_PRI): Likewise.
(POLL_HUP): Likewise.
* sysdeps/unix/sysv/linux/mips/bits/siginfo.h (ILL_ILLOPC): Likewise.
(ILL_ILLOPN): Likewise.
(ILL_ILLADR): Likewise.
(ILL_ILLTRP): Likewise.
(ILL_PRVOPC): Likewise.
(ILL_PRVREG): Likewise.
(ILL_COPROC): Likewise.
(ILL_BADSTK): Likewise.
(FPE_INTDIV): Likewise.
(FPE_INTOVF): Likewise.
(FPE_FLTDIV): Likewise.
(FPE_FLTOVF): Likewise.
(FPE_FLTUND): Likewise.
(FPE_FLTRES): Likewise.
(FPE_FLTINV): Likewise.
(FPE_FLTSUB): Likewise.
(SEGV_MAPERR): Likewise.
(SEGV_ACCERR): Likewise.
(BUS_ADRALN): Likewise.
(BUS_ADRERR): Likewise.
(BUS_OBJERR): Likewise.
(BUS_MCEERR_AR): Likewise.
(BUS_MCEERR_AO): Likewise.
(TRAP_BRKPT): Condition on [__USE_XOPEN_EXTENDED].
(TRAP_TRACE): Likewise.
(CLD_EXITED): Condition on [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(CLD_KILLED): Likewise.
(CLD_DUMPED): Likewise.
(CLD_TRAPPED): Likewise.
(CLD_STOPPED): Likewise.
(CLD_CONTINUED): Likewise.
(POLL_IN): Likewise.
(POLL_OUT): Likewise.
(POLL_MSG): Likewise.
(POLL_ERR): Likewise.
(POLL_PRI): Likewise.
(POLL_HUP): Likewise.
* sysdeps/unix/sysv/linux/s390/bits/siginfo.h (ILL_ILLOPC): Likewise.
(ILL_ILLOPN): Likewise.
(ILL_ILLADR): Likewise.
(ILL_ILLTRP): Likewise.
(ILL_PRVOPC): Likewise.
(ILL_PRVREG): Likewise.
(ILL_COPROC): Likewise.
(ILL_BADSTK): Likewise.
(FPE_INTDIV): Likewise.
(FPE_INTOVF): Likewise.
(FPE_FLTDIV): Likewise.
(FPE_FLTOVF): Likewise.
(FPE_FLTUND): Likewise.
(FPE_FLTRES): Likewise.
(FPE_FLTINV): Likewise.
(FPE_FLTSUB): Likewise.
(SEGV_MAPERR): Likewise.
(SEGV_ACCERR): Likewise.
(BUS_ADRALN): Likewise.
(BUS_ADRERR): Likewise.
(BUS_OBJERR): Likewise.
(BUS_MCEERR_AR): Likewise.
(BUS_MCEERR_AO): Likewise.
(TRAP_BRKPT): Condition on [__USE_XOPEN_EXTENDED].
(TRAP_TRACE): Likewise.
(CLD_EXITED): Condition on [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(CLD_KILLED): Likewise.
(CLD_DUMPED): Likewise.
(CLD_TRAPPED): Likewise.
(CLD_STOPPED): Likewise.
(CLD_CONTINUED): Likewise.
(POLL_IN): Likewise.
(POLL_OUT): Likewise.
(POLL_MSG): Likewise.
(POLL_ERR): Likewise.
(POLL_PRI): Likewise.
(POLL_HUP): Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h (ILL_ILLOPC): Likewise.
(ILL_ILLOPN): Likewise.
(ILL_ILLADR): Likewise.
(ILL_ILLTRP): Likewise.
(ILL_PRVOPC): Likewise.
(ILL_PRVREG): Likewise.
(ILL_COPROC): Likewise.
(ILL_BADSTK): Likewise.
(FPE_INTDIV): Likewise.
(FPE_INTOVF): Likewise.
(FPE_FLTDIV): Likewise.
(FPE_FLTOVF): Likewise.
(FPE_FLTUND): Likewise.
(FPE_FLTRES): Likewise.
(FPE_FLTINV): Likewise.
(FPE_FLTSUB): Likewise.
(SEGV_MAPERR): Likewise.
(SEGV_ACCERR): Likewise.
(BUS_ADRALN): Likewise.
(BUS_ADRERR): Likewise.
(BUS_OBJERR): Likewise.
(BUS_MCEERR_AR): Likewise.
(BUS_MCEERR_AO): Likewise.
(TRAP_BRKPT): Condition on [__USE_XOPEN_EXTENDED].
(TRAP_TRACE): Likewise.
(CLD_EXITED): Condition on [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(CLD_KILLED): Likewise.
(CLD_DUMPED): Likewise.
(CLD_TRAPPED): Likewise.
(CLD_STOPPED): Likewise.
(CLD_CONTINUED): Likewise.
(POLL_IN): Likewise.
(POLL_OUT): Likewise.
(POLL_MSG): Likewise.
(POLL_ERR): Likewise.
(POLL_PRI): Likewise.
(POLL_HUP): Likewise.
* sysdeps/unix/sysv/linux/tile/bits/siginfo.h (ILL_ILLOPC): Likewise.
(ILL_ILLOPN): Likewise.
(ILL_ILLADR): Likewise.
(ILL_ILLTRP): Likewise.
(ILL_PRVOPC): Likewise.
(ILL_PRVREG): Likewise.
(ILL_COPROC): Likewise.
(ILL_BADSTK): Likewise.
(ILL_DBLFLT): Likewise.
(ILL_HARDWALL): Likewise.
(FPE_INTDIV): Likewise.
(FPE_INTOVF): Likewise.
(FPE_FLTDIV): Likewise.
(FPE_FLTOVF): Likewise.
(FPE_FLTUND): Likewise.
(FPE_FLTRES): Likewise.
(FPE_FLTINV): Likewise.
(FPE_FLTSUB): Likewise.
(SEGV_MAPERR): Likewise.
(SEGV_ACCERR): Likewise.
(BUS_ADRALN): Likewise.
(BUS_ADRERR): Likewise.
(BUS_OBJERR): Likewise.
(BUS_MCEERR_AR): Likewise.
(BUS_MCEERR_AO): Likewise.
(TRAP_BRKPT): Condition on [__USE_XOPEN_EXTENDED].
(TRAP_TRACE): Likewise.
(CLD_EXITED): Condition on [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(CLD_KILLED): Likewise.
(CLD_DUMPED): Likewise.
(CLD_TRAPPED): Likewise.
(CLD_STOPPED): Likewise.
(CLD_CONTINUED): Likewise.
(POLL_IN): Likewise.
(POLL_OUT): Likewise.
(POLL_MSG): Likewise.
(POLL_ERR): Likewise.
(POLL_PRI): Likewise.
(POLL_HUP): Likewise.
* sysdeps/unix/sysv/linux/x86/bits/siginfo.h (ILL_ILLOPC): Likewise.
(ILL_ILLOPN): Likewise.
(ILL_ILLADR): Likewise.
(ILL_ILLTRP): Likewise.
(ILL_PRVOPC): Likewise.
(ILL_PRVREG): Likewise.
(ILL_COPROC): Likewise.
(ILL_BADSTK): Likewise.
(FPE_INTDIV): Likewise.
(FPE_INTOVF): Likewise.
(FPE_FLTDIV): Likewise.
(FPE_FLTOVF): Likewise.
(FPE_FLTUND): Likewise.
(FPE_FLTRES): Likewise.
(FPE_FLTINV): Likewise.
(FPE_FLTSUB): Likewise.
(SEGV_MAPERR): Likewise.
(SEGV_ACCERR): Likewise.
(BUS_ADRALN): Likewise.
(BUS_ADRERR): Likewise.
(BUS_OBJERR): Likewise.
(BUS_MCEERR_AR): Likewise.
(BUS_MCEERR_AO): Likewise.
(TRAP_BRKPT): Condition on [__USE_XOPEN_EXTENDED].
(TRAP_TRACE): Likewise.
(CLD_EXITED): Condition on [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(CLD_KILLED): Likewise.
(CLD_DUMPED): Likewise.
(CLD_TRAPPED): Likewise.
(CLD_STOPPED): Likewise.
(CLD_CONTINUED): Likewise.
(POLL_IN): Likewise.
(POLL_OUT): Likewise.
(POLL_MSG): Likewise.
(POLL_ERR): Likewise.
(POLL_PRI): Likewise.
(POLL_HUP): Likewise.
* conform/Makefile (test-xfail-POSIX/signal.h/conform): Remove.
(test-xfail-POSIX/sys/wait.h/conform): Likewise.

10 years agoInclude all of <time.h> from <sched.h> for older standards (bug 16670).
Joseph Myers [Fri, 7 Mar 2014 20:54:03 +0000 (20:54 +0000)]
Include all of <time.h> from <sched.h> for older standards (bug 16670).

This patch fixes one of the header namespace issues shown up by
conformtest, <sched.h> failing to expose all symbols from <time.h> as
required by older standards.  The patch keeps the existing behavior if
__USE_XOPEN2K is defined (the default; POSIX.1-2001 was the version
that made it optional to expose these symbols), but ensures that all
the symbols from <time.h> are exposed if an older standard is
selected.  Tested x86_64.

[BZ #16670]
* posix/sched.h [!__USE_XOPEN2K] (__need_time_t): Don't define
before #include of <time.h>.
[!__USE_XOPEN2K] (__need_timespec): Likewise.
* conform/Makefile (test-xfail-POSIX/sched.h/conform): Remove.
(test-xfail-UNIX98/sched.h/conform): Likewise.

10 years ago[PATCH] [AArch64] Optional trapping exceptions support.
Marcus Shawcroft [Fri, 7 Mar 2014 14:05:20 +0000 (14:05 +0000)]
[PATCH] [AArch64] Optional trapping exceptions support.

Trapping exceptions in AArch64 are optional.  The relevant exception
control bits in FPCR are are defined as RES0 hence the absence of
support can be detected by reading back the FPCR and comparing with
the desired value.

10 years agoCount miscellaneous files built on host for testing as tests.
Joseph Myers [Fri, 7 Mar 2014 03:31:41 +0000 (03:31 +0000)]
Count miscellaneous files built on host for testing as tests.

In <https://sourceware.org/ml/libc-alpha/2014-01/msg00198.html> I
raised the question of counting miscellaneous dependencies of tests,
built on the host rather than the build system, as tests, so that when
test failures don't stop "make check" neither do those other builds on
the host, so that a flaky host doesn't stop "make check" from
producing a complete summary of test results.  Brooks supported that
idea in <https://sourceware.org/ml/libc-alpha/2014-02/msg00301.html>.

This patch implements that change for all the examples I could find:
one message catalog in catgets/, locales in localedata/ and timezone
files in timezone/.

Tested x86_64.

* catgets/Makefile (tests-special): Add $(objpfx)sample.SJIS.cat.
($(objpfx)sample.SJIS.cat): Use $(evaluate-test).
* timezone/Makefile (testdata): Move definition above include of
Rules.
(test-zones): New variable.
(tests-special): Add zone files.
(build-testdata): Use $(evaluate-test).

localedata/ChangeLog:
* Makefile (LOCALES): Move definition above include of Rules.
(LOCALE_SRCS): Likewise.
(CHARMAPS): Likewise.
(CTYPE_FILES): Likewise.
(tests-special): Add locale files.
($(addprefix $(objpfx),$(CTYPE_FILES))): Use $(evaluate-test).

10 years agoMake tests consistently use *.out output files.
Joseph Myers [Fri, 7 Mar 2014 03:29:23 +0000 (03:29 +0000)]
Make tests consistently use *.out output files.

This patch systematically renames miscellaneous tests so their outputs
use a *.out name (unless the test is just running some glibc program
with its conventional output file name, rather than a special program
at all, as in catgets tests generating *.cat).  In the case of the
iconv test test-iconvconfig, output is redirected where it wasn't
before.

In various places the "generated" variable is updated to reflect the
revised test names; in iconvdata/Makefile a typo (mmtrace-tst-loading)
is also fixed.  resolv/Makefile sets both "generate" (which appears
unused) and "generated".  Bitrot in the settings of these variables
could no doubt be fixed so that "make clean" after build and testing
leaves results the same as after configure (and indeed the
tests-special / xtests-special variables could be used to simplify
things, by removing those files automatically rather than listing them
manually in these variables), and "make distclean" leaves an empty
build directory, but right now it appears various files don't get
deleted.  I think they are liable to continue to bitrot in the absence
of routine testing that these targets actually work, given that
building in the source directory isn't supported and that was the main
use of such makefile targets.

Tested x86_64.

* elf/Makefile (tests-special): Rename tests to end with .out.
($(objpfx)noload-mem): Likewise.
($(objpfx)tst-leaks1-mem): Likewise.
($(objpfx)tst-leaks1-static-mem.out): Likewise.
* iconv/Makefile (xtests-special): Change test-iconvconfig to
$(objpfx)test-iconvconfig.out.
(test-iconvconfig): Change to $(objpfx)test-iconvconfig.out.  Use
set -e inside subshell and redirect output to file.
* iconvdata/Makefile (generated): Rename tests to end with .out.
Correct type.
(tests-special): Rename tests to end with .out.
($(objpfx)mtrace-tst-loading): Likewise.
* intl/Makefile (generated): Likewise.
(tests-special): Likewise.
($(objpfx)mtrace-tst-gettext): Likewise.
* misc/Makefile (generated): Likewise.
(tests-special): Likewise.
($(objpfx)tst-error1-mem): Likewise.
* nptl/Makefile (tests-special): Likewise.
($(objpfx)tst-stack3-mem): Likewise.
(generated): Likewise.
* posix/Makefile (generated): Likewise.
(tests-special): Likewise.
(xtests-special): Likewise.
($(objpfx)tst-fnmatch-mem): Likewise.
($(objpfx)bug-regex2-mem): Likewise.
($(objpfx)bug-regex14-mem): Likewise.
($(objpfx)bug-regex21-mem): Likewise.
($(objpfx)bug-regex31-mem): Likewise.
($(objpfx)tst-vfork3-mem): Likewise.
($(objpfx)tst-rxspencer-no-utf8-mem): Likewise.
($(objpfx)tst-pcre-mem): Likewise.
($(objpfx)tst-boost-mem): Likewise.
($(objpfx)bug-ga2-mem): Likewise.
($(objpfx)bug-glob2-mem): Likewise.
* resolv/Makefile (generate): Likewise.
(tests-special): Likewise.
(xtests-special): Likewise.
(generated): Likewise.
($(objpfx)mtrace-tst-leaks): Likewise.
($(objpfx)mtrace-tst-leaks2): Likewise.

localedata:
* Makefile (generated): Rename tests to end with .out.
(tests-special): Likewise.
($(objpfx)mtrace-tst-leaks): Likewise.