about summary refs log tree commit diff
path: root/conform
Commit message (Collapse)AuthorAgeFilesLines
* Convert Python scripts to Python 3Alistair Francis2020-03-033-3/+3
| | | | | | | | | Change all of the #! lines in Python scripts that are called from Makefiles to reference /usr/bin/python3. All of the scripts called from Makefiles are already run with Python 3, so let's make sure they are explicitly using Python 3 if called manually.
* conform/conformtest.py: Extend tokenizer to cover character constantsFlorian Weimer2020-02-171-6/+5
| | | | Such constants are used in __USE_EXTERN_INLINES blocks.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-016-6/+6
|
* sysvipc: Set ipc_perm mode as mode_t (BZ#18231)Adhemerval Zanella2019-10-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets the mode field in ipc_perm as mode_t for all architectures, as POSIX specification [1]. The changes required are as follow: 1. It moves the ipc_perm definition out of ipc.h to its own header ipc_perm.h. It also allows consolidate the IPC_* definition on only one header. 2. The generic implementation follow the kernel ipc64_perm size so the syscall can be made directly without temporary buffer copy. However, since glibc defines the MODE field as mode_t, it omits the __PAD1 field (since glibc does not export mode_t as 16-bit for any architecture). It is a two-fold improvement: 2.1. New implementation which follow Linux UAPI will not need to provide an arch-specific ipc-perm.h header neither wrongly use the wrong 16-bit definition from previous default ipc.h (as csky did). 2.1. It allows consolidate ipc_perm definition for architectures that already provide mode_t as 32-bit. 3. All kernel ABIs for the supported architectures already provides the expected padding for mode type extension to 32-bit. However, some architectures the padding has the wrong placement, so it requires the ipc control routines (msgctl, semctl, and shmctl) to adjust the mode field accordingly. Currently they are armeb, microblaze, m68k, s390, and sheb. A new assume is added, __ASSUME_SYSVIPC_BROKEN_MODE_T, which the required ABIs define. 4. For the ABIs that define __ASSUME_SYSVIPC_BROKEN_MODE_T, it also require compat symbols that do not adjust the mode field. Checked on arm-linux-gnueabihf, aarch64-linux-gnu, powerpc64le-linux-gnu, and x86_64-linux-gnu. I also checked the sysvipc tests on hppa-linux-gnu, sh4-linux-gnu, s390x-linux-gnu, and s390-linux-gnu. I also did a sanity test against armeb qemu usermode for the sysvipc tests. [BZ #18231] * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add bits/ipc-perm.h. * sysdeps/unix/sysv/linux/aarch64/bits/ipc.h: Remove file. * sysdeps/unix/sysv/linux/alpha/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/hppa/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/ia64/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/s390/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/ipc.h: Likewise. * sysdeps/unix/sysv/linux/arm/kernel-features.h [__BYTE_ORDER == __BIG_ENDIAN] (__ASSUME_SYSVIPC_BROKEN_MODE_T): Define. * sysdeps/sysv/linux/microblaze/kernel-features.h: Likewise. * sysdeps/unix/sysv/linux/s390/kernel-features.h [!__s390x__] (__ASSUME_SYSVIPC_BROKEN_MODE_T): Define. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_SYSVIPC_BROKEN_MODE_T): Define. * sysdeps/unix/sysv/linux/m68k/kernel-features.h: Likewise. * sysdeps/unix/sysv/linux/bits/ipc-perm.h: New file. * sysdeps/unix/sysv/linux/powerpc/bits/ipc-perm.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/ipc-perm.h: Likewise. * sysdeps/unix/sysv/linux/bits/ipc.h (ipc_perm): Move to bits/ipc-perm.h. * sysdeps/unix/sysv/linux/hppa/bits/ipc-perm.h: New file. * sysdeps/unix/sysv/linux/kernel-features.h: Add comment about __ASSUME_SYSVIPC_BROKEN_MODE_T semantic. * sysdeps/unix/sysv/linux/msgctl.c (DEFAULT_VERSION): Define as 2.31 if __ASSUME_SYSVIPC_BROKEN_MODE_T is defined. (msgctl_syscall, __msgctl_mode16): New symbol. (__new_msgctl): Add bits for __ASSUME_SYSVIPC_BROKEN_MODE_T. * sysdeps/unix/sysv/linux/semctl.c: Likewise. * sysdeps/unix/sysv/linux/shmctl.c: Likewise. * sysdeps/unix/sysv/linux/arm/be/libc.abilist (GLIBC_2.31): Add msgctl, semctl, and shmctl. * sysdeps/sysv/linux/microblaze/be/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/be/libc.abilist: Likewise. * conform/data/sys/ipc.h-data: Only xfail {struct ipc_perm} mode_t mode for Hurd. * sysdeps/unix/sysv/linux/m68k/Versions (libc) [GLIBC_2.31]: Add msgctl, semctl, and shmctl. * sysdeps/unix/sysv/linux/arm/be/Versions: New file. * sysdeps/unix/sysv/linux/microblaze/be/Versions: Likewise. * sysdeps/unix/sysv/linux/sh/be/Versions: Likewise. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_ipc.h.html
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-076-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* Remove obsolete, never-implemented XSI STREAMS declarationsFlorian Weimer2019-03-142-148/+8
| | | | | | | | | | | | | | | | | | | The stub implementations are turned into compat symbols. Linux actually has two reserved system call numbers (for getpmsg and putpmsg), but these system calls have never been implemented, and there are no plans to implement them, so this patch replaces the wrappers with the generic stubs. According to <https://bugzilla.redhat.com/show_bug.cgi?id=436349>, the presence of the XSI STREAMS declarations is a minor portability hazard because they are not actually implemented. This commit does not change the TIRPC support code in sunrpc/rpc_svcout.c. It uses additional XTI functionality and therefore never worked with glibc. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-016-6/+6
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Combine more conformtest tests into single execution of the compiler.Joseph Myers2018-11-221-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | In <https://sourceware.org/ml/libc-alpha/2018-11/msg00225.html>, Florian reported that the change from conformtest.pl to conformtest.py had increased conform/ test time, possibly because of increased startup overhead for Python scripts. This patch improves conformtest.py performance by arranging for as many tests of a (header, standard) pair as possible to use a single execution of the compiler, so it does not need to initialize and parse the whole header under test separately for every test assertion. Specifically, compilation tests that are not marked as "optional" or "xfail" are combined into a single source file, and are only then run separately if compilation of that combined file fails. For me, this reduces the wall clock time for the conformtest.py tests (not the whole of the conform/ directory) from two minutes to 15 seconds. Tested for x86_64, and with build-many-glibcs.py. * conform/conformtest.py (CompileSubTest.__init__): Set self.run_early to False. (ExecuteSubTest.__init__): Likewise. (HeaderTests.run): Try running all non-optional, non-XFAILed compilation tests in a single execution of the compiler.
* Separate conformtest subtest generation and execution.Joseph Myers2018-11-221-65/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch continues moving conformtest towards running more tests in a single compiler execution by separating the generation and execution of the subtests of each test. Instead of test classes having a run method that both generates the text of the programs to be compiled or executed, and compiles or executes them, they are changed to having a gen_subtests method that just generates CompileSubTest and ExecuteSubTest objects to store the subtest names and text, and then a separate loop in HeaderTests.run deals with actually executing those subtests. This will allow for future changes to extract the text for all non-optional, non-xfail compilation subtests to try compiling those all at once, with separate compilations only if that fails, so massively reducing the number of separate compiler executions (each of which needs to parse the entire contents of the header under test, in addition to the startup cost that applies even for compiling an empty file). Tested for x86_64, and with build-many-glibcs.py. * conform/conformtest.py (CompileSubTest): New class. (ExecuteSubTest): Likewise. (ElementTest.run): Rename to gen_subtests. Append tests to self.subtests instead of running them. (ConstantTest.run): Likewise. (SymbolTest.run): Likewise. (TypeTest.run): Likewise. (TagTest.run): Likewise. (FunctionTest.run): Likewise. (VariableTest.run): Likewise. (MacroFunctionTest.run): Likewise. (MacroStrTest.run): Likewise. (HeaderTests.handle_test_line): Generate subtests for tests. (HeaderTests.run): Run subtests for tests.
* Use unique identifiers in conformtest.Joseph Myers2018-11-201-76/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes tests in conformtest use unique identifiers, in preparation for trying to cover more tests in a single compilation to speed up these tests as suggested in <https://sourceware.org/ml/libc-alpha/2018-11/msg00229.html>. Tests are assigned a number, used in generating identifiers; where a single call to a run method does multiple compilations (sharing that number), identifiers are changed as needed to avoid duplication between those compilations, so they can be combined in future. Large numbers of positional arguments to format strings make the code harder to follow, and using the test numbers serves to increase the number of arguments to such format strings, so the code is generally changed to use %(name)s where all the arguments come from attributes of the test object and so vars(self) is sufficient to provide all those names for the format string. Cases where some arguments aren't attributes of self still use positional format arguments. Tested for x86_64, and with build-many-glibcs.py. * conform/conformtest.py (ElementTest.run): Use unique identifiers in tests. Use names for format arguments. (ConstantTest.run): Likewise. (SymbolTest.run): Likewise. (TypeTest.run): Likewise. (TagTest.run): Likewise. (FunctionTest.run): Likewise. (VariableTest.run): Likewise. (MacroFunctionTest.run): Likewise. (MacroStrTest.run): Likewise. (HeaderTests.__init__): Set self.num_tests. (HeaderTests.handle_test_line): Set test.num. Increment self.num_tests.
* Update conform/Makefile mkdir commands.Joseph Myers2018-11-091-2/+2
| | | | | | | | | | | | | | | | conform/Makefile creates $(@D)/scratch for the per-standard per-header tests. That directory was formerly used by the Perl scripts for temporary files, but the Python implementations use tempfile.TemporaryDirectory to get such files cleaned up automatically. This patch changes the Makefile to create only $(@D) (required for the output redirection to work), not the scratch subdirectory. Tested for x86_64. * conform/Makefile ($(conformtest-header-tests)): Create $(@D), not $(@D)/scratch. ($(linknamespace-header-tests)): Likewise.
* Replace conformtest.pl with conformtest.py.Joseph Myers2018-11-0910-995/+709
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the consolidation on Python for various miscellaneous build and test scripts, this patch moves conformtest from Perl to Python. The substance of the tests run is intended to be the same as before, except that the previous test for tags did not actually achieve the intended purpose of verifying whether a tag was already declared, so is changed to one that would actually fail for a tag that wasn't declared, and a typo in the old test for variables being available ($xyzzy instead of xyzzy) would have made that test not use the correct type (but it would have passed anyway with warnings). No attempt is made to keep the details of what the test output looks like; instead, tests are given names which are made to follow PASS: / FAIL: / XFAIL: / SKIP: / MISSING: as appropriate. In the new version, there is more consistent parsing of test lines (into a series of words, either surrounded by {} or separated by spaces) that applies for all kinds of test lines, rather than the old approach of different regular expressions for every kind of test. A few of the conform/data/ files are adjusted so their syntax works with the new script (which now requires spaces in certain cases where the old script tolerated them being missing, and does not allow stray semicolons at the end of "function" lines). Similarly, common logic is used around what happens with a second subtest if a first one fails (e.g., a test for a symbol's type if the test for availability fails), rather than such logic being replicated separately for each kind of test. Common parsing also applies for test lines both when they are lines for the header under test and when they are lines for another header specified with allow-header, again unlike the old script. Tested for x86_64, and with build-many-glibcs.py. * conform/conformtest.py: New file. * conform/conformtest.pl: Remove. * conform/GlibcConform.pm: Likewise. * conform/glibcconform.py (KEYWORDS_C90): New constant. (KEYWORDS_C99): Likewise. (KEYWORDS): Likewise. * conform/Makefile ($(conformtest-header-tests)): Use conformtest.py instead of conformtest.pl. Do not pass --tmpdir option. Use --header instead of --headers. * conform/data/arpa/inet.h-data: Remove trailing semicolons on function entries. * conform/data/spawn.h-data: Likewise. * conform/data/fcntl.h-data (openat): Add space after function name. * conform/data/wchar.h-data (wcscasecmp): Likewise. (wcscasecmp_l): Likewise. * conform/data/termios.h-data (c_cc): Add space after element name.
* Convert linknamespace tests from Perl to Python.Joseph Myers2018-10-303-240/+223
| | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces conform/linknamespace.pl with a new conform/linknamespace.py, so continuing the consolidation on Python instead of Perl for miscellaneous scripts used in building and testing glibc. The new script follows the same logic as the old one; as a recently-added script, there were no major cleanups to be made in the course of the language conversion. Tested for x86_64, and with build-many-glibcs.py. For x86_64 I also tested that if the Perl and Python scripts were made to print all the symbols in seen_where and the paths of symbol references by which those symbols were linked in, even when those symbols were OK, identical symbol lists appeared in the output with both versions of the script (the differences in linknamespace.out files were only in paths to temporary files in diagnostics for e.g. deprecated functions, and error output for the expected compilation failures when testing ndbm.h and varargs.h). * conform/linknamespace.py: New file. * conform/linknamespace.pl: Remove file. * conform/Makefile ($(linknamespace-header-tests)): Use linknamespace.py instead of linknamespace.pl. Do not use --tmpdir option.
* Use tempfile.TemporaryDirectory in conform/glibcconform.py.Joseph Myers2018-10-291-8/+3
| | | | | | | | | | | | | | Now that we require Python 3.4 or later, Python code creating temporary directories can use tempfile.TemporaryDirectory in "with" to have the directory deleted automatically instead of needing to use try/finally to handle removing a directory created with tempfile.mkdtemp. This patch does so in conform/glibcconform.py. Tested for x86_64. * conform/glibcconform.py: Do not import shutil. (list_exported_functions): Use tempfile.TemporaryDirectory instead of mkdtemp.
* Patch to require Python 3.4 or later to build glibc.Joseph Myers2018-10-291-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes Python 3.4 or later a required tool for building glibc, so allowing changes of awk, perl etc. code used in the build and test to Python code without any such changes needing makefile conditionals or to handle older Python versions. This patch makes the configure test for Python check the version and give an error if Python is missing or too old, and removes makefile conditionals that are no longer needed. It does not itself convert any code from another language to Python, and does not remove any compatibility with older Python versions from existing scripts. Tested for x86_64. * configure.ac (PYTHON_PROG): Use AC_CHECK_PROG_VER. Set critic_missing for versions before 3.4. * configure: Regenerated. * manual/install.texi (Tools for Compilation): Document requirement for Python to build glibc. * INSTALL: Regenerated. * Rules [PYTHON]: Make code unconditional. * benchtests/Makefile [PYTHON]: Likewise. * conform/Makefile [PYTHON]: Likewise. * manual/Makefile [PYTHON]: Likewise. * math/Makefile [PYTHON]: Likewise.
* conform: XFAIL siginfo_t si_band test on sparc64Florian Weimer2018-10-252-2/+4
| | | | | We can use long int on sparcv9, but on sparc64, we must match the int type used by the kernel (and not long int, as in POSIX).
* Replace conform/list-header-symbols.pl with a Python script.Joseph Myers2018-08-314-88/+163
| | | | | | | | | | | | | | | | | | | | Continuing the move of test code from Perl to Python (which seems uncontroversial, unlike dependencies on Python in the actual build of glibc), this patch replaces conform/list-header-symbols.pl with a Python script, as a first step in converting the conform/ tests. (conform/glibcconform.py is an equivalent to GlibcConform.pm, containing code that will be relevant to move than one of the conform/ scripts.) Tested for x86_64, including verifying that the symbol lists generated are identical to those generated by the Perl version. * conform/glibcconform.py: New file. * conform/list-header-symbols.py: Likewise. * conform/list-header-symbols.pl: Remove. * conform/Makefile (tests-special): Only add linknamespace tests if [PYTHON]. ($(linknamespace-symlists-tests)): Use list-header-symbols.py.
* Fix C11 conformance issuesAdhemerval Zanella2018-07-251-3/+2
| | | | | | | | | | | | | | | | | | | | | | | Remove conformace assumption of NPTL implementation for ISO C threads and revert wrong libcrypt addition on linknamespace-libs-XPG4. The i686-gnu target now shows two new conformance failures: FAIL: conform/ISO11/threads.h/conform FAIL: conform/ISO11/threads.h/linknamespace It is expected due missing HTL ISO C threads support and both conformance .out files indicates the reason ("#error "HTL does not implement ISO C threads"). Checked on i686-linux-gnu and i686-gnu. * include/threads.h: Move to ... * sysdeps/nptl/threads.h: ... here. * sysdeps/htl/threads.h: New file. * conform/Makefile (linknamespace-libs-ISO11): Use static-thread-library instead of linking libpthread. (linknamespace-libs-XPG4): Revert wrong libcrypt.a addition.
* nptl: Add C11 threads tss_* functionsAdhemerval Zanella2018-07-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the tss_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically tss_create, tss_delete, tss_get, tss_set, and required types. Mostly of the definitions are composed based on POSIX conterparts, including tss_t (pthread_key_t). Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/data/threads.h-data (thread_local): New macro. (TSS_DTOR_ITERATIONS): Likewise. (tss_t): New type. (tss_dtor_t): Likewise. (tss_create): New function. (tss_get): Likewise. (tss_set): Likewise. (tss_delete): Likewise. * nptl/Makefile (libpthread-routines): Add tss_create, tss_delete, tss_get, and tss_set objects. * nptl/Versions (libpthread) [GLIBC_2.28]: Likewise. * nptl/tss_create.c: New file. * nptl/tss_delete.c: Likewise. * nptl/tss_get.c: Likewise. * nptl/tss_set.c: Likewise. * sysdeps/nptl/threads.h (thread_local): New define. (TSS_DTOR_ITERATIONS): Likewise. (tss_t): New typedef. (tss_dtor_t): Likewise. (tss_create): New prototype. (tss_get): Likewise. (tss_set): Likewise. (tss_delete): Likewise.
* nptl: Add C11 threads cnd_* functionsAdhemerval Zanella2018-07-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the cnd_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically cnd_broadcast, cnd_destroy, cnd_init, cnd_signal, cnd_timedwait, cnd_wait, and required types. Mostly of the definitions are composed based on POSIX conterparts, and cnd_t is also based on internal pthreads fields, but with distinct internal layout to avoid possible issues with code interchange (such as trying to pass POSIX structure on C11 functions and to avoid inclusion of pthread.h). The idea is to make it possible to share POSIX internal implementation for mostly of the code making adjust where only required. Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/data/threads.h-data (cnd_t): New type. (cnd_init): New function. (cnd_signal): Likewise. (cnd_broadcast): Likewise. (cnd_wait): Likewise. (cnd_timedwait): Likewise. (cnd_destroy): Likewise. * nptl/Makefile (libpthread-routines): Add cnd_broadcast, cnd_destroy, cnd_init, cnd_signal, cnd_timedwait, and cnd_wait object. * nptl/Versions (libpthread) [GLIBC_2.28]: Likewise. * nptl/cnd_broadcast.c: New file. * nptl/cnd_destroy.c: Likewise. * nptl/cnd_init.c: Likewise. * nptl/cnd_signal.c: Likewise. * nptl/cnd_timedwait.c: Likewise. * nptl/cnd_wait.c: Likewise. * sysdeps/nptl/threads.h (cnd_t): New type. (cnd_init): New prototype. (cnd_signa): Likewise. (cnd_broadcast): Likewise. (cnd_wait): Likewise. (cnd_timedwait): Likewise. (cnd_destroy): Likewise.
* nptl: Add C11 threads call_once functionsAdhemerval Zanella2018-07-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the call_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically call_once and required types. Mostly of the definitions are composed based on POSIX conterparts,including once_flag (pthread_once_t). The idea is to make possible to share POSIX internal implementations for mostly of the code (and making adjustment only when required). Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/data/threads.h-data (ONCE_FLAG_INIT): New macro. (once_flag): New type. (call_once): New function. * nptl/Makefile (libpthread-routines): Add call_once object. * nptl/Versions (libphread) [GLIBC_2.28]: Add call_once symbol. * nptl/call_once.c: New file. * sysdeps/nptl/threads.h (ONCE_FLAG_INIT): New define. (once_flag): New type. (call_once): New prototype.
* nptl: Add C11 threads mtx_* functionsAdhemerval Zanella2018-07-241-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the mtx_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically mtx_init, mtx_destroy, mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlock, and required types. Mostly of the definitions are composed based on POSIX conterparts, and mtx_t is also based on internal pthread fields, but with a distinct internal layout to avoid possible issues with code interchange (such as trying to pass POSIX structure on C11 functions and to avoid inclusion of pthread.h). The idea is to make possible to share POSIX internal implementations for mostly of the code (and making adjustment only when required). Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/data/threads.h-data (mtx_plain): New constant. (mtx_recursive): Likewise. (mtx_timed): Likewise. (mtx_t): New type. (mtx_init): New function. (mtx_lock): Likewise. (mtx_timedlock): Likewise. (mtx_trylock): Likewise. (mtx_unlock): Likewise. (mtx_destroy): Likewise. * nptl/Makefile (libpthread-routines): Add mtx_destroy, mtx_init, mtx_lock, mtx_timedlock, mtx_trylock, and mtx_unlock object. * nptl/Versions (libpthread) [GLIBC_2.28]): Add mtx_init, mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlock, and mtx_destroy. * nptl/mtx_destroy.c: New file. * nptl/mtx_init.c: Likewise. * nptl/mtx_lock.c: Likewise. * nptl/mtx_timedlock.c: Likewise. * nptl/mtx_trylock.c: Likewise. * nptl/mtx_unlock.c: Likewise. * sysdeps/nptl/threads.h (mtx_plain): New enumeration. (mtx_recursive): Likewise. (mtx_timed): Likewise. (mtx_t): New type. (mtx_init): New prototype. (mtx_lock): Likewise. (mtx_timedlock): Likewise. (mtx_trylock): Likewise. (mtx_unlock): Likewise. (mtx_destroy): Likewise.
* nptl: Add C11 threads thrd_* functionsAdhemerval Zanella2018-07-242-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the thrd_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically thrd_create, thrd_curent, rhd_detach, thrd_equal, thrd_exit, thrd_join, thrd_sleep, thrd_yield, and required types. Mostly of the definitions are composed based on POSIX conterparts, such as thrd_t (using pthread_t). For thrd_* function internally direct POSIX pthread call are used with the exceptions: 1. thrd_start uses pthread_create internal implementation, but changes how to actually calls the start routine. This is due the difference in signature between POSIX and C11, where former return a 'void *' and latter 'int'. To avoid calling convention issues due 'void *' to int cast, routines from C11 threads are started slight different than default pthread one. Explicit cast to expected return are used internally on pthread_create and the result is stored back to void also with an explicit cast. 2. thrd_sleep uses nanosleep internal direct syscall to avoid clobbering errno and to handle expected standard return codes. It is a cancellation entrypoint to be consistent with both thrd_join and cnd_{timed}wait. 3. thrd_yield also uses internal direct syscall to avoid errno clobbering. Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/Makefile (conformtest-headers-ISO11): Add threads.h. (linknamespace-libs-ISO11): Add libpthread.a. * conform/data/threads.h-data: New file: add C11 thrd_* types and functions. * include/stdc-predef.h (__STDC_NO_THREADS__): Remove definition. * nptl/Makefile (headers): Add threads.h. (libpthread-routines): Add new C11 thread thrd_create, thrd_current, thrd_detach, thrd_equal, thrd_exit, thrd_join, thrd_sleep, and thrd_yield. * nptl/Versions (libpthread) [GLIBC_2.28]): Add new C11 thread thrd_create, thrd_current, thrd_detach, thrd_equal, thrd_exit, thrd_join, thrd_sleep, and thrd_yield symbols. * nptl/descr.h (struct pthread): Add c11 field. * nptl/pthreadP.h (ATTR_C11_THREAD): New define. * nptl/pthread_create.c (START_THREAD_DEFN): Call C11 thread start routine with expected function prototype. (__pthread_create_2_1): Add C11 threads check based on attribute value. * sysdeps/unix/sysdep.h (INTERNAL_SYSCALL_CANCEL): New macro. * nptl/thrd_create.c: New file. * nptl/thrd_current.c: Likewise. * nptl/thrd_detach.c: Likewise. * nptl/thrd_equal.c: Likewise. * nptl/thrd_exit.c: Likewise. * nptl/thrd_join.c: Likewise. * nptl/thrd_priv.h: Likewise. * nptl/thrd_sleep.c: Likewise. * nptl/thrd_yield.c: Likewise. * include/threads.h: Likewise.
* conform/conformtest.pl: Escape literal braces in regular expressionsFlorian Weimer2018-07-061-13/+13
| | | | | | | | | | | This suppresses Perl warnings like these: Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^element *({ <-- HERE ([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/ at conformtest.pl line 370. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* New configure option --disable-crypt.Zack Weinberg2018-06-291-4/+7
| | | | | | | | Some Linux distributions are experimenting with a new, separately maintained and hopefully more agile implementation of the crypt API. To facilitate this, add a configure option which disables glibc's embedded libcrypt. When this option is given, libcrypt.* and crypt.h will not be built nor installed.
* Disallow use of DES encryption functions in new programs.Zack Weinberg2018-06-292-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The functions encrypt, setkey, encrypt_r, setkey_r, cbc_crypt, ecb_crypt, and des_setparity should not be used in new programs, because they use the DES block cipher, which is unacceptably weak by modern standards. Demote all of them to compatibility symbols, and remove their prototypes from installed headers. cbc_crypt, ecb_crypt, and des_setparity were already compat symbols when glibc was configured with --disable-obsolete-rpc. POSIX requires encrypt and setkey to be available when _XOPEN_CRYPT is defined, so this change also removes the definition of X_OPEN_CRYPT from <unistd.h>. The entire "DES Encryption" section is dropped from the manual, as is the mention of AUTH_DES and FIPS 140-2 in the introduction to crypt.texi. The documentation of 'memfrob' cross-referenced the DES Encryption section, which is replaced by a hyperlink to libgcrypt, and while I was in there I spruced up the actual documentation of 'memfrob' and 'strfry' a little. It's still fairly jokey, because those functions _are_ jokes, but they do also have real use cases, so people trying to use them for real should have all the information they need. DES-based authentication for Sun RPC is also insecure and should be deprecated or even removed, but maybe that can be left as TI-RPC's problem.
* hurd xfails: Add missing bug referencesSamuel Thibault2018-04-202-0/+4
|
* hurd: XFAIL tests for signal features not implemented yetSamuel Thibault2018-04-202-7/+7
| | | | | | | * conform/data/signal.h-data (SA_SIGINFO, SA_NOCLDWAIT): XFAIL on i386-gnu. * conform/data/sys/wait.h-data (WIFCONTINUED, WEXITED, WSTOPPED, WCONTINUED, WNOWAIT): XFAIL on i386-gnu.
* hurd: Fix symbols expositionSamuel Thibault2018-04-191-0/+2
| | | | | | | | | * bits/in.h [!__USE_MISC]: Do not define struct ip_opts. * conform/data/netinet/in.h-data: Allow sin_ and sin6_ prefix. * sysdeps/gnu/bits/msq.h (struct msqid_ds): Use __wait_queue struct instead of wait_queue. * sysdeps/gnu/bits/shm.h (struct shmid_ds): Use __vm_area_struct instead of vm_area_struct.
* hurd: xfail some structure fields ABI incompatibility with standardsSamuel Thibault2018-04-196-12/+18
| | | | | | | | | | | | | | | * sysdeps/mach/hurd/i386/Makefile [$(subdir) = conform] (conformtest-xfail-conds): Add i386-gnu. * conform/data/fcntl.h-data (flock.l_type, flock.l_whence): XFAIL for i386-gnu. * conform/data/sys/ipc.h-data (ipc_perm.uid, ipc_perm.gid, ipc_perm.cuid, ipc_perm.cgid): Likewise. * conform/data/sys/msg.h-data (msqid_ds.msg_lspid, msqid_ds.msg_lrpid): Likewise. * conform/data/sys/shm.h-data (shmid_ds.shm_lpid, shmid_ds.shm_cpid): Likewise. * conform/data/sys/stat.h-data (stat.st_dev): Likewise. * conform/data/sys/statvfs.h-data (statvfs.f_fsid): Likewise.
* conform sys/un.h: Allow sun_ prefix, not only sun_lenSamuel Thibault2018-04-181-1/+2
| | | | * conform/data/sys/un.h-data: Allow sun_ prefix.
* hurd: fix conformity test for sys/un.hSamuel Thibault2018-04-181-0/+1
| | | | | | | sun_len is used by BSD systems, and conformant. * conform/data/sys/un.h-data (struct sockaddr_un): Allow sun_len member.
* Don't install libio.h or _G_config.h.Zack Weinberg2018-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We shipped 2.27 with libio.h and _G_config.h still installed but issuing warnings when used. Let's stop installing them early in 2.28 so that we have plenty of time to think of another plan if there are problems. The public stdio.h had a genuine dependency on libio.h for the complete definitions of FILE and cookie_io_functions_t, and a genuine dependency on _G_config.h for the complete definitions of fpos_t and fpos64_t; these are moved to single-type headers. bits/types/struct_FILE.h also provides a handful of accessor and bitflags macros so that code is not duplicated between bits/stdio.h and libio.h. All the other _IO_ and _G_ names used by the public stdio.h can be replaced with either public names or __-names. In order to minimize the risk of breaking our own compatibility code, bits/types/struct_FILE.h preserves the _IO_USE_OLD_IO_FILE mechanism exactly as it was in libio.h, but you have to define _LIBC to use it, or it'll error out. Similarly, _IO_lock_t_defined is preserved exactly, but will error out if used without defining _LIBC. Internally, include/stdio.h continues to include libio.h, and libio.h scrupulously provides every _IO_* and _G_* name that it always did, perhaps now defined in terms of the public names. This is how this patch avoids touching dozens of files throughout glibc and becoming entangled with the _IO_MTSAFE_IO mess. The remaining patches in this series eliminate most of the _G_ names. Tested on x86_64-linux; in addition to the test suite, I installed the library in a sysroot and verified that a simple program that uses stdio.h could be compiled against the installed library, and I also verified that installed stripped libraries are unchanged. * libio/bits/types/__fpos_t.h, libio/bits/types/__fpos64_t.h: New single-type headers split from _G_config.h. * libio/bits/types/cookie_io_functions_t.h * libio/bits/types/struct_FILE.h New single-type headers split from libio.h. * libio/Makefile: Install the above new headers. Don't install libio.h, _G_config.h, bits/libio.h, bits/_G_config.h, or bits/libio-ldbl.h. * libio/_G_config.h, libio/libio.h: Delete file. * libio/bits/libio.h: Remove improper-inclusion guard. Include stdio.h and don't repeat anything that it does. Define _IO_fpos_t as __fpos_t, _IO_fpos64_t as __fpos64_t, _IO_BUFSIZ as BUFSIZ, _IO_va_list as __gnuc_va_list, __io_read_fn as cookie_read_function_t, __io_write_fn as cookie_write_function_t, __io_seek_fn as cookie_seek_function_t, __io_close_fn as cookie_close_function_t, and _IO_cookie_io_functions_t as cookie_io_functions_t. Define _STDIO_USES_IOSTREAM, __HAVE_COLUMN, and _IO_file_flags here, in the "compatibility defines" section. Remove an #if 0 block. Use the "body" macros from bits/types/struct_FILE.h to define _IO_getc_unlocked, _IO_putc_unlocked, _IO_feof_unlocked, and _IO_ferror_unlocked. Move prototypes of __uflow and __overflow... * libio/stdio.h: ...here. Don't include bits/libio.h. Don't define _STDIO_USES_IOSTREAM. Get __gnuc_va_list directly from stdarg.h. Include bits/types/__fpos_t.h, bits/types/__fpos64_t.h, bits/types/struct_FILE.h, and, when __USE_GNU, bits/types/cookie_io_functions_t.h. Use __gnuc_va_list, not _G_va_list; __fpos_t, not _G_fpos_t; __fpos64_t, not _G_fpos64_t; FILE, not struct _IO_FILE; cookie_io_functions_t, not _IO_cookie_io_functions_t; __ssize_t, not _IO_ssize_t. Unconditionally define BUFSIZ as 8192 and EOF as (-1). * libio/bits/stdio.h: Add multiple-include guard. Use the "body" macros from bits/types/struct_FILE.h instead of _IO_* macros from libio.h; use __gnuc_va_list instead of va_list and __ssize_t instead of _IO_ssize_t. * libio/bits/stdio2.h: Similarly. * libio/iolibio.h: Add multiple-include guard. Include bits/libio.h after stdio.h. * libio/libioP.h: Add multiple-include guard. Include stdio.h and bits/libio.h before iolibio.h. * include/bits/types/__fpos_t.h, include/bits/types/__fpos64_t.h * include/bits/types/cookie_io_functions_t.h * include/bits/types/struct_FILE.h: New wrappers. * bits/_G_config.h, sysdeps/unix/sysv/linux/_G_config.h: Get definitions of _G_fpos_t and _G_fpos64_t from bits/types/__fpos_t.h and bits/types/__fpos64_t.h respectively. Remove improper-inclusion guards. * conform/data/stdio.h-data: Update expectations of va_list. * scripts/check-installed-headers.sh: Remove special case for libio.h and _G_config.h.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-015-5/+5
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Fix mcontext_t sigcontext namespace (bug 21457).Joseph Myers2017-08-301-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch completes the ucontext.h namespace fixes by fixing issues related to the use of struct sigcontext as mcontext_t, and inclusion of <bits/sigcontext.h> even when struct sigcontext is not so used. Inclusion of <bits/sigcontext.h> by <sys/ucontext.h> is removed; the way to get the sigcontext structure is by including <signal.h> (in a context where __USE_MISC is defined); the sysdeps/generic version of sys/ucontext.h keeps the inclusion by necessity, with a comment about how this is not namespace-clean, but the only configuration that used it, MicroBlaze, gets its own version of the header in this patch. Where mcontext_t was typedefed to struct sigcontext, the contents of struct sigcontext are inserted (with appropriate namespace handling to prefix fields with __ when __USE_MISC is not defined); review should check that this has been done correctly in each case, whether the definition of struct sigcontext comes from glibc headers or from the Linux kernel. This changes C++ name mangling on affected architectures (which do not include x86_64/x86). Tested for x86_64, and with build-many-glibcs.py. 2017-08-14 Joseph Myers <joseph@codesourcery.com> [BZ #21457] * sysdeps/arm/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/generic/sys/ucontext.h: Add comment about use of struct sigcontext and namespace requirements. * sysdeps/i386/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/m68k/sys/ucontext.h: Likewise. * sysdeps/mips/sys/ucontext.h: Likewise. Include <bits/types.h>. * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym (oEXTENSION): Use __glibc_reserved1 instead of __reserved. * sysdeps/unix/sysv/linux/alpha/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym: Use mcontext_t instead of struct sigcontext. * sysdeps/unix/sysv/linux/arm/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/ia64/makecontext.c (__makecontext): Use mcontext_t instead of struct sigcontext. * sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym: Use mcontext_t instead of struct sigcontext. * sysdeps/unix/sysv/linux/ia64/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): New macro. (struct __ia64_fpreg_mcontext): New type. (mcontext_t): Define structure contents rather than using struct sigcontext. (_SC_GR0_OFFSET): Use mcontext_t instead of struct sigcontext. (uc_sigmask): Define using __ctx. (uc_stack): Likewise. * sysdeps/unix/sysv/linux/ia64/sys/procfs.h: Include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/ia64/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h: New file. * sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/sh/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Do not include <bits/sigcontext.h>. * sysdeps/unix/sysv/linux/tile/sys/ucontext.h: Do not include <bits/sigcontext.h>. (__ctx): Define earlier. (mcontext_t): Define structure contents rather than using struct sigcontext. * sysdeps/unix/sysv/linux/x86/sys/ucontext.h: Do not include <bits/sigcontext.h>. Include <bits/types.h>. * conform/Makefile (test-xfail-XPG42/signal.h/conform): Remove. (test-xfail-XPG42/sys/wait.h/conform): Likewise. (test-xfail-XPG42/ucontext.h/conform): Likewise. (test-xfail-UNIX98/signal.h/conform): Likewise. (test-xfail-UNIX98/sys/wait.h/conform): Likewise. (test-xfail-UNIX98/ucontext.h/conform): Likewise. (test-xfail-XOPEN2K/signal.h/conform): Likewise. (test-xfail-XOPEN2K/sys/wait.h/conform): Likewise. (test-xfail-XOPEN2K/ucontext.h/conform): Likewise. (test-xfail-POSIX2008/signal.h/conform): Likewise. (test-xfail-POSIX2008/sys/wait.h/conform): Likewise. (test-xfail-XOPEN2K8/signal.h/conform): Likewise. (test-xfail-XOPEN2K8/sys/wait.h/conform): Likewise.
* Obsolete matherr, _LIB_VERSION, libieee.a.Joseph Myers2017-08-211-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch obsoletes support for SVID libm error handling (the system where a user-defined function matherr is called on a libm function error; only enabled if you also set _LIB_VERSION = _SVID_ or _LIB_VERSION = _XOPEN_) and the use of the _LIB_VERSION global variable to control libm error handling. matherr and _LIB_VERSION are made into compat symbols, not supported for new ports or for static linking. The libieee.a object file (which sets _LIB_VERSION = _IEEE_, so disabling errno setting for some functions) is also removed, and all the related definitions are removed from math.h. The manual already recommends against using matherr, and it's already not supported for _Float128 functions (those use new wrappers that don't support matherr, only errno) - this patch means that it becomes possible to e.g. add sinf32 as an alias to sinf without that resulting in undesired matherr support in sinf32 for existing glibc ports. matherr support is not part of any standard supported by glibc (it was removed in XPG4). Because matherr is a function to be defined by the user, of course user programs defining such a function will still continue to link; it just quietly won't be used. If they try to write to the library's copy of _LIB_VERSION to enable SVID error handling, however, they will get a link error (but if they define their own _LIB_VERSION variable, they won't). I expect the most likely case of build failures from this patch to be programs with unconditional cargo-culted uses of -lieee (based on a notion of "I want IEEE floating point", not any actual requirement for that library). Ideally, the new-port-or-static-linking case would use the new wrappers used for _Float128. This is not implemented in this patch, because of the complication of architecture-specific (powerpc32 and sparc) sqrt wrappers that use _LIB_VERSION and __kernel_standard directly. Thus, the old wrappers and __kernel_standard are still built unconditionally, and _LIB_VERSION still exists in static libm. But when the old wrappers and __kernel_standard are built in the non-compat case, _LIB_VERSION and matherr are defined as macros so code to support those features isn't actually built into static libm or new ports' shared libm after this patch. I intend to move to the new wrappers for static libm and new ports in followup patches. I believe the sqrt wrappers for powerpc32 and sparc can reasonably be removed. GCC already optimizes the normal case of sqrt by generating code that uses a hardware instruction and only calls the sqrt function if the argument was negative (if -fno-math-errno, of course, it just uses the hardware instruction without any check for negative argument being needed). Thus those wrappers will only actually get called in the case of negative arguments, which is not a case it makes sense to optimize for. But even without removing the powerpc32 and sparc wrappers it should still be possible to move to the new wrappers for static libm and new ports, just without having those dubious architecture-specific optimizations in static libm. Everything said about matherr equally applies to matherrf and matherrl (IA64-specific, undocumented), except that the structure of IA64 libm means it won't be converted to using the new wrappers (it doesn't use the old ones either, but its own error-handling code instead). As with other tests of compat symbols, I expect test-matherr and test-matherr-2 to need to become appropriately conditional once we have a system for disabling such tests for ports too new to have the relevant symbols. Tested for x86_64 and x86, and with build-many-glibcs.py. * math/math.h [__USE_MISC] (_LIB_VERSION_TYPE): Remove. [__USE_MISC] (_LIB_VERSION): Likewise. [__USE_MISC] (struct exception): Likewise. [__USE_MISC] (matherr): Likewise. [__USE_MISC] (DOMAIN): Likewise. [__USE_MISC] (SING): Likewise. [__USE_MISC] (OVERFLOW): Likewise. [__USE_MISC] (UNDERFLOW): Likewise. [__USE_MISC] (TLOSS): Likewise. [__USE_MISC] (PLOSS): Likewise. [__USE_MISC] (HUGE): Likewise. [__USE_XOPEN] (MAXFLOAT): Define even if [__USE_MISC]. * math/math-svid-compat.h: New file. * conform/linknamespace.pl (@whitelist): Remove matherr, matherrf and matherrl. * include/math.h [!_ISOMAC] (__matherr): Remove. * manual/arith.texi (FP Exceptions): Do not document matherr. * math/Makefile (tests): Change test-matherr to test-matherr-3. (tests-internal): New variable. (install-lib): Do not add libieee.a. (non-lib.a): Likewise. (extra-objs): Do not add libieee.a and ieee-math.o. (CPPFLAGS-s_lib_version.c): Remove variable. ($(objpfx)libieee.a): Remove rule. ($(addprefix $(objpfx), $(tests-internal)): Depend on $(libm). * math/ieee-math.c: Remove. * math/libm-test-support.c (matherr): Remove. * math/test-matherr.c: Use <support/test-driver.c>. Add copyright and license notices. Include <math-svid-compat.h> and <shlib-compat.h>. (matherr): Undefine as macro. Use compat_symbol_reference. (_LIB_VERSION): Likewise. * math/test-matherr-2.c: New file. * math/test-matherr-3.c: Likewise. * sysdeps/generic/math_private.h (__kernel_standard): Remove declaration. (__kernel_standard_f): Likewise. (__kernel_standard_l): Likewise. * sysdeps/ieee754/s_lib_version.c: Do not include <math.h> or <math_private.h>. Include <math-svid-compat.h>. (_LIB_VERSION): Undefine as macro. (_LIB_VERSION_INTERNAL): Always initialize to _POSIX_. Define only if [LIBM_SVID_COMPAT || !defined SHARED]. If [LIBM_SVID_COMPAT], use compat_symbol. * sysdeps/ieee754/s_matherr.c: Do not include <math.h> or <math_private.h>. Include <math-svid-compat.h>. (matherr): Undefine as macro. (__matherr): Define only if [LIBM_SVID_COMPAT]. Use compat_symbol. * sysdeps/ia64/fpu/libm_error.c: Include <math-svid-compat.h>. [_LIBC && LIBM_SVID_COMPAT] (matherrf): Use compat_symbol_reference. [_LIBC && LIBM_SVID_COMPAT] (matherrl): Likewise. [_LIBC && !LIBM_SVID_COMPAT] (matherrf): Define as macro. [_LIBC && !LIBM_SVID_COMPAT] (matherrl): Likewise. * sysdeps/ia64/fpu/libm_support.h: Include <math-svid-compat.h>. (MATHERR_D): Remove declaration. [!_LIBC] (_LIB_VERSION_TYPE): Likewise [!LIBM_BUILD] (_LIB_VERSIONIMF): Likewise. [LIBM_BUILD] (pmatherrf): Likewise. [LIBM_BUILD] (pmatherr): Likewise. [LIBM_BUILD] (pmatherrl): Likewise. (DOMAIN): Likewise. (SING): Likewise. (OVERFLOW): Likewise. (UNDERFLOW): Likewise. (TLOSS): Likewise. (PLOSS): Likewise. * sysdeps/ia64/fpu/s_matherrf.c: Include <math-svid-compat.h>. (__matherrf): Define only if [LIBM_SVID_COMPAT]. Use compat_symbol. * sysdeps/ia64/fpu/s_matherrl.c: Include <math-svid-compat.h>. (__matherrl): Define only if [LIBM_SVID_COMPAT]. Use compat_symbol. * math/lgamma-compat.h: Include <math-svid-compat.h>. * math/w_acos_compat.c: Likewise. * math/w_acosf_compat.c: Likewise. * math/w_acosh_compat.c: Likewise. * math/w_acoshf_compat.c: Likewise. * math/w_acoshl_compat.c: Likewise. * math/w_acosl_compat.c: Likewise. * math/w_asin_compat.c: Likewise. * math/w_asinf_compat.c: Likewise. * math/w_asinl_compat.c: Likewise. * math/w_atan2_compat.c: Likewise. * math/w_atan2f_compat.c: Likewise. * math/w_atan2l_compat.c: Likewise. * math/w_atanh_compat.c: Likewise. * math/w_atanhf_compat.c: Likewise. * math/w_atanhl_compat.c: Likewise. * math/w_cosh_compat.c: Likewise. * math/w_coshf_compat.c: Likewise. * math/w_coshl_compat.c: Likewise. * math/w_exp10_compat.c: Likewise. * math/w_exp10f_compat.c: Likewise. * math/w_exp10l_compat.c: Likewise. * math/w_exp2_compat.c: Likewise. * math/w_exp2f_compat.c: Likewise. * math/w_exp2l_compat.c: Likewise. * math/w_fmod_compat.c: Likewise. * math/w_fmodf_compat.c: Likewise. * math/w_fmodl_compat.c: Likewise. * math/w_hypot_compat.c: Likewise. * math/w_hypotf_compat.c: Likewise. * math/w_hypotl_compat.c: Likewise. * math/w_j0_compat.c: Likewise. * math/w_j0f_compat.c: Likewise. * math/w_j0l_compat.c: Likewise. * math/w_j1_compat.c: Likewise. * math/w_j1f_compat.c: Likewise. * math/w_j1l_compat.c: Likewise. * math/w_jn_compat.c: Likewise. * math/w_jnf_compat.c: Likewise. * math/w_jnl_compat.c: Likewise. * math/w_lgamma_main.c: Likewise. * math/w_lgamma_r_compat.c: Likewise. * math/w_lgammaf_main.c: Likewise. * math/w_lgammaf_r_compat.c: Likewise. * math/w_lgammal_main.c: Likewise. * math/w_lgammal_r_compat.c: Likewise. * math/w_log10_compat.c: Likewise. * math/w_log10f_compat.c: Likewise. * math/w_log10l_compat.c: Likewise. * math/w_log2_compat.c: Likewise. * math/w_log2f_compat.c: Likewise. * math/w_log2l_compat.c: Likewise. * math/w_log_compat.c: Likewise. * math/w_logf_compat.c: Likewise. * math/w_logl_compat.c: Likewise. * math/w_pow_compat.c: Likewise. * math/w_powf_compat.c: Likewise. * math/w_powl_compat.c: Likewise. * math/w_remainder_compat.c: Likewise. * math/w_remainderf_compat.c: Likewise. * math/w_remainderl_compat.c: Likewise. * math/w_scalb_compat.c: Likewise. * math/w_scalbf_compat.c: Likewise. * math/w_scalbl_compat.c: Likewise. * math/w_sinh_compat.c: Likewise. * math/w_sinhf_compat.c: Likewise. * math/w_sinhl_compat.c: Likewise. * math/w_sqrt_compat.c: Likewise. * math/w_sqrtf_compat.c: Likewise. * math/w_sqrtl_compat.c: Likewise. * math/w_tgamma_compat.c: Likewise. * math/w_tgammaf_compat.c: Likewise. * math/w_tgammal_compat.c: Likewise. * sysdeps/ieee754/dbl-64/w_exp_compat.c: Likewise. * sysdeps/ieee754/flt-32/w_expf_compat.c: Likewise. * sysdeps/ieee754/k_standard.c: Likewise. * sysdeps/ieee754/k_standardf.c: Likewise. * sysdeps/ieee754/k_standardl.c: Likewise. * sysdeps/ieee754/ldbl-128/w_expl_compat.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/w_expl_compat.c: Likewise. * sysdeps/ieee754/ldbl-96/w_expl_compat.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt_compat.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf_compat.S: Likewise. * sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt_compat.S: Likewise. * sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf_compat.S: Likewise. * sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S: Likewise. * sysdeps/sparc/sparc32/fpu/w_sqrtf_compat.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrt_compat-vis3.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrt_compat.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/w_sqrtf_compat.S: Likewise. * sysdeps/sparc/sparc64/fpu/w_sqrt_compat.S: Likewise. * sysdeps/sparc/sparc64/fpu/w_sqrtf_compat.S: Likewise.
* conformtest: Disable si_value expectation for XPG42.Joseph Myers2017-08-141-0/+2
| | | | | | | | | | This patch corrects the conform/ expectations for sys/wait.h not to expect si_value for XPG4.2. Tested for x86_64. * conform/data/sys/wait.h-data (si_value): Do not expect for XPG42.
* conformtest: XFAIL uc_mcontext test for powerpc32 (bug 21635).Joseph Myers2017-06-202-3/+6
| | | | | | | | | | | | | | | This patch XFAILs one test where the powerpc32 ucontext_t has the wrong type of a field, to allow the conform/ tests as a whole to pass once the namespace issues are fixed. Tested with build-many-glibcs.py. [BZ #21635] * sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile [$(subdir) = conform] (conformtest-xfail-conds): New variable. * conform/data/signal.h-data (uc_mcontext): XFAIL for powerpc32-linux. * conform/data/ucontext.h-data (uc_mcontext): Likewise.
* conformtest: XFAIL uc_sigmask test for ia64 (bug 21634).Joseph Myers2017-06-202-3/+6
| | | | | | | | | | | | | | This patch XFAILs one test where the ia64 ucontext_t has the wrong type of a field, to allow the conform/ tests as a whole to pass once the namespace issues are fixed. Tested with build-many-glibcs.py. [BZ #21634] * sysdeps/unix/sysv/linux/ia64/Makefile [$(subdir) = conform] (conformtest-xfail-conds): New variable. * conform/data/signal.h-data (uc_sigmask): XFAIL for ia64-linux. * conform/data/ucontext.h-data (uc_sigmask): Likewise.
* Fix XPG4 bsd_signal namespace (bug 21552).Joseph Myers2017-06-121-1/+0
| | | | | | | | | | | | | bsd_signal was added in XPG4.2, so should be declared for __USE_XOPEN_EXTENDED, instead of the present __USE_XOPEN condition. This patch fixes the condition accordingly. Tested for x86_64. [BZ #21552] * signal/signal.h (bsd_signal): Declare if [__USE_XOPEN_EXTENDED], not [__USE_XOPEN]. * conform/Makefile (test-xfail-XPG4/signal.h/conform): Remove.
* Fix waitid namespace (bug 21561).Joseph Myers2017-06-091-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In sys/wait.h, waitid and associated constants and types are UX-shaded in XPG4.2 (so not in XPG4), and XSI-shaded in POSIX before 2008, so should be appropriately conditional in the headers. This patch fixes the conditionals accordingly. (WCONTINUED is actually still XSI-shaded in POSIX.1:2008, but W* is also reserved there without XSI-shading, so nothing special needs to be done about the conditionals on WCONTINUED to conform to POSIX.1:2008 namespace rules.) Tested for x86_64. [BZ #21561] * posix/sys/wait.h (idtype_t): Change [__USE_XOPEN] condition to [__USE_XOPEN_EXTENDED]. (id_t): Likewise. (include of <bits/types/siginfo_t.h): Likewise. (waitid): Likewise. * sysdeps/unix/sysv/linux/bits/waitflags.h (WSTOPPED): Condition on [__USE_XOPEN_EXTENDED || __USE_XOPEN2K8]. (WEXITED): Likewise. (WCONTINUED): Likewise. (WNOWAIT): Likewise. * conform/Makefile (test-xfail-XPG4/stdlib.h/conform): Remove. (test-xfail-XPG4/sys/wait.h/conform): Likewise. (test-xfail-POSIX/sys/wait.h/conform): Likewise.
* conformtest: Correct sys/wait.h expectations for XPG4.Joseph Myers2017-06-082-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corrects the conformtest expectations for sys/wait.h for XPG4. This does not change the test results for this header at the makefile level since it fixes some spurious failures for this header while introducing other failures previously hidden by incorrect expectations. However, it shows up issues with stdlib.h for XPG4 defining W* names that are not permitted in this case (previously wrongly allowed; the W* reservation is UX-shaded in XPG4.2 / XSI-shaded in POSIX before 2008); that test is thus XFAILed. Tested for x86_64. * conform/data/sys/wait.h-data (WIFCONTINUED): Do not expect for [XPG4]. (WEXITED): Likewise. (WSTOPPED): Likewise. (WCONTINUED): Likewise. (WNOHANG): Likewise. (WNOWAIT): Likewise. (idtype_t): Likewise. (P_ALL): Likewise. (P_PID): Likewise. (P_PGID): Likewise. (id_t): Likewise. (siginfo_t): Likewise. (wait3): Likewise. (waitid): Likewise. (signal.h): Do not allow header for [XPG4]. (sys/resource.h): Likewise. (si_*): Do not allow for [XPG4]. (W*): Likewise. (P_*): Likewise. (BUS_): Likewise. (CLD_): Likewise. (FPE_): Likewise. (ILL_): Likewise. (POLL_): Likewise. (SEGV_): Likewise. (SI_): Likewise. (TRAP_): Likewise. * conform/Makefile (test-xfail-XPG4/stdlib.h/conform): New variable.
* conformtest: Correct signal.h expectations for XPG4 / XPG42.Joseph Myers2017-06-011-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various of the signal.h conform/ failures for XPG4 and XPG42 are actually the result of incorrect test expectations rather than header bugs. This patch fixes the expectations to accord with those standards (this does not however allow any XFAILs to be removed, as some header bugs remain). Note for anyone comparing with the standards: corrigendum U013/16 removes the mention of a sigmask function in signal.h (C435 lists such a function in the definition of signal.h, but without any actual specification for the function itself), so sigmask is not included in the expectations. Tested for x86_64. * conform/data/signal.h-data (sa_sigaction): Do not expect for [XPG4]. (SA_SIGINFO): Likewise. (SA_ONSTACK): Likewise. (SA_RESETHAND): Likewise. (SA_RESTART): Likewise. (SA_NOCLDWAIT): Likewise. (SA_NODEFER): Likewise. (SS_ONSTACK): Likewise. (SS_DISABLE): Likewise. (MINSIGSTKSZ): Likewise. (SIGSTKSZ): Likewise. (ucontext_t): Likewise. (stack_t): Likewise. (struct sigstack): Likewise. (SI_USER): Do not expect for [XPG4 || XPG42]. (SI_QUEUE): Likewise. (SI_TIMER): Likewise. (SI_ASYNCIO): Likewise. (SI_MESGQ): Likewise. (bsd_signal): Do not expect for [XPG4]. (killpg): Likewise. (sigaltstack): Likewise. (sighold): Likewise. (sigignore): Likewise. (siginterrupt): Likewise. (sigpause): Likewise. (sigrelse): Likewise. (sigset): Likewise. (sigwait): Do not expect for [XPG4 || XPG42].
* Fix sigstack namespace (bug 21511).Joseph Myers2017-05-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The sigstack function was removed in the 2001 edition of POSIX, and the sigstack structure in the 2008 edition. signal.h wrongly includes those declarations even for newer POSIX versions. This patch fixes the conditions, and conform/ expectations, accordingly. This patch makes the minimum change to when these declarations are present, leaving them visible for __USE_MISC as they would previously have been visible by default. Arguably these legacy declarations should only be visible when an old standard is specifically requested, but implementing that would require arranging for the various sigstack implementations to be able to see the struct sigstack type despite it not being in _GNU_SOURCE in that case. Tested for x86_64. [BZ #21511] * signal/signal.h: Include <bits/types/struct_sigstack.h> only if [(__USE_XOPEN_EXTENDED && !__USE_XOPEN2K8) || __USE_MISC]. (sigstack): Declare only if [(__USE_XOPEN_EXTENDED && !__USE_XOPEN2K) || __USE_MISC]. * conform/data/signal.h-data (struct sigstack): Expect type only if [!XOPEN2K8 && !POSIX2008]. (sigstack): Expect function only if [XPG42 || UNIX98].
* Fix network headers stdint.h namespace (bug 21455).Joseph Myers2017-05-041-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conform/ namespace tests of arpa/inet.h, netdb.h and netinet/in.h fail for UNIX98 and XPG42 because of inclusion of stdint.h, which defines macros not permitted in those headers for those standards. UNIX98 allows them to include inttypes.h, but (predating C99) has restricted inttypes.h contents (not yet tested in the conform/ tests) not including those macros; XPG4.2 has no such permission and no inttypes.h / stdint.h at all. This patch rearranges the headers to avoid this issue. intN_t definitions move to bits/stdint-intn.h, and uintN_t definitions to bits/stdint-uintn.h. (These are not bits/types/ headers because they each define four types. They are separate rather than just a single header because sys/types.h defines intN_t but u_intN_t rather than uintN_t - and while sys/types.h could define uintN_t because of the POSIX reservation of *_t, existing practice there is largely to condition types on appropriate feature test macros, and indeed there is at least one open bug report (14553) about a type that's not so-conditioned, so maybe types there should actually have conditions added where appropriate.) The affected network headers are then made to include bits/stdint-uintn.h instead of stdint.h. This allows six XFAILs to be removed. This doesn't do anything about inttypes.h defining more than it should for UNIX98, but we don't have conformtest expectations for that case at present (and my inclination is that a fix for that should be as local as possible - affecting only inttypes.h, not stdint.h, only for the case of __USE_UNIX98 && !__USE_ISOC99). Tested for x86_64. [BZ #21455] * bits/stdint-intn.h: New file. * bits/stdint-uintn.h: Likewise. * stdlib/Makefile (headers): Add bits/stdint-intn.h and bits/stdint-uintn.h. * inet/netinet/in.h: Include <bits/stdint-uintn.h> instead of <stdint.h>. * posix/sys/types.h: Include <bits/stdint-intn.h>. (__int8_t_defined): Do not define here. (int8_t): Likewise. (int16_t): Likewise. (int32_t): Likewise. (int64_t): Likewise. [__GNUC_PREREQ (2, 7)] (__intN_t): Likewise. * resolv/netdb.h: Include <bits/stdint-uintn.h> instead of <stdint.h>. * include/netdb.h [_ISOMAC]: Do not include <stdint.h>. * sysdeps/generic/stdint.h: Include <bits/stdint-intn.h> and <bits/stdint-uintn.h>. (int8_t): Do not define here. (int16_t): Likewise. (int32_t): Likewise. (int64_t): Likewise. (uint8_t): Likewise. (uint16_t): Likewise. (uint32_t): Likewise. (uint64_t): Likewise. * conform/Makefile (test-xfail-XPG42/arpa/inet.h/conform): Remove variable. (test-xfail-XPG42/netdb.h/conform): Likewise. (test-xfail-XPG42/netinet/in.h/conform): Likewise. (test-xfail-UNIX98/arpa/inet.h/conform): Likewise. (test-xfail-UNIX98/netdb.h/conform): Likewise. (test-xfail-UNIX98/netinet/in.h/conform): Likewise.
* conformtest: Allow time.h inclusion from semaphore.h for XOPEN2K.Joseph Myers2017-04-282-2/+3
| | | | | | | | | | | | | | | | POSIX.1:2001 added sem_timedwait, but said nothing about defining struct timespec in semaphore.h. The 2008 edition added a corresponding permission to include <time.h> from <semaphore.h>. Since this is the normal POSIX approach in such cases, it seems appropriate to consider this a bug fix, and so this patch makes the conform/ tests allow that inclusion for POSIX.1:2001 as well. Tested for x86_64. * conform/data/semaphore.h-data [XOPEN2K] (time.h): Allow header inclusion. * conform/Makefile (test-xfail-XOPEN2K/semaphore.h/conform): Remove.
* conformtest: Fix XPG standard naming.Joseph Myers2017-04-2763-224/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conform/ tests test -D_XOPEN_SOURCE under the name "XPG3", and -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED under the name "XPG4". That naming is misleading. _XOPEN_SOURCE_EXTENDED actually means XPG4.2, including UX-shaded interfaces. _XOPEN_SOURCE actually means XPG4, or XPG4.2 without UX-shaded interfaces. (Prior XPG versions also used _XOPEN_SOURCE, but without any versioning of the values of the macro, so XPG4.2 without UX-shaded interfaces is the only sensible set of interfaces for glibc to expose given _XOPEN_SOURCE=1 without _XOPEN_SOURCE_EXTENDED defined.) This patch fixes the naming in the conform/ tests, so that what is now called XPG4 is changed to XPG42, and what is now called XPG3 is changed to XPG4. Tested for x86_64 (and verified the complete set of expectations is unchanged by the patch beyond the intended renaming). * conform/GlibcConform.pm (XPG4): Rename standard to XPG42. (XPG3): Rename standard to XPG4. * conform/Makefile: Likewise. * conform/list-header-symbols.pl: Likewise. * conform/data/aio.h-data: Likewise. * conform/data/arpa/inet.h-data: Likewise. * conform/data/complex.h-data: Likewise. * conform/data/ctype.h-data: Likewise. * conform/data/dlfcn.h-data: Likewise. * conform/data/fcntl.h-data: Likewise. * conform/data/fenv.h-data: Likewise. * conform/data/float.h-data: Likewise. * conform/data/fmtmsg.h-data: Likewise. * conform/data/ftw.h-data: Likewise. * conform/data/grp.h-data: Likewise. * conform/data/inttypes.h-data: Likewise. * conform/data/iso646.h-data: Likewise. * conform/data/langinfo.h-data: Likewise. * conform/data/libgen.h-data: Likewise. * conform/data/limits.h-data: Likewise. * conform/data/locale.h-data: Likewise. * conform/data/math.h-data: Likewise. * conform/data/mqueue.h-data: Likewise. * conform/data/ndbm.h-data: Likewise. * conform/data/net/if.h-data: Likewise. * conform/data/netdb.h-data: Likewise. * conform/data/netinet/in.h-data: Likewise. * conform/data/poll.h-data: Likewise. * conform/data/pthread.h-data: Likewise. * conform/data/pwd.h-data: Likewise. * conform/data/sched.h-data: Likewise. * conform/data/search.h-data: Likewise. * conform/data/semaphore.h-data: Likewise. * conform/data/signal.h-data: Likewise. * conform/data/spawn.h-data: Likewise. * conform/data/stdbool.h-data: Likewise. * conform/data/stdint.h-data: Likewise. * conform/data/stdio.h-data: Likewise. * conform/data/stdlib.h-data: Likewise. * conform/data/string.h-data: Likewise. * conform/data/strings.h-data: Likewise. * conform/data/stropts.h-data: Likewise. * conform/data/sys/mman.h-data: Likewise. * conform/data/sys/resource.h-data: Likewise. * conform/data/sys/select.h-data: Likewise. * conform/data/sys/socket.h-data: Likewise. * conform/data/sys/stat.h-data: Likewise. * conform/data/sys/statvfs.h-data: Likewise. * conform/data/sys/time.h-data: Likewise. * conform/data/sys/timeb.h-data: Likewise. * conform/data/sys/types.h-data: Likewise. * conform/data/sys/uio.h-data: Likewise. * conform/data/sys/un.h-data: Likewise. * conform/data/sys/wait.h-data: Likewise. * conform/data/syslog.h-data: Likewise. * conform/data/termios.h-data: Likewise. * conform/data/tgmath.h-data: Likewise. * conform/data/time.h-data: Likewise. * conform/data/ucontext.h-data: Likewise. * conform/data/unistd.h-data: Likewise. * conform/data/utmpx.h-data: Likewise. * conform/data/varargs.h-data: Likewise. * conform/data/wchar.h-data: Likewise. * conform/data/wctype.h-data: Likewise.
* Fix sys/socket.h namespace issues from sys/uio.h inclusion (bug 21426).Joseph Myers2017-04-251-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sys/socket.h includes sys/uio.h to get the definition of the iovec structure. POSIX allows sys/socket.h to make all sys/uio.h symbols visible. However, all of sys/uio.h is XSI-shaded, so for non-XSI POSIX this results in conformtest failures (for sys/socket.h and other headers that include it): Namespace violation: "UIO_MAXIOV" Namespace violation: "readv" Namespace violation: "writev" Now, there is some ambiguity in POSIX about what namespace reservations apply in this case - see http://austingroupbugs.net/view.php?id=1127 - but glibc convention would still avoid declaring readv and writev, for example, for feature test macros that don't include them (if only headers from the relevant standard are included), even if such declarations are permitted, so there is a bug here according to glibc conventions. This patch moves the struct iovec definition to a new bits/types/struct_iovec.h header and includes that from sys/socket.h instead of including the whole of sys/uio.h. This fixes the namespace issue; however, three files in glibc that were relying on the implicit inclusion needed to be updated to include sys/uio.h explicitly. So there is a question of whether sys/socket.h should continue to include sys/uio.h under some conditions, such as __USE_XOPEN or __USE_MISC or __USE_XOPEN || __USE_MISC, for greater compatibility with code that (wrongly) expects this optional inclusion to be present there. (I think the three affected files in glibc should still have explicit sys/uio.h inclusions added in any case, however.) Tested for x86_64. [BZ #21426] * misc/bits/types/struct_iovec.h: New file. * misc/Makefile (headers): Add bits/types/struct_iovec.h. * include/bits/types/struct_iovec.h: New file. * bits/uio.h (struct iovec): Replace by inclusion of <bits/types/struct_iovec.h>. * sysdeps/unix/sysv/linux/bits/uio.h (struct iovec): Likewise. * socket/sys/socket.h: Include <bits/types/struct_iovec.h> instead of <sys/uio.h>. * nptl/tst-cancel4.c: Include <sys/uio.h> * posix/test-errno.c: Likewise. * support/resolv_test.c: Likewise. * conform/Makefile (test-xfail-POSIX2008/arpa/inet.h/conform): Remove. (test-xfail-POSIX2008/netdb.h/conform): Likewise. (test-xfail-POSIX2008/netinet/in.h/conform): Likewise. (test-xfail-POSIX2008/sys/socket.h/conform): Likewise.
* conformtest: Allow *_t in sys/socket.h.Joseph Myers2017-04-251-0/+1
| | | | | | | | | | | | | | | The conformtest expectations in sys/socket.h are missing the standard POSIX allowance for all headers to define *_t names. For XSI standard versions that allowance comes in via the permission to include <sys/uio.h> (for which the expectations properly allow *_t), but for non-XSI POSIX nothing brings in that allowance and spurious namespace failures occur. This patch adds the required permission to the expectations to remove the spurious failures (by itself this does not allow any XFAILs to be removed). Tested for x86_64. * conform/data/sys/socket.h-data (*_t): Allow.
* conformtest: Enable tests when cross compiling.Joseph Myers2017-04-181-2/+0
| | | | | | | | | | | | | This patch enables the compilation part of the conformtest tests (the vast bulk of them) when cross compiling, so making it easy to run them across many configurations with build-many-glibcs.py. Tested with build-many-glibcs.py. * conform/Makefile (tests-special): Do not make addition of $(conformtest-header-tests) conditional on [$(cross-compiling) = no]. (generated): Do not make addition of $(conformtest-header-base) conditional on [$(cross-compiling) = no].