summaryrefslogtreecommitdiff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* Fix mcontext_t sigcontext namespace (bug 21457).Joseph Myers2017-08-3026-81/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* aarch64: Fix tst-makecontext3 in ILP32 mode.Steve Ellcey2017-08-301-5/+5
| | | | | * sysdeps/unix/sysv/linux/aarch64/makecontext.c (__makecontext): Use pointer to uint64_t instead of long int for sp.
* Fix m68k bits/math-inline.h macro namespace (bug 22035).Joseph Myers2017-08-291-33/+40
| | | | | | | | | | | | | | | | | | | | | As shown by build bot failures <https://sourceware.org/ml/libc-testresults/2017-q3/msg00349.html> the m68k bits/mathinline.h is not namespace-clean: it fails to compile if the user has defined macros f or l before it is included, because of expansions of those arguments to __inline_functions. This patch changes the __inline_functions definitions to take not the suffix but a macro that concatenates it with the function name, to avoid the spurious macro expansions. Tested for m68k with build-many-glibcs.py. [BZ #22035] * sysdeps/m68k/m680x0/fpu/bits/mathinline.h (__inline_functions): Define to take a second argument that is a macro that concatentates a suffix, not the suffix itself. (__CONCAT_d): New macro. (__CONCAT_f): Likewise. (__CONCAT_l): Likewise.
* MIPS/o32: Fix internal_syscall5/6/7Adhemerval Zanella2017-08-2914-186/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a commit cc25c8b4c119 ("New pthread rwlock that is more scalable.") regression and prevent uncontrolled stack space usage from happening when a 5-, 6- or 7-argument syscall wrapper is placed in a loop. The cause of the problem is the use of `alloca' in regular MIPS/Linux wrappers to force the use of the frame pointer register in any function using one or more of these wrappers. Using the frame pointer register is required so as not to break frame unwinding as the the stack pointer is lowered within the inline asm used by these wrappers to make room for the stack arguments, which 5-, 6- and 7-argument syscalls use with the o32 ABI. The regular MIPS/Linux wrappers are macros however, expanded inline, and stack allocations made with `alloca' are not discarded until the return of the function they are made in. Consequently if called in a loop, then virtual memory is wasted, and if the loop goes through enough iterations, then ultimately available memory can get exhausted causing the program to crash. Address the issue by replacing the inline code with standalone assembly functions, which rely on the compiler arranging syscall arguments according to the o32 function calling convention, which MIPS/Linux syscalls also use, except for the syscall number passed and the error flag returned. This way there is no need to fiddle with the stack pointer anymore and all that has to be handled in the new standalone functions is the special handling of the syscall number and the error flag. Redirect 5-, 6- or 7-argument MIPS16/Linux syscall wrappers to these new functions as well, so as to avoid an unnecessary double call the existing wrappers would cause with the new arrangement. [BZ #21956] * sysdeps/unix/sysv/linux/mips/mips32/mips16/Makefile [subdir = misc] (sysdep_routines): Remove `mips16-syscall5', `mips16-syscall6' and `mips16-syscall7'. (CFLAGS-mips16-syscall5.c, CFLAGS-mips16-syscall6.c) (CFLAGS-mips16-syscall7.c): Remove. * sysdeps/unix/sysv/linux/mips/mips32/mips16/Versions (libc): Remove `__mips16_syscall5', `__mips16_syscall6' and `__mips16_syscall7'. * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall0.c (__mips16_syscall0): Rename `__mips16_syscall_return' to `__mips_syscall_return'. * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall1.c (__mips16_syscall1): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall2.c (__mips16_syscall2): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall3.c (__mips16_syscall3): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall4.c (__mips16_syscall4): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall5.c: Remove. * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall6.c: Remove. * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall7.c: Remove. * sysdeps/unix/sysv/linux/mips/mips32/mips16/mips16-syscall.h (__mips16_syscall5): Expand to `__mips_syscall5' rather than `__mips16_syscall5'. Remove prototype. (__mips16_syscall6): Expand to `__mips_syscall6' rather than `__mips16_syscall6'. Remove prototype. (__mips16_syscall7): Expand to `__mips_syscall7' rather than `__mips16_syscall7'. Remove prototype. (__nomips16, __mips16_syscall_return): Move to... * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (__nomips16, __mips_syscall_return): ... here. [__mips16] (INTERNAL_SYSCALL_NCS): Rename `__mips16_syscall_return' to `__mips_syscall_return'. [__mips16] (INTERNAL_SYSCALL_MIPS16): Pass `number' to `internal_syscall##nr'. [!__mips16] (INTERNAL_SYSCALL): Pass `SYS_ify (name)' to `internal_syscall##nr'. (FORCE_FRAME_POINTER): Remove. (__mips_syscall5): New prototype. (internal_syscall5): Rewrite to call `__mips_syscall5'. (__mips_syscall6): New prototype. (internal_syscall6): Rewrite to call `__mips_syscall6'. (__mips_syscall7): New prototype. (internal_syscall7): Rewrite to call `__mips_syscall7'. * sysdeps/unix/sysv/linux/mips/mips32/mips-syscall5.S: New file. * sysdeps/unix/sysv/linux/mips/mips32/mips-syscall6.S: New file. * sysdeps/unix/sysv/linux/mips/mips32/mips-syscall7.S: New file. * sysdeps/unix/sysv/linux/mips/mips32/Makefile [subdir = misc] (sysdep_routines): Add libc-do-syscall. * sysdeps/unix/sysv/linux/mips/mips32/Versions (libc): Add `__mips_syscall5', `__mips_syscall6' and `__mips_syscall7'.
* [AArch64] Fix procfs.h not to expose stdint.h typesSzabolcs Nagy2017-08-291-2/+1
| | | | | | | Commit 39e7a5a66828a60008543db5f03f46dc7081668b added stdint.h to sys/procfs.h, but it is included into signal.h by default and there is code that does not expect stdint.h to be visible there, so use __uint64_t instead of uint64_t.
* Provide a C++ version of iszero that does not use __MATH_TG (bug 21930)Gabriel F. T. Gomes2017-08-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When signaling nans are enabled (with -fsignaling-nans), the C++ version of iszero uses the fpclassify macro, which is defined with __MATH_TG. However, when support for float128 is available, __MATH_TG uses the builtin __builtin_types_compatible_p, which is only available in C mode. This patch refactors the C++ version of iszero so that it uses function overloading to select between the floating-point types, instead of relying on fpclassify and __MATH_TG. Tested for powerpc64le, s390x, x86_64, and with build-many-glibcs.py. [BZ #21930] * math/math.h [defined __cplusplus && defined __SUPPORT_SNAN__] (iszero): New C++ implementation that does not use fpclassify/__MATH_TG/__builtin_types_compatible_p, when signaling nans are enabled, since __builtin_types_compatible_p is a C-only feature. * math/test-math-iszero.cc: When __HAVE_DISTINCT_FLOAT128 is defined, include ieee754_float128.h for access to the union and member ieee854_float128.ieee. [__HAVE_DISTINCT_FLOAT128] (do_test): Call check_float128. [__HAVE_DISTINCT_FLOAT128] (check_float128): New function. * sysdeps/powerpc/powerpc64le/Makefile [subdir == math] (CXXFLAGS-test-math-iszero.cc): Add -mfloat128 to the build options of test-math-zero on powerpc64le.
* x86_64 __redirect_ieee754_expf: Change double to floatH.J. Lu2017-08-281-1/+1
| | | | | | | __redirect_ieee754_expf has type float, not double. * sysdeps/x86_64/fpu/multiarch/e_expf.c (__redirect_ieee754_expf): Change double to float.
* Simplify math-svid-compat code.Joseph Myers2017-08-281-6/+1
| | | | | | | | | | | | | | | | | | Now there are no more assembly wrappers using _LIB_VERSION or __kernel_standard, the math-svid-compat code can be slighly simplified. math-svid-compat.h no longer needs __ASSEMBLER__ conditionals, and the _LIB_VERSION variable no longer needs to be built for static libm, since all references are now in C code that includes math-svid-compat.h and so gets the macro definition of _LIB_VERSION to _POSIX_ outside the compat case. This patch makes those cleanups. Tested for x86_64, and with build-many-glibcs.py. * math/math-svid-compat.h [!__ASSEMBLER__]: Make code unconditional. * sysdeps/ieee754/s_lib_version.c [!defined SHARED]: Remove conditional code; define contents only for [LIBM_SVID_COMPAT].
* Remove abi-*-options compiler flagsFlorian Weimer2017-08-288-53/+0
| | | | | | These options are no longer needed since commit 2dba5ce7b8115d6a2789bf279892263621088e74 (<bits/syscall.h>: Use an arch-independent system call list on Linux).
* <bits/syscall.h>: Use an arch-independent system call list on LinuxFlorian Weimer2017-08-285-68/+859
| | | | | | | | | | | | | This commit changes the way the list of SYS_* system call macros is created on Linux. glibc now contains a list of all known system calls, and the generated <bits/syscall.h> file defines the SYS_ macro only if the correspnding __NR_ macro is defined by the kernel headers. As a result, glibc does not have to be rebuilt to pick up system calls if the glibc sources already know about them. This means that glibc can be built with older kernel headers, and if the installed kernel headers are upgraded afterwards, additional SYS_ macros become available as long as glibc has a record for those system calls.
* hurd: Add system-specific sysmacros.hSamuel Thibault2017-08-271-0/+60
| | | | * sysdeps/mach/hurd/bits/sysmacros.h: New file.
* x86: Remove assembly versions of index_cpu_*/index_arch_*H.J. Lu2017-08-251-42/+1
| | | | | | | | | | | Since assembly versions of HAS_CPU_FEATURE and HAS_ARCH_FEATURE have been removed, assembly versions of index_cpu_* and index_arch_* can also be removed. Tested on i686 and x86-64 with and without --disable-multi-arch. * sysdeps/x86/cpu-features.h [__ASSEMBLER__] (index_cpu_*, index_arch_*): Removed.
* [AArch64] Fix elf_greg_t on ILP32Szabolcs Nagy2017-08-251-1/+2
| | | | Use uint64_t instead of unsigned long.
* Remove powerpc32 sqrt wrappers.Joseph Myers2017-08-2511-604/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the powerpc32-specific wrappers for sqrt and sqrtf. These wrappers, by adding architecture-specific uses of _LIB_VERSION and __kernel_standard, unnecessarily complicate cleanups of libm error handling. They also do not serve a useful optimization purpose. GCC knows about sqrt as a built-in function, and can generate direct calls to a hardware square root instruction, either on its own, in the -fno-math-errno case, or together with an inline check for the argument being negative and a call to the out-of-line sqrt function for error handling only in that case (and has been able to do so for a long time). Thus in practice the wrapper will only be called only in the case of negative arguments, which is not a case it is useful to optimize for. Tested with build-many-glibcs.py for powerpc-linux-gnu-power4. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt_compat-power5.S: Remove file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt_compat-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrt_compat.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf_compat-power5.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf_compat-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/w_sqrtf_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/powerpc/powerpc32/power4/fpu/multiarch/Makefile (libm-sysdep-routines): Remove w_sqrt_compat-power5, w_sqrt_compat-ppc32, w_sqrtf_compat-power5 and w_sqrtf_compat-ppc32.
* Remove cancellation support for syscall generationAdhemerval Zanella2017-08-2424-2766/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the cancellation mark from the auto-generation syscall script. Now all the cancellable syscalls are done throught C code using the SYSCALL_CANCEL macro. It simplifies the assembly required to each architecture port, since the SYSCALL_CANCEL uses the already defined INLINE_SYSCALL macros, and allows a more straigh fix on cancellation machanism (since no more specific assembly fixes will be required). Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.A Also with build-many-glibc.py with remaning touched architectures. * sysdeps/unix/make-syscalls.sh: Remove cancellable tagging for syscall definitions. * sysdeps/unix/syscall-template.S (SYSCALL_CANCELLABLE): Remove definition. * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (__local_enable_asynccancel): Likewise. [IS_IN (libpthread)] (__local_disable_asynccancel): Likewise. [IS_IN (libc)] (__local_enable_asynccancel): Likewise. [IS_IN (libc)] (__local_enable_asynccancel): Likewise. [IS_IN (librt)] (__local_disable_asynccancel): Likewise. [IS_IN (librt)] (__local_disable_asynccancel): Likewise. (CENABLE): Likewise. (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (PSEUDO): Remove defintion. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Remove file. * sysdeps/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h: New file. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Remove file. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h: New file. * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Remove definition. (PSEUDO_END): Likewise. [IS_IN (libpthread)] (CENABLE): Likewise. [IS_IN (libpthread)] (CDISABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (libc)] (CENABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [IS_IN (librt)] (CDISABLE): Likewise. [__ASSEMBLER__] (SINGLE_THREAD_P): Likewise.
* Fix CFLAGS override in sysdeps/ieee754/dbl-64Szabolcs Nagy2017-08-241-3/+3
| | | | | | | Use += instead of = to avoid overriding target specific CFLAGS settings. Ideally the settings in target Makefiles would have precedence, but the Makefile inclusion order does not allow that, with this fix at least the target settings are not dropped.
* x86-64: Regenerate libm-test-ulps for AVX512 mathvec testsH.J. Lu2017-08-231-2/+2
| | | | | | | Update libm-test-ulps for AVX512 mathvec tests by running “make regen-ulps” on Intel Xeon processor with AVX512. * sysdeps/x86_64/fpu/libm-test-ulps: Regenerated.
* Consolidate remaning non cancellable definitionsAdhemerval Zanella2017-08-232-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidate the remaning non cancellable syscall definitions on not-cancel.h header. They are: * __fcntl_nocancel: Moved from fcntl.h to not-cancel.h. * __sigsuspend_nocancel: Removed since 988f991b50 it is not used or defined anymore. * __nanosleep_nocancel: Removed since 6f33fd046b it is defined on not-cancel.h. Now all non-cancellable syscall definition are defined on not-cancel (the only exceptions is the stdio symbol __fxprintf_nocancel which uses non cancellable open and it is used on getopt implementation). Checked on x86_64-linux-gnu and with build-many-glibc.py. * include/fcntl.h (__fcntl_nocancel): Remove definition. * include/signal.h (__sigsuspend_nocancel): Likewise. * include/time.h (__nanosleep_nocancel): Likewise. * sysdeps/generic/not-cancel.h (__fcntl_nocancel): New macro. * login/utmp_file.c: Include non cancellable syscall header. * sysdeps/unix/sysv/linux/not-cancel.h (__fcntl_nocancel): New prototype.
* x86_64: Replace AVX512F .byte sequences with instructionsH.J. Lu2017-08-236-290/+32
| | | | | | | | | | | | | | | | | | Since binutils 2.25 or later is required to build glibc, we can replace AVX512F .byte sequences with AVX512F instructions. Tested on x86-64 and x32. There are no code differences in libmvec.so and libmvec.a. * sysdeps/x86_64/fpu/svml_d_sincos8_core.S: Replace AVX512F .byte sequences with AVX512F instructions. * sysdeps/x86_64/fpu/svml_d_wrapper_impl.h: Likewise. * sysdeps/x86_64/fpu/svml_s_sincosf16_core.S: Likewise. * sysdeps/x86_64/fpu/svml_s_wrapper_impl.h: Likewise. * sysdeps/x86_64/fpu/multiarch/svml_d_sincos8_core_avx512.S: Likewise. * sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S: Likewise.
* aarch64: Use PTR_REG macro to fix ILP32 bug and make code consistentSteve Ellcey2017-08-221-1/+1
| | | | | * sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Use PTR_REG macro in cmp instruction.
* Remove p{read,write}{v} and fallocate from x86 auto-generation listAdhemerval Zanella2017-08-222-5/+0
| | | | | | | | | | | | With {INLINE,INTERNAL}_SYSCALL macros fixed for 64-bits arguments on x32, we can remove the p{read,write}{v} from auto-generation list. Tested on x86_64 and x32. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (pread64): Remove. (preadv64): Likewise. (pwrite64(: Likewise. (pwritev64): Likewise.
* Fix {INLINE,INTERNAL}_SYSCALL macros for x32Adhemerval Zanella2017-08-222-120/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem for x32 is the {INTERNAL,INLINE}_SYSCALL C macros explicit cast the arguments to 'long int', thus passing as 32 bits arguments that should be passed to 64 bits. Previous x32 implementation uses the auto-generated syscalls from assembly macros (syscalls.list), so the {INTERNAL,INLINE}_SYSCALL macros are never used with 64 bit argument in x32 (which are internally broken for this ILP). To fix it I used a strategy similar to MIPS64n32 (although both ABI differs for some syscalls on how top pass 64-bits arguments) where argument types for kernel call are defined using GCC extension 'typeof' with a arithmetic operation. This allows 64-bits arguments to be defined while 32-bits argument will still passed as 32-bits. I also cleanup the {INLINE,INTERNAL}_SYSCALL definition by defining 'inline_syscallX' instead of constructing the argument passing using macros (it adds some readability) and removed the ununsed INTERNAL_SYSCALL_NCS_TYPES define (since the patch idea is exactly to avoid requiric explicit types passing). Tested on x86_64 and x32. * sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL_NCS_TYPES): Remove define. (LOAD_ARGS_0): Likewise. (LOAD_ARGS_1): Likewise. (LOAD_ARGS_2): Likewise. (LOAD_ARGS_3): Likewise. (LOAD_ARGS_4): Likewise. (LOAD_ARGS_5): Likewise. (LOAD_ARGS_6): Likewise. (LOAD_REGS_0): Likewise. (LOAD_REGS_1): Likewise. (LOAD_REGS_2): Likewise. (LOAD_REGS_3): Likewise. (LOAD_REGS_4): Likewise. (LOAD_REGS_5): Likewise. (LOAD_REGS_6): Likewise. (ASM_ARGS_0): Likewise. (ASM_ARGS_1): Likewise. (ASM_ARGS_2): Likewise. (ASM_ARGS_3): Likewise. (ASM_ARGS_4): Likewise. (ASM_ARGS_5): Likewise. (ASM_ARGS_6): Likewise. (LOAD_ARGS_TYPES_1): Likewise. (LOAD_ARGS_TYPES_2): Likewise. (LOAD_ARGS_TYPES_3): Likewise. (LOAD_ARGS_TYPES_4): Likewise. (LOAD_ARGS_TYPES_5): Likewise. (LOAD_ARGS_TYPES_6): Likewise. (LOAD_REGS_TYPES_1): Likewise. (LOAD_REGS_TYPES_2): Likewise. (LOAD_REGS_TYPES_3): Likewise. (LOAD_REGS_TYPES_4): Likewise. (LOAD_REGS_TYPES_5): Likewise. (LOAD_REGS_TYPES_6): Likewise. (TYPEFY): New define. (ARGIFY): Likewise. (internal_syscall0): Likewise. (internal_syscall1): Likewise. (internal_syscall2): Likewise. (internal_syscall3): Likewise. (internal_syscall4): Likewise. (internal_syscall5): Likewise. (internal_syscall6): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/times.c (INTERNAL_SYSCALL_NCS): Remove define. (internal_syscall1): Add define.
* powerpc: Shrink ULPs for float128Gabriel F. T. Gomes2017-08-221-26/+10
| | | | | | | | | | | | | | | During the development of float128 on powerpc64le, the ulps have been generated since early versions of the patches. On those versions, the functions gamma and pow10 were mistakenly thought to be part of the API. After review, the functions were removed, however the ulps for them were carried in the ulps file. This patch removes such entries from the ulps file, as well as it shrinks the ulps for the cpow and lgamma functions. Tested for powerpc64le. * sysdeps/powerpc/fpu/libm-test-ulps: Update.
* Remove non cancellable sigsuspend definitionAdhemerval Zanella2017-08-223-7/+0
| | | | | | | | | | | | | There is no current internal usage for non cancellable sigsuspend calls. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * sysdeps/generic/not-cancel.h (sigsuspend_not_cancel): remove macro. * sysdeps/mach/hurd/sigsuspend.c (sigsuspend_not_cancel): remove alias. * sysdeps/unix/sysv/linux/not-cancel.h (sigsuspend_not_cancel): likewise.
* Consolidate non cancellable nanosleep callAdhemerval Zanella2017-08-223-3/+13
| | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable nanosleep calls to use the __nanosleep_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * nptl/pthread_mutex_timedlock.c (__pthread_mutex_timedlock): Replace nanosleep_not_cancel with __nanosleep_nocancel. * sysdeps/generic/not-cancel.h (nanosleep_not_cancel): Remove macro. (__nanosleep_nocancel): New macro. * sysdeps/unix/sysv/linux/nanosleep.c (__nanosleep_nocancel): New function. * sysdeps/unix/sysv/linux/not-cancel.h (nanosleep_not_cancel): Remove macro. (__nanosleep_nocancel): New prototype.
* Consolidate non cancellable pause callAdhemerval Zanella2017-08-224-25/+15
| | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable pause calls to use the __pause_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * nptl/pthread_mutex_lock.c (__pthread_mutex_lock_full): Replace pause_not_cancel with __pause_nocancel. * sysdeps/generic/not-cancel.h (pause_not_cancel): Remove macro. (__pause_nocancel): New macro. * sysdeps/unix/sysv/linux/not-cancel.h (pause_not_cancel): Remove macro. (__pause_nocancel): New prototype. * sysdeps/unix/sysv/linux/pause.c (__pause_nocancel): New function.
* Provide a C++ version of issignaling that does not use __MATH_TGGabriel F. T. Gomes2017-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The macro __MATH_TG contains the logic to select between long double and _Float128, when these types are ABI-distinct. This logic relies on __builtin_types_compatible_p, which is not available in C++ mode. On the other hand, C++ function overloading provides the means to distinguish between the floating-point types. The overloading resolution will match the correct parameter regardless of type qualifiers, i.e.: const and volatile. Tested for powerpc64le, s390x, and x86_64. * math/math.h [defined __cplusplus] (issignaling): Provide a C++ definition for issignaling that does not rely on __MATH_TG, since __MATH_TG uses __builtin_types_compatible_p, which is only available in C mode. (CFLAGS-test-math-issignaling.cc): New variable. * math/Makefile [CXX] (tests): Add test-math-issignaling. * math/test-math-issignaling.cc: New test for C++ implementation of type-generic issignaling. * sysdeps/powerpc/powerpc64le/Makefile [subdir == math] (CXXFLAGS-test-math-issignaling.cc): Add -mfloat128 to the build options of test-math-issignaling on powerpc64le.
* Fix sparc32 bits/long-double.h (bug 21987).Joseph Myers2017-08-222-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My refactoring of long double information commit 0acb8a2a855395c25b1feef2470f4d7ca4bed589 Author: Joseph Myers <joseph@codesourcery.com> Date: Wed Dec 14 18:27:56 2016 +0000 Refactor long double information into bits/long-double.h. resulted in sparc32 configurations installing the ldbl-opt version of bits/long-double.h instead of the intended sysdeps/unix/sysv/linux/sparc version. For sparc32 by itself, this is not a problem, since the ldbl-opt version is correct for sparc32. However, both sparc32 and sparc64 are supposed to install sets of headers that work for both of them, so that a single sysroot, whichever order the libraries are built and installed in, works for both. The effect of having the wrong version installed is that you end up with a miscompiled sparc64 libstdc++ which fails glibc's configure tests for the C++ compiler. This patch moves the header from sysdeps/unix/sysv/linux/sparc to separate copies of the same file for sparc32 and sparc64, to ensure it comes before ldbl-opt in the sysdeps directory ordering. Tested with build-many-glibcs.py for sparc64-linux-gnu and sparcv9-linux-gnu. [BZ #21987] * sysdeps/unix/sysv/linux/sparc/bits/long-double.h: Remove file and copy to ... * sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h: ... here. * sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h: ... and here.
* Fix GCC 7 build of k_standard.c.Joseph Myers2017-08-211-0/+3
| | | | | | | | | | | | This patch adds a default case to k_standard.c that calls __builtin_unreachable, to avoid an uninitialized variable error from GCC 7 (reported in <https://sourceware.org/ml/libc-alpha/2017-08/msg01012.html>). Tested for x86_64 (with GCC 7). * sysdeps/ieee754/k_standard.c (__kernel_standard): Add default case calling __builtin_unreachable.
* Consolidate non cancellable waitpid callAdhemerval Zanella2017-08-213-5/+16
| | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable waitpid calls to use the __waitpid_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * libio/ioopen.c (_IO_waitpid): Replace waitpid_not_cancel with __waitpid_nocancel. * sysdeps/generic/not-cancel.h (waitpid_not_cancel): Remove macro. (__waitpid_nocancel): New macro. * sysdeps/unix/sysv/linux/not-cancel.h (waitpid_not_cancel): Remove macro. (__waitpid_nocancel): Replace macro with a function. * sysdeps/unix/sysv/linux/waitpid.c (__waitpid_nocancel): New function.
* Consolidate non cancellable fcntl callAdhemerval Zanella2017-08-212-6/+0
| | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable fcntl calls to use the __fcntl_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Since its prototype is already defined at internal fcntl.h header, it is removed from not-cancel.h one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * login/utmp_file.c (timeout_handler): Replace fcntl_not_cancel with __fcntl_nocancel. * sysdeps/generic/not-cancel.h (fcntl_not_cancel): Remove macro. * sysdeps/unix/sysv/linux/not-cancel.h (fcntl_not_cancel): Likewise.
* Consolidate non cancellable writev callAdhemerval Zanella2017-08-212-5/+9
| | | | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable writev calls to use the __writev_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * gmon/gmon.c (write_hist): Replace writev_not_cancel_no_status with __writev_nocancel_nostatus. (write_call_graph): Likewise. (write_bb_counts): Likewise. * resolv/herror.c (herror): Likewise. * sysdeps/generic/not-cancel.h (writev_not_cancel_no_status): Remove macro. (__writev_nocancel_nostatus): New macro. * sysdeps/unix/sysv/linux/not-cancel.h (writev_not_cancel_no_status): Remove macro. (__writev_nocancel_nostatus): New function.
* Remove SPARC sqrt wrappers (bug 21973).Joseph Myers2017-08-2112-430/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the SPARC-specific wrappers for sqrt and sqrtf. These wrappers, by adding architecture-specific uses of _LIB_VERSION and __kernel_standard, unnecessarily complicate cleanups of libm error handling. They also do not serve a useful optimization purpose. GCC knows about sqrt as a built-in function, and can generate direct calls to a hardware square root instruction, either on its own, in the -fno-math-errno case, or together with an inline check for the argument being negative and a call to the out-of-line sqrt function for error handling only in that case (and has been able to do so for a long time). Thus in practice the wrapper will only be called only in the case of negative arguments, which is not a case it is useful to optimize for. The removal of the wrappers also uncovers, and fixes, an old bug. 32-bit SPARC libm used (checked with glibc 2.8 binaries) to have a sqrtl compat symbol, version GLIBC_2.0, for old binaries when sqrtl was an alias of sqrt (I don't have pre-glibc-2.4 binaries for SPARC to hand to check for the sqrtl symbol in those). This disappeared, probably with: commit 8847f0377003fbfe9cbe951ce9f8717d74f26247 Author: David S. Miller <davem@davemloft.net> Date: Tue Feb 28 22:37:58 2012 -0800 Add sparc optimized sqrt{,f}. Removing the wrappers brings back the generic ldbl-opt logic for creating such compat symbols, and so restores the compat symbol that should be there. This could of course also be fixed in the wrappers - but as noted above, the wrappers are optimizing a case it's not useful to optimize, so the bug of the missing compat symbol serves to illustrate the risks involved with the extra complexity of architecture-specific function versions where not needed. Tested with build-many-glibcs.py. [BZ #21973] * sysdeps/sparc/sparc32/fpu/w_sqrt_compat.S: Remove file. * 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_sqrt_compat.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat-vis3.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/w_sqrtf_compat.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. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Add GLIBC_2.0 sqrtl symbol.
* Obsolete matherr, _LIB_VERSION, libieee.a.Joseph Myers2017-08-2127-61/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* x86-64: Mark internal symbols with attribute_hidden [BZ #18822]H.J. Lu2017-08-212-2/+2
| | | | | | | | | | | Since __syscall_clock_gettime and __start_context are internal symbols for Linux/x86-64, mark them with attribute_hidden. [BZ #18822] * sysdeps/unix/sysv/linux/x86_64/init-first.c (__syscall_clock_gettime): Add attribute_hidden. * sysdeps/unix/sysv/linux/x86_64/makecontext.c (__start_context): Likewise.
* x86: Mark VDSO_SYMBOL(getcpu) with attribute_hidden [BZ #18822]H.J. Lu2017-08-211-1/+2
| | | | | | | | | VDSO_SYMBOL(getcpu) is defined as hidden in Linux/x86_64 init-first.c and unused for Linux/i386. [BZ #18822] * sysdeps/unix/sysv/linux/x86/libc-vdso.h (VDSO_SYMBOL(getcpu)): Add attribute_hidden.
* Mark internal nss symbols with attribute_hidden [BZ #18822]H.J. Lu2017-08-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark internal nss symbols with attribute_hidden to allow direct access within libc.so and libc.a without using GOT nor PLT. Tested on x86-64 with and without --disable-nscd. [BZ #18822] * grp/initgroups.c (__nss_group_database): Removed. (__nss_initgroups_database): Likewise. * nscd/gai.c (__nss_hosts_database): Likewise. * nss/XXX-lookup.c (DATABASE_NAME_SYMBOL): Likewise. * posix/tst-rfc3484-2.c (__nss_hosts_database): Likewise. * posix/tst-rfc3484-3.c (__nss_hosts_database): Likewise. * posix/tst-rfc3484.c (__nss_hosts_database): Likewise. * sysdeps/posix/getaddrinfo.c (__nss_hosts_database): Likewise. * nss/getXXent.c (INTERNAL (REENTRANT_GETNAME)): Add attribute_hidden. * nss/nsswitch.c (__nss_database_custom): Define only if USE_NSCD is defined. (__nss_configure_lookup): Use __nss_database_custom only if USE_NSCD is defined. * nss/nsswitch.h (__nss_database_custom): Declare only if USE_NSCD is defined. Add attribute_hidden. (__nss_setent): Add attribute_hidden. (__nss_endent): Likewise. (__nss_getent_r): Likewise. (__nss_getent): Likewise. (DEFINE_DATABASE): Declare __nss_##arg##_database.
* i386: Hide __old_glob64 [BZ #18822]H.J. Lu2017-08-201-0/+3
| | | | | | | | | Hide internal __old_glob64 function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * sysdeps/unix/sysv/linux/i386/glob64.c (__old_glob64): Add libc_hidden_proto and libc_hidden_def.
* i386: Hide __old_readdir64 [BZ #18822]H.J. Lu2017-08-202-0/+3
| | | | | | | | | | | Hide internal __old_readdir64 function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * sysdeps/unix/sysv/linux/i386/olddirent.h (__old_readdir64): Add libc_hidden_proto. * sysdeps/unix/sysv/linux/i386/readdir64.c (__old_readdir64): Add libc_hidden_def.
* Remove sysdeps/alpha/bb_init_func.SH.J. Lu2017-08-201-86/+0
| | | | | | | | Since the generic __bb_init_func has been removed by commit 7ed87317c7fb, there is no need for sysdeps/alpha/bb_init_func.S. [BZ #21974] * sysdeps/alpha/bb_init_func.S: Removed.
* Mark internal SSE2 functions with attribute_hidden [BZ #18822]H.J. Lu2017-08-192-2/+2
| | | | | | | | | | Mark internal SSE2 functions with attribute_hidden to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * sysdeps/x86_64/multiarch/strcspn-c.c (STRCSPN_SSE2): Add attribute_hidden. (__strspn_sse2): Likewise.
* Consolidate non cancellable close callAdhemerval Zanella2017-08-1827-45/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable close calls to use the __close_nocancel{_nostatus} identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Also, since it is used on libcrypto it is also exported in GLIBC_PRIVATE namespace. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * sysdeps/generic/not-cancel.h (close_not_cancel): Remove macro. (close_not_cancel_no_status): Likewise. (__close_nocancel): New macro. (__close_nocancel_no_status): Likewise. * sysdeps/unix/sysv/linux/not-cancel.h (__close_nocancel): Remove macro. (close_not_cancel): Likewise. (close_not_cancel_no_status): Likewise. (__close_nocancel): New prototype. (__close_nocancel_no_status): New function. * sysdeps/unix/sysv/linux/close.c (__close_nocancel): New function. * catgets/open_catalog.c (__open_catalog): Replace close_not_cancel{_no_status) with __close_nocancel{_nostatus}. * gmon/gmon.c (write_gmon): Likewise. * iconv/gconv_cache.c (__gconv_load_cache): Likewise. * intl/loadmsgcat.c (close): Likewise. * io/ftw.c (open_dir_stream): Likewise. (ftw_startup): Likewise. * libio/fileops.c (_IO_file_open): Likewise. (_IO_file_close_mmap): Likewise. (_IO_file_close): Likewise. * libio/iopopen.c (_IO_dup2): Likewise. * locale/loadarchive.c (_nl_load_locale_from_archive): Likewise. * locale/loadlocale.c (_nl_load_locale): Likewise. * login/utmp_file.c (pututline_file): Likewise. (endutent_file): Likewise. * misc/daemon.c (daemon): Likewise. * nscd/nscd_getai.c (__nscd_getai): Likewise. * nscd/nscd_getgr_r.c (nscd_getgr_r): Likewise. * nscd/nscd_gethst_r.c (nscd_gethst_r): Likewise. * nscd/nscd_getpw_r.c (nscd_getpw_r): Likewise. * nscd/nscd_getserv_r.c (nscd_getserv_r): Likewise. * nscd/nscd_helper.c (open_socket): Likewise. (__nscd_open_socket): Likewise. * nscd/nscd_initgroups.c (__nscd_getgrouplist): Likewise. * nscd/nscd_netgroup.c (__nscd_setnetgrent): Likewise. (__nscd_innetgr): Likewise. * nss/nss_db/db-open.c (internal_setent): Likewise. * resolv/res-close.c (__res_iclose): Likewise. * sunrpc/pm_getmaps.c (pmap_getmaps): Likewise. * sysdeps/posix/closedir.c (__closedir): Likewise. * sysdeps/posix/getaddrinfo.c (getaddrinfo): Likewise. * sysdeps/posix/getcwd.c (__getcwd): Likewise. * sysdeps/posix/opendir.c (tryopen_o_directory): Likewise. (opendir_tail): Likewise. * sysdeps/posix/spawni.c (__spawni_child): Likewise. * sysdeps/unix/sysv/linux/check_native.c (__check_native): Likewise. * sysdeps/unix/sysv/linux/check_pf.c (__check_pf): Likewise. * sysdeps/unix/sysv/linux/fips-private.h (fips_enabled_p): Likewise. * sysdeps/unix/sysv/linux/gethostid.c (sethostid): Likewise. (gethostid): Likewise. * sysdeps/unix/sysv/linux/getloadavg.c (getloadavg): Likewise. * sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Likewise. * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Likewise. * sysdeps/unix/sysv/linux/grantpt.c (close_all_fds): Likewise. * sysdeps/unix/sysv/linux/i386/smp.h (is_smp_system): Likewise. * sysdeps/unix/sysv/linux/ia64/has_cpuclock.c (has_cpuclock): Likewise. * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex): Likewise. * sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps): Likewise. * sysdeps/unix/sysv/linux/malloc-sysdep.h (check_may_shrink_heap): Likewise. * sysdeps/unix/sysv/linux/mq_notify.c (init_mq_netlink): Likewise. * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np): Likewise. * sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np): Likewise. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Likewise. * sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Likewise.
* Consolidate non cancellable openat callAdhemerval Zanella2017-08-187-28/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable openat{64} calls to use the __openat{64}_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * sysdeps/generic/not-cancel.h (openat_not_cancel): Remove macro. (openat_not_cancel_3): Likewise. (openat64_not_cancel_3): Likewise). (openat_not_cancel_3): Likewise). * sysdeps/unix/sysv/linux/not-cancel.h (openat_not_cancel): Remove macro. (openat_not_cancel_3): Likewise. (openat64_not_cancel): Likewise. (openat64_not_cancel_3): Likewise. * sysdeps/unix/sysv/linux/openat.c (__openat_nocancel): New function. * sysdeps/unix/sysv/linux/openat64.c (__openat64_nocancel): Likewise. * io/ftw.c (open_dir_stream): Replace openat{64}_not_cancel{_3} with __open{64}_nocancel. * sysdeps/mach/hurd/opendir.c (__opendirat): Likewise. * sysdeps/posix/getcwd.c (__getcwd): Likewise. * sysdeps/posix/opendir.c (__opendirat): Likewise.
* Consolidate non cancellable write callAdhemerval Zanella2017-08-187-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable write calls to use the __write_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * sysdeps/generic/not-cancel.h (write_not_cancel): Remove macro. (__write_nocancel): New macro. * sysdeps/unix/sysv/linux/not-cancel.h (__write_nocancel): Rewrite as a function prototype. (write_not_cancel): Remove macro. * sysdeps/unix/sysv/linux/write.c (__write_nocancel): New function. * gmon/gmon.c (ERR): Replace write_not_cancel with __write_nocancel. (write_gmon): Likewise. * libio/fileops.c (_IO_new_file_write): Likewise. * login/utmp_file.c (pututline_file): Likewise. (updwtmp_file): Likewise. * stdio-common/psiginfo.c (psiginfo): Likewise. * sysdeps/posix/spawni.c (__spawni_child): Likewise. * sysdeps/unix/sysv/linux/gethostid.c (sethostid): Likewise. * sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps): Likewise. * sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np): Likewise.
* Consolidate non cancellable read callAdhemerval Zanella2017-08-1815-20/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable read calls to use the __read_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Also, since it is used on libcrypto it is also exported in GLIBC_PRIVATE namespace. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * sysdeps/generic/not-cancel.h (read_not_cancel): Remove macro. (__read_nocancel): New macro. * sysdeps/unix/sysv/linux/Versions (libc) [GLIBC_PRIVATE]: Add __read_nocancel. * sysdeps/unix/sysv/linux/not-cancel.h (__read_nocancel): Remove macro. (__read_nocancel): New prototype. * sysdeps/unix/sysv/linux/read.c (__read_nocancel): New function. * catgets/open_catalog.c (__open_catalog): Replace read_not_cancel with __read_nocancel. * intl/loadmsgcat.c (read): Likewise. * libio/fileops.c (_IO_file_read): Likewise. * locale/loadlocale.c (_nl_load_locale): Likewise. * login/utmp_file.c (getutent_r_file): Likewise. (internal_getut_r): Likewise. (getutline_r_file): Likewise. * sysdeps/unix/sysv/linux/fips-private.h (fips_enable_p): Likewise. * sysdeps/unix/sysv/linux/gethostid.c (gethostid): Likewise. * sysdeps/unix/sysv/linux/getloadavg.c (getloadavg): Likewise. * sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Likewise. * sysdeps/unix/sysv/linux/getsysstats.c (next_line): Likewise. * sysdeps/unix/sysv/linux/i386/smp.h (is_smp_system): Likewise. * sysdeps/unix/sysv/linux/ia64/has_cpuclock.c (has_cpuclock): Likewise. * sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps): Likewise. * sysdeps/unix/sysv/linux/malloc-sysdep.h (check_may_shrink_heap): Likewise. * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np): Likewise. * sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Likewise.
* x86-64: Check FMA_Usable in ifunc-mathvec-avx2.h [BZ #21966]H.J. Lu2017-08-181-1/+2
| | | | | | | | | | Since the AVX2 version of mathvec functions uses FMA, it can only be used when FMA is usable. [BZ #21966] * sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h (IFUNC_SELECTOR): Don't use the AVX2 version if FMA isn't usable.
* Consolidate non cancellable open callAdhemerval Zanella2017-08-1724-47/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch consolidates all the non cancellable open calls to use the __open_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. To be consistent with the following non cancellable openat call, a new __open64_nocancel is also added (although not currently used). Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * sysdeps/generic/not-cancel.h (open_not_cancel): Remove macro. (open_not_cancel_2): Likewise. (open_nocancel): New macro. (open64_nocancel): Likewise. * sysdeps/unix/sysv/linux/not-cancel.h (open_not_cancel): Remove macro. (open_not_cancel_2): Likewise. (__open_nocancel): New prototype. (__open64_nocancel): Likewise. * sysdeps/unix/sysv/linux/Versions (libc) [GLIBC_PRIVATE]: Add __open_nocancel. * sysdeps/unix/sysv/linux/open.c (__open_nocancel): New function. * sysdeps/unix/sysv/linux/open64.c (__open64_nocancel): Likewise. * catgets/open_catalog.c (__open_catalog): Replace open_not_cancel{_2} with __open_nocancel. * csu/check_fds.c (check_one_fd): Likewise. * gmon/gmon.c (write_gmon): Likewise. * iconv/gconv_cache.c (__gconv_load_cached): Likewise. * intl/loadmsgcat.c (open): Likewise. * libio/fileops.c (_IO_file_open): Likewise. * locale/loadarchive.c (_nl_load_locale_from_archive): Likewise. * locale/loadlocale.c (_nl_load_locale): Likewise. * login/utmp_file.c (setutent_file): Likewise. * misc/daemon.c (daemon): Likewise. * nss/nss_db/db-open.c (internal_setent): Likewise. * sysdeps/mach/hurd/opendir.c (__opendirat): Likewise. * sysdeps/posix/libc_fatal.c (__libc_message): Likewise. * sysdeps/posix/opendir.c (tryopen_o_directory): Likewise. (__opendir): Likewise. * sysdeps/posix/spawni.c (__spawni_child): Likewise. * sysdeps/unix/sysv/linux/fips-private.h (fips_enable_p): Likewise. * sysdeps/unix/sysv/linux/gethostid.c (sethostid): Likewise. (gethostid): Likewise. * sysdeps/unix/sysv/linux/getloadavg.c (getloadavg): Likewise. * sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Likewise. * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Likewise. * sysdeps/unix/sysv/linux/grantpt.c (__close_all_fds): Likewise. * sysdeps/unix/sysv/linux/i386/smp.h (is_smp_system): Likewise. * sysdeps/unix/sysv/linux/ia64/has_cpuclock.c (has_cpuclock): Likewise. * sysdeps/unix/sysv/linux/libc_fatal.c (backtrace_and_maps): Likewise. * sysdeps/unix/sysv/linux/malloc-sysdep.h (check_may_shrink_heap): Likewise. * sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c (__get_clockfreq): Likewise. * sysdeps/unix/sysv/linux/pthread_getname.c (pthread_getname_np): Likewise. * sysdeps/unix/sysv/linux/pthread_setname.c (pthread_setname_np): Likewise. * sysdeps/unix/sysv/linux/spawni.c (__spawni_child): Likewise. * sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Likewise.
* __opensock: Remove internal_function attributeFlorian Weimer2017-08-171-1/+1
|
* Fix sigval namespace (bug 21944).Joseph Myers2017-08-162-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XPG4.2 defines the siginfo_t type, but not union sigval or its contents (which were added in the 1993 edition of POSIX.1), resulting in namespace violations for sigval, sival_int and sival_ptr for signal.h and sys/wait.h for that standard because those headers incorrectly expose those names in that case. This patch fixes this problem. The public type in this case is union sigval, but various places in the headers use the sigval_t name for it; direct uses of union sigval are already properly guarded or in headers not in XPG4.2. Now, sigval_t, although not a standard name, does seem to be widely used outside glibc. The approach taken by this patch is to make installed headers use the name __sigval_t instead. __sigval_t is then defined to either union sigval or union __sigval (where union __sigval has __-prefixed member names as well), depending on whether there are any namespace issues with the union sigval name and its members. In the case where union __sigval is used, sigval_t is not defined at all, to avoid the problem of sigval_t having a C++ mangled name that depends on feature test macros. sigval_t is still defined by signal.h if __USE_MISC (reflecting the nonstandard nature of that name). Tested for x86_64. [BZ #21944] * signal/bits/types/__sigval_t.h: New file. * signal/Makefile (headers): Add bits/types/__sigval_t.h. * signal/bits/types/sigval_t.h: Include <bits/types/__sigval_t.h> and define sigval_t using __sigval_t. * include/bits/types/__sigval_t.h: New file. * bits/types/sigevent_t.h: Include <bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>. (struct sigevent): Use __sigval_t instead of sigval_t. * bits/types/siginfo_t.h: Include <bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>. (siginfo_t): Use __sigval_t instead of sigval_t. * sysdeps/unix/sysv/linux/bits/types/sigevent_t.h: Include <bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>. (struct sigevent): Use __sigval_t instead of sigval_t. * sysdeps/unix/sysv/linux/bits/types/siginfo_t.h: Include <bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>. (siginfo_t): Use __sigval_t instead of sigval_t. * signal/signal.h [__USE_MISC]: Include <bits/types/sigval_t.h>.
* Allow abort PLT references in libc.so for SH.Joseph Myers2017-08-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | Given my patch <https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00965.html> for the ICEs building a glibc string function test for SH, the testsuite can build completely for SH with GCC 7 and mainline. However, there is a test failure that does not appear for GCC 6: check-localplt fails because of an abort PLT reference in libc.so. Given the lack of a trap insn pattern for SH, it seems unavoidable that the compiler might sometimes generate abort calls, and such abort calls (generated from __builtin_trap when there is no trap insn pattern) will be unaffected by the normal mapping to __GI_abort for calls within glibc. Thus, this patch allows (but does not require) an abort PLT reference in libc.so for SH. Tested for sh4-linux-gnu with build-many-glibcs.py (GCC 7, with my patch applied). * sysdeps/unix/sysv/linux/sh/localplt.data: Allow abort in libc.so.