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.
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.
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.
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.
This patch, an updated version of
<https://sourceware.org/ml/libc-alpha/2014-01/msg00195.html>, makes it
possible for .test-result files for individual tests to contain XPASS
and XFAIL rather than PASS and FAIL in cases where failure is
expected. This replaces the marking of two individual tests with "-"
to cause them to be expected at makefile level to fail;
evaluate-test.sh will ensure it exits with status 0 for an expected
failure.
Tested x86_64.
* scripts/evaluate-test.sh: Take new argument indicating whether
failure is expected.
* Makeconfig (evaluate-test): Pass argument to evaluate-test.sh
indicating whether failure is expected.
* conform/Makefile (test-xfail-run-conformtest): New variable.
($(objpfx)run-conformtest.out): Don't expect to fail at makefile
level.
* posix/Makefile (test-xfail-annexc): New variable.
($(objpfx)annexc.out): Don't expect to fail at makefile level.
In <https://sourceware.org/ml/libc-alpha/2014-01/msg00196.html> I
noted it was necessary to add includes of Makeconfig early in various
subdirectory makefiles for the tests-special variable settings added
by that patch to be conditional on configuration information. No-one
commented on the general question there of whether Makeconfig should
always be included immediately after the definition of subdir.
This patch implements that early inclusion of Makeconfig in each
directory (which is a lot easier than consistent placement of includes
of Rules). Includes are added if needed, or moved up if already
present. Subdirectory "all:" targets are removed, since Makeconfig
provides one.
There is potential for further cleanups I haven't done. Rules and
Makerules have code such as
ifneq "$(findstring env,$(origin headers))" ""
headers :=
endif
to override to empty any value of various variables that came from the
environment. I think there is a case for Makeconfig setting all the
subdirectory variables (other than subdir) to empty to ensure no
outside value is going to take effect if a subdirectory fails to
define a variable. (A list of such variables, possibly out of date
and incomplete, is in manual/maint.texi.) Rules and Makerules would
give errors if Makeconfig hadn't already been included, instead of
including it themselves. The special code to override values coming
from the environment would then be obsolete and could be removed.
Tested x86_64, including that installed binaries are identical before
and after the patch.
* argp/Makefile: Include Makeconfig immediately after defining
subdir.
* assert/Makefile: Likewise.
* benchtests/Makefile: Likewise.
* catgets/Makefile: Likewise.
* conform/Makefile: Likewise.
* crypt/Makefile: Likewise.
* csu/Makefile: Likewise.
(all): Remove target.
* ctype/Makefile: Include Makeconfig immediately after defining
subdir.
* debug/Makefile: Likewise.
* dirent/Makefile: Likewise.
* dlfcn/Makefile: Likewise.
* gmon/Makefile: Likewise.
* gnulib/Makefile: Likewise.
* grp/Makefile: Likewise.
* gshadow/Makefile: Likewise.
* hesiod/Makefile: Likewise.
* hurd/Makefile: Likewise.
(all): Remove target.
* iconvdata/Makefile: Include Makeconfig immediately after
defining subdir.
* inet/Makefile: Likewise.
* intl/Makefile: Likewise.
* io/Makefile: Likewise.
* libio/Makefile: Likewise.
(all): Remove target.
* locale/Makefile: Include Makeconfig immediately after defining
subdir.
* login/Makefile: Likewise.
* mach/Makefile: Likewise.
(all): Remove target.
* malloc/Makefile: Include Makeconfig immediately after defining
subdir.
(all): Remove target.
* manual/Makefile: Include Makeconfig immediately after defining
subdir.
* math/Makefile: Likewise.
* misc/Makefile: Likewise.
* nis/Makefile: Likewise.
* nss/Makefile: Likewise.
* po/Makefile: Likewise.
(all): Remove target.
* posix/Makefile: Include Makeconfig immediately after defining
subdir.
* pwd/Makefile: Likewise.
* resolv/Makefile: Likewise.
* resource/Makefile: Likewise.
* rt/Makefile: Likewise.
* setjmp/Makefile: Likewise.
* shadow/Makefile: Likewise.
* signal/Makefile: Likewise.
* socket/Makefile: Likewise.
* soft-fp/Makefile: Likewise.
* stdio-common/Makefile: Likewise.
* stdlib/Makefile: Likewise.
* streams/Makefile: Likewise.
* string/Makefile: Likewise.
* sunrpc/Makefile: Likewise.
(all): Remove target.
* sysvipc/Makefile: Include Makeconfig immediately after defining
subdir.
* termios/Makefile: Likewise.
* time/Makefile: Likewise.
* timezone/Makefile: Likewise.
(all): Remove target.
* wcsmbs/Makefile: Include Makeconfig immediately after defining
subdir.
* wctype/Makefile: Likewise.
libidn/ChangeLog:
* Makefile: Include Makeconfig immediately after defining subdir.
localedata/ChangeLog:
* Makefile: Include Makeconfig immediately after defining subdir.
(all): Remove target.
nptl/ChangeLog:
* Makefile: Include Makeconfig immediately after defining subdir.
nptl_db/ChangeLog:
* Makefile: Include Makeconfig immediately after defining subdir.