about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant macro definitions from ia64 sfp-machine.h.Joseph Myers2018-11-122-10/+8
| | | | | | | | | | | | | | | | | | | | After the changes to use the copy attribute, building glibc for ia64 fails, even with older compilers, because sysdeps/ia64/fpu/sfp-machine.h has a definition of _strong_alias that now differs from the one in libc-symbols.h. That definition is a relic of this file coming from libgcc, as are some other such macro definitions in this file; in the glibc context, there is no need for those macros, and this patch removes them to fix the build. Tested with build-many-glibcs.py for ia64-linux-gnu. * sysdeps/ia64/fpu/sfp-machine.h (__LITTLE_ENDIAN): Remove. (__BIG_ENDIAN): Likewise. (__BYTE_ORDER): Likewise. (strong_alias): Likewise. (_strong_alias): Likewise.
* malloc: Convert the unlink macro to the unlink_chunk functionFlorian Weimer2018-11-123-47/+62
| | | | | | | This commit is in preparation of turning the macro into a proper function. The output arguments of the macro were in fact unused. Also clean up uses of __builtin_expect.
* hurd: Fix spawni's user_link reallocationSamuel Thibault2018-11-111-2/+2
| | | | | * hurd/hurd/userlink.h (_hurd_userlink_move): Make new_link's predecessor point to new_link instead of link.
* hurd: Document dtable_cloexec size convention.Samuel Thibault2018-11-112-1/+3
| | | | | * sysdeps/mach/hurd/spawni.c (__spawni): Use orig_dtablesize instead of dtablesize for allocating dtable_cloexec.
* Hurd: export _hurd_port_moveSamuel Thibault2018-11-103-0/+8
| | | | | | * hurd/Versions (_hurd_port_move): Export function. * sysdeps/mach/hurd/i386/libc.abilist (_hurd_port_move): Expect symbol.
* Hurd: Fix ulinks in fd table reallocationSamuel Thibault2018-11-104-1/+64
| | | | | | | * hurd/hurd/userlink.h (_hurd_userlink_move): New function. * hurd/hurd/port.h (_hurd_port_move): New function. * sysdeps/mach/hurd/spawni.c (NEW_ULINK_TABLE): New macro. (EXPAND_DTABLE): Use NEW_ULINK_TABLE macro for ulink_dtable.
* Hurd: Implement chdir support in posix_spawnSamuel Thibault2018-11-102-10/+85
| | | | | | | | | | | | This fixes build-many-glibcs.py on i686-gnu. Thanks Florian Weimer for the initial version. * sysdeps/mach/hurd/spawni.c (__spawni): Add ccwdir port. Test and use it, free it if needed. (reauthenticate): Test and use ccwdir. (child_init_port): In non-resetids case, test and use ccwdir. (child_chdir): New nested function to set ccwdir.
* Add support for GCC 9 attribute copy.Martin Sebor2018-11-0921-26/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 9 has gained an enhancement to help detect attribute mismatches between alias declarations and their targets. It consists of a new warning, -Wattribute-alias, an enhancement to an existing warning, -Wmissing-attributes, and a new attribute called copy. The purpose of the warnings is to help identify either possible bugs (an alias declared with more restrictive attributes than its target promises) or optimization or diagnostic opportunities (an alias target missing some attributes that it could be declared with that might benefit analysis and code generation). The purpose of the new attribute is to easily apply (almost) the same set of attributes to one declaration as those already present on another. As expected (and intended) the enhancement triggers warnings for many alias declarations in Glibc code. This change, tested on x86_64-linux, avoids all instances of the new warnings by making use of the attribute where appropriate. To fully benefit from the enhancement Glibc will need to be compiled with -Wattribute-alias=2 and remaining warnings reviewed and dealt with (there are a couple of thousand but most should be straightforward to deal with). ChangeLog: * include/libc-symbols.h (__attribute_copy__): Define macro unless it's already defined. (_strong_alias): Use __attribute_copy__. (_weak_alias, __hidden_ver1, __hidden_nolink2): Same. * misc/sys/cdefs.h (__attribute_copy__): New macro. * sysdeps/x86_64/multiarch/memchr.c (memchr): Use __attribute_copy__. * sysdeps/x86_64/multiarch/memcmp.c (memcmp): Same. * sysdeps/x86_64/multiarch/mempcpy.c (mempcpy): Same. * sysdeps/x86_64/multiarch/memset.c (memset): Same. * sysdeps/x86_64/multiarch/stpcpy.c (stpcpy): Same. * sysdeps/x86_64/multiarch/strcat.c (strcat): Same. * sysdeps/x86_64/multiarch/strchr.c (strchr): Same. * sysdeps/x86_64/multiarch/strcmp.c (strcmp): Same. * sysdeps/x86_64/multiarch/strcpy.c (strcpy): Same. * sysdeps/x86_64/multiarch/strcspn.c (strcspn): Same. * sysdeps/x86_64/multiarch/strlen.c (strlen): Same. * sysdeps/x86_64/multiarch/strncmp.c (strncmp): Same. * sysdeps/x86_64/multiarch/strncpy.c (strncpy): Same. * sysdeps/x86_64/multiarch/strnlen.c (strnlen): Same. * sysdeps/x86_64/multiarch/strpbrk.c (strpbrk): Same. * sysdeps/x86_64/multiarch/strrchr.c (strrchr): Same. * sysdeps/x86_64/multiarch/strspn.c (strspn): Same.
* Convert tst-efgcvt to the new test frameworkGabriel F. T. Gomes2018-11-092-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | The function do_test, in tst-efgcvt.c, increments an error counter for each error that it finds, then returns it to the test framework. However, the test framework does not expect an error count as return, but zero for a passing test, one for a failing test, or 77 for an unsupported test. Alternatively, the framework provides the function support_record_failure that records errors, which then allows the test program to return zero unconditionally. This patch removes the error counter, replaces each increment of the counter with a call to support_record_failure, and makes do_test unconditionally return zero. Tested for powerpc64le (as-is and with a patched results table to check that the error reporting actually works). * misc/tst-efgcvt.c: Include support/check.h and support/test-driver.c. Do not include test-skeleton.c. (error_count): Remove. (output_error): Replace increments to error_count with calls to support_record_failure. (output_r_error): Likewise. (special): Likewise. (do_test): Unconditionally return zero. (TEST_FUNCTION): Remove.
* Update conform/Makefile mkdir commands.Joseph Myers2018-11-092-2/+6
| | | | | | | | | | | | | | | | 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-0911-995/+730
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use TEST_COMPARE_STRING in recently added testGabriel F. T. Gomes2018-11-084-21/+10
| | | | | | | | | | | | | | | | | | | | | | | The commit commit 1df872fd74f730bcae3df201a229195445d2e18a Author: Florian Weimer <fweimer@redhat.com> Date: Wed Nov 7 12:42:44 2018 +0100 support: Implement TEST_COMPARE_STRING added the new macro TEST_COMPARE_STRING, which compares the output of functions under test against expected strings, and, when there's a mismatch, automatically reports an error and prints the differences. This patch adapts recently added test cases to use this new macro. Tested for powerpc64le (as is, and locally patched to intentionally fail and produce error output). * argp/tst-ldbl-argp.c (do_one_test): Use TEST_COMPARE_STRING, instead of manually comparing and reporting mismatching strings. * misc/tst-ldbl-error.c (do_one_test): Likewise. * misc/tst-ldbl-warn.c (do_one_test): Likewise.
* Remove __ASSUME_SOCKETCALL.Joseph Myers2018-11-089-25/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The __ASSUME_SOCKETCALL macro in kernel-features.h is no longer used for anything. (It used to be used in defining other macros related to accept4 / recvmmsg / sendmmsg availability, but the code in that area was simplified once we could assume a kernel with those features, whether through a syscall or through socketcall, so allowing those functions to be handled much like other socket operations, without requring __ASSUME_SOCKETCALL.) This patch removes that unused macro. (Note: once we can assume a Linux 4.4 or later kernel, much of the support for using socketcall at all can be removed from glibc, although a few functions may need that support in glibc for longer.) Tested with build-many-glibcs.py. * sysdeps/unix/sysv/linux/kernel-features.h: Remove comment about __ASSUME_SOCKETCALL. * sysdeps/unix/sysv/linux/i386/kernel-features.h (__ASSUME_SOCKETCALL): Remove. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_SOCKETCALL): Likewise. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_SOCKETCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__ASSUME_SOCKETCALL): Likewise. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__ASSUME_SOCKETCALL): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_SOCKETCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel-features.h (__ASSUME_SOCKETCALL): Likewise.
* Check multiple NT_GNU_PROPERTY_TYPE_0 notes [BZ #23509]H.J. Lu2018-11-083-14/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linkers group input note sections with the same name into one output note section with the same name. One output note section is placed in one PT_NOTE segment. Since new linkers merge input .note.gnu.property sections into one output .note.gnu.property section, there is only one NT_GNU_PROPERTY_TYPE_0 note in one PT_NOTE segment with new linkers. Since older linkers treat input .note.gnu.property section as a generic note section and just concatenate all input .note.gnu.property sections into one output .note.gnu.property section without merging them, we may see multiple NT_GNU_PROPERTY_TYPE_0 notes in one PT_NOTE segment with older linkers. When an older linker is used to created the program on CET-enabled OS, the linker output has a single .note.gnu.property section with multiple NT_GNU_PROPERTY_TYPE_0 notes, some of which have IBT and SHSTK enable bits set even if the program isn't CET enabled. Such programs will crash on CET-enabled machines. This patch updates the note parser: 1. Skip note parsing if a NT_GNU_PROPERTY_TYPE_0 note has been processed. 2. Check multiple NT_GNU_PROPERTY_TYPE_0 notes. [BZ #23509] * sysdeps/x86/dl-prop.h (_dl_process_cet_property_note): Skip note parsing if a NT_GNU_PROPERTY_TYPE_0 note has been processed. Update the l_cet field when processing NT_GNU_PROPERTY_TYPE_0 note. Check multiple NT_GNU_PROPERTY_TYPE_0 notes. * sysdeps/x86/link_map.h (l_cet): Expand to 3 bits, Add lc_unknown.
* Add an additional test to resolv/tst-resolv-network.cAlexandra Hájková2018-11-082-0/+11
| | | | Test for the infinite loop in getnetbyname, bug #17630.
* Fix __ASSUME_MLOCK2 for ARM, MicroBlaze (bug 23867).Joseph Myers2018-11-073-0/+20
| | | | | | | | | | | | | | | | | | The generic kernel-features.h defines __ASSUME_MLOCK2 for 4.4 and later kernels. However, for 32-bit ARM binaries running on 64-bit ARM kernels, and for MicroBlaze, the syscall was only wired up in the 4.7 kernel. (32-bit ARM kernels did have the syscall from 4.4 onwards.) This patch duly arranges for the macro to be undefined for those architectures for kernels before 4.7. Tested with build-many-glibcs.py for its ARM and MicroBlaze configurations. [BZ #23867] * sysdeps/unix/sysv/linux/arm/kernel-features.h [__LINUX_KERNEL_VERSION < 0x040700] (__ASSUME_MLOCK2): Undefine. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h [__LINUX_KERNEL_VERSION < 0x040700] (__ASSUME_MLOCK2): Undefine.
* support: Fix printf format for TEST_COMPARE_STRINGAdhemerval Zanella2018-11-072-1/+6
| | | | | | | | | | | | | | | | Fix the following on 32 bits targets: support_test_compare_string.c: In function ‘support_test_compare_string’: support_test_compare_string.c:80:37: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=] printf (" string length: %lu bytes\n", left_length); ~~^ ~~~~~~~~~~~ %u Checked on arm-linux-gnueabihf. * support/support_test_compare_string.c (support_test_compare_string): Fix printf format.
* support: Implement TEST_COMPARE_STRINGFlorian Weimer2018-11-075-0/+224
|
* RISC-V: don't assume PI mutexes and robust futexes before 4.20 (bug 23864)Andreas Schwab2018-11-072-0/+12
| | | | Support for futex_cmpxchg as only been added to 4.20-rc1.
* Correct SH kernel-features.h undefines (bug 23862).Joseph Myers2018-11-062-1/+13
| | | | | | | | | | | | | | | | | | The SH kernel-features.h undefines __ASSUME_RENAMEAT2 for kernel versions before 4.8, but fails to undefine __ASSUME_EXECVEAT, __ASSUME_MLOCK2 and __ASSUME_COPY_FILE_RANGE, although all those syscalls (and several others) were added for SH in the same Linux kernel commit (first released in 4.8). This patch adds the proper undefines of those macros. Tested with build-many-glibcs.py for its SH configurations. [BZ #23862] * sysdeps/unix/sysv/linux/sh/kernel-features.h [__LINUX_KERNEL_VERSION < 0x040800] (__ASSUME_EXECVEAT): Undefine. [__LINUX_KERNEL_VERSION < 0x040800] (__ASSUME_MLOCK2): Likewise. [__LINUX_KERNEL_VERSION < 0x040800] (__ASSUME_COPY_FILE_RANGE): Likewise.
* posix: New function posix_spawn_file_actions_addchdir_np [BZ #17405]Florian Weimer2018-11-0638-2/+377
|
* Add tests with floating-point arguments for err* and verr* functionsGabriel F. T. Gomes2018-11-063-1/+136
| | | | | | | | | | | | | | | Similarly to what has been done for argp_error, and argp_failure, as well as for warn, warnx, vwarn, and vwarnx, this patch adds new tests for the following functions: err, errx, verr, verrx, error, and error_at_line. The new tests check that the conversion of long double variables into string works correctly on the default format of the type. Future patches will reuse these tests for other formats that long double can take. Tested for powerpc64le. * misc/Makefile (tests): Add tst-ldbl-error. * misc/tst-ldbl-error.c: New file.
* Add test for warn, warnx, vwarn, and vwarnx with floating-point parametersGabriel F. T. Gomes2018-11-063-1/+127
| | | | | | | | | | | | | | | Similarly to what has been done for argp_error and argp_failure, this patch patch adds new tests for the warn, warnx, vwarn, and vwarnx functions. The new tests use the format string to request the conversion of long double parameters into string. Currently, these tests only check that the default format of the long double type works. Future patches will extend the test for platforms that can have an optional format for long double. Tested for powerpc64le. * misc/Makefile (tests): Add tst-ldbl-warn. * misc/tst-ldbl-warn.c: New file.
* Add tests for argp_error and argp_failure with floating-point parametersGabriel F. T. Gomes2018-11-063-1/+116
| | | | | | | | | | | | | | | | | | | | | The functions argp_error and argp_failure, from argp.h, have a format string as parameter, which can possibly request the printing of floating-point values. These values could be of long double type, which can have different formats, depending on the architecture and on compilation parameters (for instance, on powerpc, long double values can have double format (-mlong-double-64) or IBM Extended Precision format (-mlong-double-128)). This patch adds tests for argp_error and argp_failure that contain a format string with double and long double conversion specifiers ('%f' and '%Lf'). These tests automatically check that the default format of the long double type works. A future patch will extend the test for platforms that can have an optional format for long double. Tested for powerpc64le. * argp/Makefile (tests): Add tst-ldbl-argp. * argp/tst-ldbl-argp.c: New file.
* Unconditionally call __gconv_get_path when reading iconv configurationArjun Shankar2018-11-052-2/+6
| | | | | | | | | __gconv_read_conf is only ever called once during the program's lifetime. This means that __gconv_path_elem is always uninitialized when the function begins executing. __gconv_get_path has an assert to ensure that this expected runtime behaviour is always exhibited. Given this, checking for a NULL value before calling __gconv_get_path is unnecessary. This commit drops the condition and calls __gconv_get_path unconditionally.
* libanl: properly cleanup if first helper thread creation failed (bug 22927)Andreas Schwab2018-11-052-2/+11
|
* hurd: Fix last-minute refactoringSamuel Thibault2018-11-041-1/+1
| | | | * sysdeps/mach/hurd/msync.c (msync): Fix syntax.
* hurd: Support msyncSamuel Thibault2018-11-032-0/+97
| | | | * sysdeps/mach/hurd/msync.c: New file.
* support/shell-container.c: Use support_copy_file_rangeFlorian Weimer2018-11-022-1/+7
| | | | Reviewed-by: DJ Delorie <dj@redhat.com>
* support/test-container.c: Include <libc-pointer-arith.h>Florian Weimer2018-11-022-0/+6
| | | | Reviewed-by: DJ Delorie <dj@redhat.com>
* Fix typo in the documentation of gcvtGabriel F. T. Gomes2018-11-011-1/+1
| | | | | | | In the description of gcvt, add missing closing parenthesis in the comparison with sprintf. * manual/arith.texi (gcvt): Add missing closing parenthesis.
* soft-fp: Add implementation for 128 bit self-containedZong Li2018-11-012-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here only add the implementation when building the RV32 port. These macros are used when the following situations occur at the same time: soft-fp fma, ldbl-128 and 32-bit _FP_W_TYPE_SIZE. The RISC-V 32-bit port is the first port which use all three together. This is the building flow about the situation: When building soft-fp/s_fmal.c, there uses the FP_FMA_Q in __fmal. The _FP_W_TYPE_SIZE is defined to 32-bit in sysdeps/riscv/sfp-machine.h, so the FP_FMA_Q was defined to _FP_FMA (Q, 4, 8, R, X, Y, Z) in soft-fp/quad.h. Something in the soft-fp/quad.h: #if _FP_W_TYPE_SIZE < 64 # define FP_FMA_Q(R, X, Y, Z) _FP_FMA (Q, 4, 8, R, X, Y, Z) #else # define FP_FMA_Q(R, X, Y, Z) _FP_FMA (Q, 2, 4, R, X, Y, Z) #endif Finally, in _FP_FMA (fs, wc, dwc, R, X, Y, Z), it will use the _FP_FRAC_HIGHBIT_DW_##dwc macro, and it will be expanded to _FP_FRAC_HIGHBIT_DW_8, but the _FP_FRAC_HIGHBIT_DW_8 is not be implemented in soft-fp/op-8.h. there is only _FP_FRAC_HIGHBIT_DW_1, _FP_FRAC_HIGHBIT_DW_2 and _FP_FRAC_HIGHBIT_DW_4 in the soft-fp/op-*.h. After this modification, we can pass the soft floating testing of glibc testsuites on RV32. * soft-fp/op-8.h (_FP_FRAC_SET_8, _FP_FRAC_ADD_8, _FP_FRAC_SUB_8) (_FP_FRAC_CLZ_8, _FP_MINFRAC_8, _FP_FRAC_NEGP_8, _FP_FRAC_ZEROP_8) (_FP_FRAC_HIGHBIT_DW_8, _FP_FRAC_COPY_4_8, _FP_FRAC_COPY_8_4) (__FP_FRAC_SET_8): Add implementation for RV32 use.
* soft-fp: Use temporary variable in FP_FRAC_SUB_3/FP_FRAC_SUB_4Zong Li2018-11-012-28/+40
| | | | | | | | | | | | | | | | | | | | | | | | | In FRAC_SUB_3(R, X, Y) and FRAC_SUB_4(R,, X, Y), it reference both the X[N] and X[N] after R[N] have been set. If one of the X and Y is the same address with R, the result of the calculation is wrong, because the value of the original X and Y are overwritten. In glibc, there are two places use FRAC_SUB and occurs the overlap. The first is _FP_DIV_MEAT_N_loop in op-common.h, it uses the source _FP_DIV_MEAT_N_loop_u as the destination. This macro only be used when N is one(_FP_DIV_MEAT_1_loop) and then the _FP_FRAC_SUB_##wc extend to _FP_FRAC_SUB_1 in this macro. so it also work because _FP_FRAC_SUB_1 has no overlap problem in its implementation. The second places is _FP_DIV_MEAT_4_udiv, the original value of X##_f[0] is overwritten before the calculatation. In FRAC_SUB_1 and FRAC_SUB_2, there don't refer the source after destination have been set, so they have no problem. After this modification, we can pass the soft floating testing of glibc testsuites on RV32. * soft-fp/op-4.h (_FP_FRAC_SUB_3, _FP_FRAC_SUB_4): Use temporary variable to avoid overlap arguments.
* Avoid printf ("%s", NULL) in posix/bug-regex22.c.Joseph Myers2018-11-012-4/+8
| | | | | | | | | | | | | | | | | | | | | | Building posix/bug-regex22.c fails with GCC mainline because of -Wformat-overflow= warnings for NULL arguments to %s formats. This is *not* testing how glibc handles such format arguments; in the context of the messages in question it makes no sense to pass NULL to such a %s format (the code passes s, inside "if (s == NULL)"). So this patch changes the code not to pass such a format argument at all (which means the string passed is constant, so no need to use printf at all - however, there are two separate tests here with different length arguments passed to re_compile_pattern, so it *does* make sense to make the strings used different so that in the event of failure it's clear which one of the tests failed). Tested with build-many-glibcs.py with GCC mainline for aarch64-linux-gnu. * posix/bug-regex22.c (main): Use puts with distinct error messages for unexpected success of re_compile_pattern, not printf with NULL argument to %s.
* Disable -Wformat-overflow= warnings for some printf tests.Joseph Myers2018-11-013-0/+35
| | | | | | | | | | | | | | | | | | Recent GCC -Wformat-overflow= changes result in some printf tests failing to build, because those tests are deliberately testing the handling of formats writing more than INT_MAX characters and the handling of NULL arguments to the %s format, which GCC now warns about. This patch duly disables -Wformat-overflow= for the relevant calls to printf functions. Tested with build-many-glibcs.py with GCC mainline for aarch64-linux-gnu. * stdio-common/bug22.c: Include <libc-diag.h>. (do_test): Disable -Wformat-overflow= warnings around fprintf calls outputting more than INT_MAX characters. * stdio-common/tst-printf.c: Disable -Wformat-overflow= warnings around printf call with NULL %s argument.
* Update and correct SPARC configuration for supported socket syscalls (bug ↵Joseph Myers2018-11-013-4/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 23848). Looking at kernel-features.h files, I saw that SPARC was missing full information on when it gained separate socket syscalls. This patch adds such information to the SPARC kernel-features.h. It also corrects what appear to be bugs in the existing code (that would cause syscalls to be assumed to be present when not actually present). Various __ASSUME_* macros, defined by default, were not undefined for 32-bit despite those syscalls only being added for 32-bit in Linux 4.4. Some syscalls were used in the SPARC64 syscalls.list but only added in 4.4; this was harmless before the __NR_* macros were defined at all, but once the macros were defined it means a build with post-4.4 headers would assume the syscalls to be present regardless of --enable-kernel version. Then, various __ASSUME_* macros were previously not defined in cases where they could be defined (this part of the patch is just an optimization, not a bug fix). Note the observation in a comment in the patch that even the latest Linux kernel for SPARC does not have getpeername and getsockname syscalls in the compat syscall table for 32-bit binaries on 64-bit kernels (so glibc can't assume those syscalls to be present for 32-bit at all, although the 32-bit syscall table gained them in 4.4). Tested (compilation only) for SPARC with build-many-glibcs.py. [BZ #23848] * sysdeps/unix/sysv/linux/sparc/kernel-features.h [!__arch64__ && __LINUX_KERNEL_VERSION < 0x040400] (__ASSUME_SENDMSG_SYSCALL): Undefine. [!__arch64__ && __LINUX_KERNEL_VERSION < 0x040400] (__ASSUME_RECVMSG_SYSCALL): Likewise. [!__arch64__ && __LINUX_KERNEL_VERSION < 0x040400] (__ASSUME_SENDTO_SYSCALL): Likewise. [!__arch64__ && __LINUX_KERNEL_VERSION < 0x040400] (__ASSUME_ACCEPT_SYSCALL): Undefine under this condition, not just [!__arch64__]. [!__arch64__ && __LINUX_KERNEL_VERSION < 0x040400] (__ASSUME_CONNECT_SYSCALL): Likewise. [!__arch64__ && __LINUX_KERNEL_VERSION < 0x040400] (__ASSUME_RECVFROM_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_BIND_SYSCALL): Define. [__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_LISTEN_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_SETSOCKOPT_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (bind): Remove. (listen): Likewise. (setsockopt): Likewise.
* MIPS: Use `.set mips2' to emulate LL/SC for the R5900 tooFredrik Noring2018-11-012-1/+7
| | | | | | | | | | | | | | | | | | | GAS treats the R5900 as MIPS III, with some modifications. The MIPS III designation means that the GNU C Library will try to assemble the LL and SC instructions, even though they are not implemented in the R5900. GAS will therefore produce the following errors: Error: opcode not supported on this processor: r5900 (mips3) `ll $2,0($4)' Error: opcode not supported on this processor: r5900 (mips3) `sc $6,0($4)' The MIPS II ISA override as used here enables the kernel to trap and emulate the LL and SC instructions, as required. This change has been tested by compiling the GNU C Library 2.27 with a GCC 8.2.0 cross-compiler for mipsr5900el-unknown-linux-gnu under Gentoo. * sysdeps/mips/sys/tas.h (_test_and_set): Handle the R5900 CPU with the ISA override.
* hurd: Add pci RPC stubsSamuel Thibault2018-10-312-1/+2
| | | | * hurd/Makefile (user-interfaces): Add pci.
* Simplify an #if #else #endifRafael Avila de Espindola2018-10-312-19/+15
| | | | | | | | | The #else of two nested #if clauses were identical. * sysdeps/unix/sysv/linux/sysdep-vdso.h: Simplify an #if #else #endif. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* Merge branch 'master' into errnoSamuel Thibault2018-10-310-0/+0
|\
| * Merge branch 'master' of git://sourceware.org/git/glibcSamuel Thibault2018-10-3126-336/+834
| |\
| * | hurd: Fix cancellation just before RPC callSamuel Thibault2018-10-283-10/+12
| | | | | | | | | | | | | | | | | | | | | * sysdeps/mach/hurd/i386/intr-msg.h (INTR_MSG_TRAP): Set intr_port to 0 when canceled. * hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Pass intr_port address.
| * | hurd: Fix race between calling RPC and handling a signalSamuel Thibault2018-10-284-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sysdeps/mach/hurd/i386/intr-msg.h (INTR_MSG_TRAP): Make _hurd_intr_rpc_msg_about_to global point to start of controlled assembly snippet. Make it check canceled flag again. * hurd/hurdsig.c (_hurdsig_abort_rpcs): Only mutate thread if it passed the _hurd_intr_rpc_msg_about_to point. * hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Remove comment on mutation issue.
* | | hurd: Fix errno* generationSamuel Thibault2018-10-314-2/+28
| |/ |/| | | | | | | | | | | | | * sysdeps/mach/hurd/errnos.awk: Avoid printing errnos.d. * sysdeps/gnu/errlist.c (EIEIO): Move text to... * manual/errno.texi (EIEIO): ... here. * sysdeps/gnu/errlist.c (EIEIO): Regenerate. * sysdeps/mach/hurd/bits/errno.h: Regenerate.
* | hurd: Fix buildSamuel Thibault2018-10-311-2/+2
| | | | | | | | * sysdeps/gnu/errlist.c (EIEIO): Fix comment marker.
* | hurd: Document how to translate EIEIO error messageSamuel Thibault2018-10-312-0/+18
| | | | | | | | | | * sysdeps/gnu/errlist.c (EIEIO): Document how translators should translate the error message.
* | Convert linknamespace tests from Perl to Python.Joseph Myers2018-10-304-240/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | stdlib/test-bz22786: Avoid memory leaks in the test itselfFlorian Weimer2018-10-302-2/+9
| |
* | support_blob_repeat: Call mkstemp directory for the backing fileFlorian Weimer2018-10-302-5/+13
| | | | | | | | This avoids a warning during post-test cleanup.
* | stdlib/tst-strtod-overflow: Switch to support_blob_repeatFlorian Weimer2018-10-302-6/+15
| | | | | | | | This is another test with an avoidable large memory allocation.