platform/upstream/glibc.git
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.

10 years agoGenerate overall summary of test results.
Joseph Myers [Fri, 7 Mar 2014 03:25:57 +0000 (03:25 +0000)]
Generate overall summary of test results.

This patch, an updated version of
<https://sourceware.org/ml/libc-alpha/2014-01/msg00197.html>, makes
testsuite runs generate an overall summary of test results.

A new script merge-test-results.sh deals both with collecting results
within a directory to a file with all the results from that directory,
and collecting the results from subdirectories into a single overall
file (there's not much in common between the two modes of operation of
the script, but it seemed silly to have two separate scripts for
this).  Within a directory, missing results produce UNRESOLVED lines;
at top level, missing results for a whole directory produce an ERROR
line (since toplevel can't identify what the specific missing tests
are in this case).

Note that this does not change the rules for when "make" considers
there has been an error, or terminates, so unexpected failures will
still cause make to terminate, or, with -k, mean the commands for
"tests" don't get run because of failure of a dependency.

Tested x86_64, including that the summary does in fact reflect all the
tests with .test-result files.

* scripts/merge-test-results.sh: New file.
* Makefile (tests-special-notdir): New variable.
(tests): Run merge-test-results.sh.
(xtests): Likewise.
* Rules (tests-special-notdir): New variable.
(xtests-special-notdir): Likewise.
(tests): Run merge-test-results.sh
(xtests): Likewise.

10 years agoconformtest: split up running of tests from makefile.
Joseph Myers [Fri, 7 Mar 2014 03:23:34 +0000 (03:23 +0000)]
conformtest: split up running of tests from makefile.

This patch changes the logic by which header conformance tests are run
so that the makefiles run the tests for each (standard, header) pair
separately rather than as a single test (there are 518 such pairs
being tested at present).

Since these tests are slow and previously couldn't be run in parallel,
this obviously speeds up the whole test run significantly when using
parallel testing.  There are other benefits.  These tests can now be
marked as expected to fail at the level of (standard, header) pairs,
meaning that regressions introduced by a header change are much more
likely to be spotted (of course, such a regression could be a bug in
the header or in the expectations, most of which have not been
properly checked against the relevant standards).

The patch introduces lists in conform/Makefile of the headers to test
for each standard, with a new (quick) test for each standard that the
list agrees with the set of headers for which there are in fact
nonempty expectations for that standard.  This means that each of the
518 pairs being tested is actually something meaningful to test rather
than a null test.  I also hope to use these lists of headers in
various standards in future tests for namespace violations where a
function in a standard is implemented to call a non-reserved name for
a function outside that standard.

Although there are a lot of tests now marked as expected to fail, I
expect most of those to be easy to fix (whether with fixes to the
expectations, the headers or both - if fixing a header bug, of course
file it in Bugzilla first); only a limited number are likely to
reflect actual missing features in glibc.

Tested x86_64 (GCC 4.7 branch).  It's quite possible some failures
vary from platform to platform, in which case either additional XFAILs
can be added here, or platform-specific header bugs (if applicable)
the failures show up can be fixed.  I made XFAILs unconditional for
tests that should only fail for GCC 4.6 and earlier; we could make the
GCC version available in the makefiles and condition these, but simply
moving the XFAILing to a finer granularity seems a clear improvement
on the previous state of the whole of conformtest being XFAILed.

* Makeconfig (test-xfail-name): New variable.
(evaluate-test): Use $(test-xfail-name) instead of $(@F:.out=) to
compute variable name for expected failures.
* conform/Makefile (conformtest-headers-data): New variable.
(conformtest-standards): Likewise.
(conformtest-headers-ISO): Likewise.
(conformtest-headers-ISO99): Likewise.
(conformtest-headers-ISO11): Likewise.
(conformtest-headers-POSIX): Likewise.
(conformtest-headers-XPG3): Likewise.
(conformtest-headers-XPG4): Likewise.
(conformtest-headers-UNIX98): Likewise.
(conformtest-headers-XOPEN2K): Likewise.
(conformtest-headers-POSIX2008): Likewise.
(conformtest-headers-XOPEN2K8): Likewise.
(conformtest-header-list-base): Likewise.
(conformtest-header-list-tests): Likewise.
(conformtest-header-base): Likewise.
(conformtest-header-tests): Likewise.
(tests-special): Add $(conformtest-header-list-tests).  If
[$(fast-check) && !$(cross-compiling)], add
$(conformtest-header-tests) instead of
$(objpfx)run-conformtest.out.
(generated): Add $(conformtest-header-list-base).  If
[$(fast-check) && !$(cross-compiling)], add
$(conformtest-header-base).  Remove previous setting.
($(conformtest-header-list-tests)): New target.
(test-xfail-run-conformtest): Remove variable.
($(objpfx)run-conformtest.out): Remove target.
(test-xfail-ISO11/complex.h/conform): New variable.
(test-xfail-ISO11/stdalign.h/conform): Likewise.
(test-xfail-ISO11/stdnoreturn.h/conform): Likewise.
(test-xfail-XPG3/varargs.h/conform): Likewise.
(test-xfail-XPG4/varargs.h/conform): Likewise.
(test-xfail-UNIX98/varargs.h/conform): Likewise.
(test-xfail-XPG4/ndbm.h/conform): Likewise.
(test-xfail-UNIX98/ndbm.h/conform): Likewise.
(test-xfail-XOPEN2K/ndbm.h/conform): Likewise.
(test-xfail-XOPEN2K8/ndbm.h/conform): Likewise.
(test-xfail-XPG3/fcntl.h/conform): Likewise.
(test-xfail-XPG3/ftw.h/conform): Likewise.
(test-xfail-XPG3/grp.h/conform): Likewise.
(test-xfail-XPG3/langinfo.h/conform): Likewise.
(test-xfail-XPG3/limits.h/conform): Likewise.
(test-xfail-XPG3/pwd.h/conform): Likewise.
(test-xfail-XPG3/search.h/conform): Likewise.
(test-xfail-XPG3/signal.h/conform): Likewise.
(test-xfail-XPG3/stdio.h/conform): Likewise.
(test-xfail-XPG3/stdlib.h/conform): Likewise.
(test-xfail-XPG3/string.h/conform): Likewise.
(test-xfail-XPG3/sys/ipc.h/conform): Likewise.
(test-xfail-XPG3/sys/msg.h/conform): Likewise.
(test-xfail-XPG3/sys/sem.h/conform): Likewise.
(test-xfail-XPG3/sys/shm.h/conform): Likewise.
(test-xfail-XPG3/sys/stat.h/conform): Likewise.
(test-xfail-XPG3/sys/types.h/conform): Likewise.
(test-xfail-XPG3/sys/wait.h/conform): Likewise.
(test-xfail-XPG3/termios.h/conform): Likewise.
(test-xfail-XPG3/time.h/conform): Likewise.
(test-xfail-XPG3/unistd.h/conform): Likewise.
(test-xfail-XPG4/arpa/inet.h/conform): Likewise.
(test-xfail-XPG4/fcntl.h/conform): Likewise.
(test-xfail-XPG4/langinfo.h/conform): Likewise.
(test-xfail-XPG4/netdb.h/conform): Likewise.
(test-xfail-XPG4/netinet/in.h/conform): Likewise.
(test-xfail-XPG4/signal.h/conform): Likewise.
(test-xfail-XPG4/stdio.h/conform): Likewise.
(test-xfail-XPG4/stdlib.h/conform): Likewise.
(test-xfail-XPG4/stropts.h/conform): Likewise.
(test-xfail-XPG4/sys/ipc.h/conform): Likewise.
(test-xfail-XPG4/sys/msg.h/conform): Likewise.
(test-xfail-XPG4/sys/sem.h/conform): Likewise.
(test-xfail-XPG4/sys/shm.h/conform): Likewise.
(test-xfail-XPG4/sys/socket.h/conform): Likewise.
(test-xfail-XPG4/sys/stat.h/conform): Likewise.
(test-xfail-XPG4/sys/time.h/conform): Likewise.
(test-xfail-XPG4/sys/types.h/conform): Likewise.
(test-xfail-XPG4/sys/wait.h/conform): Likewise.
(test-xfail-XPG4/termios.h/conform): Likewise.
(test-xfail-XPG4/ucontext.h/conform): Likewise.
(test-xfail-XPG4/unistd.h/conform): Likewise.
(test-xfail-XPG4/utmpx.h/conform): Likewise.
(test-xfail-POSIX/sched.h/conform): Likewise.
(test-xfail-POSIX/signal.h/conform): Likewise.
(test-xfail-POSIX/sys/wait.h/conform): Likewise.
(test-xfail-POSIX/tar.h/conform): Likewise.
(test-xfail-UNIX98/arpa/inet.h/conform): Likewise.
(test-xfail-UNIX98/fcntl.h/conform): Likewise.
(test-xfail-UNIX98/langinfo.h/conform): Likewise.
(test-xfail-UNIX98/netdb.h/conform): Likewise.
(test-xfail-UNIX98/netinet/in.h/conform): Likewise.
(test-xfail-UNIX98/sched.h/conform): Likewise.
(test-xfail-UNIX98/signal.h/conform): Likewise.
(test-xfail-UNIX98/stdio.h/conform): Likewise.
(test-xfail-UNIX98/stdlib.h/conform): Likewise.
(test-xfail-UNIX98/stropts.h/conform): Likewise.
(test-xfail-UNIX98/sys/ipc.h/conform): Likewise.
(test-xfail-UNIX98/sys/msg.h/conform): Likewise.
(test-xfail-UNIX98/sys/sem.h/conform): Likewise.
(test-xfail-UNIX98/sys/shm.h/conform): Likewise.
(test-xfail-UNIX98/sys/socket.h/conform): Likewise.
(test-xfail-UNIX98/sys/time.h/conform): Likewise.
(test-xfail-UNIX98/sys/wait.h/conform): Likewise.
(test-xfail-UNIX98/ucontext.h/conform): Likewise.
(test-xfail-UNIX98/unistd.h/conform): Likewise.
(test-xfail-UNIX98/utmpx.h/conform): Likewise.
(test-xfail-XOPEN2K/aio.h/conform): Likewise.
(test-xfail-XOPEN2K/arpa/inet.h/conform): Likewise.
(test-xfail-XOPEN2K/fcntl.h/conform): Likewise.
(test-xfail-XOPEN2K/langinfo.h/conform): Likewise.
(test-xfail-XOPEN2K/math.h/conform): Likewise.
(test-xfail-XOPEN2K/mqueue.h/conform): Likewise.
(test-xfail-XOPEN2K/netdb.h/conform): Likewise.
(test-xfail-XOPEN2K/netinet/in.h/conform): Likewise.
(test-xfail-XOPEN2K/semaphore.h/conform): Likewise.
(test-xfail-XOPEN2K/signal.h/conform): Likewise.
(test-xfail-XOPEN2K/stdarg.h/conform): Likewise.
(test-xfail-XOPEN2K/stdio.h/conform): Likewise.
(test-xfail-XOPEN2K/stropts.h/conform): Likewise.
(test-xfail-XOPEN2K/sys/ipc.h/conform): Likewise.
(test-xfail-XOPEN2K/sys/msg.h/conform): Likewise.
(test-xfail-XOPEN2K/sys/sem.h/conform): Likewise.
(test-xfail-XOPEN2K/sys/shm.h/conform): Likewise.
(test-xfail-XOPEN2K/sys/socket.h/conform): Likewise.
(test-xfail-XOPEN2K/sys/wait.h/conform): Likewise.
(test-xfail-XOPEN2K/termios.h/conform): Likewise.
(test-xfail-XOPEN2K/tgmath.h/conform): Likewise.
(test-xfail-XOPEN2K/ucontext.h/conform): Likewise.
(test-xfail-XOPEN2K/utmpx.h/conform): Likewise.
(test-xfail-POSIX2008/arpa/inet.h/conform): Likewise.
(test-xfail-POSIX2008/fcntl.h/conform): Likewise.
(test-xfail-POSIX2008/netdb.h/conform): Likewise.
(test-xfail-POSIX2008/netinet/in.h/conform): Likewise.
(test-xfail-POSIX2008/signal.h/conform): Likewise.
(test-xfail-POSIX2008/stropts.h/conform): Likewise.
(test-xfail-POSIX2008/sys/socket.h/conform): Likewise.
(test-xfail-POSIX2008/sys/wait.h/conform): Likewise.
(test-xfail-XOPEN2K8/arpa/inet.h/conform): Likewise.
(test-xfail-XOPEN2K8/fcntl.h/conform): Likewise.
(test-xfail-XOPEN2K8/limits.h/conform): Likewise.
(test-xfail-XOPEN2K8/math.h/conform): Likewise.
(test-xfail-XOPEN2K8/netdb.h/conform): Likewise.
(test-xfail-XOPEN2K8/netinet/in.h/conform): Likewise.
(test-xfail-XOPEN2K8/signal.h/conform): Likewise.
(test-xfail-XOPEN2K8/stdio.h/conform): Likewise.
(test-xfail-XOPEN2K8/stropts.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/ipc.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/msg.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/select.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/sem.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/shm.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/socket.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/time.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/wait.h/conform): Likewise.
(test-xfail-XOPEN2K8/termios.h/conform): Likewise.
(test-xfail-XOPEN2K8/tgmath.h/conform): Likewise.
(test-xfail-XOPEN2K8/utmpx.h/conform): Likewise.
(conformtest-cc-flags): Likewise.
($(conformtest-header-tests): New target.
* conform/check-header-lists.sh: New file.
* conform/run-conformtest.sh: Remove.

10 years agoconformtest: clean up POSIX expectations for semaphore.h, signal.h, tar.h.
Joseph Myers [Fri, 7 Mar 2014 03:21:04 +0000 (03:21 +0000)]
conformtest: clean up POSIX expectations for semaphore.h, signal.h, tar.h.

Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up those for semaphore.h, signal.h and
tar.h (including various corrections for other standards for the
expectations affected by this patch).  Tested x86_64.

(Some of the failures for signal.h shown up by this patch correcting
expectations for that header are among the reasons for posix/annexc
being expected to fail.  The goal is for conformtest eventually to
replace posix/annexc and stdlib/isomac once it has all relevant
functionality, and for the loop over standards and headers in
conformtest to convert to separate makefile targets for each
combination, so they can be run in parallel and so that xfails can be
more specific than the present xfailing of the whole of conformtest.)

* conform/conformtest.pl: Allow ' and \ in values given for
constants.
* conform/data/semaphore.h-data [POSIX] (fcntl.h): Allow header
inclusion.
[POSIX] (sys/types.h): Likewise.
[POSIX2008 || XOPEN2K8] (sys/types.h): Don't allow header
inclusion.
[POSIX || UNIX98 || XOPEN2K] (time.h): Don't allow header
inclusion.
* conform/data/signal.h-data (SIGIO): Remove expectation.
[XPG3] (SIGBUS): Do not expect.
[POSIX || XPG3] (SIGPOLL): Likewise.
[POSIX || XPG3] (SIGPROF): Likewise.
[POSIX || XPG3] (SIGSYS): Likewise.
[XPG3] (SIGTRAP): Likewise.
[POSIX || XPG3] (SIGURG): Likewise.
[POSIX || XPG3] (SIGVTALRM): Likewise.
[POSIX || XPG3] (SIGXCPU): Likewise.
[POSIX || XPG3] (SIGXFSZ): Likewise.
[POSIX] (SA_SIGINFO): Expect.
[XPG3] (siginfo_t): Do not expect type or contents.
[POSIX] (si_pid): Do not expect element.
[POSIX] (si_uid): Likewise.
[POSIX] (si_addr): Likewise.
[POSIX] (si_status): Likewise.
[POSIX] (si_band): Likewise.
[XPG4] (si_value): Likewise.
[POSIX || XPG3] (ILL_ILLOPC): Do not expect.
[POSIX || XPG3] (ILL_ILLOPN): Likewise.
[POSIX || XPG3] (ILL_ILLADR): Likewise.
[POSIX || XPG3] (ILL_ILLTRP): Likewise.
[POSIX || XPG3] (ILL_PRVOPC): Likewise.
[POSIX || XPG3] (ILL_PRVREG): Likewise.
[POSIX || XPG3] (ILL_COPROC): Likewise.
[POSIX || XPG3] (ILL_BADSTK): Likewise.
[POSIX || XPG3] (FPE_INTDIV): Likewise.
[POSIX || XPG3] (FPE_INTOVF): Likewise.
[POSIX || XPG3] (FPE_FLTDIV): Likewise.
[POSIX || XPG3] (FPE_FLTOVF): Likewise.
[POSIX || XPG3] (FPE_FLTUND): Likewise.
[POSIX || XPG3] (FPE_FLTRES): Likewise.
[POSIX || XPG3] (FPE_FLTINV): Likewise.
[POSIX || XPG3] (FPE_FLTSUB): Likewise.
[POSIX || XPG3] (SEGV_MAPERR): Likewise.
[POSIX || XPG3] (SEGV_ACCERR): Likewise.
[POSIX || XPG3] (BUS_ADRALN): Likewise.
[POSIX || XPG3] (BUS_ADRERR): Likewise.
[POSIX || XPG3] (BUS_OBJERR): Likewise.
[POSIX || XPG3] (CLD_EXITED): Likewise.
[POSIX || XPG3] (CLD_KILLED): Likewise.
[POSIX || XPG3] (CLD_DUMPED): Likewise.
[POSIX || XPG3] (CLD_TRAPPED): Likewise.
[POSIX || XPG3] (CLD_STOPPED): Likewise.
[POSIX || XPG3] (CLD_CONTINUED): Likewise.
[POSIX || XPG3] (POLL_IN): Likewise.
[POSIX || XPG3] (POLL_OUT): Likewise.
[POSIX || XPG3] (POLL_MSG): Likewise.
[POSIX || XPG3] (POLL_ERR): Likewise.
[POSIX || XPG3] (POLL_PRI): Likewise.
[POSIX || XPG3] (POLL_HUP): Likewise.
[POSIX || XPG3 || POSIX2008] (TRAP_BRKPT): Likewise.
[POSIX || XPG3 || POSIX2008] (TRAP_TRACE): Likewise.
(SIG*): Do not allow.
[XPG3] (si_*): Likewise.
[XPG3] (SI_*): Likewise.
[XPG3 || XPG4] (sigev_*): Likewise.
[XPG3 || XPG4] (SIGEV_*): Likewise.
[XPG3 || XPG4] (sival_*): Likewise.
[POSIX || XPG3 || XPG4] (uc_*): Likewise.
[POSIX || XPG3] (BUS_*): Likewise.
[POSIX || XPG3] (CLD_*): Likewise.
[POSIX || XPG3] (FPE_*): Likewise.
[POSIX || XPG3] (ILL_*): Likewise.
[POSIX || XPG3] (POLL_*): Likewise.
[POSIX || XPG3] (SEGV_*): Likewise.
[POSIX || XPG3 || POSIX2008] (SS_*): Likewise.
[POSIX || XPG3 || POSIX2008] (SV_*): Likewise.
[POSIX || XPG3 || POSIX2008] (TRAP_*): Likewise.
[POSIX || XPG3 || POSIX2008] (ss_*): Likewise.
[POSIX || XPG3 || POSIX2008] (sv_*): Likewise.
* conform/data/tar.h-data (TMAGLEN): Use macro-int-constant.
Specify type and value.
(TVERSLEN): Likewise.
(REGTYPE): Likewise.
(AREGTYPE): Likewise.
(LNKTYPE): Likewise.
(SYMTYPE): Likewise.
(CHRTYPE): Likewise.
(BLKTYPE): Likewise.
(DIRTYPE): Likewise.
(FIFOTYPE): Likewise.
(CONTTYPE): Likewise.
(TSUID): Likewise.
(TSGID): Likewise.
(TSVTX): Likewise.
(TUREAD): Likewise.
(TUWRITE): Likewise.
(TUEXEC): Likewise.
(TGREAD): Likewise.
(TGWRITE): Likewise.
(TGEXEC): Likewise.
(TOREAD): Likewise.
(TOWRITE): Likewise.
(TOEXEC): Likewise.
[POSIX] (TSVTX): Expect constant.

10 years agoEnumerate tests with special rules in tests-special variable.
Joseph Myers [Thu, 6 Mar 2014 22:35:33 +0000 (22:35 +0000)]
Enumerate tests with special rules in tests-special variable.

This patch is a revised and updated version of
<https://sourceware.org/ml/libc-alpha/2014-01/msg00196.html>.

In order to generate overall summaries of the results of all tests in
the glibc testsuite, we need to identify and concatenate the files
with the results of individual tests.

Tomas Dohnalek's patch used $(common-objpfx)*/*.test-result for this.
However, the normal glibc approach is explicit enumeration of the
expected set of files with a given property, rather than all files
matching some pattern like that.  Furthermore, we would like to be
able to mark tests as UNRESOLVED if the file with their results is for
some reason missing, and in future we would like to be able to mark
tests as UNSUPPORTED if they are disabled for a particular
configuration (rather than simply having them missing from the list of
tests as at present).  Such handling of tests that were not run or did
not record results requires an explicit enumeration of tests.

For the tests following the default makefile rules, $(tests) (and
$(xtests)) provides such an enumeration.  Others, however, are added
directly as dependencies of the "tests" and "xtests" makefile
targets.  This patch changes the makefiles to put them in variables
tests-special and xtests-special, with appropriate dependencies on the
tests listed there then being added centrally.

Those variables are used in Rules and so need to be set before Rules
is included in a subdirectory makefile, which is often earlier in the
makefile than the dependencies were present before.  We previously
discussed the question of where to include Rules; see the question at
<https://sourceware.org/ml/libc-alpha/2012-11/msg00798.html>, and a
discussion in
<https://sourceware.org/ml/libc-alpha/2013-01/msg00337.html> of why
Rules is included early rather than late in subdirectory makefiles.

It was necessary to avoid an indirection through the check-abi target
and get the check-abi-* targets for individual libraries into the
tests-special variable.  The intl/ test $(objpfx)tst-gettext.out,
previously built only because of dependencies from other tests, was
also added to tests-special for the same reason.

The entries in tests-special are the full makefile targets, complete
with $(objpfx) and .out.  If a future change causes tests to be named
consistently with a .out suffix, this can be changed to include just
the path relative to $(objpfx), without .out.

Tested x86_64, including that the same set of files is generated in
the build directory by a build and testsuite run both before and after
the patch (except for changes to the
elf/tst-null-argv.debug.out.<number> file name), and a build with
run-built-tests=no to verify there aren't any more obvious instances
of the issue Marcus Shawcroft reported with a previous version in
<https://sourceware.org/ml/libc-alpha/2014-01/msg00462.html>.

* Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
(tests): Depend on $(tests-special).
* Makerules (check-abi-list): New variable.
(check-abi): Depend on $(check-abi-list).
[$(subdir) = elf] (tests-special): Add
$(objpfx)check-abi-libc.out.
[$(build-shared) = yes && subdir] (tests-special): Add
$(check-abi-list).
[$(build-shared) = yes && subdir] (tests): Do not depend on
check-abi.
* Rules (tests): Depend on $(tests-special).
(xtests): Depend on $(xtests-special).
* catgets/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* conform/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* elf/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* grp/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* iconv/Makefile (xtests): Change dependencies to ....
(xtests-special): ... additions to this variable.
* iconvdata/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* intl/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.  Also add
$(objpfx)tst-gettext.out.
* io/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* libio/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* malloc/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* misc/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* nptl/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* nptl_db/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* posix/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
(xtests): Change dependencies to ....
(xtests-special): ... additions to this variable.
* resolv/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
(xtests): Change dependencies to ....
(xtests-special): ... additions to this variable.
* stdio-common/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
(do-tst-unbputc): Remove target.
(do-tst-printf): Likewise.
* stdlib/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* string/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.
* sysdeps/x86/Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.

localedata:
* Makefile (tests): Change dependencies to ....
(tests-special): ... additions to this variable.

10 years agoconformtest: correct set of standards for which more headers are tested.
Joseph Myers [Thu, 6 Mar 2014 17:43:46 +0000 (17:43 +0000)]
conformtest: correct set of standards for which more headers are tested.

Continuing the corrections to which headers conformtest tests for
which standards, this patch corrects conformtest mistakes regarding
which headers to test for the remaining standards (XOPEN2K POSIX2008
XOPEN2K8).  Tested x86_64.

2014-03-05  Joseph Myers  <joseph@codesourcery.com>

* conform/data/netinet/tcp.h-data [POSIX2008 || XOPEN2K8]: Enable
whole file.
* conform/data/sys/timeb.h-data [POSIX2008 || XOPEN2K8]: Disable
whole file.
* conform/data/sys/uio.h-data [POSIX2008]: Likewise.
* conform/data/ucontext.h-data [POSIX2008 || XOPEN2K8]: Likewise.

10 years agoconformtest: correct set of standards for which some headers are tested.
Joseph Myers [Thu, 6 Mar 2014 17:42:03 +0000 (17:42 +0000)]
conformtest: correct set of standards for which some headers are tested.

Reviewing the sets of headers for which conformtest has expectations
for various standards showed up cases where headers had expectations
for standards not including those headers, or were missing
expectations for a standard that did include the header.  This patch
fixes easy cases of this (largely disabling tests for standards for
which they are inapplicable).  Tested x86_64.

* conform/data/aio.h-data [XPG3 || XPG4]: Disable whole file.
* conform/data/arpa/inet.h-data [XPG3]: Likewise.
* conform/data/dlfcn.h-data [XPG3 || XPG4]: Likewise.
* conform/data/fmtmsg.h-data [XPG3]: Likewise.
* conform/data/libgen.h-data [XPG3]: Likewise.
* conform/data/mqueue.h-data [XPG3 || XPG4]: Likewise.
* conform/data/ndbm.h-data [XPG3]: Likewise.
* conform/data/net/if.h-data [XPG3 || XPG4 || UNIX98]: Likewise.
* conform/data/netdb.h-data [XPG3]: Likewise.
* conform/data/netinet/in.h-data [XPG3]: Likewise.
* conform/data/poll.h-data [XPG3]: Likewise.
* conform/data/spawn.h-data [XPG3 || XPG4 || UNIX98]: Likewise.
* conform/data/strings.h-data [XPG3]: Likewise.
* conform/data/stropts.h-data [XPG3]: Likewise.
* conform/data/sys/mman.h-data [XPG3]: Likewise.
* conform/data/sys/resource.h-data [XPG3]: Likewise.
* conform/data/sys/select.h-data [XPG3 || XPG4 || UNIX98]:
Likewise.
* conform/data/sys/statvfs.h-data [XPG3]: Likewise.
* conform/data/sys/time.h-data [XPG3]: Likewise.
* conform/data/sys/timeb.h-data [XPG3]: Likewise.
* conform/data/sys/uio.h-data [XPG3]: Likewise.
* conform/data/sys/un.h-data [XPG3]: Likewise.
* conform/data/syslog.h-data [XPG3]: Likewise.
* conform/data/ucontext.h-data [XPG3]: Likewise.
* conform/data/utmpx.h-data [XPG3]: Likewise.
* conform/data/varargs.h-data [UNIX98]: Enable file.

10 years agoRemove INSTALL_INFO setting in manual/Makefile.
Joseph Myers [Thu, 6 Mar 2014 15:57:24 +0000 (15:57 +0000)]
Remove INSTALL_INFO setting in manual/Makefile.

* manual/Makefile (INSTALL_INFO): Remove variable setting.

10 years agoPrepare libm-test.inc structures for multi-rounding-mode testing.
Joseph Myers [Thu, 6 Mar 2014 14:15:00 +0000 (14:15 +0000)]
Prepare libm-test.inc structures for multi-rounding-mode testing.

At present, libm-test.inc tests are run in multiple rounding modes by
having a separate array for each rounding mode (which might or might
not have the same test inputs as the other such arrays), a separate
function calling a RUN_TEST_LOOP_* macro over that array, and a
separate call to that function in main.  The number of functions
tested in multiple rounding modes has gradually increased as
rounding-mode-specific bugs have been found and fixed in different
functions.

It would be better to be able to use a single macro call, in a single
function, to run tests for a function over all rounding modes, with
this being done for all libm functions except in cases where it's
deferred until some bugs can be fixed because XFAILing all affected
tests would be painful (that's why the full set of pow tests isn't
currently run in all rounding modes).  This patch helps prepare for
that by making the structures storing expected results for tests store
results for all four rounding modes.  After this patch, the results
for all modes are just duplicates, but tests access the appropriate
field in the structure, so helping to pave the way for when the fields
stop being duplicates and multiple rounding modes can be tested from a
single array.  Tests might in future specify a single set of results,
to be used in all rounding modes; separate results for each rounding
mode, specified manually; or use of auto-libm-tests-* to generate
results for each rounding mode.

Tested x86_64.

* math/libm-test.inc (struct test_f_f_data): Move expected results
into structure for each rounding mode.
(struct test_ff_f_data): Likewise.
(struct test_ff_f_data_nexttoward): Likewise.
(struct test_fi_f_data): Likewise.
(struct test_fl_f_data): Likewise.
(struct test_if_f_data): Likewise.
(struct test_fff_f_data): Likewise.
(struct test_c_f_data): Likewise.
(struct test_f_f1_data): Likewise.
(struct test_fF_f1_data): Likewise.
(struct test_ffI_f1_data): Likewise.
(struct test_c_c_data): Likewise.
(struct test_cc_c_data): Likewise.
(struct test_f_i_data): Likewise.
(struct test_ff_i_data): Likewise.
(struct test_f_l_data): Likewise.
(struct test_f_L_data): Likewise.
(struct test_fFF_11_data): Likewise.
(RM_): New macro.
(RM_FE_DOWNWARD): Likewise.
(RM_FE_TONEAREST): Likewise.
(RM_FE_TOWARDZERO): Likewise.
(RM_FE_UPWARD): Likewise.
(RUN_TEST_LOOP_f_f): Update references to expected results.
(RUN_TEST_LOOP_2_f): Likewise.
(RUN_TEST_LOOP_fff_f): Likewise.
(RUN_TEST_LOOP_c_f): Likewise.
(RUN_TEST_LOOP_f_f1): Likewise.
(RUN_TEST_LOOP_fF_f1): Likewise.
(RUN_TEST_LOOP_fI_f1): Likewise.
(RUN_TEST_LOOP_ffI_f1): Likewise.
(RUN_TEST_LOOP_c_c): Likewise.
(RUN_TEST_LOOP_cc_c): Likewise.
(RUN_TEST_LOOP_f_i): Likewise.
(RUN_TEST_LOOP_f_i_tg): Likewise.
(RUN_TEST_LOOP_ff_i_tg): Likewise.
(RUN_TEST_LOOP_f_b): Likewise.
(RUN_TEST_LOOP_f_b_tg): Likewise.
(RUN_TEST_LOOP_f_l): Likewise.
(RUN_TEST_LOOP_f_L): Likewise.
(RUN_TEST_LOOP_fFF_11): Likewise.
* math/gen-libm-test.pl (parse_args): Output four copies of
expected results for each test.

10 years agoDon't define __ASSUME_UTIMES for linux-generic architectures.
Joseph Myers [Thu, 6 Mar 2014 14:13:18 +0000 (14:13 +0000)]
Don't define __ASSUME_UTIMES for linux-generic architectures.

The __ASSUME_UTIMES macro describes whether the utimes syscall is
present.  For linux-generic architectures, it isn't (utimensat is
instead), so the macro should not be defined for them; this patch
removes the spurious definitions for such architectures.  (Those
definitions don't actually cause any user-visible bug, because
futimes.c doesn't use __ASSUME_UTIMES if __ASSUME_UTIMENSAT is
defined, and futimesat.c and utimes.c are overridden for
linux-generic, but the definitions are still logically incorrect.)

* sysdeps/unix/sysv/linux/aarch64/kernel-features.h
(__ASSUME_UTIMES): Remove.
* sysdeps/unix/sysv/linux/tile/kernel-features.h
(__ASSUME_UTIMES): Likewise.

10 years agoAdjust how gen-auto-libm-tests handles before-rounding/after-rounding cases.
Joseph Myers [Thu, 6 Mar 2014 14:11:19 +0000 (14:11 +0000)]
Adjust how gen-auto-libm-tests handles before-rounding/after-rounding cases.

This patch changes gen-auto-libm-tests so that, when generating test
results that depend on whether the architecture has before-rounding or
after-rounding tininess detection, the :before-rounding or
:after-rounding conditions go on the exception / errno flags
generated, rather than generating two separate lines in
auto-libm-test-out for e.g. flt-32:before-rounding and
flt-32:after-rounding.

The rationale for this is as follows.  It would be desirable for
testing a libm function in all rounding modes to require just one
function and array in libm-test.inc, not four (or five), with the
array of test data including expected results for all rounding modes
rather than separate arrays for each rounding mode that also need to
repeat all the test inputs.  For gen-libm-test.pl to generate data for
such an array from auto-libm-test-out, it would be helpful if each
(format, test input) pair has exactly four lines in
auto-libm-test-out, one for each rounding mode, rather than some
rounding modes having just one line and some having two because the
exceptions depend on tininess detection.

Tested x86_64 and x86.

* math/gen-auto-libm-tests.c: Update comment on output format.
(output_for_one_input_case): Generate before-rounding and
after-rounding information as conditions on output flags not
floating-point format.
* math/auto-libm-test-out: Regenerated.
* math/gen-libm-test.pl (cond_value): New function.
(or_cond_value): Use cond_value.
(generate_testfile): Handle conditional exceptions.

10 years agoAutomatically check sanity of ulps from libm tests.
Joseph Myers [Wed, 5 Mar 2014 15:05:20 +0000 (15:05 +0000)]
Automatically check sanity of ulps from libm tests.

This patch makes libm-test.inc apply sanity checks to ulps values
resulting from tests, or found in libm-test-ulps files, to avoid the
need for manual checking/editing of new ulps for cases that are
excessively large or involve functions that should not have any ulps.
For IBM long double, errors must be at most 14ulp (the largest
currently checked-in value), or at most 3ulp (the documented error
bound for division) in the case of exactly-determined functions; for
other formats, the limits are 9ulp (also the largest currently
checked-in value) and 0ulp.  Limits from ulps files are saturated to
those bounds, and regen-ulps will ignore any errors outside those
bounds.  (Thus if, say, you have an architecture-specific problem with
fma, the tests can still be XFAILed in auto-libm-test-in, but errors
outside the permitted range can no longer be listed in
libm-test-ulps.)

Tested x86_64.

* math/libm-test.inc (max_valid_error): New variable.
(init_max_error): Take new argument specifying whether function
results are exactly determined.  Set max_valid_error and bound
other variables for errors based on this argument.
(set_max_error): Do not record results above max_valid_error.
(check_float_internal): Only accept errors of up to 0.5ulps if
also at most max_valid_error.
(START): Take new argument EXACT and pass it to init_max_error.
(acos_test): Update call to START.
(acos_test_tonearest): Likewise.
(acos_test_towardzero): Likewise.
(acos_test_downward): Likewise.
(acos_test_upward): Likewise.
(acosh_test): Likewise.
(asin_test): Likewise.
(asin_test_tonearest): Likewise.
(asin_test_towardzero): Likewise.
(asin_test_downward): Likewise.
(asin_test_upward): Likewise.
(asinh_test): Likewise.
(atan_test): Likewise.
(atanh_test): Likewise.
(atan2_test): Likewise.
(cabs_test): Likewise.
(cacos_test): Likewise.
(cacosh_test): Likewise.
(carg_test): Likewise.
(casin_test): Likewise.
(casinh_test): Likewise.
(catan_test): Likewise.
(catanh_test): Likewise.
(cbrt_test): Likewise.
(ccos_test): Likewise.
(ccosh_test): Likewise.
(ceil_test): Likewise.
(cexp_test): Likewise.
(cimag_test): Likewise.
(clog_test): Likewise.
(clog10_test): Likewise.
(conj_test): Likewise.
(copysign_test): Likewise.
(cos_test): Likewise.
(cos_test_tonearest): Likewise.
(cos_test_towardzero): Likewise.
(cos_test_downward): Likewise.
(cos_test_upward): Likewise.
(cosh_test): Likewise.
(cosh_test_tonearest): Likewise.
(cosh_test_towardzero): Likewise.
(cosh_test_downward): Likewise.
(cosh_test_upward): Likewise.
(cpow_test): Likewise.
(cproj_test): Likewise.
(creal_test): Likewise.
(csin_test): Likewise.
(csinh_test): Likewise.
(csqrt_test): Likewise.
(ctan_test): Likewise.
(ctan_test_tonearest): Likewise.
(ctan_test_towardzero): Likewise.
(ctan_test_downward): Likewise.
(ctan_test_upward): Likewise.
(ctanh_test): Likewise.
(ctanh_test_tonearest): Likewise.
(ctanh_test_towardzero): Likewise.
(ctanh_test_downward): Likewise.
(ctanh_test_upward): Likewise.
(erf_test): Likewise.
(erfc_test): Likewise.
(exp_test): Likewise.
(exp_test_tonearest): Likewise.
(exp_test_towardzero): Likewise.
(exp_test_downward): Likewise.
(exp_test_upward): Likewise.
(exp10_test): Likewise.
(exp10_test_tonearest): Likewise.
(exp10_test_towardzero): Likewise.
(exp10_test_downward): Likewise.
(exp10_test_upward): Likewise.
(pow10_test): Likewise.
(exp2_test): Likewise.
(expm1_test): Likewise.
(expm1_test_tonearest): Likewise.
(expm1_test_towardzero): Likewise.
(expm1_test_downward): Likewise.
(expm1_test_upward): Likewise.
(fabs_test): Likewise.
(fdim_test): Likewise.
(floor_test): Likewise.
(fma_test): Likewise.
(fma_test_towardzero): Likewise.
(fma_test_downward): Likewise.
(fma_test_upward): Likewise.
(fmax_test): Likewise.
(fmin_test): Likewise.
(fmod_test): Likewise.
(fpclassify_test): Likewise.
(frexp_test): Likewise.
(hypot_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.
(j0_test): Likewise.
(j1_test): Likewise.
(jn_test): Likewise.
(ldexp_test): Likewise.
(lgamma_test): Likewise.
(gamma_test): Likewise.
(lrint_test): Likewise.
(lrint_test_tonearest): Likewise.
(lrint_test_towardzero): Likewise.
(lrint_test_downward): Likewise.
(lrint_test_upward): Likewise.
(llrint_test): Likewise.
(llrint_test_tonearest): Likewise.
(llrint_test_towardzero): Likewise.
(llrint_test_downward): Likewise.
(llrint_test_upward): Likewise.
(log_test): Likewise.
(log10_test): Likewise.
(log1p_test): Likewise.
(log2_test): Likewise.
(logb_test): Likewise.
(logb_test_downward): Likewise.
(lround_test): Likewise.
(llround_test): Likewise.
(modf_test): Likewise.
(nearbyint_test): Likewise.
(nextafter_test): Likewise.
(nexttoward_test): Likewise.
(pow_test): Likewise.
(pow_test_tonearest): Likewise.
(pow_test_towardzero): Likewise.
(pow_test_downward): Likewise.
(pow_test_upward): Likewise.
(remainder_test): Likewise.
(drem_test): Likewise.
(remainder_test_tonearest): Likewise.
(drem_test_tonearest): Likewise.
(remainder_test_towardzero): Likewise.
(drem_test_towardzero): Likewise.
(remainder_test_downward): Likewise.
(drem_test_downward): Likewise.
(remainder_test_upward): Likewise.
(drem_test_upward): Likewise.
(remquo_test): Likewise.
(rint_test): Likewise.
(rint_test_tonearest): Likewise.
(rint_test_towardzero): Likewise.
(rint_test_downward): Likewise.
(rint_test_upward): Likewise.
(round_test): Likewise.
(scalb_test): Likewise.
(scalbn_test): Likewise.
(scalbln_test): Likewise.
(signbit_test): Likewise.
(sin_test): Likewise.
(sin_test_tonearest): Likewise.
(sin_test_towardzero): Likewise.
(sin_test_downward): Likewise.
(sin_test_upward): Likewise.
(sincos_test): Likewise.
(sinh_test): Likewise.
(sinh_test_tonearest): Likewise.
(sinh_test_towardzero): Likewise.
(sinh_test_downward): Likewise.
(sinh_test_upward): Likewise.
(sqrt_test): Likewise.
(sqrt_test_tonearest): Likewise.
(sqrt_test_towardzero): Likewise.
(sqrt_test_downward): Likewise.
(sqrt_test_upward): Likewise.
(tan_test): Likewise.
(tan_test_tonearest): Likewise.
(tan_test_towardzero): Likewise.
(tan_test_downward): Likewise.
(tan_test_upward): Likewise.
(tanh_test): Likewise.
(tgamma_test): Likewise.
(trunc_test): Likewise.
(y0_test): Likewise.
(y1_test): Likewise.
(yn_test): Likewise.
(significand_test): Likewise.

10 years agoDon't include individual test ulps in libm-test-ulps.
Joseph Myers [Wed, 5 Mar 2014 15:02:38 +0000 (15:02 +0000)]
Don't include individual test ulps in libm-test-ulps.

As recently discussed
<https://sourceware.org/ml/libc-alpha/2014-02/msg00670.html>, it
doesn't seem particularly useful for libm-test-ulps files to contain
huge amounts of data on ulps for individual tests; just the global
maximum observed ulps for each function, together with the
verification of exceptions, errno and special results such as
infinities and NaNs for each test, suffices to verify that a
function's behavior on the given test inputs is within the expected
accuracy.  Removing this data reduces source tree churn caused by
updates to these files when libm tests are added, and reduces the
frequency with which testsuite additions actually need libm-test-ulps
changes at all.

Accordingly, this patch removes that data, so that individual tests
get checked against the global bounds for the given function and only
generate an error if those are exceeded.  Tested x86_64 (including
verifying that if an ulps value is artificially reduced, the tests do
indeed fail as they should and "make regen-ulps" generates the
expected changes).

* math/libm-test.inc (struct ulp_data): Don't refer to ulps for
individual tests in comment.
(libm-test-ulps.h): Don't refer to test_ulps in #include comment.
(prev_max_error): New variable.
(prev_real_max_error): Likewise.
(prev_imag_max_error): Likewise.
(compare_ulp_data): Don't refer to test names in comment.
(find_test_ulps): Remove function.
(find_function_ulps): Likewise.
(find_complex_function_ulps): Likewise.
(init_max_error): Take function name as argument.  Look up ulps
for that function.
(print_ulps): Remove function.
(print_max_error): Use prev_max_error instead of calling
find_function_ulps.
(print_complex_max_error): Use prev_real_max_error and
prev_imag_max_error instead of calling find_complex_function_ulps.
(check_float_internal): Take max_ulp parameter instead of calling
find_test_ulps.  Don't call print_ulps.
(check_float): Update call to check_float_internal.
(check_complex): Update calls to check_float_internal.
(START): Pass argument to init_max_error.
* math/gen-libm-test.pl (%results): Don't include "kind"
information.
(parse_ulps): Don't handle ulps of individual tests.
(print_ulps_file): Likewise.
(output_ulps): Likewise.
* math/README.libm-test: Update.
* manual/libm-err-tab.pl (parse_ulps): Don't handle ulps of
individual tests.
* sysdeps/aarch64/libm-test-ulps: Remove individual test ulps.
* sysdeps/alpha/fpu/libm-test-ulps: Likewise.
* sysdeps/arm/libm-test-ulps: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Likewise.
* sysdeps/ia64/fpu/libm-test-ulps: Likewise.
* sysdeps/m68k/coldfire/fpu/libm-test-ulps: Likewise.
* sysdeps/m68k/m680x0/fpu/libm-test-ulps: Likewise.
* sysdeps/microblaze/libm-test-ulps: Likewise.
* sysdeps/mips/mips32/libm-test-ulps: Likewise.
* sysdeps/mips/mips64/libm-test-ulps: Likewise.
* sysdeps/powerpc/fpu/libm-test-ulps: Likewise.
* sysdeps/powerpc/nofpu/libm-test-ulps: Likewise.
* sysdeps/s390/fpu/libm-test-ulps: Likewise.
* sysdeps/sh/libm-test-ulps: Likewise.
* sysdeps/sparc/fpu/libm-test-ulps: Likewise.
* sysdeps/tile/libm-test-ulps: Likewise.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

* sysdeps/hppa/fpu/libm-test-ulps: Remove individual test ulps.

10 years agohppa: Remove fma ulps from libm-test-ulps.
Carlos O'Donell [Wed, 5 Mar 2014 05:00:25 +0000 (00:00 -0500)]
hppa: Remove fma ulps from libm-test-ulps.

The expected fma ulp of 1 has been removed.

The fma function should have 0 ulps.

Bug #16661 has been filed to track this issue.

10 years agohppa: Regenerate ULPs again.
Carlos O'Donell [Tue, 4 Mar 2014 23:47:35 +0000 (18:47 -0500)]
hppa: Regenerate ULPs again.

10 years agohppa: Regenerate ULPs.
Carlos O'Donell [Tue, 4 Mar 2014 19:43:58 +0000 (14:43 -0500)]
hppa: Regenerate ULPs.

10 years agoFix libm-test.inc:print_complex_max_error handling of some error cases.
Joseph Myers [Tue, 4 Mar 2014 14:16:25 +0000 (14:16 +0000)]
Fix libm-test.inc:print_complex_max_error handling of some error cases.

When regenerating ulps incrementally with "make regen-ulps", the
resulting diffs should only increase existing ulps, never decrease
them.  This allows successive uses of "make regen-ulps" on different
hardware or with different compiler configurations to accumulate ulps
that are sufficient for tests to pass in a variety of configurations.

However, sometimes changes that decrease ulps are wrongly generated;
thus, when applying
<https://sourceware.org/ml/libc-alpha/2014-02/msg00605.html> I had to
remove such changes manually.  The problem is
print_complex_max_error.  If the ulps for either the real or the
imaginary part of a function are out of range, this function prints
the maximum ulps seen for both parts, which then replace those
previously in libm-test-ulps.  So if the ulps for one part are bigger
than recorded before, but those for the other part are smaller, the
diffs reduce existing ulps.

This patch fixes the logic so that only increased ulps get printed.

Tested x86_64 ("make math/tests", and "make regen-ulps" in a situation
with ulps manually modified so one part would go up and the other
down, to confirm the changes have the intended effect then).

* math/libm-test.inc (print_complex_max_error): Check separately
whether real and imaginary errors are within allowed range and
pass 0 to print_complex_function_ulps instead of value within
allowed range.

10 years agoFix up formatting in tst-ftell-active-handler.c
Siddhesh Poyarekar [Tue, 4 Mar 2014 10:19:58 +0000 (15:49 +0530)]
Fix up formatting in tst-ftell-active-handler.c

10 years agoFix up formatting
Siddhesh Poyarekar [Tue, 4 Mar 2014 06:57:34 +0000 (12:27 +0530)]
Fix up formatting

10 years agoUse cached offset in ftell when reliable
Siddhesh Poyarekar [Tue, 4 Mar 2014 06:53:27 +0000 (12:23 +0530)]
Use cached offset in ftell when reliable

The cached offset is reliable to use in ftell when the stream handle
is active.  We can consider a stream as being active when there is
unflushed data.  However, even in this case, we can use the cached
offset only when the stream is not being written to in a+ mode,
because this case may have unflushed data and a stale offset; the
previous read could have sent it off somewhere other than the end of
the file.

There were a couple of adjustments necessary to get this to work.
Firstly, fdopen now ceases to use _IO_attach_fd because it sets the
offset cache to the current file position.  This is not correct
because there could be changes to the file descriptor before the
stream handle is activated, which would not get reflected.

A similar offset caching action is done in _IO_fwide, claiming that
wide streams have 'problems' with the file offsets.  There don't seem
to be any obvious problems with not having the offset cache available,
other than that it will have to be queried in a subsequent
read/write/seek.  I have removed this as well.

The testsuite passes successfully with these changes on x86_64.

10 years agoSeparate ftell from fseek logic and avoid modifying FILE data (#16532)
Siddhesh Poyarekar [Tue, 4 Mar 2014 02:15:58 +0000 (07:45 +0530)]
Separate ftell from fseek logic and avoid modifying FILE data (#16532)

ftell semantics are distinct from fseek(SEEK_CUR) especially when it
is called on a file handler that is not yet active.  Due to this
caveat, much care needs to be taken while modifying the handler data
and hence, this first iteration on separating out ftell focusses on
maintaining handler data integrity at all times while it figures out
the current stream offset.  The result is that it makes a syscall for
every offset request.

There is scope for optimizing this by caching offsets when we know
that the handler is active.  A simple way to find out is when the
buffers have data.  It is not so simple to find this out when the
buffer is empty without adding some kind of flag.

10 years agoRetire the separate ChangeLog files in nptl/ and nptl_db/ subdirs.
Roland McGrath [Mon, 3 Mar 2014 23:30:42 +0000 (15:30 -0800)]
Retire the separate ChangeLog files in nptl/ and nptl_db/ subdirs.

10 years agonscd: Improved support for tracking startup failure in nscd service (BZ #16639)
Siddhesh Poyarekar [Mon, 3 Mar 2014 17:21:39 +0000 (22:51 +0530)]
nscd: Improved support for tracking startup failure in nscd service (BZ #16639)

Currently, the nscd parent process parses commandline options and
configuration, forks on startup and immediately exits with a success.
If the child process encounters some error after this, it goes
undetected and any services started up after it may have to repeatedly
check to make sure that the nscd service did actually start up and is
serving requests.

To make this process more reliable, I have added a pipe between the
parent and child process, through which the child process sends a
notification to the parent informing it of its status.  The parent
waits for this status and once it receives it, exits with the
corresponding exit code.  So if the child service sends a success
status (0), the parent exits with a success status.  Similarly for
error conditions, the child sends the non-zero status code, which the
parent passes on as the exit code.

This, along with setting the nscd service type to forking in its
systemd configuration file, allows systemd to be certain that the nscd
service is ready and is accepting connections.

10 years agoRevert 4248f0da6ff9e7dd63464cdecec2dec332dfc2f0.
Carlos O'Donell [Mon, 3 Mar 2014 17:28:25 +0000 (12:28 -0500)]
Revert 4248f0da6ff9e7dd63464cdecec2dec332dfc2f0.

Objections were raised surrounding the calloc simplification
and it is better to revert the patch, continue discussions
and then submit a new patch for inclusion with all issues
fully addressed.

10 years agoPowerPC: Update powerpc-fpu ULPs.
Adhemerval Zanella [Mon, 3 Mar 2014 14:58:08 +0000 (08:58 -0600)]
PowerPC: Update powerpc-fpu ULPs.

10 years agoPowerPC: strrchr optimization for POWER7/PPC64
Rajalakshmi Srinivasaraghavan [Mon, 3 Mar 2014 14:06:41 +0000 (08:06 -0600)]
PowerPC: strrchr optimization for POWER7/PPC64

This patch optimizes strrchr() for ppc64. It uses aligned memory
access along with cmpb instruction and CPU prefetch to avoid
cache misses for speed improvement.

10 years agoAdd changelog.
Ondřej Bílka [Sat, 1 Mar 2014 01:06:18 +0000 (02:06 +0100)]
Add changelog.

10 years agoAdd header and standard information to threads.texi.
Carlos O'Donell [Fri, 28 Feb 2014 23:30:22 +0000 (18:30 -0500)]
Add header and standard information to threads.texi.

The glibc manual uses special annotations to include functions
in the summary chapter. These annotations were missing from the
functions in the threads chapter. This patch adds those special
markers and in turn adds these functions to the summary chapter.

10 years agoPromote do_lookup_x:check_match to a full function.
Carlos O'Donell [Fri, 28 Feb 2014 23:11:06 +0000 (18:11 -0500)]
Promote do_lookup_x:check_match to a full function.

While it may be argued that nested functions make the resulting
code easier to read, or worse to read the following two bugs
make it difficult to debug:

Bug 8300 - no local symbol information within nested or nesting
procedures
https://sourceware.org/bugzilla/show_bug.cgi?id=8300

Bug 53927 - wrong value for DW_AT_static_link
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53927

Until these are fixed I've made check_match a full function.
After they are fixed we can resume arguing about the merits
of nested functions on readability and maintenance.

10 years agoMake strtok benchmark competive.
Ondřej Bílka [Fri, 28 Feb 2014 21:45:33 +0000 (22:45 +0100)]
Make strtok benchmark competive.

We include a generic version of strtok to result which could be faster
when underlying primitives are better optimized than current version.

10 years agoFix fallout from Joseph's untested Makeconfig change.
Roland McGrath [Fri, 28 Feb 2014 21:00:27 +0000 (13:00 -0800)]
Fix fallout from Joseph's untested Makeconfig change.

10 years agoAdd missing } in Versions file.
Roland McGrath [Fri, 28 Feb 2014 19:07:43 +0000 (11:07 -0800)]
Add missing } in Versions file.

10 years agoFix missing ChangeLog
Siddhesh Poyarekar [Fri, 28 Feb 2014 12:25:05 +0000 (17:55 +0530)]
Fix missing ChangeLog

I had forgotten to add a changelog entry for a patch.  Added it now in
the right place.

10 years agoPowerPC: llround/llroundf POWER8 optimization
Adhemerval Zanella [Mon, 17 Feb 2014 16:44:08 +0000 (10:44 -0600)]
PowerPC: llround/llroundf POWER8 optimization

This patch add a optimized llround/llroundf implementation for POWER8
using the new Move From VSR Doubleword instruction to gains some
cycles from FP to GRP register move.

10 years agoPowerPC: llrint/llrintf POWER8 optimization
Adhemerval Zanella [Tue, 18 Feb 2014 14:29:29 +0000 (09:29 -0500)]
PowerPC: llrint/llrintf POWER8 optimization

This patch add a optimized llrint/llrintf implementation for POWER8
using the new Move From VSR Doubleword instruction to gains some
cycles from FP to GRP register move.

10 years agoPowerPC: Optimized finite/finitef for POWER8
Adhemerval Zanella [Thu, 27 Feb 2014 15:46:46 +0000 (09:46 -0600)]
PowerPC: Optimized finite/finitef for POWER8

This patch add a optimized finite/finitef implementation for POWER8
using the new Move From VSR Doubleword instruction to gains some
cycles from FP to GRP register move.

10 years agoPowerPC: Optimized isinf/isinff for POWER8
Adhemerval Zanella [Thu, 27 Feb 2014 15:45:41 +0000 (09:45 -0600)]
PowerPC: Optimized isinf/isinff for POWER8

This patch add a optimized isinf/isinff implementation for POWER8
using the new Move From VSR Doubleword instruction to gains some
cycles from FP to GRP register move.

10 years agoPowerPC: Optimized isnan/isnanf for POWER8
Adhemerval Zanella [Thu, 27 Feb 2014 15:43:51 +0000 (09:43 -0600)]
PowerPC: Optimized isnan/isnanf for POWER8

This patch add a optimized isnan/isnanf implementation for POWER8
using the new Move From VSR Doubleword instruction to gains some
cycles from FP to GRP register move.

10 years agoFix ARM NAN fraction bits.
Joey Ye [Thu, 27 Feb 2014 17:44:43 +0000 (17:44 +0000)]
Fix ARM NAN fraction bits.

Current ARM soft-float implementation is violating the RTABI
(http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf)
Section 4.1.1.1:

When not otherwise specified by IEEE 754, the result on an invalid
operation should be the quiet NaN bit pattern with only the most
significant bit of the significand set, and all other significand bits
zero.

This patch fixes it by setting _FP_NANFRAC_* to zero.

Ran make check test with -mfloat-abi=soft. No regression.

* sysdeps/arm/soft-fp/sfp-machine.h (_FP_NANFRAC_S, _FP_NANFRAC_D)
(_FP_NANFRAC_Q): Set to zero.