about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Suppress internal declarations for most of the testsuite.Zack Weinberg2017-05-1143-257/+573
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new build module called 'testsuite'. IS_IN (testsuite) implies _ISOMAC, as do IS_IN_build and __cplusplus (which means several ad-hoc tests for __cplusplus can go away). libc-symbols.h now suppresses almost all of *itself* when _ISOMAC is defined; in particular, _ISOMAC mode does not get config.h automatically anymore. There are still quite a few tests that need to see internal gunk of one variety or another. For them, we now have 'tests-internal' and 'test-internal-extras'; files in this category will still be compiled with MODULE_NAME=nonlib, and everything proceeds as it always has. The bulk of this patch is moving tests from 'tests' to 'tests-internal'. There is also 'tests-static-internal', which has the same effect on files in 'tests-static', and 'modules-names-tests', which has the *inverse* effect on files in 'modules-names' (it's inverted because most of the things in modules-names are *not* tests). For both of these, the file must appear in *both* the new variable and the old one. There is also now a special case for when libc-symbols.h is included without MODULE_NAME being defined at all. (This happens during the creation of libc-modules.h, and also when preprocessing Versions files.) When this happens, IS_IN is set to be always false and _ISOMAC is *not* defined, which was the status quo, but now it's explicit. The remaining changes to C source files in this patch seemed likely to cause problems in the absence of the main change. They should be relatively self-explanatory. In a few cases I duplicated a definition from an internal header rather than move the test to tests-internal; this was a judgement call each time and I'm happy to change those however reviewers feel is more appropriate. * Makerules: New subdir configuration variables 'tests-internal' and 'test-internal-extras'. Test files in these categories will still be compiled with MODULE_NAME=nonlib. Test files in the existing categories (tests, xtests, test-srcs, test-extras) are now compiled with MODULE_NAME=testsuite. New subdir configuration variable 'modules-names-tests'. Files which are in both 'modules-names' and 'modules-names-tests' will be compiled with MODULE_NAME=testsuite instead of MODULE_NAME=extramodules. (gen-as-const-headers): Move to tests-internal. (do-tests-clean, common-mostlyclean): Support tests-internal. * Makeconfig (built-modules): Add testsuite. * Makefile: Change libof-check-installed-headers-c and libof-check-installed-headers-cxx to 'testsuite'. * Rules: Likewise. Support tests-internal. * benchtests/strcoll-inputs/filelist#en_US.UTF-8: Remove extra-modules.mk. * config.h.in: Don't check for __OPTIMIZE__ or __FAST_MATH__ here. * include/libc-symbols.h: Move definitions of _GNU_SOURCE, PASTE_NAME, PASTE_NAME1, IN_MODULE, IS_IN, and IS_IN_LIB to the very top of the file and rationalize their order. If MODULE_NAME is not defined at all, define IS_IN to always be false, and don't define _ISOMAC. If any of IS_IN (testsuite), IS_IN_build, or __cplusplus are true, define _ISOMAC and suppress everything else in this file, starting with the inclusion of config.h. Do check for inappropriate definitions of __OPTIMIZE__ and __FAST_MATH__ here, but only if _ISOMAC is not defined. Correct some out-of-date commentary. * include/math.h: If _ISOMAC is defined, undefine NO_LONG_DOUBLE and _Mlong_double_ before including math.h. * include/string.h: If _ISOMAC is defined, don't expose _STRING_ARCH_unaligned. Move a comment to a more appropriate location. * include/errno.h, include/stdio.h, include/stdlib.h, include/string.h * include/time.h, include/unistd.h, include/wchar.h: No need to check __cplusplus nor use __BEGIN_DECLS/__END_DECLS. * misc/sys/cdefs.h (__NTHNL): New macro. * sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__m81_defun): Use __NTHNL to avoid errors with GCC 6. * elf/tst-env-setuid-tunables.c: Include config.h with _LIBC defined, for HAVE_TUNABLES. * inet/tst-checks-posix.c: No need to define _ISOMAC. * intl/tst-gettext2.c: Provide own definition of N_. * math/test-signgam-finite-c99.c: No need to define _ISOMAC. * math/test-signgam-main.c: No need to define _ISOMAC. * stdlib/tst-strtod.c: Convert to test-driver. Split locale_test to... * stdlib/tst-strtod1i.c: ...this new file. * stdlib/tst-strtod5.c: Convert to test-driver and add copyright notice. Split tests of __strtod_internal to... * stdlib/tst-strtod5i.c: ...this new file. * string/test-string.h: Include stdint.h. Duplicate definition of inhibit_loop_to_libcall here (from libc-symbols.h). * string/test-strstr.c: Provide dummy definition of libc_hidden_builtin_def when including strstr.c. * sysdeps/ia64/fpu/libm-symbols.h: Suppress entire file in _ISOMAC mode; no need to test __STRICT_ANSI__ nor __cplusplus as well. * sysdeps/x86_64/fpu/math-tests-arch.h: Include cpu-features.h. Don't include init-arch.h. * sysdeps/x86_64/multiarch/test-multiarch.h: Include cpu-features.h. Don't include init-arch.h. * elf/Makefile: Move tst-ptrguard1-static, tst-stackguard1-static, tst-tls1-static, tst-tls2-static, tst-tls3-static, loadtest, unload, unload2, circleload1, neededtest, neededtest2, neededtest3, neededtest4, tst-tls1, tst-tls2, tst-tls3, tst-tls6, tst-tls7, tst-tls8, tst-dlmopen2, tst-ptrguard1, tst-stackguard1, tst-_dl_addr_inside_object, and all of the ifunc tests to tests-internal. Don't add $(modules-names) to test-extras. * inet/Makefile: Move tst-inet6_scopeid_pton to tests-internal. Add tst-deadline to tests-static-internal. * malloc/Makefile: Move tst-mallocstate and tst-scratch_buffer to tests-internal. * misc/Makefile: Move tst-atomic and tst-atomic-long to tests-internal. * nptl/Makefile: Move tst-typesizes, tst-rwlock19, tst-sem11, tst-sem12, tst-sem13, tst-barrier5, tst-signal7, tst-tls3, tst-tls3-malloc, tst-tls5, tst-stackguard1, tst-sem11-static, tst-sem12-static, and tst-stackguard1-static to tests-internal. Link tests-internal with libpthread also. Don't add $(modules-names) to test-extras. * nss/Makefile: Move tst-field to tests-internal. * posix/Makefile: Move bug-regex5, bug-regex20, bug-regex33, tst-rfc3484, tst-rfc3484-2, and tst-rfc3484-3 to tests-internal. * stdlib/Makefile: Move tst-strtod1i, tst-strtod3, tst-strtod4, tst-strtod5i, tst-tls-atexit, and tst-tls-atexit-nodelete to tests-internal. * sunrpc/Makefile: Move tst-svc_register to tests-internal. * sysdeps/powerpc/Makefile: Move test-get_hwcap and test-get_hwcap-static to tests-internal. * sysdeps/unix/sysv/linux/Makefile: Move tst-setgetname to tests-internal. * sysdeps/x86_64/fpu/Makefile: Add all libmvec test modules to modules-names-tests.
* Remove _IO_MTSAFE_IO from public headers.Zack Weinberg2017-05-115-26/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _IO_MTSAFE_IO controls whether stdio is *built* with support for multithreading. In the distant past it might also have worked as a feature selection macro, allowing library *users* to select thread-safe or lock-free stdio at application build time, I haven't done the archaeology. Nowadays, defining _IO_MTSAFE_IO while using the installed headers, or in _ISOMAC mode, will cause libio.h to throw syntax errors. This patch removes _IO_MTSAFE_IO from the public headers (specifically, from libio/libio.h). The most important thing it controlled in there was whether libio.h defines _IO_lock_t itself or expects stdio-lock.h to have done it, and we do still need a inter-header communication macro for that, because stdio-lock.h can only define _IO_lock_t as a typedef. I've invented _IO_lock_t_defined, which is defined by both versions of stdio-lock.h. _IO_MTSAFE_IO also controlled the definitions of a handful of macros that _might_ count as part of the public libio.h interface. They are now unconditionally given their non-_IO_MTSAFE_IO definition in libio/libio.h, and include/libio.h redefines them with the _IO_MTSAFE_IO definition. This should minimize the odds of breaking old software that actually uses those macros. I suspect that this entire mechanism is vestigial, and that glibc won't build anymore if you *don't* define _IO_MTSAFE_IO, but that's another patchset. The bulk of libio.h is internal-use-only stuff that no longer makes sense to expose (libstdc++ gave up on making a FILE the same object as a C++ filebuf *decades* ago) but that, too, is another patchset. * libio/libio.h: Condition dummy definition of _IO_lock_t on _IO_lock_t_defined, not _IO_MTSAFE_IO. Unconditionally use the non-_IO_MTSAFE_IO definitions for _IO_peekc, _IO_flockfile, _IO_funlockfile, and _IO_ftrylockfile. Only define _IO_cleanup_region_start and _IO_cleanup_region_end if not already defined. * include/libio.h: If _IO_MTSAFE_IO is defined, redefine _IO_peekc, _IO_flockfile, _IO_funlockfile, and _IO_ftrylockfile appropriately. * sysdeps/generic/stdio-lock.h, sysdeps/nptl/stdio-lock.h: Define _IO_lock_t_defined after defining _IO_lock_t.
* powerpc: Fix signal handling in backtraceAdhemerval Zanella2017-05-113-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now with read consolidation which uses SYSCALL_CANCEL macro, a frame pointer is created in the syscall code and this makes the powerpc backtrace obtain a bogus entry for the signal handling patch. It is because it does not setup the correct frame pointer register (r1) based on the saved value from the kernel sigreturn. It was not failing because the syscall frame pointer register was the same one for the next frame (the function that actually called the syscall). This patch fixes it by setup the next stack frame using the saved one by the kernel sigreturn. It fixes tst-backtrace{5,6} from the read consolidation patch. Checked on powerpc-linux-gnu and powerpc64le-linux-gnu. * sysdeps/powerpc/powerpc32/backtrace.c (is_sigtramp_address): Use void* for argument type and use VDSO_SYMBOL macro. (is_sigtramp_address_rt): Likewise. (__backtrace): Setup expected frame pointer address for signal handling. * sysdeps/powerpc/powerpc64/backtrace.c (is_sigtramp_address): Use void* for argumetn type and use VSDO_SYMBOL macro. (__backtrace): Setup expected frame pointer address for signal handling.
* Consolidate Linux writev implementationAdhemerval Zanella2017-05-112-0/+29
| | | | | | | | | | This patch consolidates the writev Linux syscall implementation on sysdeps/unix/sysv/linux/writev.c. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/writev.c: New file.
* Consolidate Linux readv implementationAdhemerval Zanella2017-05-112-0/+29
| | | | | | | | | | This patch consolidates the readv Linux syscall implementation on sysdeps/unix/sysv/linux/readv.c. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/readv.c: New file.
* Consolidate Linux write syscallAdhemerval Zanella2017-05-115-0/+41
| | | | | | | | | | | | | This patch consolidates the write Linux syscall implementation on sysdeps/unix/sysv/linux/write.c. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * include/unistd.h (write): Add hidden proto. * io/Makefile (CFLAGS-write.c): New rule. * nptl/Makefile (CFLAGS-write.c): Likewise. * sysdeps/unix/sysv/linux/write.c: New file.
* Consolidate Linux read syscallAdhemerval Zanella2017-05-115-0/+42
| | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the read Linux syscall implementation on sysdeps/unix/sysv/linux/read.c. This leads to a different frame pointer creation on some architectures: * It fixes BZ#21428 on aarch64, since now the returned address for the read syscall can be correctly found out by backtrace_symbols. * It makes tst-backtrace{5,6} fails on powerpc due an issue on its custom backtrace implementation. It is fixed on subsequent patch from this set. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. [BZ #21428] * include/unistd.h (read): Add hidden proto. * io/Makefile (CFLAGS-read.c): New rule. * nptl/Makefile (CFLAGS-read.c): New rule. * sysdeps/unix/sysv/linux/read.c: New file.
* Consolidate Linux creat implementationAdhemerval Zanella2017-05-118-18/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the creat Linux syscall implementation on sysdeps/unix/sysv/linux/creat{64}.c. The changes are: 1. Remove creat{64} from auto-generation syscalls.list. 2. Add a new creat{64}.c implementation. For architectures that define __OFF_T_MATCHES_OFF64_T the default creat64 will create alias to required creat symbols. 3. Use __NR_creat where possible, otherwise use internal open{64} call with expected flags. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * io/Makefile (CFLAGS-creat.c): New rule. (CFLAGS-creat64.c): Likewise. * sysdeps/unix/sysv/linux/alpha/creat.c: Remove file. * sysdeps/unix/sysv/linux/generic/creat.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/creat64.c: Likewise. * sysdeps/unix/sysv/linux/creat.c: New file. * sysdeps/unix/sysv/linux/creat64.c: Likewise. * sysdeps/unix/sysv/linux/syscalls.list: Remove create from auto-generated list. * sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Likewise.
* Consolidate Linux open implementationAdhemerval Zanella2017-05-116-68/+36
| | | | | | | | | | | | | | | | | | | | | | | This patch consolidates the open Linux syscall implementation on sysdeps/unix/sysv/linux/open{64}.c. The changes are: 1. Remove open{64} from auto-generation syscalls.list. 2. Add a new open{64}.c implementation. For architectures that define __OFF_T_MATCHES_OFF64_T the default open64 will create alias to required open symbols. 3. Use __NR_openat as default syscall for open{64}. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/generic/open.c: Remove file. * sysdeps/unix/sysv/linux/generic/open64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/open64.c: Likewise. * sysdeps/unix/sysv/linux/open.c: New file. * sysdeps/unix/sysv/linux/open64.c (__libc_open64): Use O_LARGEFILE only for __OFF_T_MATCHES_OFF64_T and add alias to open if the case. * sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: Remove open from auto-generated list.
* Consolidate Linux close syscall generationAdhemerval Zanella2017-05-113-0/+36
| | | | | | | | | | | This patch consolidates the close Linux syscall generation on sysdeps/unix/sysv/linux/close.c. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * nptl/Makefile (CFLAGS-close.c): New flag. * sysdeps/unix/sysv/linux/close.c: New file.
* Add MAINTAINERSDJ Delorie2017-05-112-0/+5
| | | | | Add a toplevel file "MAINTAINERS" that only points to the MAINTAINERS page on the wiki.
* tunables: Make tunable_list relroSiddhesh Poyarekar2017-05-112-1/+6
| | | | | | | | | | | | | | | | | As of now we don't need tunables to be writable after they have been set initially, so there is no point in having them writable. Put tunable_list in .data.rel.ro so that it is set as read-only after relocation. This also allows us to move some of the dl_* variables that are tunables controlled into the tunables infrastructure instead of having two copies. In future if we ever need specific tunables to be writable at runtime, we can split the tunable_list into two. Regression tested on x86_64 to verify that tests continue to pass. * scripts/gen-tunables.awk: Add attribute_relro to tunable_list.
* Condition some sys/ucontext.h contents on __USE_MISC (bug 21457).Joseph Myers2017-05-1112-150/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the fixes for namespace issues arising from sys/ucontext.h, this patch conditions various definitions, that are not needed for defining mcontext_t / ucontext_t, on __USE_MISC, so they do not appear in strict POSIX modes. This patch is non-exhaustive; that is, it only conditions straightforward cases and there may be more such definitions that can be conditioned for these and other architectures, to be dealt with later in separate patches. Also, using __USE_MISC is the minimum change for these definitions where they conflict with POSIX; some headers already have __USE_GNU conditionals on similar definitions of names for registers. The patch specifically does not do anything with definitions in bits/sigcontext.h, and nor does it condition any inclusions of bits/sigcontext.h even where in fact that is not needed on some architectures for the definitions of mcontext_t / ucontext_t. As other namespace issues in these headers remain, this patch does not fix bug 21457, nor allow any XFAILs to be removed. Tested with build-many-glibcs.py. [BZ #21457] * sysdeps/arm/sys/ucontext.h (R0): Condition on [__USE_MISC]. (R1): Likewise. (R2): Likewise. (R3): Likewise. (R4): Likewise. (R5): Likewise. (R6): Likewise. (R7): Likewise. (R8): Likewise. (R9): Likewise. (R10): Likewise. (R11): Likewise. (R12): Likewise. (R13): Likewise. (R14): Likewise. (R15): Likewise. * sysdeps/i386/sys/ucontext.h (REG_GS): Likewise. (REG_FS): Likewise. (REG_ES): Likewise. (REG_DS): Likewise. (REG_EDI): Likewise. (REG_ESI): Likewise. (REG_EBP): Likewise. (REG_ESP): Likewise. (REG_EBX): Likewise. (REG_EDX): Likewise. (REG_ECX): Likewise. (REG_EAX): Likewise. (REG_TRAPNO): Likewise. (REG_ERR): Likewise. (REG_EIP): Likewise. (REG_CS): Likewise. (REG_EFL): Likewise. (REG_UESP): Likewise. (REG_SS): Likewise. * sysdeps/m68k/sys/ucontext.h (R_D0): Likewise. (R_D1): Likewise. (R_D2): Likewise. (R_D3): Likewise. (R_D4): Likewise. (R_D5): Likewise. (R_D6): Likewise. (R_D7): Likewise. (R_A0): Likewise. (R_A1): Likewise. (R_A2): Likewise. (R_A3): Likewise. (R_A4): Likewise. (R_A5): Likewise. (R_A6): Likewise. (R_A7): Likewise. (R_SP): Likewise. (R_PC): Likewise. (R_PS): Likewise. (fpregset_t): Likewise. (MCONTEXT_VERSION): Likewise. * sysdeps/mips/sys/ucontext.h (CTX_R0): Likewise. (CTX_AT): Likewise. (CTX_V0): Likewise. (CTX_V1): Likewise. (CTX_A0): Likewise. (CTX_A1): Likewise. (CTX_A2): Likewise. (CTX_A3): Likewise. (CTX_T0): Likewise. (CTX_T1): Likewise. (CTX_T2): Likewise. (CTX_T3): Likewise. (CTX_T4): Likewise. (CTX_T5): Likewise. (CTX_T6): Likewise. (CTX_T7): Likewise. (CTX_S0): Likewise. (CTX_S1): Likewise. (CTX_S2): Likewise. (CTX_S3): Likewise. (CTX_S4): Likewise. (CTX_S5): Likewise. (CTX_S6): Likewise. (CTX_S7): Likewise. (CTX_T8): Likewise. (CTX_T9): Likewise. (CTX_K0): Likewise. (CTX_K1): Likewise. (CTX_GP): Likewise. (CTX_SP): Likewise. (CTX_S8): Likewise. (CTX_RA): Likewise. (CTX_MDLO): Likewise. (CTX_MDHI): Likewise. (CTX_CAUSE): Likewise. (CTX_EPC): Likewise. * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Condition inclusion of <sys/procfs.h> on [__USE_MISC]. (greg_t): Condition on [__USE_MISC]. (gregset_t): Likewise. (fpregset_t): Likewise. * sysdeps/unix/sysv/linux/arm/sys/ucontext.h (greg_t): Likewise. (NGREG): Likewise. (gregset_t): Likewise. (REG_R0): Likewise. (REG_R1): Likewise. (REG_R2): Likewise. (REG_R3): Likewise. (REG_R4): Likewise. (REG_R5): Likewise. (REG_R6): Likewise. (REG_R7): Likewise. (REG_R8): Likewise. (REG_R9): Likewise. (REG_R10): Likewise. (REG_R11): Likewise. (REG_R12): Likewise. (REG_R13): Likewise. (REG_R14): Likewise. (REG_R15): Likewise. (struct _libc_fpstate): Likewise. (fpregset_t): Likewise. * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h (NGREG): Likewise. (NFPREG): Likewise. (gregset_t): Likewise. (fpregset_t): Likewise. * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h (R_D0): Likewise. (R_D1): Likewise. (R_D2): Likewise. (R_D3): Likewise. (R_D4): Likewise. (R_D5): Likewise. (R_D6): Likewise. (R_D7): Likewise. (R_A0): Likewise. (R_A1): Likewise. (R_A2): Likewise. (R_A3): Likewise. (R_A4): Likewise. (R_A5): Likewise. (R_A6): Likewise. (R_A7): Likewise. (R_SP): Likewise. (R_PC): Likewise. (R_PS): Likewise. (fpregset_t): Likewise. (MCONTEXT_VERSION): Likewise. * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h (MCONTEXT_VERSION): Likewise. * sysdeps/unix/sysv/linux/sh/sys/ucontext.h (REG_R0): Likewise. (REG_R1): Likewise. (REG_R2): Likewise. (REG_R3): Likewise. (REG_R4): Likewise. (REG_R5): Likewise. (REG_R6): Likewise. (REG_R7): Likewise. (REG_R8): Likewise. (REG_R9): Likewise. (REG_R10): Likewise. (REG_R11): Likewise. (REG_R12): Likewise. (REG_R13): Likewise. (REG_R14): Likewise. (REG_R15): Likewise. * sysdeps/unix/sysv/linux/tile/sys/ucontext.h: Condition inclusion of <arch/abi.h> on [__USE_MISC]. (greg_t): Condition on [__USE_MISC]. (NGREG): Likewise. (gregset_t): Likewise.
* Remove wrong definitions from pthread header refactorAdhemerval Zanella2017-05-113-2/+9
| | | | | | | | | | | | This patch removes wrong struct definition from eab380d (Move shared pthread definitions to common headers) on ARM and hppa. Checked on arm-linux-gnueabihf. * sysdeps/arm/nptl/bits/pthreadtypes-arch.h (__pthread_rwlock_arch_t): Remove __data definition. * sysdeps/hppa/nptl/bits/pthreadtypes-arch.h (__pthread_rwlock_arch_t): Likewise.
* inet_pton: Reformat in GNU styleFlorian Weimer2017-05-112-149/+158
| | | | Generated machine code is identical on x86-64.
* support_format_addrinfo: Fix flags and canonname formattingFlorian Weimer2017-05-113-20/+136
| | | | | | | | | | The address family splitting via format_ai_family made unpredictable the place where the canonname field was printed. This commit adjusts the implementation so that the ai_flags is checked for consistency across the list, and ai_canonname must only be present on the first list element. Tests for AI_CANONNAME are added to resolv/tst-resolv-basic.
* getaddrinfo: Unconditionally use malloc for address listFlorian Weimer2017-05-112-24/+10
| | | | | getaddrinfo has to call malloc eventually anyway, so the complexity of avoiding malloc calls is not worth potential savings.
* Use test-driver in ntpl/tst-fork1.cAndreas Schwab2017-05-102-2/+9
|
* Fix rawmemchr build with GCC 8.Joseph Myers2017-05-102-0/+14
| | | | | | | | | | | | | | | | | The default rawmemchr implementation uses memchr with size (size_t)-1, which produces a warning with current GCC mainline. The warning seems reasonable for normal code, so this patch uses the DIAG_* macros to disable it. Tested (compilation of glibc only) with build-many-glibcs.py for arm-linux-gnueabi and powerpc64le-linux-gnu, two architectures for which the build was previously failing. Note that the glibc testsuite will still fail to build with GCC mainline because of <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80669>. * string/rawmemchr.c: Include <libc-diag.h>. (RAWMEMCHR): Disable -Wstringop-overflow around call to memchr with size (size_t)-1.
* Remove MIPS32 accept4, recvmmsg, sendmmsg implementations.Joseph Myers2017-05-094-88/+4
| | | | | | | | | | | | | | | | | | MIPS32 has its own implementations of accept4, recvmmsg and sendmmsg because at one point it needed to avoid socketcall being used for those functions (MIPS32 has socketcall, but has never used it in glibc, and so never had socket.S at the time when socketcall used such a per-architecture file instead of C code). The current code no longer uses socketcall based on __NR_socketcall being defined, and the syscalls are always present on MIPS for supported kernels so the socketcall case in the code is dead for MIPS; this patch removes the implementations that are, as Adhemerval noted, no longer needed. Tested compilation for mips-linux-gnu with build-many-glibcs.py. * sysdeps/unix/sysv/linux/mips/mips32/accept4.c: Remove file. * sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c: Likewise.
* Simplify accept4, recvmmsg, sendmmsg code.Joseph Myers2017-05-0910-65/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The accept4, recvmmsg and sendmmsg functions had macros __ASSUME_*_SYSCALL_WITH_SOCKETCALL. Before we could assume kernels with the relevant functionality, these macros represented the conditions under which, on a socketcall architecture, glibc could just call the syscall unconditionally and not have to deal with socketcall at all for those functions, because if the syscall didn't work for them the socketcall call wouldn't either. Now we can assume kernels with the relevant functionality, the only question is whether we can assume the syscall is present; if not, we are on a socketcall architecture and just use socketcall instead. Thus, this patch removes the macros that are no longer necessary, and simplifies the code for accept4, recvmmsg and sendmmsg to use the same logic as the other C implementations of socket functions that may use a syscall or socketcall depending on kernel support. Tested for x86_64 and x86. * sysdeps/unix/sysv/linux/accept4.c (accept4): Use syscall if [__ASSUME_ACCEPT4_SYSCALL], otherwise socketcall. * sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Use syscall if [__ASSUME_RECVMMSG_SYSCALL], otherwise socketcall. * sysdeps/unix/sysv/linux/sendmmsg.c (__sendmmsg): Use syscall if [__ASSUME_SENDMMSG_SYSCALL], otherwise socketcall. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Move to general list of macros for socket syscalls. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/i386/kernel-features.h (__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Remove. (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Remove. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL): Likewise. (__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
* Move shared pthread definitions to common headersAdhemerval Zanella2017-05-0933-3236/+1357
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes all the replicated pthread definition accross the architectures and consolidates it on shared headers. The new organization is as follow: * Architecture specific definition (such as pthread types sizes) are place in the new pthreadtypes-arch.h header in arch specific path. * All shared structure definition are moved to a common NPTL header at sysdeps/nptl/bits/pthreadtypes.h (with now includes the arch specific one for internal definitions). * Also, for C11 future thread support, both mutex and condition definition are placed in a common header at sysdeps/nptl/bits/thread-shared-types.h. It is also a refactor patch without expected functional changes. 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, mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, tile{pro,gx}-linux-gnu, and x86_64-linux-gnu). * posix/Makefile (headers): Add pthreadtypes-arch.h and thread-shared-types.h. * sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h: New file: arch specific thread definition. * sysdeps/alpha/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/arm/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/hppa/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/ia64/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/m68k/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/mips/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/nios2/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/s390/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/sh/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/sparc/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/tile/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/x86/nptl/bits/pthreadtypes-arch.h: Likewise. * sysdeps/nptl/bits/thread-shared-types.h: New file: shared thread definition between POSIX and C11. * sysdeps/aarch64/nptl/bits/pthreadtypes.h.: Remove file. * sysdeps/alpha/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/arm/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/hppa/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/m68k/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/microblaze/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/mips/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/nios2/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/ia64/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/powerpc/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/s390/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/sh/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/sparc/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/tile/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/x86/nptl/bits/pthreadtypes.h: Likewise. * sysdeps/nptl/bits/pthreadtypes.h: New file: common thread definitions shared across all architectures.
* Simplify sendmmsg code.Joseph Myers2017-05-093-68/+20
| | | | | | | | | | | | | | | | | | | Now we can assume a kernel with sendmmsg support, this patch simplifies the implementation to be similar to that for accept4: either using socketcall or the syscall according to whether the syscall is known to be available, without further fallback implementations. The __ASSUME_SENDMMSG macro is kept (now defined unconditionally), since it's used in resolv/res_send.c. Tested for x86_64 and x86. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_SENDMMSG_SYSCALL): Define unconditionally. (__ASSUME_SENDMMSG): Likewise. (__ASSUME_SENDMMSG_SOCKETCALL): Remove macro. * sysdeps/unix/sysv/linux/sendmmsg.c (__sendmmsg): Define using sendmmsg syscall if that can be assumed to be present, socketcall otherwise, with no fallback for runtime failure.
* Simplify recvmmsg code.Joseph Myers2017-05-093-68/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now we can assume a kernel with recvmmsg support, this patch simplifies the implementation to be similar to that for accept4: either using socketcall or the syscall according to whether the syscall is known to be available, without further fallback implementations. (In fact further simplification is possible, getting rid of the __ASSUME_*_SYSCALL_WITH_SOCKETCALL macros now that the minimum kernel is guaranteed support for all of accept4, recvmmsg, sendmmsg, whether through syscalls or through socketcall. I intend to do that for all of accept4 / recvmmsg / sendmmsg together - so making their implementations just like those for older socket functions - once the basic cleanup for 3.2 minimum kernel is done for sendmmsg as well as recvmmsg.) Tested for x86_64 and x86. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_RECVMMSG_SYSCALL): Define unconditionally. (__ASSUME_RECVMMSG_SOCKETCALL): Remove macro. (__ASSUME_RECVMMSG): Likewise. * sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Define using recvmmsg syscall if it can be assumed to be present, socketcall otherwise, with no fallback for runtime failure.
* Add support for testing __STDC_WANT_IEC_60559_TYPES_EXT__Paul E. Murphy2017-05-094-0/+28
| | | | | | | | | | This macro is defined by TS 18661-3 for supporting the _FloatN and _FloatNx types, as well as the functions suffixed with fN. * bits/libc-header-start.h: (__GLIBC_USE_IEC_60559_TYPES_EXT): New macro. * include/features.h: Describe __STDC_WANT_IEC_60559_TYPES_EXT__. * manual/creature.texi: Likewise.
* float128: Add _Float128 make bits to libm.Paul E. Murphy2017-05-094-2/+177
| | | | | | | | | | | | | | | | | This adds the appropriate common bits for a platform to enable float128 and expose ABI. * math/Makefile: (type-float128-suffix): New variable (type-float128-routines): Likewise (type-float128-yes): Likewise (types): Append float128 if supported (types-basic): New variable to control the use of templates for float, double, and long double, but not for float128 or newer types. (type-basic-foreach): Likewise. * sysdeps/ieee754/float128/Makeconfig: New file. * sysdeps/ieee754/float128/Versions: New file.
* Assume prlimit64 is available.Joseph Myers2017-05-096-85/+16
| | | | | | | | | | | | | | | | | | | | | | | This patch makes sysdeps/unix/sysv/linux code assume the prlimit64 syscall is always available, given the minimum of a 3.2 kernel. __ASSUME_PRLIMIT64, which in fact was no longer used, is removed. Code conditional on __NR_prlimit64 being defined is made unconditional. Fallback code for the case where prlimit64 produces an ENOSYS error is removed, substantially simplifying some functions. Tested for x86_64 and x86. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PRLIMIT64): Remove macro. * sysdeps/unix/sysv/linux/getrlimit64.c (__getrlimit64): Assume prlimit64 is always available and does not give an ENOSYS error. * sysdeps/unix/sysv/linux/prlimit.c [__NR_prlimit64]: Make code unconditional. [!__NR_prlimit64]: Remove conditional code. * sysdeps/unix/sysv/linux/setrlimit.c (__setrlimit): Assume prlimit64 is always available and does not give an ENOSYS error. * sysdeps/unix/sysv/linux/setrlimit64.c (__setrlimit64): Likewise.
* sunrpc/tst-xdrmem2.c: Include stdint.h.Zack Weinberg2017-05-092-0/+5
|
* resolv: Use RES_DFLRETRY consistently [BZ #21474]Florian Weimer2017-05-092-2/+8
|
* Rename cppflags-iterator.mk to libof-iterator.mk, remove extra-modules.mk.Zack Weinberg2017-05-0917-35/+39
| | | | | | | | | | | | | | | | | | | | | | cppflags-iterator.mk no longer has anything to do with CPPFLAGS; all it does is set libof-$(foo) for a list of files. extra-modules.mk does the same thing, but with a different input variable, and doesn't let the caller control the module. Therefore, this patch gives cppflags-iterator.mk a better name, removes extra-modules.mk, and updates all uses of both. * extra-modules.mk: Delete file. * cppflags-iterator.mk: Rename to ... * libof-iterator.mk: ...this. Adjust comments. * Makerules, extra-lib.mk, benchtests/Makefile, elf/Makefile * elf/rtld-Rules, iconv/Makefile, locale/Makefile, malloc/Makefile * nscd/Makefile, sunrpc/Makefile, sysdeps/s390/Makefile: Use libof-iterator.mk instead of cppflags-iterator.mk or extra-modules.mk. * benchtests/strcoll-inputs/filelist#en_US.UTF-8: Remove extra-modules.mk and cppflags-iterator.mk, add libof-iterator.mk.
* S390: Regenerate ULPsStefan Liebler2017-05-092-6/+10
| | | | | | | | Updated ulps file - Needed if build with GCC 7. ChangeLog: * sysdeps/s390/fpu/libm-test-ulps: Regenerated.
* vfprintf.c: Refactor magic number 32 into EXTSIZ.Carlos O'Donell2017-05-082-25/+33
| | | | | | | The magic number 32 is used everywhere as extra size to use when doing certain operations. This commit refactors that into a macro so you can change this value if you're debugging something in a local build.
* Remove __ASSUME_PROC_PID_TASK_COMM.Joseph Myers2017-05-083-19/+6
| | | | | | | | | | | | | | This patch removes the __ASSUME_PROC_PID_TASK_COMM macro, and associated conditional code (in a testcase), now that 3.2 is the global minimum Linux kernel version supported. Tested for x86_64. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_PROC_PID_TASK_COMM): Remove macro. * sysdeps/unix/sysv/linux/tst-setgetname.c: Do not include <kernel-features.h>. (do_test) [!__ASSUME_PROC_PID_TASK_COMM]: Remove conditional code.
* Remove __ASSUME_GETCPU_SYSCALL.Joseph Myers2017-05-082-5/+5
| | | | | | | | | | | | | | | | | | | This patch removes the definition of __ASSUME_GETCPU_SYSCALL. In fact this macro is unused, probably since: commit dd26c44403582fdf10d663170f947dfe4b3207a0 Author: Adhemerval Zanella <adhemerval.zanella@linaro.com> Date: Wed Apr 22 14:21:39 2015 -0300 Consolidate sched_getcpu so it could have been removed even without the move to 3.2 as minimum kernel version on x86_64. Tested for x86_64. * sysdeps/unix/sysv/linux/x86_64/kernel-features.h (__ASSUME_GETCPU_SYSCALL): Remove macro.
* support: Prevent multiple deletion of temporary filesFlorian Weimer2017-05-087-93/+81
| | | | | | Otherwise, another user might recreate these files after the first deletion. Particularly with temporary directories, this could result in the removal of unintended files through symbol link attacks.
* support: Delete temporary files in LIFO orderFlorian Weimer2017-05-082-11/+14
| | | | | | | | This is required to remove temporary directories which contain temporary files. Previously, FIFO order meant that directory removal was attempted when the directory still contained files, which meant that temporary directory cleanup was essentially unsupported.
* Remove <sys/ultrasound.h>Florian Weimer2017-05-084-2/+9
| | | | | This header was once used for constants related to the Gravis Ultrasound sound card.
* Require Linux kernel 3.2 or later on x86 / x86_64.Joseph Myers2017-05-087-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As per the recent discussion, this patch implements a requirement for Linux 3.2 or later for x86 and x86_64. This is only the initial change to increase the configured minimum; it's expected that followup patches would deal with associated removal of conditionals that are no longer needed. If we remove the start-up test on the kernel version, of course the NEWS and README text should then be revised (to reflect that this version is just one such that glibc does not intend to include compatibility code for any older kernel version, rather than older kernels necessarily failing to work or glibc necessarily having compatibility code for newer interfaces). The followups would be able to assume presence of getcpu (x86_64), recvmmsg (not always through its own syscall, sometimes only through socketcall), sendmmsg (likewise), /proc/$pid/task/$tid/comm, f_flags from statfs, prlimit64. Tested for x86_64 and x86. * sysdeps/unix/sysv/linux/i386/configure.ac (arch_minimum_kernel): Remove. * sysdeps/unix/sysv/linux/i386/configure: Regenerated. * sysdeps/unix/sysv/linux/x86_64/64/configure.ac (arch_minimum_kernel): Remove. * sysdeps/unix/sysv/linux/x86_64/64/configure: Regenerated. * README: Update statement about Linux kernel requirements.
* manual: Add preadv and pwritev documentationAdhemerval Zanella2017-05-042-0/+106
| | | | * manual/llio.texi: Add preadv and pwritev documentation.
* Fix network headers stdint.h namespace (bug 21455).Joseph Myers2017-05-0410-60/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ldbl-128: Use mathx_hidden_def inplace of hidden_defPaul E. Murphy2017-05-045-3/+15
| | | | | | | | | | | | | This provides a extra macro expansion before invoking the hidden_def macro. This is necessary to build the ldbl-128 files as float128 correctly. * sysdeps/generic/math_private.h: (mathx_hidden_def): New macro. * sysdeps/ieee754/ldbl-128/s_finitel.c: Replace hidden_def with the above. * sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise. * sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise.
* Fix signal.h bsd_signal namespace (bug 21445).Joseph Myers2017-05-042-1/+4
| | | | | | | | | | | | | signal.h declares bsd_signal for __USE_XOPEN. But this function was obsoleted in the 2001 edition of POSIX and removed in the 2008 edition, so it should not be declared when the 2008 edition is in use. This patch fixes the conditionals accordingly. (This does not fix any conform/ test failures because of other namespace issues in signal.h.) Tested for x86_64. [BZ #21445] * signal/signal.h [__USE_XOPEN2K8] (bsd_signal): Do not declare.
* Use __glibc_reserved convention in mcontext, sigcontext (bug 21457).Joseph Myers2017-05-044-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the most straightforward part of fixing namespace issues for sys/ucontext.h and related headers: where fields in sys/ucontext.h or bits/sigcontext.h are named "reserved", "padding" or similar, they are renamed to use the __glibc_reserved* naming convention. It does not change fields with a leading underscore, or even those with a prefix such as uc_ or sc_. It only fixes a small part of bug 21457, so no XFAILs are removed. Tested for x86_64 and x86, and with build-many-glibcs.py. [BZ #21457] * sysdeps/unix/sysv/linux/mips/sys/ucontext.h [_MIPS_SIM != _ABIO32] (mcontext_t): Rename field reserved to __glibc_reserved1. * sysdeps/unix/sysv/linux/x86/bits/sigcontext.h (struct _fpx_sw_bytes): Rename field padding to __glibc_reserved1. (struct _fpxreg): Likewise. [!__x86_64__] (struct _fpstate): Rename field reserved to __glibc_reserved1. Rename field padding to __glibc_reserved2. [__x86_64__] (struct _fpstate): Rename field padding to __glibc_reserved1. (struct _xsave_hdr): Rename field reserved1 to __glibc_reserved1. Rename field reserved2 to __glibc_reserved2. * sysdeps/unix/sysv/linux/x86/sys/ucontext.h [__x86_64__] (struct _libc_fpxreg): Rename field padding to __glibc_reserved1. [__x86_64__] (struct _libc_fpstate): Rename field padding to __glibc_reserved1.
* powerpc: Fix strncat ifunc selectionRajalakshmi Srinivasaraghavan2017-05-042-1/+6
| | | | | | Correct hwcap usage in strncat introduced by commit 249dcdb71b79e4c488a46c9027e0014c0bc27044. Tested on power7 and power8 systems
* x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391]H.J. Lu2017-05-0312-138/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dl_platform and dl_hwcap are set from AT_PLATFORM and AT_HWCAP very early during startup. They are used by dynamic linker to determine platform and build an array of hardware capability names, which are added to search path when loading shared object. dl_platform and dl_hwcap are unused on x86-64. On i386, i386, i486, i586 and i686 platforms were supported and only SSE2 capability was used. On x86, usage of AT_PLATFORM and AT_HWCAP to determine platform and processor capabilities is obsolete since all information is available in dl_x86_cpu_features. This patch sets dl_platform and dl_hwcap from dl_x86_cpu_features in dynamic linker. On i386, the available plaforms are changed to i586 and i686 since i386 has been deprecated. On x86-64, the available plaforms are haswell, which is for Haswell class processors with BMI1, BMI2, LZCNT, MOVBE, POPCNT, AVX2 and FMA, and xeon_phi, which is for Xeon Phi class processors with AVX512F, AVX512CD, AVX512ER and AVX512PF. A capability, avx512_1, is also added to x86-64 for AVX512 ISAs: AVX512F, AVX512CD, AVX512BW, AVX512DQ and AVX512VL. [BZ #21391] * sysdeps/i386/dl-machine.h (dl_platform_init) [IS_IN (rtld)]: Only call init_cpu_features. [!IS_IN (rtld)]: Only set GLRO(dl_platform) to NULL if needed. * sysdeps/x86_64/dl-machine.h (dl_platform_init): Likewise. * sysdeps/i386/dl-procinfo.h: Removed. * sysdeps/unix/sysv/linux/i386/dl-procinfo.h: Don't include <sysdeps/i386/dl-procinfo.h> nor <ldsodefs.h>. Include <sysdeps/x86/dl-procinfo.h>. (_dl_procinfo): Replace _DL_HWCAP_COUNT with 32. * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h [!IS_IN (ldconfig)]: Include <sysdeps/x86/dl-procinfo.h> instead of <sysdeps/generic/dl-procinfo.h>. * sysdeps/x86/cpu-features.c: Include <dl-hwcap.h>. (init_cpu_features): Set dl_platform, dl_hwcap and dl_hwcap_mask. * sysdeps/x86/cpu-features.h (bit_cpu_LZCNT): New. (bit_cpu_MOVBE): Likewise. (bit_cpu_BMI1): Likewise. (bit_cpu_BMI2): Likewise. (index_cpu_BMI1): Likewise. (index_cpu_BMI2): Likewise. (index_cpu_LZCNT): Likewise. (index_cpu_MOVBE): Likewise. (index_cpu_POPCNT): Likewise. (reg_BMI1): Likewise. (reg_BMI2): Likewise. (reg_LZCNT): Likewise. (reg_MOVBE): Likewise. (reg_POPCNT): Likewise. * sysdeps/x86/dl-hwcap.h: New file. * sysdeps/x86/dl-procinfo.h: Likewise. * sysdeps/x86/dl-procinfo.c (_dl_x86_hwcap_flags): New. (_dl_x86_platforms): Likewise.
* Tweak realloc/MREMAP comment to be more accurate.DJ Delorie2017-05-032-3/+8
| | | | | | | | | MMap'd memory isn't shrunk without MREMAP, but IIRC this is intentional for performance reasons. Regardless, this patch tweaks the existing comment to be more accurate wrt the existing code. [BZ #21411] * malloc/malloc.c: Tweak realloc/MREMAP comment to be more accurate.
* Correct misplaced comments in struct ip_mreq_sourcePhil Blundell2017-05-032-2/+7
|
* Bug 20686: Add el_GR@euro support.Carlos O'Donell2017-05-032-0/+6
| | | | | | | | | Despite the fact that el_GR is ISO-8859-7:2003 which contains the euro symobl, it is not possible to know this apriori to selecting the el_GR locale. Therefore you don't know if el_GR can possibly have the 2003 ammendments which include the euro symbol. This is resolved by creating an el_GR@euro locale similar to all the other @euro locales for non-UTF8 charsets.
* Bug 20116: Clarify behaviour of PD->lock.Carlos O'Donell2017-05-032-3/+18
| | | | | Add comments to the concurrency notes to clarify the semaphore-like and mutex-like behaviours of PD->lock.
* Consolidate Linux epoll_wait syscallAdhemerval Zanella2017-05-035-5/+17
| | | | | | | | | | | | | | This patch consolidates the epoll_wait Linux syscall generation on sysdeps/unix/sysv/linux/epoll_wait.c. The implementation tries to use __NR_epoll_wait if defined, otherwise calls epoll_pwait. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, arch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/epoll_wait.c: New file. * sysdeps/unix/sysv/linux/generic/epoll_wait.c: Remove file. * sysdeps/unix/sysv/linux/syscalls.list: Remove epoll_wait from auto-generation list.