Commit Graph

205 Commits

Author SHA1 Message Date
Joseph Myers 8737be8064 Fix netdb.h addrinfo namespace (bug 18529).
netdb.h declares interfaces such as getaddrinfo if __USE_POSIX,
i.e. POSIX.1:1990 or later.  However, these interfaces were new in the
2001 edition of POSIX, although the header was in XPG4 and UNIX98, so
they should not be declared for XPG4 or UNIX98.  (This produces
spurious linknamespace test failures, although there are other
failures for this header as well for the same standards so this patch
doesn't remove any XFAILs.)  This patch corrects the condition, and
the conform/ test expectations which were similarly wrong.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #18529]
	* resolv/netdb.h [__USE_POSIX]: Change condition to
	[__USE_XOPEN2K].
	* conform/data/netdb.h-data [XPG4 || UNIX98] (struct addrinfo): Do
	not expect.
	[XPG4 || UNIX98] (AI_PASSIVE): Likewise.
	[XPG4 || UNIX98] (AI_CANONNAME): Likewise.
	[XPG4 || UNIX98] (AI_NUMERICHOST): Likewise.
	[XPG4 || UNIX98] (AI_V4MAPPED): Likewise.
	[XPG4 || UNIX98] (AI_ALL): Likewise.
	[XPG4 || UNIX98] (AI_ADDRCONFIG): Likewise.
	[XPG4 || UNIX98] (AI_NUMERICSERV): Likewise.
	[XPG4 || UNIX98] (NI_NOFQDN): Likewise.
	[XPG4 || UNIX98] (NI_NUMERICHOST): Likewise.
	[XPG4 || UNIX98] (NI_NAMEREQD): Likewise.
	[XPG4 || UNIX98] (NI_NUMERICSERV): Likewise.
	[XPG4 || UNIX98] (NI_DGRAM): Likewise.
	[XPG4 || UNIX98] (EAI_AGAIN): Likewise.
	[XPG4 || UNIX98] (EAI_BADFLAGS): Likewise.
	[XPG4 || UNIX98] (EAI_FAIL): Likewise.
	[XPG4 || UNIX98] (EAI_FAMILY): Likewise.
	[XPG4 || UNIX98] (EAI_MEMORY): Likewise.
	[XPG4 || UNIX98] (EAI_NONAME): Likewise.
	[XPG4 || UNIX98] (EAI_SERVICE): Likewise.
	[XPG4 || UNIX98] (EAI_SOCKTYPE): Likewise.
	[XPG4 || UNIX98] (EAI_SYSTEM): Likewise.
	[XPG4 || UNIX98] (EAI_SYSTEM): Likewise.
	[XPG4 || UNIX98] (freeaddrinfo): Likewise.
	[XPG4 || UNIX98] (gai_strerror): Likewise.
	[XPG4 || UNIX98] (getaddrinfo): Likewise.
	[XPG4 || UNIX98] (getnameinfo): Likewise.
2015-06-12 22:35:07 +00:00
Joseph Myers b400fdefc7 Fix grp.h endgrent, getgrent namespace (bug 18528).
grp.h declares endgrent and getgrent if __USE_XOPEN2K8 (i.e. 2008
edition of POSIX, non-XSI).  However, the 2013 Technical Corrigendum
corrected the grp.h specification to XSI-shade these functions as in
previous editions (see <http://austingroupbugs.net/view.php?id=24>),
so they should not be declared for non-XSI POSIX.  This patch corrects
the conditions - using __USE_MISC || __USE_XOPEN_EXTENDED to match
setgrent - and the conform/ test expectations for this header, thereby
fixing the conform tests for this header for XPG3 (where the
expectations were wrong) and the linknamespace tests for it for
POSIX2008 (where the header bug meant it was wrongly considered a
problem for endgrent to bring in a reference to setgrent).

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #18528]
	* grp/grp.h (endgrent): Condition on [__USE_MISC ||
	__USE_XOPEN_EXTENDED], not [__USE_XOPEN_EXTENDED ||
	__USE_XOPEN2K8].
	(getgrent): Likewise.
	* conform/data/grp.h-data [XPG3 || POSIX2008] (getgrent): Do not
	expect.
	[XPG3 || POSIX2008] (endgrent): Likewise.
	[XPG3] (setgrent): Likewise.
	* conform/Makefile (test-xfail-XPG3/grp.h/conform): Remove
	variable.
	(test-xfail-POSIX2008/grp.h/linknamespace): Likewise.
2015-06-12 22:29:19 +00:00
Joseph Myers 5371d99e87 Fix getlogin_r namespace (bug 18527).
Various functions in XPG4 bring in references to getlogin_r, which is
not in XPG4; this is also a bug for some older POSIX versions which
aren't yet covered by the linknamespace tests.  This patch fixes this
by making getlogin_r into a weak alias for __getlogin_r and using
__getlogin_r as needed.

Tested for x86_64 and x86 (testsuite, and that disassembly of
installed stripped shared libraries is unchanged by the patch).

	[BZ #18527]
	* login/getlogin_r.c (getlogin_r): Rename to __getlogin_r and
	define as weak alias of __getlogin_r.  Use libc_hidden_weak.
	* sysdeps/mach/hurd/getlogin_r.c (getlogin_r): Likewise.
	* sysdeps/unix/getlogin_r.c (getlogin_r): Likewise.
	* sysdeps/unix/sysv/linux/getlogin_r.c (getlogin_r): Likewise.
	* include/unistd.h (__getlogin_r): Declare.  Use
	libc_hidden_proto.
	* posix/glob.c (glob): Call __getlogin_r instead of getlogin_r.
	* conform/Makefile (test-xfail-XPG3/glob.h/linknamespace): Remove
	variable.
	(test-xfail-XPG3/wordexp.h/linknamespace): Likewise.
	(test-xfail-XPG4/glob.h/linknamespace): Likewise.
	(test-xfail-XPG4/wordexp.h/linknamespace): Likewise.
2015-06-12 20:02:30 +00:00
Joseph Myers 9714012ca0 Fix aio_* pread namespace (bug 18519).
aio_* bring in references to pread, which isn't in all the standards
containing aio_* (as a reference from one library to another, this is
a bug for dynamic as well as static linking).  This patch fixes this
by using __libc_pread instead, exporting that function from libc at
symbol version GLIBC_PRIVATE; the code, with conditionals that may
call either __pread64 or __libc_pread, becomes exactly analogous to
that elsewhere in the same file that may call either __pwrite64 or
__libc_pwrite.

Tested for x86_64 and x86 (testsuite, and comparison of disassembly of
installed shared libraries).  libc changes because of the PLT entry
for the newly exported __libc_pread; librt changes because of
assertion line numbers and PLT rearrangement; other stripped installed
shared libraries do not change.

	[BZ #18519]
	* posix/Versions (libc): Export __libc_pread at version
	GLIBC_PRIVATE.
	* sysdeps/pthread/aio_misc.c (handle_fildes_io): Call __libc_pread
	instead of pread.
	* conform/Makefile (test-xfail-POSIX/aio.h/linknamespace): Remove
	variable.
2015-06-12 17:34:11 +00:00
Joseph Myers 498c1f6a7c Fix ecvt_r, fcvt_r namespace (bug 18522).
The functions ecvt, fcvt and gcvt, in some standards, bring in
references to ecvt_r and fcvt_r, which aren't in any of those
standards.  The calls are correctly to __ecvt_r and __fcvt_r, but then
the names ecvt_r and fcvt_r are defined as strong aliases; this patch
changes them to weak aliases.

Tested for x86_64 and x86 (testsuite, and that disassembly of
installed stripped shared libraries is unchanged by the patch).

	[BZ #18522]
	* misc/efgcvt_r.c
	[LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) && !LONG_DOUBLE_CVT]
	(cvt_symbol): Use weak_alias instead of strong_alias.
	[LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)] (cvt_symbol): Likewise.
	* conform/Makefile (test-xfail-XPG4/stdlib.h/linknamespace):
	Remove variable.
	(test-xfail-UNIX98/stdlib.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/stdlib.h/linknamespace): Likewise.
2015-06-12 10:11:35 +00:00
Joseph Myers 9acacaa02f Fix h_errno namespace (bug 18520).
The 2008 edition of POSIX removed h_errno, but some functions still
bring in references to the h_errno external symbol.  As this symbol is
not a part of the public ABI (only __h_errno_location is), this patch
fixes this by renaming the GLIBC_PRIVATE TLS symbol to __h_errno.

Tested for x86_64 and x86 (testsuite, and comparison of installed
shared libraries).  Disassembly of all shared libraries using h_errno
changes because of the renaming (and changes to associated TLS / GOT
offsets in some cases); disassembly of libpthread on x86_64 changes
more substantially because the enlargement of .dynsym affects
subsequent addresses.

	[BZ #18520]
	* inet/herrno.c (h_errno): Rename to __h_errno.
	(__libc_h_errno): Define as alias of __h_errno not h_errno.
	* include/netdb.h [IS_IN_LIB && !IS_IN (libc)] (h_errno): Define
	to __h_errno instead of h_errno.
	* nptl/herrno.c (h_errno): Rename to __h_errno.
	(__h_errno_location): Refer to __h_errno not h_errno.
	* resolv/Versions (h_errno): Rename to __h_errno.
	* conform/Makefile (test-xfail-XOPEN2K8/grp.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K8/pwd.h/linknamespace): Likewise.
2015-06-12 10:10:18 +00:00
Joseph Myers 2f44ee08db Fix regcomp wcscoll, wcscmp namespace (bug 18497).
regcomp brings in references to wcscoll, which isn't in all the
standards that contain regcomp.  In turn, wcscoll brings in references
to wcscmp, also not in all those standards.  This patch fixes this by
making those functions into weak aliases of __wcscoll and __wcscmp and
calling those names instead as needed.

Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).

	[BZ #18497]
	* wcsmbs/wcscmp.c [!WCSCMP] (WCSCMP): Define as __wcscmp instead
	of wcscmp.
	(wcscmp): Define as weak alias of WCSCMP.
	* wcsmbs/wcscoll.c (STRCOLL): Define as __wcscoll instead of
	wcscoll.
	(USE_HIDDEN_DEF): Define.
	[!USE_IN_EXTENDED_LOCALE_MODEL] (wcscoll): Define as weak alias of
	__wcscoll.  Don't use libc_hidden_weak.
	* wcsmbs/wcscoll_l.c (STRCMP): Define as __wcscmp instead of
	wcscmp.
	* sysdeps/i386/i686/multiarch/wcscmp-c.c
	[SHARED] (libc_hidden_def): Define __GI___wcscmp instead of
	__GI_wcscmp.
	(weak_alias): Undefine and redefine.
	* sysdeps/i386/i686/multiarch/wcscmp.S (wcscmp): Rename to
	__wcscmp and define as weak alias of __wcscmp.
	* sysdeps/x86_64/wcscmp.S (wcscmp): Likewise.
	* include/wchar.h (__wcscmp): Declare.  Use libc_hidden_proto.
	(__wcscoll): Likewise.
	(wcscmp): Don't use libc_hidden_proto.
	(wcscoll): Likewise.
	* posix/regcomp.c (build_range_exp): Call __wcscoll instead of
	wcscoll.
	* posix/regexec.c (check_node_accept_bytes): Likewise.
	* conform/Makefile (test-xfail-XPG3/regex.h/linknamespace): Remove
	variable.
	(test-xfail-XPG4/regex.h/linknamespace): Likewise.
	(test-xfail-POSIX/regex.h/linknamespace): Likewise.
2015-06-09 21:07:30 +00:00
Joseph Myers d3ab671c94 Fix pathconf statvfs namespace (bug 18507).
pathconf uses __statvfs64, and fpathconf uses __fstatvfs64.  On
systems using sysdeps/unix/sysv/linux/wordsize-64, __statvfs64 then
brings in the strong symbol statvfs, and __fstatvfs64 brings in the
strong symbol fstatvfs, which are not in all the standards that have
pathconf and fpathconf.  This patch fixes this by making those symbols
into weak aliases.

Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).

	[BZ #18507]
	* sysdeps/unix/sysv/linux/fstatvfs.c (fstatvfs): Rename to
	__fstatvfs and define as weak alias of __fstatvfs.  Use
	libc_hidden_weak.
	* sysdeps/unix/sysv/linux/statvfs.c (statvs): Rename to __statvfs
	and define as weak alias of __statvfs.  Use libc_hidden_weak.
	* sysdeps/unix/sysv/linux/wordsize-64/fstatvfs.c (__fstatvfs64):
	Define as alias of __fstatvfs, not fstatvfs.
	(fstatvfs64): Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/statvfs.c (__statvfs64):
	Define as alias of __statvfs, not statvfs.
	(statvfs64): Likewise.
	* conform/Makefile (test-xfail-POSIX/unistd.h/linknamespace):
	Remove variable.
2015-06-09 19:52:01 +00:00
Joseph Myers 711f67a789 Fix open_memstream namespace (bug 18498).
open_memstream is new in the 2008 edition of POSIX.  However, the
older functions getopt, closelog and fmtmsg all bring in references to
it.  This patch fixes this in the usual way, making open_memstream
into a weak alias of __open_memstream and calling __open_memstream
from the relevant places.

Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).  32-bit builds
produce an XPASS for conform/POSIX/unistd.h/linknamespace after this
patch (because the only cause of failure left there now is 64-bit
specific); that will disappear once the 64-bit failure is resolved and
the XFAIL removed at that time.

	[BZ #18498]
	* libio/memstream.c (open_memstream): Rename to __open_memstream
	and define as weak alias of __open_memstream.
	* include/stdio.h (__open_memstream): Declare.  Use
	libc_hidden_proto.
	(open_memstream): Don't use libc_hidden_proto.
	* misc/syslog.c (__vsyslog_chk): Call __open_memstream instead of
	open_memstream.
	* posix/getopt.c (_getopt_internal_r): Likewise.
	* conform/Makefile (test-xfail-XPG3/stdio.h/linknamespace): Remove
	variable.
	(test-xfail-XPG4/stdio.h/linknamespace): Likewise.
	(test-xfail-UNIX98/stdio.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/unistd.h/linknamespace): Likewise.
2015-06-05 23:32:46 +00:00
Joseph Myers 007f2dd122 Fix psignal, psiginfo declaration conditions (bug 18483).
signal.h declares psignal and psiginfo if __USE_XOPEN2K - that is, for
the 2001 edition of POSIX.  These functions were actually added in the
2008 edition (as indicated in the header comments).  This patch fixes
the header conditionals.  This fixes some linknamespace test failures
because psiginfo uses fmemopen, which is also new in the 2008 edition,
so before the header fix this appeared to the linknamespace tests as a
2001 function bringing in references to a 2008 function.  The problem
also appeared in conformtest header namespace test results (the
conformtest data has correct conditionals for when these functions
should be visible), but the affected headers still have other
namespace problems so this doesn't fix any of those XFAILs.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #18483]
	* signal/signal.h [__USE_XOPEN2K] (psignal): Change condition to
	[__USE_XOPEN2K8].  Remove redundant #endif.
	[__USE_XOPEN2K] (psiginfo): Change condition to [__USE_XOPEN2K8].
	Remove redundant #if.
	* conform/Makefile (test-xfail-XOPEN2K/signal.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K/sys/wait.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/ucontext.h/linknamespace): Likewise.
2015-06-05 21:14:16 +00:00
Joseph Myers f014e87eff Fix fnmatch strnlen namespace (bug 18470).
fnmatch brings in references to strnlen, which isn't in all the
standards that contain fnmatch (not added until the 2008 edition of
POSIX), resulting in linknamespace test failures.  (This is contrary
to glibc conventions, rather than a standards conformance issue,
because of the str* reservation.)  This patch fixes this in the usual
way, using __strnlen instead of strnlen.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #18470]
	* posix/fnmatch.c (fnmatch) [_LIBC]: Call __strnlen instead of
	strnlen.
	* conform/Makefile (test-xfail-XPG3/fnmatch.h/linknamespace):
	Remove variable.
	(test-xfail-XPG4/fnmatch.h/linknamespace): Likewise.
	(test-xfail-POSIX/fnmatch.h/linknamespace): Likewise.
	(test-xfail-POSIX/glob.h/linknamespace): Likewise.
	(test-xfail-POSIX/wordexp.h/linknamespace): Likewise.
	(test-xfail-UNIX98/fnmatch.h/linknamespace): Likewise.
	(test-xfail-UNIX98/glob.h/linknamespace): Likewise.
	(test-xfail-UNIX98/wordexp.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/fnmatch.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/glob.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/wordexp.h/linknamespace): Likewise.
2015-06-03 13:58:58 +00:00
Szabolcs Nagy a06b40cdf5 struct stat is not posix conform
On 21/05/15 05:29, Siddhesh Poyarekar wrote:
> On Wed, May 20, 2015 at 06:55:02PM +0100, Szabolcs Nagy wrote:
>> i guess it's ok for consistency if i fix struct stat64
>> too to use __USE_XOPEN2K8.
>>
>> i will run some tests and come back with a patch
>
> I also think it would be appropriate to change this code in other
> architectures (microblaze and nacl IIRC) to make all of them
> consistent.  It is a mechanical enough change IMO that all arch
> maintainer acks is not necessary.
>

here is the patch with consistent __USE_XOPEN2K8

ok to commit?

2015-05-21  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	[BZ #18234]
	* conform/data/sys/stat.h-data (struct stat): Add tests for st_atim,
	st_mtim and st_ctim members.

	* sysdeps/nacl/bits/stat.h (struct stat, struct stat64): Make
	st_atim, st_ctim, st_mtim visible under __USE_XOPEN2K8 only.

	* sysdeps/unix/sysv/linux/generic/bits/stat.h (struct stat,):
	(struct stat64): Likewise.

	* sysdeps/unix/sysv/linux/ia64/bits/stat.h (struct stat,):
	(struct stat64): Likewise.

	* sysdeps/unix/sysv/linux/microblaze/bits/stat.h (struct stat,):
	(struct stat64): Likewise.
2015-05-26 22:27:24 +05:30
Joseph Myers 4e5f9259f3 Restore _POSIX2_C_VERSION definition (bug 438).
My review of conformtest expectations for POSIX showed up that the
_POSIX2_C_VERSION macro, required by POSIX and XPG standards before
2001, was missing in unistd.h, having been removed on 2003-04-03
despite those standards still being supported.  This patch adds it
back.  As it's in the implementation namespace, there's no need for it
to be conditional, and other such macros aren't conditional in this
header either.

Tested for x86_64 and x86 (testsuite).  Note that this *does* change
the installed libraries, because it affects the sysconf support
(present all along) for _SC_2_C_VERSION.

	[BZ #438]
	* posix/unistd.h (_POSIX2_C_VERSION): New macro.
	* conform/Makefile (test-xfail-POSIX/unistd.h/conform): Remove
	variable.
2015-05-22 17:14:04 +00:00
Joseph Myers cf06a4e357 Fix pathconf basename namespace (bug 18444).
pathconf (sysdeps/unix/sysv/linux/pathconf.c) uses basename.  But
pathconf is in POSIX back to 1990 while basename is only reserved with
external linkage in those standards including XPG functions.  This
patch fixes this namespace issue in the usual way, renaming basename
to __basename and making it into a weak alias.

Tested for x86_64 and x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).

	[BZ #18444]
	* string/basename.c (basename): Rename to __basename and define as
	weak alias of __basename.  Use libc_hidden_weak.
	* include/string.h (__basename): Declare.  Use libc_hidden_proto.
	* sysdeps/unix/sysv/linux/pathconf.c (distinguish_extX): Call
	__basename instead of basename.
	* conform/Makefile (test-xfail-POSIX2008/unistd.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K8/unistd.h/linknamespace): Likewise.
2015-05-22 17:09:36 +00:00
Joseph Myers 9d12d7652b linknamespace: whitelist re_syntax_options.
This patch adds re_syntax_options (bug 18442) to the set of symbols
that are whitelisted in the linknamespace tests because, while the
references to them are genuine bugs that should be fixed, the
involvement of data symbols makes them harder to fix than most such
bugs.

Tested for x86_64 and x86.

	* conform/linknamespace.pl (@whitelist): Add re_syntax_options.
	* conform/Makefile (test-xfail-UNIX98/regex.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K/regex.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/regex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/regex.h/linknamespace): Likewise.
2015-05-21 16:24:24 +00:00
Joseph Myers f58573781c conformtest: use proper _POSIX_C_SOURCE value for POSIX.
The conform/ tests were using -D_POSIX_C_SOURCE=199912 to test "POSIX"
(1995/6).  This patch changes them to use 199506L, the proper value
from the relevant edition of POSIX.  (This doesn't make any difference
to features.h, but is the logically correct value to use.)  Tested for
x86_64.

	* conform/GlibcConform.pm ($CFLAGS{"POSIX"}): Use
	-D_POSIX_C_SOURCE=199506L.
2015-05-20 23:14:53 +00:00
Joseph Myers 38d3d5b7bd conformtest: correct POSIX expectations for locale.h.
When cleaning up conformtest expectations for POSIX for locale.h in
<https://sourceware.org/ml/libc-alpha/2012-11/msg00382.html>, I missed
that locale.h had contents defined in POSIX.2:1993 as well as
POSIX.1:1995/6.  Thus, LC_MESSAGES *should* in fact be required for
POSIX, because POSIX.2 says so; this patch adds that expectation
back.  Tested for x86_64.

	* conform/data/locale.h-data [POSIX] (LC_MESSAGES): Require.
2015-05-20 22:56:27 +00:00
Joseph Myers be8b8f1768 conformtest: clean up POSIX expectations for unistd.h.
Concluding the series of patches to clean up conformtest expectations
for "POSIX" (POSIX.1:1995/6, union with POSIX.2:1993), this patch
cleans up expectations for unistd.h.  Tested x86_64; the new XFAIL is
for missing _POSIX2_C_VERSION.

	* conform/data/unistd.h-data (_POSIX_VERSION): Require.
	(_POSIX2_C_VERSION): Require if [POSIX || XPG3 || XPG4 || UNIX98].
	Do not mention otherwise.
	[POSIX] (_XOPEN_VERSION): Do not expect.
	[POSIX] (_XOPEN_XCU_VERSION): Likewise.
	[POSIX] (_POSIX2_C_BIND): Likewise.
	[POSIX] (_POSIX2_VERSION): Likewise.
	[POSIX] (_XOPEN_XPG2): Likewise.
	[POSIX] (_XOPEN_XPG3): Likewise.
	[POSIX] (_XOPEN_XPG4): Likewise.
	[POSIX] (_XOPEN_UNIX): Likewise.
	[POSIX] (_POSIX_ADVISORY_INFO): Likewise.
	[POSIX] (_POSIX_BARRIERS): Likewise.
	[POSIX] (_POSIX_CLOCK_SELECTION): Likewise.
	[POSIX] (_POSIX_CPUTIME): Likewise.
	[POSIX] (_POSIX_MONOTONIC_CLOCK): Likewise.
	[POSIX] (_POSIX_READER_WRITER_LOCKS): Likewise.
	[POSIX] (_POSIX_SHELL): Likewise.
	[POSIX] (_POSIX_SPAWN): Likewise.
	[POSIX] (_POSIX_SPIN_LOCKS): Likewise.
	[POSIX] (_POSIX_SPORADIC_SERVER): Likewise.
	[POSIX] (_POSIX_THREAD_CPUTIME): Likewise.
	[POSIX] (_POSIX_TYPED_MEMORY_OBJECTS): Likewise.
	[POSIX] (_POSIX_THREAD_SPORADIC_SERVER): Likewise.
	[POSIX] (_XBS5_ILP32_OFF32): Likewise.
	[POSIX] (_XBS5_ILP32_OFBIG): Likewise.
	[POSIX] (_XBS5_LP64_OFF64): Likewise.
	[POSIX] (_XBS5_LPBIG_OFFBIG): Likewise.
	[POSIX] (_POSIX_TIMEOUTS): Likewise.
	[POSIX] (_POSIX2_PBS): Likewise.
	[POSIX] (_POSIX2_PBS_ACCOUNTING): Likewise.
	[POSIX] (_POSIX2_PBS_CHECKPOINT): Likewise.
	[POSIX] (_POSIX2_PBS_LOCATE): Likewise.
	[POSIX] (_POSIX2_PBS_MESSAGE): Likewise.
	[POSIX] (_POSIX2_PBS_TRACK): Likewise.
	[POSIX] (_POSIX_TIMESTAMP_RESOLUTION): Likewise.
	[POSIX] (_CS_XBS5_ILP32_OFF32_CFLAGS): Likewise.
	[POSIX] (_CS_XBS5_ILP32_OFF32_LDFLAGS): Likewise.
	[POSIX] (_CS_XBS5_ILP32_OFF32_LIBS): Likewise.
	[POSIX] (_CS_XBS5_ILP32_OFF32_LINTFLAGS): Likewise.
	[POSIX] (_CS_XBS5_ILP32_OFFBIG_CFLAGS): Likewise.
	[POSIX] (_CS_XBS5_ILP32_OFFBIG_LDFLAGS): Likewise.
	[POSIX] (_CS_XBS5_ILP32_OFFBIG_LIBS): Likewise.
	[POSIX] (_CS_XBS5_ILP32_OFFBIG_LINTFLAGS): Likewise.
	[POSIX] (_CS_XBS5_LP64_OFF64_CFLAGS): Likewise.
	[POSIX] (_CS_XBS5_LP64_OFF64_LDFLAGS): Likewise.
	[POSIX] (_CS_XBS5_LP64_OFF64_LIBS): Likewise.
	[POSIX] (_CS_XBS5_LP64_OFF64_LINTFLAGS): Likewise.
	[POSIX] (_CS_XBS5_LPBIG_OFFBIG_CFLAGS): Likewise.
	[POSIX] (_CS_XBS5_LPBIG_OFFBIG_LDFLAGS): Likewise.
	[POSIX] (_CS_XBS5_LPBIG_OFFBIG_LIBS): Likewise.
	[POSIX] (_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS): Likewise.
	[POSIX] (_SC_2_C_BIND): Likewise.
	[POSIX] (_SC_2_C_VERSION): Likewise.
	[POSIX] (_SC_2_PBS): Likewise.
	[POSIX] (_SC_2_PBS_ACCOUNTING): Likewise.
	[POSIX] (_SC_2_PBS_CHECKPOINT): Likewise.
	[POSIX] (_SC_2_PBS_LOCATE): Likewise.
	[POSIX] (_SC_2_PBS_MESSAGE): Likewise.
	[POSIX] (_SC_2_PBS_TRACK): Likewise.
	[POSIX] (_SC_ATEXIT_MAX): Likewise.
	[POSIX] (_SC_BARRIERS): Likewise.
	[POSIX] (_SC_BASE): Likewise.
	[POSIX] (_SC_CLOCK_SELECTION): Likewise.
	[POSIX] (_SC_DEVICE_IO): Likewise.
	[POSIX] (_SC_DEVICE_SPECIFIC): Likewise.
	[POSIX] (_SC_DEVICE_SPECIFIC_R): Likewise.
	[POSIX] (_SC_FD_MGMT): Likewise.
	[POSIX] (_SC_FIFO): Likewise.
	[POSIX] (_SC_FILE_ATTRIBUTES): Likewise.
	[POSIX] (_SC_FILE_LOCKING): Likewise.
	[POSIX] (_SC_FILE_SYSTEM): Likewise.
	[POSIX] (_SC_IOV_MAX): Likewise.
	[POSIX] (_SC_MONOTONIC_CLOCK): Likewise.
	[POSIX] (_SC_NETWORKING): Likewise.
	[POSIX] (_SC_PAGE_SIZE): Likewise.
	[POSIX] (_SC_PASS_MAX): Likewise.
	[POSIX] (_SC_PIPE): Likewise.
	[POSIX] (_SC_READER_WRITER_LOCKS): Likewise.
	[POSIX] (_SC_REGEXP): Likewise.
	[POSIX] (_SC_SHELL): Likewise.
	[POSIX] (_SC_SIGNALS): Likewise.
	[POSIX] (_SC_SINGLE_PROCESS): Likewise.
	[POSIX] (_SC_SPIN_LOCKS): Likewise.
	[POSIX] (_SC_TYPED_MEMORY_OBJECTS): Likewise.
	[POSIX] (_SC_USER_GROUPS): Likewise.
	[POSIX] (_SC_USER_GROUPS_R): Likewise.
	[POSIX] (_SC_STREAMS): Likewise.
	[POSIX] (_SC_XBS5_ILP32_OFF32): Likewise.
	[POSIX] (_SC_XBS5_ILP32_OFFBIG): Likewise.
	[POSIX] (_SC_XBS5_LP64_OFF64): Likewise.
	[POSIX] (_SC_XBS5_LPBIG_OFFBIG): Likewise.
	[POSIX] (_SC_THREAD_ROBUST_PRIO_INHERIT): Likewise.
	[POSIX] (_SC_THREAD_ROBUST_PRIO_PROTECT): Likewise.
	[POSIX] (_PC_FILESIZEBITS): Likewise.
	[POSIX] (_PC_REC_INCR_XFER_SIZE): Likewise.
	[POSIX] (_PC_REC_MAX_XFER_SIZE): Likewise.
	[POSIX] (_PC_REC_MIN_XFER_SIZE): Likewise.
	[POSIX] (_PC_REC_XFER_ALIGN): Likewise.
	[POSIX] (uid_t): Likewise.
	[POSIX] (gid_t): Likewise.
	[POSIX] (off_t): Likewise.
	[POSIX] (pid_t): Likewise.
	[POSIX] (cuserid): Allow.
	(_SC_2_CHAR_TERM): Require constant.
	(_POSIX_ASYNCHRONOUS_IO): Remove duplicate optional-constant.
	* conform/Makefile (test-xfail-POSIX/unistd.h/conform): New
	variable.
2015-05-20 22:47:03 +00:00
Joseph Myers 8e65ea4dc0 Fix linknamespace test handling of architecture-specific st_other.
For mips16, some of the linknamespace tests were failing because
[MIPS16] annotations in readelf output were wrongly interpreted as
falling in the symbol index field, meaning symbol index values were
wrongly interpreted as symbol names and such names as 1 and 2 then
resulted in namespace test failures.

This patch fixes this by removing the annotations for such
architecture-specific st_other bits before splitting the readelf
output into fields.  Tested for x86_64 and mips16.

	* conform/linknamespace.pl (list_syms): Remove \[.*?\] before
	splitting into fields.
2015-05-12 17:09:49 +00:00
Joseph Myers 40176158f1 Fix scandir scandirat namespace (bug 17999).
The POSIX function scandir calls scandirat, which is not a POSIX
function.  This patch fixes this by making it use __scandirat and
making scandirat a weak alias.  There are no changes for scandir64 /
scandirat64 because those are both _GNU_SOURCE-only functions so no
namespace issue arises for them.

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

	[BZ #17999]
	* dirent/scandir.c [!SCANDIR] (SCANDIRAT): Define to __scandirat
	instead of scandirat.
	* dirent/scandirat.c [!SCANDIRAT] (SCANDIRAT): Likewise.
	[!SCANDIRAT] (SCANDIRAT_WEAK_ALIAS): Define.
	[SCANDIRAT_WEAK_ALIAS] (scandirat): Define as weak alias of
	__scandirat.
	* include/dirent.h (scandirat): Do not use libc_hidden_proto.
	(__scandirat): Declare.  Use libc_hidden_proto.
	* conform/Makefile (test-xfail-POSIX2008/dirent.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K8/dirent.h/linknamespace): Likewise.
2015-02-19 17:18:51 +00:00
Joseph Myers 4ffb177155 Fix search.h namespace (bug 17996).
The implementation of the (XSI POSIX) functions hsearch / hcreate /
hdestroy uses hsearch_r / hcreate_r / hdestroy_r, which are not POSIX
functions.  This patch makes those into weak aliases for __*_r and
uses those names for the calls within libc.

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

	[BZ #17996]
	* include/search.h (hcreate_r): Don't use libc_hidden_proto.
	(hdestroy_r): Likewise.
	(hsearch_r): Likewise.
	(__hcreate_r): Declare and use libc_hidden_proto.
	(__hdestroy_r): Likewise.
	(__hsearch_r): Likewise.
	* misc/hsearch.c (hsearch): Call __hsearch_r instead of hsearch_r.
	(hcreate): Call __hcreate_r instead of hcreate_r.
	(__hdestroy): Call __hdestroy_r instead of hdestroy_r.
	* misc/hsearch_r.c (hcreate_r): Rename to __hcreate_r and define
	as weak alias of __hcreate_r.
	(hdestroy_r): Rename to __hdestroy_r and define as weak alias of
	__hdestroy_r.
	(hsearch_r): Rename to __hsearch_r and define as weak alias of
	__hsearch_r.
	* conform/Makefile (test-xfail-XPG3/search.h/linknamespace):
	Remove variable.
	(test-xfail-XPG4/search.h/linknamespace): Likewise.
	(test-xfail-UNIX98/search.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/search.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/search.h/linknamespace): Likewise.
2015-02-18 18:47:34 +00:00
Joseph Myers 1a2325c06c Fix posix_spawn getrlimit64 namespace (bug 17991).
posix_spawn (a standard POSIX function) brings in a use of getrlimit64
(not a standard POSIX function).  This patch fixes this by using
__getrlimit64 and making getrlimit64 a weak alias.

This is more complicated than some such changes because of files that
define getrlimit64 in their own way using symbol versioning after
including the main sysdeps/unix/sysv/linux/getrlimit64.c with a
getrlimit macro defined.  There are various existing patterns for such
cases in glibc; the one I've used here is that a getrlimit64 macro
disables the weak_alias / libc_hidden_weak calls, leaving it to the
including file to define the getrlimit64 name in whatever way is
appropriate.

Tested for x86_64 and x86 that installed stripped shared libraries are
unchanged by this patch.

	[BZ #17991]
	* include/sys/resource.h (__getrlimit64): Declare.  Use
	libc_hidden_proto.
	* resource/getrlimit64.c (getrlimit64): Rename to __getrlimit64
	and define as weak alias of __getrlimit64.  Use libc_hidden_weak.
	* sysdeps/posix/spawni.c (__spawni): Call __getrlimit64 instead of
	getrlimit64.
	* sysdeps/unix/sysv/linux/getrlimit64.c (getrlimit64): Rename to
	__getrlimit64.
	[!getrlimit64] (getrlimit64): Define as weak alias of
	__getrlimit64.  Use libc_hidden_weak.
	* sysdeps/unix/sysv/linux/i386/getrlimit64.c (getrlimit64): Define
	using __getrlimit64 not __new_getrlimit64.
	(__GI_getrlimit64): Likewise.
	* sysdeps/unix/sysv/linux/mips/getrlimit64.c (getrlimit64):
	Likewise.
	(__GI_getrlimit64): Likewise.
	(__old_getrlimit64): Use __getrlimit64 not __new_getrlimit64.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
	(getrlimit): Add __getrlimit64 alias.
	* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (getrlimit):
	Likewise.
	* conform/Makefile (test-xfail-XOPEN2K/spawn.h/linknamespace):
	Remove variable.
	(test-xfail-POSIX2008/spawn.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/spawn.h/linknamespace): Likewise.
2015-02-18 00:26:35 +00:00
Joseph Myers b8986484e4 Fix isblank / isascii / toascii namespace (bug 17635).
Use of isblank brings in isascii and toascii, but isblank is a C99
function and the other two aren't; similarly, isascii and toascii are
UNIX98 functions and bring in isblank, which isn't.  (Not a
conformance issue because of the is* and to* reservation, but still
contrary to glibc practice.)  This patch fixes this by splitting
isblank out of ctype-extn.c to a separate ctype-c99.c.  isblank_l is
also moved to a separate file, ctype-c99_l.c (non-XSI POSIX.1-2008 has
isblank_l, but isascii / toascii are marked OB XSI).  (In principle
all these functions could go in separate files - that's optimal for
static linking - but they are also all very small, and splitting them
all out is not needed to fix the present bug.)

Tested for x86_64 (testsuite, and that installed stripped shared
libraries are unchanged by the patch - the ordering in which new and
existing sources are listed in ctype/Makefile is arranged so functions
go in the same order so that this comparison works).

	[BZ #17635]
	* ctype/ctype-c99.c: New file.  isblank implementation moved from
	...
	* ctype/ctype-extn.c: ... here.
	(__isblank_l): Move to ...
	* ctype/ctype-c99_l.c: ... here.  New file.
	* ctype/Makefile (routines): Add ctype-c99 and ctype-c99_l.
	* conform/Makefile (test-xfail-ISO99/ctype.h/linknamespace):
	Remove variable.
	(test-xfail-ISO11/ctype.h/linknamespace): Likewise.
	(test-xfail-XPG3/ctype.h/linknamespace): Likewise.
	(test-xfail-XPG4/ctype.h/linknamespace): Likewise.
	(test-xfail-UNIX98/ctype.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/ctype.h/linknamespace): Likewise.
2015-01-05 15:06:57 +00:00
Joseph Myers a287953a45 Fix wordsize-64 posix_fadvise64, posix_fallocate64 namespace (bug 17777).
On systems using sysdeps/unix/sysv/linux/wordsize-64, posix_fadvise64
and posix_fallocate64 (non-POSIX) are strong aliases for posix_fadvise
and posix_fallocate (POSIX), meaning references to the latter wrongly
bring in definitions of the former.  They should be weak aliases; this
patch makes them so.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).

	[BZ #17777]
	* sysdeps/unix/sysv/linux/wordsize-64/posix_fadvise.c
	(posix_fadvise64): Define as weak alias not strong alias.
	* sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
	(posix_fallocate64): Likewise.
	* conform/Makefile (test-xfail-XOPEN2K/fcntl.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K/mqueue.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/fcntl.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/mqueue.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/fcntl.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/mqueue.h/linknamespace): Likewise.
2015-01-05 14:37:07 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Joseph Myers 8ac5a76a99 Fix resolver inet_* namespace (bug 17722).
Parts of the resolver brought in by pthreads (at least) use inet_*
functions that aren't in the 1995/6 edition of POSIX that introduced
pthreads (or in one case, use __inet_aton which is then defined in the
same file as non-weak inet_addr).  This patch fixes this by making the
affected functions into weak alias for __inet_* and using those names
in the problematic resolver code.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).

	[BZ #17722]
	* inet/inet_mkadr.c (inet_makeaddr): Rename to __inet_makeaddr and
	define as weak alias of __inet_makeaddr.
	* resolv/inet_addr.c (inet_addr): Rename to __inet_addr and define
	as weak alias of __inet_addr.
	* resolv/inet_pton.c (inet_pton): Rename to __inet_pton and define
	as weak alias of __inet_pton.  Use libc_hidden_weak.
	* include/arpa/inet.h (__inet_pton): Declare.  Use
	libc_hidden_proto.
	(inet_makeaddr): Don't use libc_hidden_proto.
	(__inet_makeaddr): Declare.  Use libc_hidden_proto.
	* resolv/res_init.c (__res_vinit): Use __inet_pton instead of
	inet_pton.  Use __inet_makeaddr instead of inet_makeaddr.
	* conform/Makefile (test-xfail-POSIX/pthread.h/linknamespace):
	Remove variable.
	(test-xfail-POSIX/sched.h/linknamespace): Likewise.
	(test-xfail-POSIX/time.h/linknamespace): Likewise.
2014-12-17 18:09:11 +00:00
Joseph Myers 380292ba8b Fix x86_64 memrchr namespace (bug 17719).
On x86_64, memrchr (not a standard function) is defined as a strong
symbol, instead of a weak alias of __memrchr as on other
architectures.  This results in linknamespace test failures from the
use of __memrchr from dirname.  (Not a conformance issue because of
the mem* reservation, but contrary to glibc conventions.)  This patch
makes x86_64 follow other architectures by defining memrchr as a weak
alias.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).

	[BZ #17719]
	* sysdeps/x86_64/memrchr.S (memrchr): Rename to __memrchr and
	define as weak alias of __memrchr.
	(__memrchr): Do not define as strong alias of memrchr.
	* conform/Makefile (test-xfail-XPG4/libgen.h/linknamespace):
	Remove variable.
	(test-xfail-UNIX98/libgen.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/libgen.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/libgen.h/linknamespace): Likewise.
2014-12-16 18:31:31 +00:00
Joseph Myers 9a44d530c4 Fix resolver if_* namespace (bug 17717).
Resolver code, brought in by pthreads (at least), uses if_* interfaces
that weren't in POSIX before 2001, resulting in linknamespace
failures.  This patch changes those interfaces to be weak aliases of
__if_* and makes the resolver use __if_* directly.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).

	[BZ #17717]
	* inet/if_index.c (if_nametoindex): Rename to __if_nametoindex and
	define as weak alias of __if_nametoindex.  Use libc_hidden_weak.
	(if_indextoname): Rename to __if_indextoname and define as weak
	alias of __if_indextoname.  Use libc_hidden_weak.
	(if_freenameindex): Rename to __if_freenameindex and define as
	weak alias of __if_freenameindex.
	(if_nameindex): Rename to __if_nameindex and define as weak alias
	of __if_nameindex.
	* sysdeps/mach/hurd/if_index.c (if_nametoindex): Rename to
	__if_nametoindex and define as weak alias of __if_nametoindex.
	Use libc_hidden_weak.
	(if_freenameindex): Rename to __if_freenameindex and define as
	weak alias of __if_freenameindex.
	(if_nameindex): Rename to __if_nameindex and define as weak alias
	of __if_nameindex.
	(if_indextoname): Rename to __if_indextoname and define as weak
	alias of __if_indextoname.  Use libc_hidden_weak.
	* sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Rename to
	__if_nametoindex and define as weak alias of __if_nametoindex.
	Use libc_hidden_weak.
	(if_freenameindex): Rename to __if_freenameindex and define as
	weak alias of __if_freenameindex.  Use libc_hidden_weak.
	(if_nameindex_netlink): Use __if_freenameindex instead of
	if_freenameindex.
	(if_nameindex): Rename to __if_nameindex and define as weak alias
	of __if_nameindex.  Use libc_hidden_weak.
	(if_indextoname): Rename to __if_indextoname and define as weak
	alias of __if_indextoname.  Use libc_hidden_weak.
	* include/net/if.h [!_ISOMAC] (__if_nametoindex): Declare and use
	libc_hidden_proto.
	[!_ISOMAC] (__if_freenameindex): Likewise.
	* resolv/res_init.c (__res_vinit): Use __if_nametoindex instead of
	if_nametoindex.
	* conform/Makefile (test-xfail-XPG4/grp.h/linknamespace): Remove
	variable.
	(test-xfail-XPG4/pwd.h/linknamespace): Likewise.
	(test-xfail-UNIX98/aio.h/linknamespace): Likewise.
	(test-xfail-UNIX98/grp.h/linknamespace): Likewise.
	(test-xfail-UNIX98/pthread.h/linknamespace): Likewise.
	(test-xfail-UNIX98/pwd.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sched.h/linknamespace): Likewise.
	(test-xfail-UNIX98/time.h/linknamespace): Likewise.
2014-12-16 18:18:49 +00:00
Joseph Myers d003ada20e Remove some semaphore.h linknamespace XFAILs.
Roland's recent sem_* changes introduced some XPASSes for semaphore.h
linknamespace tests by removing a non-static variable "mountpoint".
This patch removes the XFAILs for the fixed bug.

Tested for x86_64.

	* conform/Makefile (test-xfail-UNIX98/semaphore.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K/semaphore.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/semaphore.h/linknamespace): Likewise.
2014-12-16 16:25:08 +00:00
Joseph Myers 2cfbdb9a27 Fix strftime wcschr namespace (bug 17634).
Use of strftime, a C90 function, ends up bringing in wcschr, which is
not a C90 function.  Although not a conformance bug (C90 reserves
wcs*), this is still contrary to glibc practice of avoiding relying on
those reservations; this patch arranges for the internal uses to use
__wcschr instead, with wcschr being a weak alias.  This is more
complicated than some such patches because of the various IFUNC
definitions of wcschr (which include code redefining libc_hidden_def
in a way that involves creating __GI_wcschr manually and so also needs
to create __GI___wcschr after the change of internal uses to use
__wcschr).

Tested for x86_64 and 32-bit x86 (testsuite, and that disassembly of
installed shared libraries is unchanged by the patch).

2014-12-10  Joseph Myers  <joseph@codesourcery.com>
	    Adhemerval Zanella  <azanella@linux.vnet.ibm.com>

	[BZ #17634]
	* wcsmbs/wcschr.c [!WCSCHR] (wcschr): Define as __wcschr.
	Undefine after defining function.  Define as weak alias of
	__wcschr.  Use libc_hidden_weak.
	* include/wchar.h (__wcschr): Declare.  Use libc_hidden_proto.
	* sysdeps/i386/i686/multiarch/wcschr-c.c [IS_IN (libc) && SHARED]
	(libc_hidden_def): Also define __GI___wcschr alias.
	* sysdeps/i386/i686/multiarch/wcschr.S (wcschr): Rename to
	__wcschr and define as weak alias of __wcschr.
	* sysdeps/powerpc/power6/wcschr.c [!WCSCHR] (WCSCHR): Define as
	__wcschr.
	[!WCSCHR] (DEFAULT_WCSCHR): Define.
	[DEFAULT_WCSCHR] (__wcschr): Use libc_hidden_def.
	[DEFAULT_WCSCHR] (wcschr): Define as weak alias of __wcschr.  Use
	libc_hidden_weak.  Do not use libc_hidden_def.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c
	[IS_IN (libc) && SHARED] (libc_hidden_def): Also define
	__GI___wcschr alias.
	* sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c
	[IS_IN (libc)] (wcschr): Define as macro expanding to
	__redirect_wcschr.
	[IS_IN (libc)] (__wcschr_ppc): Use __redirect_wcschr in typeof.
	[IS_IN (libc)] (__wcschr_power6): Likewise.
	[IS_IN (libc)] (__wcschr_power7): Likewise.
	[IS_IN (libc)] (__libc_wcschr): New.  Define with libc_ifunc
	instead of wcschr.
	[IS_IN (libc)] (wcschr): Undefine and define as weak alias of
	__libc_wcschr.
	[!IS_IN (libc)] (libc_hidden_def): Do not undefine and redefine.
	* sysdeps/powerpc/powerpc64/multiarch/wcschr.c (wcschr): Rename to
	__wcschr and define as weak alias of __wcschr.  Use
	libc_hidden_builtin_def.
	* sysdeps/x86_64/wcschr.S (wcschr): Rename to __wcschr and define
	as weak alias of __wcschr.  Use libc_hidden_weak.
	* time/alt_digit.c (_nl_get_walt_digit): Use __wcschr instead of
	wcschr.
	* time/era.c (_nl_init_era_entries): Likewise.
	* conform/Makefile (test-xfail-ISO/time.h/linknamespace): Remove
	variable.
	(test-xfail-XPG3/time.h/linknamespace): Likewise.
	(test-xfail-XPG4/time.h/linknamespace): Likewise.
2014-12-10 16:59:02 +00:00
Joseph Myers c5c2b7c3fd Fix pthreads getrlimit, gettimeofday namespace (bug 17682).
Some pthreads functions use getrlimit and gettimeofday, but these
functions are XSI, not base POSIX; this is a namespace issue for
dynamic linking as well as static linking.  This patch makes them use
__getrlimit and __gettimeofday instead - the former needed to be newly
exported from libc.so at GLIBC_PRIVATE (and so now needs
libc_hidden_proto / libc_hidden_def), the latter was already exported.

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).

	[BZ #17682]
	* resource/Versions (libc): Add __getrlimit at GLIBC_PRIVATE.
	* resource/getrlimit.c (__getrlimit): Use libc_hidden_def.
	* sysdeps/mach/hurd/getrlimit.c (__getrlimit): Likewise.
	* include/sys/resource.h (__getrlimit): Use libc_hidden_proto.
	* nptl/nptl-init.c (__pthread_initialize_minimal_internal): Use
	__getrlimit instead of getrlimit.
	* nptl/pthread_cond_timedwait.c (__pthread_cond_timedwait): Use
	__gettimeofday instead of gettimeofday.
	* nptl/pthread_rwlock_timedrdlock.c (pthread_rwlock_timedrdlock):
	Likewise.
	* nptl/pthread_rwlock_timedwrlock.c (pthread_rwlock_timedwrlock):
	Likewise.
	* sysdeps/pthread/aio_misc.c (handle_fildes_io): Likewise.
	* conform/Makefile (test-xfail-POSIX2008/aio.h/linknamespace):
	Remove variable.
	(test-xfail-POSIX2008/pthread.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/time.h/linknamespace): Likewise.
2014-12-06 23:40:48 +00:00
Joseph Myers 84dbedb608 Fix linknamespace h_errno handling.
Some linknamespace tests were failing because of references to
h_errno.  References to this symbol should be allowed for XPG4, UNIX98
and XOPEN2K; this patch adds it to the list of allowed data symbols
for those standards.  (h_errno was removed in the 2008 edition of
POSIX, so POSIX2008 and XOPEN2K8 references to it are genuine bugs;
fortunately it's not a public data symbol - __h_errno_location is
public, TLS h_errno is GLIBC_PRIVATE - so the symbol can simply be
renamed to __h_errno to fix those bugs without the ABI complications
normally associated with namespace issues for data symbols.)

Tested for x86_64.

	* conform/list-header-symbols.pl (%extra_syms): Add h_errno for
	XPG4, UNIX98 and XOPEN2K.
	* conform/Makefile (test-xfail-XOPEN2K/grp.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K/pwd.h/linknamespace): Likewise.
2014-12-04 17:12:46 +00:00
Joseph Myers e3d6dba5df Fix linknamespace getdate_err handling.
Some linknamespace tests were failing because of references to
getdate_err.  References to this symbol should be allowed for XPG4 and
later XSI standards; it was missing from the whitelist of data
symbols.  This patch adds it to that list.

Tested for x86_64.

	* conform/list-header-symbols.pl (%extra_syms): Add getdate_err
	for XPG4, UNIX98, XOPEN2K and XOPEN2K8.
	* conform/Makefile (test-xfail-XOPEN2K/pthread.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K/time.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/pthread.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/time.h/linknamespace): Likewise.
2014-12-03 15:21:28 +00:00
Joseph Myers 28a91e8f65 Remove some linknamespace test XFAILs.
It seems two of the XFAILed linknamespace tests were completely fixed
by some of my recent namespace fixes in combination (although not by
any individual one of those fixes relative to the sources used for
testing each patch, or that individual fix would also have removed the
XFAIL in question).  This patch removes those XFAILs that are no
longer needed.

Tested for x86_64.

	* conform/Makefile (test-xfail-XOPEN2K/aio.h/linknamespace):
	Remove variable.
	(test-xfail-XOPEN2K8/aio.h/linknamespace): Likewise.
2014-12-02 23:38:47 +00:00
Joseph Myers 7f994279e9 Fix getifaddrs, freeifaddrs namespace (bug 17668).
Various objects in glibc bring in ifaddrs.o (via references to
__netlink_*) and thereby getifaddrs and freeifaddrs, which are not
part of any standard supported by glibc.  These should be weak aliases
of __getifaddrs and __freeifaddrs; this patch makes them so.

(The path by which these functions are brought in is Linux-specific,
but it seems less confusing to make all versions of these functions
weak aliases rather than only the Linux-specific versions that
definitely need it.)

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).

	[BZ #17668]
	* inet/ifaddrs.c (getifaddrs): Rename to __getifaddrs and define
	as weak alias of __getifaddrs.  Use libc_hidden_weak.
	(freeifaddrs): Rename to __freeifaddrs and define as weak alias of
	__freeifaddrs.  Use libc_hidden_weak.
	* sysdeps/gnu/ifaddrs.c (getifaddrs): Rename to __getifaddrs and
	define as weak alias of __getifaddrs.  Use libc_hidden_weak.
	(freeifaddrs): Rename to __freeifaddrs and define as weak alias of
	__freeifaddrs.  Use libc_hidden_weak.
	* sysdeps/unix/sysv/linux/ifaddrs.c (getifaddrs): Rename to
	__getifaddrs and define as weak alias of __getifaddrs.  Use
	libc_hidden_weak.
	(freeifaddrs): Rename to __freeifaddrs and define as weak alias of
	__freeifaddrs.  Use libc_hidden_weak.
	* conform/Makefile (test-xfail-XOPEN2K/net/if.h/linknamespace):
	Remove variable.
	(test-xfail-POSIX2008/net/if.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/net/if.h/linknamespace): Likewise.
2014-12-02 23:11:09 +00:00
Joseph Myers 84e5e75640 Fix fgets_unlocked namespace issues (bug 17664).
Various POSIX functions bring in res_init.o, res_hconf.o or
mntent_r.o, which use fgets_unlocked, which is not a POSIX function.
This patch arranges for them to use __fgets_unlocked instead.  (The
IS_IN (libc) conditional in rec_hconf.c is needed because that file is
also used in nscd.)

Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch except for an assertion line
number).  Note that most of the linknamespace tests that failed
because of fgets_unlocked from the resolver also fail because of other
symbols brought in by the resolver, so the number of XFAILs this
removes is limited.  Also note that fgets_unlocked failures for
unistd.h for XPG3/XPG4 showed up that actually unistd.h is declaring
too much for XPG3/XPG4 (bug 17665) - there is no actual need to make
getusershell.c use __fgets_unlocked (at least as regards formal
standards are concerned; maybe it should still change for
namespace-cleanness of _DEFAULT_SOURCE) because the functions there
aren't actually in any of the supported standards; the correct fix for
those failures will be to stop the *usershell* functions appearing in
unistd.h for XPG3/XPG4.

	[BZ #17664]
	* misc/mntent_r.c (__getmntent_r): Use __fgets_unlocked instead of
	fgets_unlocked.
	* resolv/res_hconf.c [IS_IN (libc)] (fgets_unlocked): Define to
	__fgets_unlocked.
	* resolv/res_init.c (__res_vinit): Use __fgets_unlocked instead of
	fgets_unlocked.
	* conform/Makefile (test-xfail-XPG4/sys/statvfs.h/linknamespace):
	Remove variable.
	(test-xfail-POSIX/sys/mman.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sys/mman.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/sys/mman.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/sys/mman.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/sys/mman.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/sys/statvfs.h/linknamespace): Likewise.
2014-12-02 21:31:24 +00:00
Joseph Myers 0e7e69baa8 Make linknamespace tests check only relevant libraries.
This patch addresses one known caveat in the linknamespace tests: with
this patch they will now only look for definitions of symbols in
relevant libraries, meaning that librt and libpthread are not checked
for ISO C standards, XPG3 and XPG4.

In particular, this means that if __pthread_initialize_minimal is
somehow brought in for one of those standards, the definition from
libc-tls.o will be considered instead of that from libpthread, so
avoiding bringing in lots of other libpthread symbols.  This should
address some of the failures reported by Carlos in
<https://sourceware.org/ml/libc-alpha/2014-11/msg00882.html>, where
__pointer_chk_guard_local brought in __pthread_initialize_minimal.

Tested for x86_64.  The removal of one XFAIL for XPG4 actually shows
up a header bug (shm_open should not be declared for XPG4 - the
namespace issue was for symbols brought in by shm_open, which is no
longer found at all now librt isn't searched; I've filed bug 17663 for
the header bug, though it would show up eventually anyway in the
course of review of conform/ data against XPG4).

Committed.

	* conform/Makefile (linknamespace-symlist-stdlibs-base): New
	variable.
	(linknamespace-symlist-stdlibs-tests): Likewise.
	(tests-special): Append $(linknamespace-symlist-stdlibs-tests)
	instead of $(objpfx)symlist-stdlibs.
	(linknamespace-libs-isoc): New variable.
	(linknamespace-libs): Use $(linknamespace-libs-isoc).
	(linknamespace-libs-ISO): New variable.
	(linknamespace-libs-ISO99): Likewise.
	(linknamespace-libs-ISO11): Likewise.
	(linknamespace-libs-XPG3): Likewise.
	(linknamespace-libs-XPG4): Likewise.
	(linknamespace-libs-POSIX): Likewise.
	(linknamespace-libs-UNIX98): Likewise.
	(linknamespace-libs-XOPEN2K): Likewise.
	(linknamespace-libs-POSIX2008): Likewise.
	(linknamespace-libs-XOPEN2K8): Likewise.
	($(objpfx)symlist-stdlibs): Replace by
	$(linknamespace-symlist-stdlibs-tests).  Use
	$(linknamespace-libs-$*) as set of libraries.
	($(linknamespace-header-tests)): Update dependencies.  Use
	$(objpfx)symlist-stdlibs-$$std for --libsyms argument.
	(test-xfail-XPG4/sys/mman.h/linknamespace): Remove.
	* conform/linknamespace.pl: Remove comment about considering
	definitions of symbols from irrelevant libraries.
2014-11-29 01:46:56 +00:00
Joseph Myers 9744496f8a Fix perror fileno namespace (bug 17633).
perror, an ISO C function, uses fileno, which is not an ISO C
function.  This patch makes it use __fileno instead.  (The nearby call
to fdopen is not a problem because that's #defined to _IO_new_fdopen.)

Tested for x86_64 (testsuite, and that installed stripped shared
libraries are unchanged by this patch).

	[BZ #17633]
	* stdio-common/perror.c (perror): Call __fileno instead of fileno.
	* conform/Makefile (test-xfail-ISO/stdio.h/linknamespace): Remove
	variable.
	(test-xfail-ISO99/stdio.h/linknamespace): Likewise.
	(test-xfail-ISO11/stdio.h/linknamespace): Likewise.
2014-11-24 15:59:15 +00:00
Joseph Myers 107a5bf085 Fix libm mpone, mptwo namespace (bug 17616).
libm uses symbols mpone and mptwo for internal purposes.  This patch
moves them to the implementation namespace (__mpone and __mptwo).

Tested for x86_64 (testsuite, and that installed stripped shared
libraries are unchanged by the patch).

	[BZ #17616]
	* sysdeps/ieee754/dbl-64/mpa.c (mpone): Rename to __mpone.
	(mptwo): Rename to __mptwo.
	(__inv): Use __mptwo instead of mptwo.
	* sysdeps/ieee754/dbl-64/mpa.h (mpone): Rename to __mpone.
	(mptwo): Rename to __mptwo.
	* sysdeps/ieee754/dbl-64/mpatan.c (__mpatan): Use __mpone instead
	of mpone and __mptwo instead of mptwo.
	* sysdeps/ieee754/dbl-64/mpatan2.c (__mpatan2): Use __mpone
	instead of mpone.
	* sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Likewise.
	* sysdeps/ieee754/dbl-64/mplog.c (__mplog): Likewise.
	* sysdeps/ieee754/dbl-64/sincos32.c (__c32): Use __mpone instead
	of mpone and __mptwo instead of mptwo.
	(__mpranred): Use __mpone instead of mpone.
	* conform/Makefile (test-xfail-ISO/math.h/linknamespace): Remove
	variable.
	(test-xfail-ISO99/complex.h/linknamespace): Likewise.
	(test-xfail-ISO99/math.h/linknamespace): Likewise.
	(test-xfail-ISO99/tgmath.h/linknamespace): Likewise.
	(test-xfail-ISO11/complex.h/linknamespace): Likewise.
	(test-xfail-ISO11/math.h/linknamespace): Likewise.
	(test-xfail-ISO11/tgmath.h/linknamespace): Likewise.
	(test-xfail-XPG3/math.h/linknamespace): Likewise.
	(test-xfail-XPG4/math.h/linknamespace): Likewise.
	(test-xfail-POSIX/math.h/linknamespace): Likewise.
	(test-xfail-UNIX98/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/complex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/tgmath.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/complex.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/math.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/tgmath.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/complex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/tgmath.h/linknamespace): Likewise.
2014-11-18 15:40:56 +00:00
Joseph Myers a473381208 Only declare __sigpause in installed signal.h when necessary.
This patch makes the installed signal.h declare __sigpause only when
necessary (when a macro definition of sigpause makes use of
__sigpause), rather than unconditionally.  This fixes false positives
in the linknamespace tests by making it visible to those tests that no
use of ISO C functionality will actually bring in the definition of
__sigpause and so bring in the other symbols defined in the same
object.  There is no bug filed in Bugzilla because this is fixing
false positives rather than any user-visible bug.

Tested for x86_64 (testsuite, and that installed stripped shared
libraries are unchanged by this patch).

	* signal/signal.h (__sigpause): Only declare if [__USE_XOPEN &&
	!__GNUC__].
	* include/signal.h (__sigpause): Move declaration above call to
	libc_hidden_proto.
	* conform/Makefile (test-xfail-ISO/signal.h/linknamespace): Remove
	variable.
	(test-xfail-ISO99/signal.h/linknamespace): Likewise.
	(test-xfail-ISO11/signal.h/linknamespace): Likewise.
2014-11-14 18:35:42 +00:00
Joseph Myers 24f4f8253f Add tests for namespace for static linking.
One thing we currently try to ensure manually is that glibc is
namespace-clean for static linking; that is, if you only use features
from a particular standard (including the set of features exposed by
headers given feature test macros such as _DEFAULT_SOURCE that don't
correspond to any written standard), the library objects brought in by
the static linker will not define or use (strong) names that are
reserved to the user in that standard.

This patch implements automatic tests for this, using the same set of
standards as for the header conformance tests (it would, however, be
easy to add more standards for this testing, without them needing to
have the definitions of expected header contents for the header
tests).  The tests are based on the functions declared in each header,
as extracted using GCC's -aux-info option.  The following comment from
linknamespace.pl explains the caveats around this approach:

Here's an example of the output for ISO (C90) assert.h, from before my
recent fixes and whitelisting of cases that seem more complicated to
fix:

[initial] __assert_fail -> [libc.a(assert.o)] free -> [libc.a(malloc.o)] __get_nprocs -> [libc.a(getsysstats.o)] fgets_unlocked
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __libc_setlocale_lock -> [libc.a(setlocale.o)] _nl_archive_subfreeres -> [libc.a(loadarchive.o)] __sysconf -> [libc.a(sysconf.o)] __tzname_max -> [libc.a(tzset.o)] __tzfile_compute -> [libc.a(tzfile.o)] fileno
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __libc_setlocale_lock -> [libc.a(setlocale.o)] _nl_archive_subfreeres -> [libc.a(loadarchive.o)] __sysconf -> [libc.a(sysconf.o)] __tzname_max -> [libc.a(tzset.o)] __tzfile_compute -> [libc.a(tzfile.o)] fread_unlocked
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __libc_setlocale_lock -> [libc.a(setlocale.o)] _nl_archive_subfreeres -> [libc.a(loadarchive.o)] __sysconf -> [libc.a(sysconf.o)] __tzname_max -> [libc.a(tzset.o)] __tzfile_compute -> [libc.a(tzfile.o)] ftello
[initial] __assert_fail -> [libc.a(assert.o)] free -> [libc.a(malloc.o)] malloc_info
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __libc_setlocale_lock -> [libc.a(setlocale.o)] _nl_default_locale_path -> [libc.a(findlocale.o)] memmem
[initial] __assert_perror_fail -> [libc.a(assert-perr.o)] __strerror_r -> [libc.a(_strerror.o)] mempcpy
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] _nl_find_domain -> [libc.a(finddomain.o)] _nl_expand_alias -> [libc.a(localealias.o)] qsort -> [libc.a(msort.o)] qsort_r
[initial] __assert_fail -> [libc.a(assert.o)] _dl_pagesize -> [libc.a(dl-support.o)] __rawmemchr -> [libc.a(rawmemchr.o)] rawmemchr
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] __getcwd -> [libc.a(getcwd.o)] rewinddir
[initial] __assert_fail -> [libc.a(assert.o)] stderr
[initial] __assert_fail -> [libc.a(assert.o)] stderr -> [libc.a(stdio.o)] stdin
[initial] __assert_fail -> [libc.a(assert.o)] stderr -> [libc.a(stdio.o)] stdout
[initial] __assert_fail -> [libc.a(assert.o)] __dcgettext -> [libc.a(dcgettext.o)] __dcigettext -> [libc.a(dcigettext.o)] stpcpy
[initial] __assert_fail -> [libc.a(assert.o)] __fxprintf -> [libc.a(fxprintf.o)] _IO_vfprintf -> [libc.a(vfprintf.o)] __printf_fp -> [libc.a(printf_fp.o)] wmemset

Of the 161 XFAILs, seven are the inevitable varargs.h and ndbm.h
failures; I think the remaining 154 mostly represent genuine bugs in
glibc that should mostly be straightforward to fix (probably rather
fewer than 154 bugs - issues generally affect multiple headers, for
multiple standards).  (When fixing, of course you need to file a bug
in Bugzilla, and check for the possibility that the header
conditionals are what's incorrect - that the first listed symbol
shouldn't have been declared, or that the symbol finally brought in
should have been declared.)

	* conform/GlibcConform.pm: New file.
	* conform/conformtest.pl: Use GlibcConform module.
	* conform/linknamespace.pl: New file.
	* conform/list-header-symbols.pl: Likewise.
	* conform/Makefile (linknamespace-symlists-base): New variable.
	(linknamespace-symlists-tests): Likewise.
	(linknamespace-header-base): Likewise.
	(linknamespace-header-tests): Likewise.
	(tests-special): Add new tests.
	($(linknamespace-symlists-tests)): New rule.
	(linknamespace-libs): New variable.
	($(objpfx)symlist-stdlibs): New rule.
	($(linknamespace-header-tests)): Likewise.
	(test-xfail-XPG3/varargs.h/linknamespace): New variable.
	(test-xfail-XPG4/varargs.h/linknamespace): Likewise.
	(test-xfail-UNIX98/varargs.h/linknamespace): Likewise.
	(test-xfail-XPG4/ndbm.h/linknamespace): Likewise.
	(test-xfail-UNIX98/ndbm.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/ndbm.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/ndbm.h/linknamespace): Likewise.
	(test-xfail-ISO/math.h/linknamespace): Likewise.
	(test-xfail-ISO/signal.h/linknamespace): Likewise.
	(test-xfail-ISO/stdio.h/linknamespace): Likewise.
	(test-xfail-ISO/time.h/linknamespace): Likewise.
	(test-xfail-ISO99/complex.h/linknamespace): Likewise.
	(test-xfail-ISO99/ctype.h/linknamespace): Likewise.
	(test-xfail-ISO99/math.h/linknamespace): Likewise.
	(test-xfail-ISO99/signal.h/linknamespace): Likewise.
	(test-xfail-ISO99/stdio.h/linknamespace): Likewise.
	(test-xfail-ISO99/tgmath.h/linknamespace): Likewise.
	(test-xfail-ISO11/complex.h/linknamespace): Likewise.
	(test-xfail-ISO11/ctype.h/linknamespace): Likewise.
	(test-xfail-ISO11/math.h/linknamespace): Likewise.
	(test-xfail-ISO11/signal.h/linknamespace): Likewise.
	(test-xfail-ISO11/stdio.h/linknamespace): Likewise.
	(test-xfail-ISO11/tgmath.h/linknamespace): Likewise.
	(test-xfail-XPG3/ctype.h/linknamespace): Likewise.
	(test-xfail-XPG3/fnmatch.h/linknamespace): Likewise.
	(test-xfail-XPG3/glob.h/linknamespace): Likewise.
	(test-xfail-XPG3/math.h/linknamespace): Likewise.
	(test-xfail-XPG3/regex.h/linknamespace): Likewise.
	(test-xfail-XPG3/search.h/linknamespace): Likewise.
	(test-xfail-XPG3/stdio.h/linknamespace): Likewise.
	(test-xfail-XPG3/time.h/linknamespace): Likewise.
	(test-xfail-XPG3/unistd.h/linknamespace): Likewise.
	(test-xfail-XPG3/wordexp.h/linknamespace): Likewise.
	(test-xfail-XPG4/ctype.h/linknamespace): Likewise.
	(test-xfail-XPG4/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-XPG4/fnmatch.h/linknamespace): Likewise.
	(test-xfail-XPG4/glob.h/linknamespace): Likewise.
	(test-xfail-XPG4/grp.h/linknamespace): Likewise.
	(test-xfail-XPG4/libgen.h/linknamespace): Likewise.
	(test-xfail-XPG4/math.h/linknamespace): Likewise.
	(test-xfail-XPG4/netdb.h/linknamespace): Likewise.
	(test-xfail-XPG4/pwd.h/linknamespace): Likewise.
	(test-xfail-XPG4/regex.h/linknamespace): Likewise.
	(test-xfail-XPG4/search.h/linknamespace): Likewise.
	(test-xfail-XPG4/stdio.h/linknamespace): Likewise.
	(test-xfail-XPG4/stdlib.h/linknamespace): Likewise.
	(test-xfail-XPG4/sys/mman.h/linknamespace): Likewise.
	(test-xfail-XPG4/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-XPG4/syslog.h/linknamespace): Likewise.
	(test-xfail-XPG4/time.h/linknamespace): Likewise.
	(test-xfail-XPG4/unistd.h/linknamespace): Likewise.
	(test-xfail-XPG4/wordexp.h/linknamespace): Likewise.
	(test-xfail-POSIX/aio.h/linknamespace): Likewise.
	(test-xfail-POSIX/fnmatch.h/linknamespace): Likewise.
	(test-xfail-POSIX/glob.h/linknamespace): Likewise.
	(test-xfail-POSIX/math.h/linknamespace): Likewise.
	(test-xfail-POSIX/mqueue.h/linknamespace): Likewise.
	(test-xfail-POSIX/pthread.h/linknamespace): Likewise.
	(test-xfail-POSIX/regex.h/linknamespace): Likewise.
	(test-xfail-POSIX/sched.h/linknamespace): Likewise.
	(test-xfail-POSIX/semaphore.h/linknamespace): Likewise.
	(test-xfail-POSIX/sys/mman.h/linknamespace): Likewise.
	(test-xfail-POSIX/time.h/linknamespace): Likewise.
	(test-xfail-POSIX/unistd.h/linknamespace): Likewise.
	(test-xfail-POSIX/wordexp.h/linknamespace): Likewise.
	(test-xfail-UNIX98/aio.h/linknamespace): Likewise.
	(test-xfail-UNIX98/ctype.h/linknamespace): Likewise.
	(test-xfail-UNIX98/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-UNIX98/fnmatch.h/linknamespace): Likewise.
	(test-xfail-UNIX98/glob.h/linknamespace): Likewise.
	(test-xfail-UNIX98/grp.h/linknamespace): Likewise.
	(test-xfail-UNIX98/libgen.h/linknamespace): Likewise.
	(test-xfail-UNIX98/math.h/linknamespace): Likewise.
	(test-xfail-UNIX98/mqueue.h/linknamespace): Likewise.
	(test-xfail-UNIX98/netdb.h/linknamespace): Likewise.
	(test-xfail-UNIX98/pthread.h/linknamespace): Likewise.
	(test-xfail-UNIX98/pwd.h/linknamespace): Likewise.
	(test-xfail-UNIX98/regex.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sched.h/linknamespace): Likewise.
	(test-xfail-UNIX98/search.h/linknamespace): Likewise.
	(test-xfail-UNIX98/semaphore.h/linknamespace): Likewise.
	(test-xfail-UNIX98/stdio.h/linknamespace): Likewise.
	(test-xfail-UNIX98/stdlib.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sys/mman.h/linknamespace): Likewise.
	(test-xfail-UNIX98/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-UNIX98/syslog.h/linknamespace): Likewise.
	(test-xfail-UNIX98/time.h/linknamespace): Likewise.
	(test-xfail-UNIX98/unistd.h/linknamespace): Likewise.
	(test-xfail-UNIX98/wchar.h/linknamespace): Likewise.
	(test-xfail-UNIX98/wordexp.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/aio.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/complex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/fcntl.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/fnmatch.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/glob.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/grp.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/libgen.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/mqueue.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/net/if.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/netdb.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/pthread.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/pwd.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/regex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/search.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/semaphore.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/signal.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/spawn.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/stdlib.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/sys/mman.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/sys/wait.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/syslog.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/tgmath.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/time.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/ucontext.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/unistd.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/wordexp.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/aio.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/complex.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/ctype.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/dirent.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/fcntl.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/grp.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/math.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/mqueue.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/net/if.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/netdb.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/pthread.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/regex.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/semaphore.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/spawn.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/sys/mman.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/tgmath.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/time.h/linknamespace): Likewise.
	(test-xfail-POSIX2008/unistd.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/aio.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/complex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/dirent.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/fcntl.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/fmtmsg.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/grp.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/libgen.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/math.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/mqueue.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/net/if.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/netdb.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/pthread.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/pwd.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/regex.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/search.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/semaphore.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/spawn.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/sys/mman.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/sys/statvfs.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/syslog.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/tgmath.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/time.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K8/unistd.h/linknamespace): Likewise.
2014-11-12 22:45:25 +00:00
Joseph Myers a75d3b0288 conformtest: clean up POSIX expections for sys/utsname.h, sys/wait.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for sys/utsname.h and
sys/wait.h.  Tested x86_64; a new XFAIL for sys/wait.h is added.

	* conform/data/sys/utsname.h-data (*_t): Allow.
	* conform/data/sys/wait.h-data [POSIX] (uid_t): Do not define.
	[POSIX] (WEXITED): Do not expect constant.
	[POSIX] (WSTOPPED): Likewise.
	[POSIX] (WNOHANG): Likewise.
	[POSIX] (WNOWAIT): Likewise.
	[POSIX] (siginfo_t): Do not expect type or elements.
	[POSIX] (pid_t): Do not expect type.
	[POSIX] (signal.h): Do not allow header.
	[POSIX] (sys/resource.h): Likewise.
	[POSIX] (si_*): Do not allow pattern.
	[POSIX] (W*): Likewise.
	[POSIX] (P_*): Likewise.
	[POSIX] (BUS_*): Likewise.
	[POSIX] (CLD_*): Likewise.
	[POSIX] (FPE_*): Likewise.
	[POSIX] (ILL_*): Likewise.
	[POSIX] (POLL_*): Likewise.
	[POSIX] (SEGV_*): Likewise.
	[POSIX] (SI_*): Likewise.
	[POSIX] (TRAP_*): Likewise.
	* conform/Makefile (test-xfail-POSIX/sys/wait.h/conform): New
	variable.
2014-10-14 17:00:11 +00:00
Joseph Myers e81a4f9a54 conformtest: clean up POSIX expectations for sys/mman.h, sys/stat.h, sys/types.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for sys/mman.h, sys/stat.h
and sys/types.h.  Tested x86_64; no new XFAILs needed.

	* conform/data/sys/mman.h-data [POSIX] (size_t): Do not require
	type.
	[POSIX] (off_t): Likewise.
	* conform/data/sys/stat.h-data (S_IRGRP): Require constant.
	[POSIX] (S_ISBLK): Require macro.
	[POSIX] (S_ISCHR): Likewise.
	[POSIX] (S_ISDIR): Likewise.
	[POSIX] (S_ISFIFO): Likewise.
	[POSIX] (S_ISREG): Likewise.
	[POSIX || XPG3 || XPG4 || UNIX98] (S_TYPEISTMO): Do not list
	optional-macro.
	* conform/data/sys/types.h-data [POSIX] (blkcnt_t): Do not require
	type.
	[POSIX] (time_t): Likewise.
	[POSIX] (timer_t): Likewise.
2014-06-11 23:16:23 +00:00
Joseph Myers 09f19b0552 conformtest: clean up POSIX expectations for termios.h, time.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for termios.h and time.h.
Tested x86_64; no new XFAILs needed.

	* conform/data/termios.h-data [POSIX] (IUCLC): Do not expect
	constant.
	[POSIX] (IXANY): Likewise.
	[POSIX] (OLCUC): Likewise.
	[POSIX || POSIX2008] (CBAUD): Do not allow.
	[POSIX || POSIX2008] (DEFECHO): Likewise.
	[POSIX || POSIX2008] (ECHOCTL): Likewise.
	[POSIX || POSIX2008] (ECHOKE): Likewise.
	[POSIX || POSIX2008] (ECHOPRT): Likewise.
	[POSIX || POSIX2008] (EXTA): Likewise.
	[POSIX || POSIX2008] (EXTB): Likewise.
	[POSIX || POSIX2008] (FLUSHO): Likewise.
	[POSIX || POSIX2008] (LOBLK): Likewise.
	[POSIX || POSIX2008] (PENDIN): Likewise.
	[POSIX || POSIX2008] (SWTCH): Likewise.
	[POSIX || POSIX2008] (VDISCARD): Likewise.
	[POSIX || POSIX2008] (VDSUSP): Likewise.
	[POSIX || POSIX2008] (VLNEXT): Likewise.
	[POSIX || POSIX2008] (VREPRINT): Likewise.
	[POSIX || POSIX2008] (VSTATUS): Likewise.
	[POSIX || POSIX2008] (VWERASE): Likewise.
	(B*): Change to B[0123456789]*.
	* conform/data/time.h-data [POSIX || UNIX98]
	(CLOCK_PROCESS_CPUTIME_ID): Do not expect constant.
	[POSIX || UNIX98] (CLOCK_THREAD_CPUTIME_ID): Likewise.
	[POSIX || UNIX98] (CLOCK_MONOTONIC): Likewise.
	[POSIX] (tm_*): Do not allow.
2014-06-09 11:39:33 +00:00
Joseph Myers e59252a58e Define TSVTX in tar.h for older POSIX (bug 16978).
As noted in bug 16978, older POSIX versions include

in the specified contents of <tar.h>, with only the 2001 edition
introducing the notion of XSI-conditional definitions and conditioning
that definition.  Thus, this macro should be defined for
!__USE_XOPEN2K as well as for __USE_XOPEN, and this patch duly defines
it in that case.  Tested x86_64.

	[BZ #16978]
	* posix/tar.h [!__USE_XOPEN2K] (TSVTX): Define macro.
	* conform/Makefile (test-xfail-POSIX/tar.h/conform): Remove
	variable.
2014-05-23 20:37:40 +00:00
Joseph Myers 9a461d467f conformtest: clean up POSIX expectations for stdlib.h, string.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for stdlib.h and
string.h.  Tested x86_64; no new XFAILs needed.

	* conform/data/stdlib.h-data [POSIX] (stddef.h): Do not allow
	header inclusion.
	[POSIX] (limits.h): Likewise.
	[POSIX] (math.h): Likewise.
	[POSIX] (sys/wait.h): Likewise.
	* conform/data/string.h-data [POSIX || UNIX98] (strtok_r): Require
	function.
	[POSIX] (stddef.h): Do not allow header inclusion.
2014-04-30 15:35:18 +00:00
Adhemerval Zanella aebe100329 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.
2014-03-18 13:55:48 -05:00
Joseph Myers 5c7808498e 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.
2014-03-07 23:57:56 +00:00
Joseph Myers bc61d27c61 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.
2014-03-07 20:54:03 +00:00
Joseph Myers 54ee292da7 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.
2014-03-07 03:23:34 +00:00