Commit Graph

17178 Commits

Author SHA1 Message Date
Roland McGrath e641054cd8 IA64: Consolidate NPTL/non versions of clone 2014-08-04 09:06:51 -04:00
Andreas Schwab dacdc86717 Fix missing <math_private.h> in ldbl-96 fma 2014-08-04 10:20:20 +02:00
Mike Frysinger 41f725ff29 add ChangeLog for previous commit 2014-08-03 11:12:35 -04:00
Roland McGrath 277cfb315b Remove sysdeps/unix/sysv/linux/arm/lowlevellock.h 2014-08-01 18:59:48 -07:00
Richard Henderson 4896f04920 Force eval for fma implementations 2014-08-01 12:13:50 -10:00
Roland McGrath 6f64e7d75f ARM: Move PTR_MANGLE et al out of Linux-specific file. 2014-08-01 11:28:49 -07:00
Siddhesh Poyarekar a476ac4b45 Fix -Wundef warnings in regex_internal.h 2014-08-01 14:30:43 +05:30
Siddhesh Poyarekar 78dd658a02 Check if DEBUG is defined in regex_internal.c
The DEBUG macro is checked for its value in one place and if it is
defined in another.  Make this consistent across the two cases and use
the same style that we did in mktime.c, which is to check if the macro
is defined and it is set.
2014-08-01 14:24:41 +05:30
Siddhesh Poyarekar 3f3dd810e0 Fix -Wundef warnings in fnmatch.c
Fixes -Wundef warnings for MBSTATE_T and HAVE_STRING_H.  The
HAVE_STRING_H bit is a merge from the gnulib fnmatch.c and the
MBSTATE_T fix has been posted to gnulib for inclusion.
2014-08-01 14:23:38 +05:30
Stefan Liebler 95ee7fb13b NEWS: Explain the s390 jmp_buf / ucontext_t ABI change reversal. 2014-08-01 09:49:31 +02:00
Roland McGrath f61a113fe0 Add __safe_fatal and use it in __pthread_unwind forwarder fallback. 2014-07-31 14:00:33 -07:00
Roland McGrath 9fe7e787ad Use __builtin_trap for ABORT_INSTRUCTION. 2014-07-31 13:07:19 -07:00
Roland McGrath 23fe486beb Split nptl-signals.h out from pthreadP.h 2014-07-31 11:37:48 -07:00
Stefan Liebler f349489e7e [PATCH] S390: Fix remaining ONE_DIRECTION warning messages
This patch fixes the remaining ONE_DIRECTION warnings for s390 specific conversions.
It defines ONE_DIRECTION to 0 like the patch from Steve Ellcey:
https://www.sourceware.org/ml/libc-alpha/2014-05/msg00039.html

    Changelog:
    * sysdeps/s390/s390-64/utf16-utf32-z9.c
    (ONE_DIRECTION): Define.
    * sysdeps/s390/s390-64/utf8-utf16-z9.c
    (ONE_DIRECTION): Define.
    * sysdeps/s390/s390-64/utf8-utf32-z9.c
    (ONE_DIRECTION): Define.
2014-07-31 20:10:47 +02:00
Stefan Liebler 2f438e20ab S/390: Revert the jmp_buf/ucontext_t ABI change. 2014-07-31 20:04:54 +02:00
Andreas Schwab 6c9578a24b Fix -Wundef warning for HAVE_IFUNC 2014-07-31 17:05:19 +02:00
Ling Ma 05f3633da4 Improve 64bit memcpy performance for Haswell CPU with AVX instruction
In this patch we take advantage of HSW memory bandwidth, manage to
reduce miss branch prediction by avoiding using branch instructions and
force destination to be aligned with avx instruction.

The CPU2006 403.gcc benchmark indicates this patch improves performance
from 2% to 10%.
2014-07-30 08:02:35 -07:00
Adhemerval Zanella a53fbd8e6c PowerPC: Fix gprof entry point for LE
This patch fixes the ELFv2 gprof entry point since the ABI
does not define function descriptors.  It fixes BZ#17213.
2014-07-30 09:01:25 -03:00
Jeff Layton 0961f7e1e3 fcntl-linux.h: add new definitions and manual updates for open file description locks
Open file description locks have been merged into the Linux kernel for
v3.15.  Add the appropriate command-value definitions and an update to
the manual that describes their usage.
2014-07-29 23:27:21 -04:00
Allan McRae cc5fb300fc Update Spanish translations 2014-07-23 17:06:01 +10:00
Allan McRae 8125aedc0e Add missing changelog entry for commit ab7ac0f2 2014-07-23 16:52:13 +10:00
Andreas Schwab 23329dcaf9 m68k: use generic lowlevellock.h 2014-07-18 23:35:11 +02:00
Maciej W. Rozycki 9c82da17b5 [BZ #17078] ARM: R_ARM_TLS_DESC prelinker support
This is a change to the dynamic linker to add prelinker support for the
R_ARM_TLS_DESC relocation.  Two cases can be considered here, the usual
one where lazy binding is in use and the less frequent one, where
immediate binding is requested via the use of the DF_BIND_NOW dynamic
flag (e.g. by using the GNU linker's "-z now" option).

This change only handles the first case.  In this scenario the prelinker
does what the dynamic linker would do, that is it preinitialises
R_ARM_TLS_DESC relocations with a pointer to the lazy specialization as
provided with the DT_TLSDESC_PLT dynamic tag.  A conflict is
additionally created and in the conflict resolution path the dynamic
linker complements the work by initialising the object's pointer as
indicated by the DT_TLSDESC_GOT dynamic tag to the linker's internal
lazy specialization worker function and also providing the associated
link map in the second entry of the GOT.  This step is required, because
if prelinking is successful at the run time, then the dynamic linker's
elf_machine_runtime_setup() function isn't called that would normally do
so.

The second case remains unresolved, because support for that scenario
has not been implemented in the prelinker.  In this case the lazy
specialization is unavailable and the DT_TLSDESC_PLT dynamic tag is not
present.

The prelinker could assume the common case of static specialization and
resolve the relocation, but that would require the exposure of dynamic
linker's specialization worker function.  Furthermore the dynamic linker
would have to handle the relocation in the conflict resolution path and
see if the dynamic specialization should be used instead.  This however
would require access to data structures currently not made available to
the conflict resolution path and therefore a redesign of this part of
the dynamic linker.

Alternatively the prelinker could defer all processing to the dynamic
linker's conflict resolution path, but that would require similar access
to the said data structures.

Therefore the prelinker issues an error instead and the dynamic linker
has assertions to check that DT_TLSDESC_PLT and DT_TLSDESC_GOT are in
use in its conflict resolution path.

This change resolves all TLS failures in the prelinker testsuite, as
noted in the bug report, as well as the small test case provided there.
Unfortunately we don't seem to have any hooks to factor in the prelinker
(if present on a system) to testing, so at this time this fix has to
rely on using the prelinker test suite and enabling TLS descriptors
there for coverage.

	[BZ #17078]
	* sysdeps/arm/dl-machine.h (elf_machine_rela)
	[RESOLVE_CONFLICT_FIND_MAP]: Handle R_ARM_TLS_DESC relocation.
	(elf_machine_lazy_rel): Handle prelinked R_ARM_TLS_DESC entries.
2014-07-17 19:22:05 +01:00
Joseph Myers 831b9896d8 Fix fallback fesetenv and feupdateenv on FE_NOMASK_ENV (bug 17088).
This patch fixes bug 17088, fallback fesetenv and feupdateenv not
giving an error for an FE_NOMASK_ENV argument when it requires traps
to be enabled.  (This is the bug tested for by test-fenv-return.c.)

Tested mips64 soft-float.

	[BZ #17088]
	* math/fesetenv.c (__fesetenv)
	[FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Return 1 for FE_NOMASK_ENV.
	* math/feupdateenv.c (__feupdateenv)
	[FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Likewise.
2014-07-17 17:56:43 +00:00
Joseph Myers b21c2d5020 [PATCH 6/6] Split s390 out of main Linux kernel-features.h.
This patch splits s390 out of the main Linux kernel-features.h.

Not tested.

	* sysdeps/unix/sysv/linux/s390/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__s390__]
	(__ASSUME_SOCKETCALL): Do not define.
2014-07-17 17:55:44 +00:00
Joseph Myers 067764ef47 [PATCH 5/6] Split sh out of main Linux kernel-features.h.
This patch splits sh out of the main Linux kernel-features.h.

Not tested.

	* sysdeps/unix/sysv/linux/sh/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__sh__]
	(__ASSUME_SOCKETCALL): Do not define.
	(__ASSUME_ST_INO_64_BIT): Define unconditionally.
	[__LINUX_KERNEL_VERSION >= 0x020625 && __sh__]
	(__ASSUME_ACCEPT4_SYSCALL): Do not define.
	[__LINUX_KERNEL_VERSION >= 0x020625 && __sh__]
	(__ASSUME_RECVMMSG_SYSCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __sh__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__sh__] (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
2014-07-17 17:54:43 +00:00
Joseph Myers 642530c1b4 [PATCH 4/6] Split powerpc out of main Linux kernel-features.h.
This patch splits powerpc out of the main Linux kernel-features.h.

Not tested.

	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__powerpc__]
	(__ASSUME_SOCKETCALL): Do not define.
	(__ASSUME_IPC64): Define unconditionally.
	[__LINUX_KERNEL_VERSION >= 0x020625 && __powerpc__]
	(__ASSUME_ACCEPT4_SYSCALL): Do not define.
	[__LINUX_KERNEL_VERSION >= 0x020625 && __powerpc__]
	(__ASSUME_RECVMMSG_SYSCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __powerpc__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__powerpc__] (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL):
	Likewise.
2014-07-17 17:53:52 +00:00
Joseph Myers 03f7731518 [PATCH 3/6] Split sparc out of main Linux kernel-features.h.
This patch splits sparc out of the main Linux kernel-features.h.

Not tested.

	* sysdeps/unix/sysv/linux/sparc/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__sparc__]
	(__ASSUME_SOCKETCALL): Do not define.
	(__ASSUME_SET_ROBUST_LIST): Define unconditionally.
	(__ASSUME_FUTEX_LOCK_PI): Likewise.
	[__sparc__] (__ASSUME_ACCEPT4_SYSCALL): Do not define.
	[__sparc__] (__ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL): Likewise.
	(__ASSUME_REQUEUE_PI): Define unconditionally.
	[__LINUX_KERNEL_VERSION >= 0x020621 && __sparc__]
	(__ASSUME_RECVMMSG_SYSCALL): Do not define.
	[__sparc__] (__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __sparc__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__sparc__] (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
2014-07-17 17:52:58 +00:00
Joseph Myers 083b1f7c12 [PATCH 2/6] Split i386 out of main Linux kernel-features.h.
This patch splits i386 out of the main Linux kernel-features.h.

Tested x86 that there are no changes to disassembly of installed
shared libraries.

	* sysdeps/unix/sysv/linux/i386/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__i386__]
	(__ASSUME_SOCKETCALL): Do not define.
	[__LINUX_KERNEL_VERSION >= 0x020621 && __i386__]
	(__ASSUME_RECVMMSG_SYSCALL): Likewise.
	[__i386__] (__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __i386__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__i386__] (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
2014-07-17 17:51:52 +00:00
Joseph Myers 5be44ea623 [PATCH 1/6] Split x86_64 out of main Linux kernel-features.h.
This patch splits x86_64 out of the main Linux kernel-features.h.

Tested x86_64 that there are no changes to disassembly of installed
shared libraries.

	* sysdeps/unix/sysv/linux/x86_64/kernel-features.h: New file.
	* sysdeps/unix/sysv/linux/kernel-features.h [__x86_64__]
	(__ASSUME_ACCEPT4_SYSCALL): Do not define.
	[__LINUX_KERNEL_VERSION >= 0x020621 && __x86_64__]
	(__ASSUME_RECVMMSG_SYSCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030000 && __x86_64__]
	(__ASSUME_SENDMMSG_SYSCALL): Likewise.
	[__x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100]
	(__ASSUME_GETCPU_SYSCALL): Likewise.
2014-07-17 17:49:45 +00:00
Joseph Myers d95ffd4cfd Refactor handling of /lib64 etc. cases, move out of sysdeps/gnu/configure.ac.
This patch continues removing architecture-specific cases from
non-architecture-specific files by moving the logic to use directories
such as /lib64 out of sysdeps/gnu/configure.ac.

A new macro LIBC_SLIBDIR_RTLDDIR is created that sysdeps configure
scripts can use to declare the library directories to be used; the
logic was previously duplicated in configure fragments for aarch64,
mips and x32 as well as in sysdeps/gnu/configure.ac.  This macro is
used directly in sysdeps/gnu/configure.ac only to provide the /lib
default (the logic saying that with --prefix=/usr shared libraries go
in /lib not /usr/lib); the architecture cases formerly there are moved
into various new or existing configure.ac files.  The new macro is
also used in the various architecture fragments that already had such
logic.  In the x32 there was previously a configure fragment, but it
was a directly written one without a .ac file; now a .ac file is used
there instead to generate configure.

Tested x86_64 that the installed shared libraries, and the directory
structure of the installation, are unchanged by this patch.

There is an old bug report - bug 6441 - about library directories
changing after reconfiguring.  If this is still applicable - and I
haven't attempted to confirm it or review the old patch pointed to in
that bug - then this patch should reduce the number of places needing
changing in any fix.

	* aclocal.m4 (LIBC_SLIBDIR_RTLDDIR): New macro.
	* sysdeps/gnu/configure.ac: Use LIBC_SLIBDIR_RTLDDIR.  Remove
	cases for individual architectures.
	* sysdeps/gnu/configure: Regenerated.
	* sysdeps/unix/sysv/linux/aarch64/configure.ac: Use
	LIBC_SLIBDIR_RTLDDIR.
	* sysdeps/unix/sysv/linux/aarch64/configure: Regenerated.
	* sysdeps/unix/sysv/linux/mips/configure.ac: Use
	LIBC_SLIBDIR_RTLDDIR.
	* sysdeps/unix/sysv/linux/mips/configure: Regenerated.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac: Use
	LIBC_SLIBDIR_RTLDDIR.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/configure:
	Regenerated.
	* sysdeps/unix/sysv/linux/s390/s390-64/configure.ac: New file.
	* sysdeps/unix/sysv/linux/s390/s390-64/configure: New generated
	file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/configure.ac: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/configure: New generated
	file.
	* sysdeps/unix/sysv/linux/x86_64/64/configure.ac: New file.
	* sysdeps/unix/sysv/linux/x86_64/64/configure: New generated file.
	* sysdeps/unix/sysv/linux/x86_64/x32/configure.ac: New file.
	* sysdeps/unix/sysv/linux/x86_64/x32/configure: Generate.
2014-07-17 14:35:48 +00:00
Joseph Myers 29c4f53e2a Move architecture shlib-versions files to Linux-specific directories.
Various architectures have files such as sysdeps/<arch>/shlib-versions
whose contents are in fact entirely Linux-specific, relating only to
the symbol / shared library versions for the port to Linux on that
architecture, when any future port to a different OS on that
architecture would use the symbol version of the glibc release it goes
in, as standard for new ports.

This patch moves such files under sysdeps/unix/sysv/linux/, merging in
the contents of sysdeps/<arch>/nptl/shlib-versions in the process.
The only bits not moved are those relating to libgcc_s versions, which
don't appear OS-specific in the same way that glibc's symbol versions
so.  It deliberately does not change the regular expressions given for
matching configurations in each file; some match only Linux although
not Linux-specific, or match other OSes although Linux-specific.  It
is with a view to at least the following further cleanups:

* Move architecture-specific content from the toplevel shlib-versions
  and nptl/shlib-versions into sysdeps shlib-versions files, so
  eliminating another difference between ex-ports and non-ex-ports
  architectures.

* Likewise, for OS-specific content in shlib-versions files.

* At that point, the first field in shlib-versions files (the regular
  expression matching a configuration triplet) should be redundant, so
  eliminate that field and leave shlib-versions selection working
  purely on a sysdeps basis (with limited use of %ifdef in
  shlib-versions files when needed) rather than having its own
  separate mechanism to select what configuration information is
  relevant.

* Move the build of gnu/lib-names.h to a similar mechanism to that
  used for gnu/stubs.h (each library build installing a version of the
  header specifically for that build), so we can eliminate the
  duplication of soname information in the makefiles and get it purely
  from shlib-versions files again.

There may be other cleanups possible as well (in particular, I'm not
sure that all cases where the same "Earliest symbol set" information
is repeated for many different libraries actually should need to
repeat it rather than specifying it just once for DEFAULT for the
given configuration, and separately specifying any non-default choices
of soname).

Tested x86_64 that the installed shared libraries are unchanged by
this patch.

	* sysdeps/aarch64/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/aarch64/shlib-versions: ... here.
	* sysdeps/alpha/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/alpha/shlib-versions: ... here.
	* sysdeps/arm/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/arm/shlib-versions: ... here.
	* sysdeps/hppa/shlib-versions: Move all contents except for
	libgcc_s entry to ...
	* sysdeps/unix/sysv/linux/hppa/shlib-versions: ... here.  Merge in
	entry from ...
	* sysdeps/hppa/nptl/shlib-versions: ... here.  Remove file.
	* sysdeps/ia64/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/ia64/shlib-versions: ... here.  Merge in
	entry from ...
	* sysdeps/ia64/nptl/shlib-versions: ... here.  Remove file.
	* sysdeps/m68k/coldfire/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/m68k/coldfire/shlib-versions: ... here.
	* sysdeps/microblaze/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/microblaze/shlib-versions: ... here.
	* sysdeps/mips/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/mips/shlib-versions: ... here.  Merge in
	entry from ...
	* sysdeps/mips/nptl/shlib-versions: ... here.  Remove file.
	* sysdeps/tile/shlib-versions: Move to ...
	* sysdeps/unix/sysv/linux/tile/shlib-versions: ... here.
	* sysdeps/unix/sysv/linux/x86_64/64/shlib-versions: Merge in entry
	from ...
	* sysdeps/x86_64/64/shlib-versions: ... here.  Remove file.
	* sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions: Merge in
	entry from ...
	* sysdeps/x86_64/x32/shlib-versions: ... here.  Remove file.
2014-07-17 14:31:12 +00:00
Will Newton 57977c4bf3 ARM: Fix compiler warnings from atomic.h
__arch_compare_and_exchange_bool_*_int return a boolean so in the
dummy implementations for 8, 16 and 64 bits return zero rather than
oldval. Zero is used rather than TRUE or FALSE to avoid needing to
including any headers for these dummy functions.

ChangeLog:

2014-07-17  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/bits/atomic.h
	(__arch_compare_and_exchange_bool_8_int): Evaluate to zero.
	(__arch_compare_and_exchange_bool_16_int): Likewise.
	(__arch_compare_and_exchange_bool_64_int): Likewise.
2014-07-17 11:36:31 +01:00
Will Newton 32bead5b6d iconv/loop.c: Fix -Wundef warning with !_STRING_ARCH_unaligned
If code is required to handle the unaligned case then loop.c includes
itself and relies on the #undefs at the end of the file to avoid
outputting two copies of LOOPFCT and gconv_btowc. However
MAX_NEEDED_INPUT is tested with #if so this causes a warning.
Reorder the code so that the function definitions are in an #else
block to make the behaviour clearer and fix the warning.

Verified that code is unchanged on x86_64 and arm.

ChangeLog:

2014-07-17  Will Newton  <will.newton@linaro.org>

	* iconv/loop.c: Move definition of LOOPFCT and gconv_btowc
	into an #else block.
2014-07-17 10:16:09 +01:00
Roland McGrath 37fccd4192 ARM: Clean up EABI-related configury 2014-07-16 15:18:36 -07:00
Roland McGrath 8badf496ab Add generic/stub implementations of pthread_{kill,sigmask,sigqueue}. 2014-07-15 15:48:18 -07:00
Roland McGrath 3df6f22e5f Separate Linuxisms from lowlevellock.h, make a generic one 2014-07-15 15:23:06 -07:00
Roland McGrath b365f3ec9e Remove declarations of two nonexistent variables from nptl/pthreadP.h. 2014-07-15 14:44:47 -07:00
H.J. Lu f2fef657d8 Enable AVX2 optimized memset only if -mavx2 works
* config.h.in (HAVE_AVX2_SUPPORT): New #undef.
	* sysdeps/i386/configure.ac: Set HAVE_AVX2_SUPPORT and
	config-cflags-avx2.
	* sysdeps/x86_64/configure.ac: Likewise.
	* sysdeps/i386/configure: Regenerated.
	* sysdeps/x86_64/configure: Likewise.
	* sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
	memset-avx2 only if config-cflags-avx2 is yes.
	* sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list):
	Tests for memset_chk and memset only if HAVE_AVX2_SUPPORT is
	defined.
	* sysdeps/x86_64/multiarch/memset.S: Define multiple versions
	only if HAVE_AVX2_SUPPORT is defined.
	* sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
2014-07-14 07:58:27 -07:00
Alan Modra f6c44d4751 Correct DT_PPC64_NUM
[BZ #17153]
	* elf/elf.h (DT_PPC64_NUM): Correct value.
	* NEWS: Add to fixed bug list.
2014-07-14 21:17:32 +09:30
Jim Meyering 7ee03f0018 regex: don't deref NULL upon heap allocation failure
* posix/regcomp.c: (parse_dup_op): Handle duplicate_tree
failure in one more place.
To trigger the segfault, configure grep -with-included-regex,
build it, and run these commands:
( ulimit -v 300000; echo a|src/grep -E a+++++++++++++++++++++ )
2014-07-13 21:25:22 -07:00
Andreas Schwab 9d39d517a7 m68k: update libm test ULPs 2014-07-13 11:20:44 +02:00
Richard Henderson a75b89b776 aarch64: Update libm-test-ulps 2014-07-11 10:57:48 -07:00
Florian Weimer 771eb1415f nptl: Fix abort in case of set*id failure [BZ #17135]
If a call to the set*id functions fails in a multi-threaded program,
the abort introduced in commit 13f7fe35ae
was triggered.

We address by checking that all calls to set*id on all threads give
the same result, and only abort if we see success followed by failure
(or vice versa).
2014-07-11 12:30:53 +02:00
Adhemerval Zanella bc1da1765e PowerPC: Fix build due missing lll_robust_trylock
Commit 887865f remove the lll_robust_trylock definition on all
architectures, however for powerpc both __lll_trylock and
__lll_cond_trylock were based on lll_robust_trylock definition.
This patch restore it with a different name.
2014-07-10 16:46:33 -05:00
Roland McGrath 6a42be57e8 ChangeLog fixup for last commit. 2014-07-10 11:30:38 -07:00
Roland McGrath c0c6bac945 Get rid of lll_robust_dead. 2014-07-10 11:21:54 -07:00
Roland McGrath 887865fcfa Get rid of lll_robust_trylock. 2014-07-10 10:57:57 -07:00
Florian Weimer 5853672669 manual: Update the locale documentation 2014-07-10 16:30:40 +02:00
Florian Weimer 4e8f95a0df _nl_find_locale: Improve handling of crafted locale names [BZ #17137]
Prevent directory traversal in locale-related environment variables
(CVE-2014-0475).
2014-07-10 16:29:55 +02:00
Florian Weimer d183645616 setlocale: Use the heap for the copy of the locale argument
This avoids alloca calls with potentially large arguments.
2014-07-10 16:29:34 +02:00
Siddhesh Poyarekar 888c679ba4 Sync up error.c with gnulib
Summary of changes:

- Use of !_LIBC instead of HAVE_CONFIG_H
- Code changes in [!_LIBC] that don't affect us
- Minor formatting changes
- Use __builtin_expect in shared code
- Define some macros in [_LIBC] that are used in gnulib but never
  defined in glibc
- Flip macro check for STRERROR_R_CHAR_P so that it does not throw a
  warning
2014-07-10 14:24:30 +05:30
Siddhesh Poyarekar 180e0e4b29 Fix -Wundef warning for HAVE_LOCALTIME_R
Define it to 0.  There is a gnulib copy for this, but it is out of
sync with our copy.
2014-07-10 14:21:27 +05:30
Siddhesh Poyarekar d22f1fe2f3 Fix Wundef warning for HAVE_STRFTIME
Define it to 0
2014-07-10 14:20:42 +05:30
Siddhesh Poyarekar 12f2254b81 Fix -Wundef warning for HAVE_SYS_PARAM_H
Include sys/param.h unconditionally
2014-07-10 14:19:21 +05:30
Siddhesh Poyarekar c3c7c3604f Fix -Wundef warning for HAVE_OBSTACK
Remove the HAVE_OBSTACK macro check and include obstack check in
include path order since we don't have a copy of obstack.h in the
current directory.
2014-07-10 14:18:13 +05:30
Siddhesh Poyarekar d62aa75af1 Fix crash when system has no ipv6 address [BZ #17125]
Here's an updated patch to fix the crash in bug-ga2 when the system
has no configured ipv6 address.  I have taken a different approach of
using libc_freeres_fn instead of the libc_freeres_ptr since the former
gives better control over what is freed; we need that since cache may
or may not be allocated using malloc.

Verified that bug-ga2 works correctly in both cases and does not have
memory leaks in either of them.
2014-07-10 14:15:16 +05:30
David S. Miller 7000d82e01 Get rid of sparc specific NPTL internaltypes.h header.
* sysdeps/sparc/nptl/internaltypes.h: Delete.
	* sysdeps/sparc/nptl/sparc-nptl.h: New file.
	* sysdeps/sparc/nptl/pthread_barrier_destroy.c: Include it.
	* sysdeps/sparc/nptl/pthread_barrier_init.c: Likewise.
	* sysdeps/sparc/nptl/pthread_barrier_wait.c: Likewise.
	* sysdeps/sparc/nptl/sem_init.c: Likewise.
	* sysdeps/sparc/nptl/sem_post.c: Likewise.
	* sysdeps/sparc/nptl/sem_timedwait.c: Likewise.
	* sysdeps/sparc/nptl/sem_wait.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/pthread_barrier_wait.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/sem_post.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/sem_timedwait.c: Likewise.
	* sysdeps/sparc/sparc32/nptl/sem_wait.c: Likewise.
2014-07-09 22:19:09 -07:00
Siddhesh Poyarekar d69b7f5ac0 Add comment about SIZE initialization in xdr.c 2014-07-10 10:33:48 +05:30
David S. Miller 5efe06a176 Update sparc ULPS.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2014-07-09 17:20:01 -07:00
Andreas Schwab 4a2552c3eb Fix missing newline in test output 2014-07-09 11:07:24 +02:00
Andreas Schwab c213442ddd Update i386 libm test ULPs 2014-07-09 10:53:46 +02:00
Will Newton 82374e65d7 Fix -Wundef warnings for SHARED
The definition of SHARED is tested with #ifdef pretty much everywhere
apart from these few places. The tlsdesc.c code seems to be copy and
pasted to a few architectures and there is one instance in the hppa
startup code.

ChangeLog:

2014-07-09  Will Newton  <will.newton@linaro.org>

	* sysdeps/aarch64/tlsdesc.c (_dl_unmap): Test SHARED with #ifdef.
	* sysdeps/arm/tlsdesc.c (_dl_unmap): Likewise.
	* sysdeps/i386/tlsdesc.c (_dl_unmap): Likewise.
	* sysdeps/x86_64/tlsdesc.c (_dl_unmap): Likewise.
	* sysdeps/hppa/start.S (_start): Likewise.
2014-07-09 09:26:07 +01:00
Siddhesh Poyarekar 6ee3eab429 Fix -Wmaybe-uninitialized warning in xdr.c
While we're at fixing build warnings, here's one unnecessary warning
that can be fixed fairly easily.  The SIZE variable is never actually
use uninitialized, but the compiler cannot make that out and thinks
(correctly) that there is a potential for accessing SIZE without
initializing it.  Make this safe by initializing SIZE to 0.

Tested on x86_64.
2014-07-09 10:36:50 +05:30
Siddhesh Poyarekar 6680738a18 Fix Wundef warning for __cplusplus
All current uses of the __cplusplus macro only check if it is defined
or not.  Fix this #if to use $ifdef like the rest of the code.
2014-07-09 10:36:23 +05:30
Siddhesh Poyarekar e35c53e397 Check value at resplen2 if it is not NULL
There was a typo in the previous patch due to which resplen2 was
checked for non-zero instead of the value at resplen2.  Fix that and
improve the condition by checking resplen2 for non-NULL (instead of
answerp2) and also adding the check in a third place.
2014-07-08 22:52:49 +05:30
Siddhesh Poyarekar 80b5c50588 Fix Wundef warning for ELF_MACHINE_NO_REL on i386 2014-07-08 22:52:45 +05:30
Adhemerval Zanella 27b75f56c9 PowerPC: Cleanup powerpc memmove
Now that MEMCPY_OK_FOR_FWD_MEMMOVE should be define on memcopy.h there
is no need to specialized powerpc memmove implementation.  This patch
moves the define set to powerpc memcopy and cleanup its definition on
powerpc code.
2014-07-08 09:16:15 -05:00
Adhemerval Zanella e7f95bb5f0 PowerPC: Fix compiler warnings
This patch fixes some compiler due trailing data in #undef directives
and due missing prototypes.
2014-07-08 09:16:12 -05:00
Adhemerval Zanella 91f4b564bd PowerPC: Add ifunc tests for memmove
This patch add the missing ifunc tests definition for memmove ppc32
optimization patch (commit 07aedd7).
2014-07-08 09:16:09 -05:00
Siddhesh Poyarekar 7c33f1e52c Fix Wundef warning with SHOJI_IS_RIGHT
The macro is not defined anywhere, so it looks like we're convinced
that Shoji is wrong :)
2014-07-08 15:02:58 +05:30
Adhemerval Zanella 87868c2418 PowerPC: Align power7 memcpy using VSX to quadword
This patch changes power7 memcpy to use VSX instructions only when
memory is aligned to quardword.  It is to avoid unaligned kernel traps
on non-cacheable memory (for instance, memory-mapped I/O).
2014-07-07 15:41:27 -05:00
Adhemerval Zanella 07aedd78b0 PowerPC: optimized memmove for POWER7/PPC32
This patch adds a optimized memmove for power7 by using the optimized
power7 memcpy for forward copying.
2014-07-07 15:41:27 -05:00
Adhemerval Zanella 17762f6625 PowerPC: optimized memmove for POWER7/PPC64
This patch adds an optimized memmove optimization for POWER7/powerpc64.
Basically the idea is to use the memcpy for POWER7 on non-overlapped
memory regions and a optimized backward memcpy for memory regions
that overlap (similar to the idea of string/memmove.c).

The backward memcpy algorithm used is similar the one use for memcpy for
POWER7, with adjustments done for alignment.  The difference is memory
is always aligned to 16 bytes before using VSX/altivec instructions.
2014-07-07 15:41:21 -05:00
Adhemerval Zanella d6f68bbef4 PowerPC: memmove default implementation cleanup
This patch removes the powerpc specific logic in memmove and instead
include default implementation with MEMCPY_OK_FOR_FWD_MEMMOVE defined.
This lead in a increase performance, since the constraints to use
memcpy in powerpc code are too restrictive and memcpy can be used for
any forward memmove.
2014-07-07 14:46:44 -05:00
Adhemerval Zanella 3f17b03b09 PowerPC: Guard CALL_ELF check for ppc64 only in link.h
This patch fixes powerpc32 undef compiler warnings for _CALL_ELF,
since it is defined only for powerpc64.
2014-07-07 14:46:22 -05:00
Roland McGrath f4c4021bc0 Remove old stub lowlevellock.h file. It is not even useful as documentation. 2014-07-07 09:29:34 -07:00
Roland McGrath f083450f45 NPTL is no longer an add-on! 2014-07-07 09:29:06 -07:00
Roland McGrath 08192659bb Get rid of nptl/sysdeps/ entirely! 2014-07-07 09:28:38 -07:00
Siddhesh Poyarekar 96baf6ffc5 Add comment for MEMCPY_OK_FOR_FWD_MEMMOVE 2014-07-05 01:09:15 +05:30
Will Newton 1570a72bb8 string/memchr.c: Merge from gnulib
Merge most of the gnulib implementation of memchr. The changes that
remain are:

 - copyright header
 - bp-sym.h removed
 - reg_char removed
 - allow MEMCHR to be redefined
 - non-conforming whitespace changes

The merged code fixes a number of -Wundef warnings and also introduces
an optimized algorithm. I haven't detected any performance difference
in the new code which I believe is down to the quite specific
circumstances required to hit it. However the new code is approximately
half the size of the old code on AArch64 (which uses generic memchr).

ChangeLog:

2014-07-04  Will Newton  <will.newton@linaro.org>

	* string/memchr.c: Merge from gnulib.
	[_LIBC]: Remove conditionals.
	(__ptr_t): Remove define.
	(LONG_MAX_32_BITS): Likewise.
	(LONG_MAX): Likewise.
	(MEMCHR): Use ANSI prototype and optimize algorithm.
2014-07-04 09:23:21 +01:00
Will Newton 6b7b14b26f ARM: Define ELF_MACHINE_NO_REL
Fix a -Wundef warning on ARM.

ChangeLog:

2014-07-04  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/dl-machine.h (ELF_MACHINE_NO_REL): Define.
2014-07-04 08:58:21 +01:00
Roland McGrath 3d9eb57c55 Fix ia64 build error in lll_futex_timed_wait_bitset 2014-07-03 22:03:14 -07:00
Roland McGrath 78b984ae2c Fix unwind.h configure check for bare environment. 2014-07-03 21:46:59 -07:00
Roland McGrath 2d5976a580 Add missing #include in sysdeps/alpha/fpu/s_nearbyint.c 2014-07-03 21:15:56 -07:00
Roland McGrath c1f5acd4f4 Robustify Linux kernel headers configure checks 2014-07-03 20:35:42 -07:00
Roland McGrath 4d614fe5e0 S390: Quash unused variable warning due to no-op THREAD_SET_POINTER_GUARD. 2014-07-03 19:17:00 -07:00
Siddhesh Poyarekar 38851324d8 Restore subdir conditional for tst-timer dependency. 2014-07-03 18:52:51 -07:00
Richard Henderson 69862e2511 alpha: Remove nearbyint and nearbyintf implementations
The original implementation was written for EV5, which does not
record inexact in the status register for /SU (but no /I) insns.
But EV6 does record the inexact status; the lack of /I simply
means that the exception is suppressed.

Adding feholdexcept becomes the bulk of the overhead, so we might
as well use the default implementation.
2014-07-03 10:37:59 -07:00
Richard Henderson d5e16ade14 alpha: Implement math_opt_barrier and math_force_eval 2014-07-03 08:56:55 -07:00
Richard Henderson ca7b945c73 alpha: Fix lround implementations
Use chopped rounding to add 0.5.
2014-07-03 08:52:45 -07:00
Richard Henderson cd1175a373 alpha: Remove round and roundf implementations
Two bugs in these implementations: First is that the add of 0.5
was not done in chopped rounding mode (easily fixable).  Second
is that the method generates incorrect inexact exceptions for
small integral values (not easily fixable).
2014-07-03 08:45:57 -07:00
Richard Henderson b3ec00e599 Changelog for last 8 patches 2014-07-03 08:38:41 -07:00
Maciej W. Rozycki 225f410f3e stdlib/tst-strtod-overflow: Bump timeout up yet
This test case is very, especially on targets using soft-float or QEMU
(where soft-float is used internally), and appears to be the only such
outlier.  Therefore rather than requiring to have TIMEOUTFACTOR set
large enough globally, bump up the local scaling factor instead.

	* stdlib/tst-strtod-overflow.c (TIMEOUT): Bump up to 30.
2014-07-03 08:07:55 +01:00
Siddhesh Poyarekar 3247f28556 Sync up loadmsgcat.c with gettext 2014-07-03 01:49:48 +05:30
Siddhesh Poyarekar d12704c78f Fix Wundef warning for __STDC_VERSION__
c4c4124473 added the _Noreturn macro for
pre-C11 compilers, but it now throws a new Wundef warning during `make
check` for __STDC_VERSION__ which gcc does not define by default.  The
following patch fixes this in line with other uses of __STDC_VERSION__
in the file.
2014-07-03 01:49:48 +05:30
Siddhesh Poyarekar 05fdac772b Don't use __glibc_unlikely in shared code 2014-07-03 01:49:48 +05:30
Siddhesh Poyarekar 99f8dc9220 Fix -Wundef warning on PAGE_COPY_THRESHOLD
The PAGE_COPY_THRESHOLD macro is meant to be overridden by
architecture-specific pagecopy.h, but it is currently done only by
mach; all other architectures use the default.  Check to see if the
macro is defined in addition to whether it is set to a non-zero value.
2014-07-03 01:49:43 +05:30
Vidya Ranganathan bc8ea38590 PowerPC: strcat optimization for PPC64/POWER7
This patch adds an ifunc power7 strcat symbol that uses the logic on
sysdeps/powerpc/strcat.c but call power7 strlen/strcpy symbols instead
of default ones.
2014-07-02 14:04:21 -05:00
Roland McGrath fe5f34e470 Add missing #include for MIN use in dl-sysdep.c. 2014-07-02 11:10:08 -07:00
Siddhesh Poyarekar d4eb8195e5 Fix typo and formatting in loadmsgcat.c
This reduces the differences with gettext version of loadmsgcat.c
2014-07-02 16:57:48 +05:30
Siddhesh Poyarekar 256aa66596 Fix typo in macro name
It is _POSIX_SIGNALS and not _POSUX_SIGNALS
2014-07-02 15:09:39 +05:30
Will Newton b100f9aa77 malloc/obstack: Merge from gnulib
Merge the latest version of the obstack.c and obstack.h files
from gnulib. The majority of this change is coding style and
cosmetic comment changes but it also fixes a -Wundef warning
in the build as a side effect.

2014-07-02  Will Newton  <will.newton@linaro.org>

	* malloc/obstack.c: Merge from gnulib master.
	[HAVE_CONFIG_H]: Remove conditional code.
	[!_LIBC]: Include config.h.
	[!ELIDE_CODE]: Don't include inttypes.h, include
	stdint.h unconditionally.
	(print_and_abort): Mark as _Noreturn.
	(_obstack_allocated_p): Mark as __attribute_pure__.
	(obstack_free): Rename to __obstack_free.
	[!__attribute__]: Remove conditional code.
	* malloc/obstack.h: Merge from gnulib master.
	[__cplusplus]: Move conditional down.
	[!__attribute_pure__]: Define __attribute_pure__ here
	if it is not already defined.
	(_obstack_memory_used): Mark as __attribute_pure__.
	[!__obstack_free]: Define as obstack_free.
	[__GNUC__]: Remove check for ancient NeXT gcc.
2014-07-02 10:31:43 +01:00
Paul Eggert c4c4124473 misc/sys/cdefs.h: Add _Noreturn macro for pre-C11 compilers
2014-07-02  Will Newton  <will.newton@linaro.org>
	    Paul Eggert  <eggert@cs.ucla.edu>

	* misc/sys/cdefs.h (_Noreturn): New macro, for pre-C11 compilers.
2014-07-02 10:31:42 +01:00
Siddhesh Poyarekar e1e041c439 Add comment to gethnamaddr.c to warn that the file is unmaintained 2014-07-02 13:25:55 +05:30
Carlos O'Donell d34570a6b8 hppa: Remove GLIBC_2.3 from librt.abilist.
This commit removes the aio_cancel and aio_cancel64 symbols at
GLIBC_2.3 from the ABI baseline. The ABI baseline is now complete
for hppa and considered stable.
2014-07-02 03:18:26 -04:00
Carlos O'Donell ccf431ffe1 hppa: Add ABI baselines.
The following ABI baselines were tested against several old releases
of debian and gentoo. Several problems were discovered and fixed as
part of developing the ABI baselines.

Firstly, libBrokenLocale on gentoo exports __ctype_get_mb_cur_max
as @@GLIBC_2.0, but it should be @@GLIBC_2.2 since that's the minimum
version defined in shlib-versions for hppa. I don't know when this
broke, but master properly parses hppa's shlib-versions which clearly
lists libBrokenLocale as defaulting to GLIBC_2.2. Therefore I'm
accepting GLBIC_2.2 as the correct version for this symbol and setting
the baseline to that, despite the fact that the present distribution
is wrong. I don't expect that any new applications should be using
libBrokenLocale, so it should match the oldest behaviour which is to
export a GLIBC_2.2 symbol. For example in debian's 2.7 has it at
version GLIBC_2.2.

Secondly, aio_cancel and aio_cancel64 previously had a compat symbol
at version @GLIBC_2.1 with a new symbol at @@GLIBC_2.3[1]. During the
Linuxthreads to NPTL transition the file aio_cancel.c was lost for hppa
and that resulted in just @@GLIBC_2.1 versions of these symbols being
exported. The @@GLIBC_2.1 version works correctly and uses the right
value of ECANCELLED. Therefore if I were to fix this today it might
break correctly working applications using aio_cancel*@GLIBC_2.1 by
causing those to use the old aio_cancel that used the older value
of ECANCELLED. Thus the best option is to accept that the ABI changed
and ignore older applications in favour of newer applications. The
best thing to do is cleanup the version files (included in the patch).

The rest of the ABI was as expected (ignoring __p_type_syms size
change in 2008).
2014-07-01 23:59:47 -04:00
Roland McGrath ca06321df0 Add missing #include for MIN/MAX users. 2014-07-01 15:01:24 -07:00
Richard Henderson 631021e0aa alpha: Fix isnan
The isunordered formulation raises SIGFPE for SNaN.
2014-07-01 09:54:29 -07:00
Richard Henderson a1ac3184fa alpha: Update libm-test-ulps 2014-07-01 09:54:27 -07:00
Stefan Liebler 0c1d731ff9 S/390: Regenerate ULPs 2014-07-01 11:04:58 -03:00
Siddhesh Poyarekar 76985d3e03 Remove MULTI_PTRS_ARE_ALIASES in dns-hosts.c
The code in gethnamaddr.c for gethostbyaddr used and set this macro to
allow multiple PTR records to be added as aliases.  This was useful
for gethostbyaddr since it returns a hostent structure, which can
return aliases.

The gethnamaddr.c source however is unused in glibc since pretty much
forever.  Instead, the DNS lookup bits for gethostbyaddr (as well as
getnameinfo) are implemented in dns-hosts.c and in that implementation
all but one (the first one) of the multiple PTR records are ignored.
Since gethnamaddr.c is essentially dead code, ignore that
implementation and replace the MULTI_PTRS_ARE_ALIASES bit with a
comment mentioning that bind adds PTR records as aliases while we
don't.
2014-07-01 17:23:20 +05:30
Joseph Myers b0cb309635 MicroBlaze: Update kernel-features.h for syscalls added in 3.15
Now that the MicroBlaze 3.15 kernel has the pselect6, preadv and
pwritev syscalls, this patch updates kernel-features.h so they are
assumed to be present for 3.15 and later kernels.

2014-06-17  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
	[__LINUX_KERNEL_VERSION >= 0x030f00] (__ASSUME_PSELECT): Do not
	undefine.
	[__LINUX_KERNEL_VERSION >= 0x030f00] (__ASSUME_PREADV): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x030f00] (__ASSUME_PWRITEV): Likewise.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
2014-07-01 14:57:59 +10:00
Roland McGrath 4d76cb3935 MicroBlaze: Consolidate nptl/ subdirectories under linux/...
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
2014-07-01 14:57:58 +10:00
David Holsgrove 0cdcad1769 MicroBlaze: Add missing sysdep-cancel.h implementation
And update socket.S, Makefile to use *_nocancel definitions.

Absence of sysdep-cancel.h was not apparent until Roland's
not-cancel.h unification.

2014-06-30  David Holsgrove  <david.holsgrove@xilinx.com>

  * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: New file
  * sysdeps/unix/sysv/linux/microblaze/socket.S: Update SINGLE_THREAD_P
  * sysdeps/unix/sysv/linux/microblaze/Makefile: Add to libpthread-routines

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
2014-07-01 09:58:03 +10:00
Adhemerval Zanella 9b71d0e38c Update powerpc-fpu ULPs. 2014-06-30 17:38:43 -04:00
Joseph Myers ae05a9d77f Regenerate MIPS libm-test-ulps.
This patch regenerates libm-test-ulps for MIPS.

	* sysdeps/mips/mips32/libm-test-ulps: Regenerated.
	* sysdeps/mips/mips64/libm-test-ulps: Likewise.
2014-06-30 21:34:20 +00:00
Joseph Myers a7672a2f81 Regenerate powerpc-nofpu libm-test-ulps.
This patch regenerates libm-test-ulps for powerpc-nofpu.

	* sysdeps/powerpc/nofpu/libm-test-ulps: Regenerated.
2014-06-30 21:26:49 +00:00
Joseph Myers 665390c2e7 Regenerate ARM libm-test-ulps.
This patch regenerates libm-test-ulps for ARM.  As before it may be
useful for someone building for a configuration with VFMA enabled to
do a followup regeneration for any additional ulps in that
configuration.

Committed.

	* sysdeps/arm/libm-test-ulps: Regenerated.
2014-06-30 21:20:35 +00:00
Maciej W. Rozycki d7a05d0728 test-skeleton: Kill any child process's offspring
This makes sure any subprocesses created by the program being tested get
killed as well if their parent times out.  Otherwise if they are really
stuck, they may remain there running forever after the test case and
then the whole test suite has completed, until killed by hand.

	* test-skeleton.c (signal_handler): Kill the whole process group
	before killing the child individually.
	(main): Report any failure on `setpgid'.
2014-06-30 20:11:56 +01:00
Roland McGrath 46f1d8a6b5 ARM: Split Linuxism out of sysdeps/arm/nptl/tls.h 2014-06-30 11:19:22 -07:00
Joseph Myers ce9c5b3e95 Fix ldbl-128 expm1l spurious underflow (bug 16539).
This patch fixes spurious underflows from ldbl-128 expm1l, as reported
in <https://sourceware.org/ml/libc-alpha/2014-06/msg00835.html> and
exposed by the tests added for such a bug in the x86 / x86-64
version.  The bug and fix are essentially the same, so no separate bug
is filed in Bugzilla.

Tested for mips64.

	[BZ #16539]
	* sysdeps/ieee754/ldbl-128/s_expm1l.c: Include <float.h>.
	(__expm1l): Return argument unchanged when small but not
	subnormal.
2014-06-30 17:38:16 +00:00
Joseph Myers 3a6e988706 Rename soft-fp op-[1248].h variables to avoid risk of shadowing.
Continuing the soft-fp variable renaming from
<https://sourceware.org/ml/libc-alpha/2014-06/msg00434.html> to avoid
shadowing if two macros happen to use the same variable name and that
variable is involved in an argument one of those macros passes to
another, this patch renames variables in op-[1248].h.  (The two
patches are to different files and are independent of each other.)

Tested for powerpc32 (soft-float) and mips64 that this makes no change
to the disassembly of installed shared libraries.

	* soft-fp/op-1.h (_FP_UNPACK_RAW_1): Rename local variables to
	include macro name.
	(_FP_UNPACK_RAW_1_P): Likewise.
	(_FP_PACK_RAW_1): Likewise.
	(_FP_PACK_RAW_1_P): Likewise.
	(_FP_MUL_MEAT_1_wide): Likewise.
	(_FP_MUL_MEAT_DW_1_hard): Likewise.
	(_FP_MUL_MEAT_1_hard): Likewise.
	(_FP_DIV_MEAT_1_imm): Likewise.
	(_FP_DIV_MEAT_1_udiv_norm): Likewise.
	(_FP_DIV_MEAT_1_udiv): Likewise.
	* soft-fp/op-2.h (__FP_FRAC_DEC_2): Likewise.
	(_FP_UNPACK_RAW_2): Likewise.
	(_FP_UNPACK_RAW_2_P): Likewise.
	(_FP_PACK_RAW_2): Likewise.
	(_FP_PACK_RAW_2_P): Likewise.
	(_FP_MUL_MEAT_DW_2_wide): Likewise.
	(_FP_MUL_MEAT_2_wide): Likewise.
	(_FP_MUL_MEAT_DW_2_wide_3mul): Likewise.
	(_FP_MUL_MEAT_2_wide_3mul): Likewise.
	(_FP_MUL_MEAT_DW_2_gmp): Likewise.
	(_FP_MUL_MEAT_2_gmp): Likewise.
	(_FP_DIV_MEAT_2_udiv): Likewise.
	* soft-fp/op-4.h (_FP_FRAC_SLL_4): Likewise.
	(_FP_FRAC_SRL_4): Likewise.
	(_FP_FRAC_SRST_4): Likewise.
	(_FP_FRAC_SRS_4): Likewise.
	(_FP_UNPACK_RAW_4): Likewise.
	(_FP_UNPACK_RAW_4_P): Likewise.
	(_FP_PACK_RAW_4): Likewise.
	(_FP_PACK_RAW_4_P): Likewise.
	(_FP_MUL_MEAT_DW_4_wide): Likewise.
	(_FP_MUL_MEAT_4_wide): Likewise.
	(_FP_MUL_MEAT_4_gmp): Likewise.
	(umul_ppppmnnn): Likewise.
	(_FP_DIV_MEAT_4_udiv): Likewise.
	(__FP_FRAC_ADD_4): Likewise.
	(__FP_FRAC_SUB_3): Likewise.
	(__FP_FRAC_SUB_4): Likewise.
	(__FP_FRAC_DEC_3): Likewise.
	(__FP_FRAC_DEC_4): Likewise.
	(__FP_FRAC_ADDI_4): Likewise.
	* soft-fp/op-8.h (_FP_FRAC_SLL_8): Likewise.
	(_FP_FRAC_SRL_8): Likewise.
	(_FP_FRAC_SRS_8): Likewise.
2014-06-30 17:37:10 +00:00
Joseph Myers 9c37ec0b89 Rename soft-fp extended.h, op-common.h variables to avoid risk of shadowing.
In <https://sourceware.org/ml/libc-alpha/2013-06/msg00851.html>, I
fixed a bug caused by multiple soft-fp macros using the same variable
names, resulting in shadowing when one macro called another that used
the same variable name, with an argument involving the variable in the
outer macro.  The fix was to rename the local variables so their names
included the containing macro name, to ensure uniqueness.

I noted then that this would make sense more systematically for all
variables in any soft-fp macro.  Since then, I've used such variable
names in new soft-fp macros.  This patch now converts existing macros
in extended.h and op-common.h to use this convention.  (op-[1248].h
are intended to be converted separately.)

(Name conflicts could arise for label names as well, but because those
are function-scope in C any such conflict will give an immediate
compile error rather than a subtle bug, so there's no need for
preemptive renaming in that case.)

Tested for powerpc32 (soft-float) and mips64 that this makes no change
to the disassembly of installed shared libraries.

	* soft-fp/extended.h (FP_UNPACK_RAW_E): Rename local variables to
	include macro name.
	(FP_UNPACK_RAW_EP): Likewise.
	(FP_PACK_RAW_E): Likewise.
	(FP_PACK_RAW_EP): Likewise.
	* soft-fp/op-common.h (_FP_UNPACK_CANONICAL): Likewise.
	(_FP_ISSIGNAN): Likewise.
	(_FP_ADD_INTERNAL): Likewise.
	(_FP_FMA): Likewise.
	(_FP_CMP): Likewise.
	(_FP_SQRT): Likewise.
	(_FP_TO_INT): Likewise.
	(_FP_FROM_INT): Likewise.
	(FP_EXTEND): Likewise.
	(_FP_DIV_MEAT_N_loop): Likewise.
2014-06-30 17:36:18 +00:00
Maciej W. Rozycki 2125f67454 sysdeps/unix/sysv/linux/bits/socket.h: Correct formatting
* sysdeps/unix/sysv/linux/bits/socket.h: Adjust macro formatting
	throughout.
2014-06-30 10:38:49 +01:00
Joseph Myers edea402804 Fix ldbl-128 powl sign of result in overflow / underflow cases (bug 17097).
This patch fixes bug 17097, ldbl-128 powl producing overflowing /
underflowing results with positive sign when the result should have
been negative.  This was shown up by the tests in non-default rounding
modes added by my patch for bug 16315, but isn't actually limited to
non-default rounding modes: rather, when rounding to nearest the
wrappers produced a result with the correct sign and so always hid the
bug unless -lieee was used to disable the wrappers.  The problem is
that in the cases where Y is large enough that the result overflows or
underflows for X not very close to 1, but not large enough to overflow
or underflow for all X != +/- 1 (in the latter case Y is always an
even integer), a positive overflowing / underflowing result is always
returned, rather than one with the correct sign.  This patch moves the
relevant part of computation of the sign earlier and returns a result
of the correct sign.

Tested for mips64.

	[BZ #17097]
	* sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Return
	result with correct sign in case of exponents that produce
	overflow except for X very close to 1.
2014-06-29 11:49:08 +00:00
Paul Eggert dd0ba01812 Sync up mktime with gnulib
From the gnulib commit log:

commit e2646b0c6b5acda25e9ffeb4c12a5513a1e3b5ac
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Fri Jun 27 11:35:44 2014 -0700

    mktime: merge #if/#ifdef usage from glibc

    * lib/mktime.c: Use "#if defined DEBUG && DEBUG", not "#if DEBUG",
    as that works with both Glibc's and Gnulib's style.
    See thread starting at Siddhesh Poyarekar's bug report at:
    http://lists.gnu.org/archive/html/bug-gnulib/2014-06/msg00102.html
2014-06-28 06:15:54 +05:30
Siddhesh Poyarekar 64df73c2ea Fix Wundef warning for MEMCPY_OK_FOR_FWD_MEMMOVE
Define MEMCPY_OK_FOR_FWD_MEMMOVE in memcopy.h and let arch-specific
implementations of that file override the value if necessary.  This
override is only useful for tile and moving this macro to memcopy.h
allows us to remove the tile-specific memmove.c.
2014-06-28 06:05:24 +05:30
Joseph Myers f1eafb41fa Remove shlib-versions ABI names support.
shlib-versions files can contain ABI lines that map triplets to a
canonical ABI name.  This name was once used for various purposes
where test baseline files for different ABIs went in a single
directory; now these purposes use sysdeps files, generation of headers
which have per-ABI variants uses abi-variants and related Makefile
variables and the shlib-versions ABI names are unused.  This patch
duly removes those lines and associated build system support for them.

Tested for x86_64 (both a full testsuite run and confirming the
installed shared libraries are unchanged by the patch).

	* Makeconfig ($(common-objpfx)soversions.mk): Do not generate
	abi-name definition.
	* scripts/soversions.awk: Do not handle or generate ABI lines.
	* shlib-versions: Remove ABI entries.
	* sysdeps/powerpc/nofpu/shlib-versions: Remove file.
	* sysdeps/x86_64/x32/shlib-versions: Remove ABI entry.
2014-06-27 20:24:23 +00:00
Roland McGrath 37caf178e2 MIPS: Consolidate nptl/ subdirectories under linux/... 2014-06-27 11:41:04 -07:00
Roland McGrath 58eb0862c3 MIPS: Consolidate NPTL/non versions of vfork 2014-06-27 11:18:10 -07:00
Arjun Shankar 6f12d0629f Correctly report nscd child process status (BZ #17092)
The nscd parent process returns the result of a `wait' call rather
than the exit status of the child it waits for. These two aren't
exactly the same. In my case (and probably on most machines), the exit
status is in the 2nd LSB of the result of `wait', and so:

e.g. if the nscd child process returns 1, the parent returns 1 << 8,
which Bash happily reports as 0.
2014-06-27 23:31:47 +05:30
Joseph Myers cb403c34c6 Remove relro configure test.
This patch removes the configure test for working -z relro.

The use of -z relro in Makeconfig became unconditional with

commit 2e6ab1df44c412bb9d30b26a4d8a679150a7e375
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Sat Oct 28 06:44:04 2006 +0000

    Remove conditional code which now is unnecessary.

(commit reference from git://repo.or.cz/glibc/history), so since then
the configure test has not controlled anything about how glibc is
built - simply about whether configure succeeds and allows a build to
be attempted.  The test for whether the option did something useful
(as opposed to whether it exists - which we can certainly just assume
by now) was originally added in
<https://sourceware.org/ml/libc-hacker/2004-09/msg00069.html> to
disable the option in a case when it did nothing useful on ia64 (as a
result of something deliberate in the linker on ia64).  Since 2006
that disabling has been of no effect, and given that the current test
does not set libc_relro_required for ia64, it does nothing whatever
useful for the original motivating case.  Also at around the same time
in 2006 the test was made to give an error for missing or broken -z
relro support on various architectures.

So effectively all the test does now is verify that, on certain
architectures, the linker has not been changed deliberately to make
the option ineffective.  I see no apparent reason why such a change
should be expected, or why the build should be stopped if it were to
be made (any more than we disallow build on ia64); I think we can
trust binutils patch review to point out the consequences of any
change to COMMONPAGESIZE setting.  The only thing that might now make
sense would be disabling the -z relro use on an architecture-specific
basis if there were an architecture-specific reason to consider that
to make sense; it would be for the ia64 maintainer to decide if that
makes sense for ia64 at present, but I think that could be done
through sysdeps Makefiles - no special configure tests needed.

Tested for x86_64 that this patch makes no change to the installed
shared libraries.

Together with
<https://sourceware.org/ml/libc-alpha/2014-06/msg00788.html> (pending
review) this substantially eliminates architecture-specific cases from
architecture-independent configure.ac files.  There remains an i386
case in sysdeps/mach/hurd/configure.ac that should properly move to
the i386 subdirectory.  (There are also OS-specific cases outside
OS-specific directories; in principle I think should should also
move.)

	* configure.ac (libc_commonpagesize): Remove variable.
	(libc_relro_required): Likewise.
	(libc_cv_z_relro): Remove configure test.
	* configure: Regenerated.
	* sysdeps/aarch64/preconfigure (libc_commonpagesize): Do not set
	variable.
	(libc_relro_required): Likewise.
	* sysdeps/alpha/preconfigure (libc_commonpagesize): Likewise.
	(libc_relro_required): Likewise.
	* sysdeps/arm/preconfigure.ac (libc_commonpagesize): Likewise.
	(libc_relro_required): Likewise.
	* sysdeps/arm/preconfigure: Regenerated.
	* sysdeps/ia64/preconfigure: Remove file.
	* sysdeps/tile/preconfigure (libc_commonpagesize): Do not set
	variable.
	(libc_relro_required): Likewise.
2014-06-27 16:51:22 +00:00
Joseph Myers be25493251 Fix yn overflow handling in non-default rounding modes (bug 16561, bug 16562).
This patch fixes bugs 16561 and 16562, bad results of yn in overflow
cases in non-default rounding modes, both because an intermediate
overflow in the recurrence does not get detected if the result is not
an infinity and because an overflowing result may occur in the wrong
sign.  The fix is to set FE_TONEAREST mode internally for the parts of
the function where such overflows can occur (which includes the call
to y1 - where yn is used to compute a Bessel function of order -1,
negating the result of y1 isn't correct for overflowing results in
directed rounding modes) and then compute an overflowing value in the
original rounding mode if the to-nearest result was an infinity.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 and powerpc32 to test the ldbl-128 and ldbl-128ibm changes.

(The tests for these bugs were added in my previous y1 patch, so the
only thing this patch has to do with the testsuite is enable yn
testing in all rounding modes.)

	[BZ #16561]
	[BZ #16562]
	* sysdeps/ieee754/dbl-64/e_jn.c: Include <float.h>.
	(__ieee754_yn): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/flt-32/e_jnf.c: Include <float.h>.
	(__ieee754_ynf): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/ldbl-128/e_jnl.c: Include <float.h>.
	(__ieee754_ynl): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Include <float.h>.
	(__ieee754_ynl): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/ieee754/ldbl-96/e_jnl.c: Include <float.h>.
	(__ieee754_ynl): Set FE_TONEAREST mode internally and then
	recompute overflowing results in original rounding mode.
	* sysdeps/i386/fpu/fenv_private.h [!__SSE2_MATH__]
	(libc_feholdsetround_ctx): New macro.
	* math/libm-test.inc (yn_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps : Likewise.
2014-06-27 14:52:13 +00:00
Joseph Myers b351d85aa2 Fix MIPS64 *_nocancel gp setup.
The 64-bit MIPS ABIs involve the caller setting up t9 ($25) to the
address of the called function, and the called function then using
this in a .cpsetup directive to compute gp.  The .cpsetup directive
needs to name the function to which t9 points for this purpose.  In
the definition of *_nocancel functions, the directive pointed to the
normal entry point rather than the _nocancel one, resulting in
segfaults when the _nocancel functions were used.  This patch corrects
the function name used in the directive.  (It seems the bug was latent
until Roland's not-cancel.h unification, with the _nocancel entry
points not previously being used - so not user-visible in a release,
so no Bugzilla entry required.)

Tested mips64 sufficiently to confirm the previously seen segfaults
are fixed.

	* sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
	[__PIC__] (PSEUDO): Use name of _nocancel entry point in
	corresponding .cpsetup call.
2014-06-26 23:55:46 +00:00
Roland McGrath 3cb4de4741 ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
Joseph Myers 354426bb34 Update scripts/list-sources.sh for ports repository merge.
scripts/list-sources.sh includes handling of ports that has been
obsolete ever since the ports repository was merged into the libc
repository.  This patch removes that handling.

Tested by regenerating libc.pot and examining the resulting changes.

	* scripts/list-sources.sh: Do not handle ports specially.
2014-06-26 21:30:07 +00:00
Roland McGrath a3dd035d9d Add missing #include <fpu_control.h> to ARM fesetenv/feupdateenv. 2014-06-26 13:35:31 -07:00
Roland McGrath 28b0a8c9f3 Add missing #include in spawn_faction_addopen.c 2014-06-26 13:21:58 -07:00
Joseph Myers e66a820300 Update miscellaneous files from upstream sources.
This patch updates miscellaneous files from their upstream sources:
texinfo.tex from Texinfo, config.guess and config.sub from config.git,
install-sh from automake and move-if-change from gnulib.

Tested x86_64 that installed shared libraries are unchanged by the
patch; also looked at the generated libc.pdf manual.

	* manual/texinfo.tex: Update to version 2014-05-05.10 with
	trailing whitespace removed.
	* scripts/config.guess: Update to version 2014-03-23.
	* scripts/config.sub: Update to version 2014-05-01
	* scripts/install-sh: Update to version 2013-12-25.23.
	* scripts/move-if-change: Update from gnulib.
2014-06-26 20:13:44 +00:00
Siddhesh Poyarekar 4000f892e5 Correctly attribute the mktime.c change to Paul Eggert
I mentioned it on the list, but forgot to put that in the changelog.
2014-06-27 00:08:12 +05:30
Siddhesh Poyarekar b97c9ce50d Remove unnecessary include in memmove_chk
This also has the side-effect of fixing a couple of Wundef warnings
raised from pagecopy.h.  The generated code is identical before and
after this patch.
2014-06-27 00:01:37 +05:30
Siddhesh Poyarekar 7417111567 Remove inline keyword from leapyear function
This syncs up the code with gnulib.
2014-06-27 00:00:06 +05:30
Joseph Myers e64708de36 Remove powerpc special cases in configure.ac.
This patch removes two powerpc special cases in the main configure.ac.
The test for rs6000 is irrelevant to currently supported
configurations (config.guess reports rs6000 for some OSes, of which
the only one currently supported by GCC is AIX, but not for Linux).
There's no need either for a special case for powerpc*-*soft;
--without-fp suffices, and GCC doesn't have any special handling of
such a triplet.

Not tested.

	* configure.ac: Do not test for machine being rs6000.  Do not test
	for powerpc*-*soft.
	* configure: Regenerated.
2014-06-26 17:34:27 +00:00
Joseph Myers a8779c28a8 Remove configure tests for assembler CFI support.
This patch removes configure tests for assembler CFI support (and
thereby eliminates an architecture-specific case in the main
configure.ac), instead assuming that support is present
unconditionally.

The main test was added in 2003 around the time CFI support was added
to the assembler.  cfi_personality and cfi_lsda support were added to
the assembler in 2006.  cfi_sections support was added in 2009, a few
weeks before binutils 2.20 was released; it's in 2.20, the minimum
supported version, so even that configure test is obsolete.

Tested x86_64 that the installed shared libraries are unchanged by
this patch.

	* configure.ac (libc_cv_asm_cfi_directives): Remove configure
	test.
	* configure: Regenerated.
	* config.h.in (HAVE_ASM_CFI_DIRECTIVES): Remove macro undefine.
	* sysdeps/arm/configure.ac (libc_cv_asm_cfi_directive_sections):
	Remove configure test.
	* sysdeps/arm/configure: Regenerated.
	* sysdeps/nptl/configure.ac: Do not check
	libc_cv_asm_cfi_directives.
	* sysdeps/nptl/configure: Regenerated.
	* sysdeps/x86_64/nptl/configure.ac: Remove file.
	* sysdeps/x86_64/nptl/configure: Remove generated file.
	* b/sysdeps/generic/sysdep.h [HAVE_ASM_CFI_DIRECTIVES]: Make code
	unconditional.
	[!HAVE_ASM_CFI_DIRECTIVES]: Remove conditional code.
2014-06-26 17:33:32 +00:00
Siddhesh Poyarekar 059bf913b5 Fix Wundef warning for WIDE_CHAR_VERSION
fnmatch.c defines WIDE_CHAR_VERSION as 1 for wide chars, but does not
define it for the non-wide char bits.  Define it and also undef it in
fnmatch_loop.c like all other macros.
2014-06-26 22:30:45 +05:30
Siddhesh Poyarekar 4cf5b6d0d7 Fix Wundef warning for ELF_MACHINE_NO_RELA
This patch defines ELF_MACHINE_NO_RELA on all architectures.  Tested
only on x86_64 to verify that the sources before and after are
identical except for two instructions that pass the current line
number in dl-machine.h to assert_fail.
2014-06-26 22:30:40 +05:30
Siddhesh Poyarekar 2aac0a8623 Fix Wundef warning for SEPARATE_KEY
The SEPARATE_KEY macro is never defined in any condition or
architecture.  It is effectively dead code, so remove it.
2014-06-26 22:30:35 +05:30
Roland McGrath d8a483f3ef S390: Consolidate nptl/ subdirectories under linux/... 2014-06-26 09:34:34 -07:00
Roland McGrath 52ae23b4bf Move remaining S390 code out of nptl/. 2014-06-26 09:31:11 -07:00
Roland McGrath 39507e4a6c S390: Consolidate NPTL/non versions of vfork 2014-06-26 09:30:52 -07:00
Roland McGrath e549ee5658 S390: Consolidate NPTL/non versions of clone 2014-06-26 09:30:33 -07:00
Roland McGrath 6ad2df0bda AArch64: Consolidate nptl/ subdirectories under linux/... 2014-06-26 09:29:24 -07:00
Roland McGrath 7c1c1d8ec3 MIPS: Consolidate NPTL/non versions of clone 2014-06-25 14:50:58 -07:00
Joseph Myers 74385da564 Remove __ASSUME_O_CLOEXEC / O_CLOEXEC conditionals in sysdeps/unix/sysv/linux/.
This patch removes conditionals on __ASSUME_O_CLOEXEC, and on
O_CLOEXEC being defined, in sysdeps/unix/sysv/linux/, now that
O_CLOEXEC support can be unconditionally assumed.

The patch is conservative in what it changes and further followup
cleanups may be possible.  It may be possible to remove dl-opendir.c,
but the patch does not do so, just removing a redundant undefine and
redefine of __ASSUME_O_CLOEXEC.  Also, __ASSUME_O_CLOEXEC is defined
unconditionally for Hurd as well as Linux.  Thus, if we decide that
O_CLOEXEC support is a required feature of any glibc port, we could
remove __ASSUME_O_CLOEXEC and all conditionals on it throughout glibc,
rather than just cleaning up sysdeps/unix/sysv/linux/.

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

	* sysdeps/unix/sysv/linux/dl-opendir.c (__ASSUME_O_CLOEXEC): Do
	not undefine and redefine.
	* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs)
	[O_CLOEXEC]: Make code unconditional.
	(__get_nprocs) [!O_CLOEXEC]: Remove conditional code.
	* sysdeps/unix/sysv/linux/shm_open.c: Do not include
	<kernel-features.h>.
	[O_CLOEXEC && !__ASSUME_O_CLOEXEC] (have_o_cloexec): Remove
	conditional variable definition.
	(shm_open) [O_CLOEXEC]: Make code unconditional.
	(shm_open) [!O_CLOEXEC || !__ASSUME_O_CLOEXEC]: Remove conditional
	code.
2014-06-25 20:29:45 +00:00
Joseph Myers c2570a0b35 Move USE_REGPARMS define to sysdeps/i386/configure.ac.
This patch moves the USE_REGPARMS define from the toplevel
configure.ac to sysdeps/i386/configure.ac.

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

	* configure.ac (USE_REGPARMS): Don't define here.
	* configure: Regenerated.
	* sysdeps/i386/configure.ac (USE_REGPARMS): Define here.
	* sysdeps/i386/configure: Regenerated.
2014-06-25 20:26:14 +00:00
Joseph Myers 11b076bbae Remove stray includes of kernel-features.h.
Now that files using __ASSUME_* macros have been made by
<https://sourceware.org/ml/libc-alpha/2014-06/msg00543.html> to
include <kernel-features.h> directly, any include from a file not
using __ASSUME_* macros can safely be removed (as there will no longer
be some other file relying on indirect inclusion via a header from
which the include is being removed).

This patch removes such unnecessary kernel-features.h includes.

Tested x86_64 that disassembly of installed shared libraries is
unchanged by this patch, except for line numbers in calls to
__assert_fail from libc.so and ld.so.

2014-06-23  Joseph Myers  <joseph@codesourcery.com>

	* nptl/createthread.c: Don't include kernel-features.h.
	* nptl/pthread_cancel.c: Likewise.
	* nptl/pthread_condattr_setclock.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/pthread_getcpuclockid.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/pthread_sigqueue.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/raise.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: Likewise.
	* nptl/sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: Likewise.
	* nptl/sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: Likewise.
	* nptl/sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_create.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_delete.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_getoverr.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_gettime.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_routines.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/timer_settime.c: Likewise.
	* nscd/gai.c: Likewise.
	* nss/nss_db/db-open.c: Likewise.
	* sysdeps/generic/ldsodefs.h: Likewise.
	* sysdeps/sh/nptl/tls.h: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/aarch64/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/adjtime.c: Likewise.
	* sysdeps/unix/sysv/linux/alpha/xstatconv.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/check_pf.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_getcpuclockid.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_getres.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_gettime.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_nanosleep.c: Likewise.
	* sysdeps/unix/sysv/linux/clock_settime.c: Likewise.
	* sysdeps/unix/sysv/linux/dl-execstack.c: Likewise.
	* sysdeps/unix/sysv/linux/dl-osinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/dl-sysdep.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/futimesat.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/poll.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/fxstatat.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c: Likewise.
	* sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c: Likewise.
	* sysdeps/unix/sysv/linux/getcwd.c: Likewise.
	* sysdeps/unix/sysv/linux/getpagesize.c: Likewise.
	* sysdeps/unix/sysv/linux/getsysstats.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/fxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/mmap64.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/xstat.c: Likewise.
	* sysdeps/unix/sysv/linux/ia64/system.c: Likewise.
	* sysdeps/unix/sysv/linux/if_index.c: Likewise.
	* sysdeps/unix/sysv/linux/ifaddrs.c: Likewise.
	* sysdeps/unix/sysv/linux/ifreq.c: Likewise.
	* sysdeps/unix/sysv/linux/ldsodefs.h: Likewise.
	* sysdeps/unix/sysv/linux/lutimes.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/nptl/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/accept4.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/recvmmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/sendmmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/mmap64.c: Likewise.
	* sysdeps/unix/sysv/linux/netlinkaccess.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/chown.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/vfork.S: Likewise.
	* sysdeps/unix/sysv/linux/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/prof-freq.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/mmap.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/mmap64.S: Likewise.
	* sysdeps/unix/sysv/linux/s390/system.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pread.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pwrite.c: Likewise.
	* sysdeps/unix/sysv/linux/sh/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/sigpending.c: Likewise.
	* sysdeps/unix/sysv/linux/sigprocmask.c: Likewise.
	* sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/xstatconv.c: Likewise.
	* sysdeps/unix/sysv/linux/sparc/system.c: Likewise.
	* sysdeps/unix/sysv/linux/syslog.c: Likewise.
	* sysdeps/unix/sysv/linux/system.c: Likewise.
	* sysdeps/unix/sysv/linux/testrtsig.h: Likewise.
	* sysdeps/unix/sysv/linux/timespec_get.c: Likewise.
	* sysdeps/unix/sysv/linux/ttyname.c: Likewise.
	* sysdeps/unix/sysv/linux/ttyname_r.c: Likewise.
	* sysdeps/unix/sysv/linux/utimensat.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise.
	* sysdeps/unix/sysv/linux/xstatconv.h: Likewise.
2014-06-25 18:09:01 +00:00
Joseph Myers 92072d57c6 Remove BROKEN_PPC_ASM_CR0 configure test.
One piece of architecture-specific code in the main configure.ac is
the powerpc test that can define BROKEN_PPC_ASM_CR0.  There's no need
to move this to a sysdeps configure script, or to work out what bug it
was testing in May 1998 to see if it's still relevant, since nothing
in the source tree now uses the results of this test.  Thus, this
patch just removes the test in question.

Not tested.

	* configure.ac (libc_cv_c_asmcr0_bug): Remove configure test.
	* configure: Regenerated.
	* config.h.in (BROKEN_PPC_ASM_CR0): Remove macro.
2014-06-25 17:54:44 +00:00
Joseph Myers 3e239be647 Move base_machine and machine settings from configure.ac to sysdeps preconfigure fragments.
This patch makes non-ex-ports architectures set base_machine and
machine based on the original configured machine value in preconfigure
fragments, like ex-ports architectures, rather than in the toplevel
configure.ac.

Tested x86 that the disassembly of installed shared libraries is
unchanged by the patch.

	* configure.ac (base_machine): Do not set specially for particular
	machines here.
	* configure: Regenerated.
	* sysdeps/powerpc/preconfigure: Move machine and base_machine
	settings from configure.ac.
	* sysdeps/i386/preconfigure: New file.
	* sysdeps/s390/preconfigure: Likewise.
	* sysdeps/sh/preconfigure: Likewise.
	* sysdeps/sparc/preconfigure: Likewise.
2014-06-25 17:52:56 +00:00
Roland McGrath 74836003ed SPARC: Consolidate unnecessary nptl/ subdirectories. 2014-06-25 10:04:14 -07:00
Roland McGrath 06d50baa34 SPARC: Consolidate nptl/ subdirectories under linux/... 2014-06-25 10:03:52 -07:00
Joseph Myers 0828edbfd6 Update timezone code from tzcode 2014e.
This patch updates the timezone code from tzcode 2014e (the previous
version used was 2013i).

Tested x86_64.

	* timezone/checktab.awk: Update from tzcode 2014e.
	* timezone/private.h: Likewise.
	* timezone/tzfile.h: Likewise.
	* timezone/zdump.c: Likewise.
	* timezone/zic.c: Likewise.
2014-06-25 16:51:17 +00:00
Joseph Myers a4ccbc9b24 Remove __ASSUME_XFS_RESTRICTED_CHOWN.
This patch removes the __ASSUME_XFS_RESTRICTED_CHOWN macro, now it can
be presumed to be defined unconditionally.  I'm not sure if what's
left of __statfs_chown_restricted is actually useful (if not, a
followup could remove it), but I left it there to keep the patch
conservative and avoid changing the code generated for glibc.

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

	* sysdeps/unix/sysv/linux/kernel-features.h
	(__ASSUME_XFS_RESTRICTED_CHOWN): Remove macro.
	* sysdeps/unix/sysv/linux/pathconf.c (__statfs_chown_restricted)
	[__ASSUME_XFS_RESTRICTED_CHOWN]: Make code unconditional.
	(__statfs_chown_restricted) [!__ASSUME_XFS_RESTRICTED_CHOWN]:
	Remove conditional code.
2014-06-25 16:39:33 +00:00
Will Newton 9aea0cb842 ARM: Add support for AT_HWCAP2 in _dl_procinfo
Add support for the new HWCAP2 values for ARMv8 added in the
3.15 kernel. Tested using QEMU which supports these extensions.

ChangeLog:

2014-06-25  Will Newton  <will.newton@linaro.org>

	* sysdeps/unix/sysv/linux/arm/dl-procinfo.c
	(_dl_arm_cap_flags): Add HWCAP2 values.
	* sysdeps/unix/sysv/linux/arm/dl-procinfo.h
	(_DL_HWCAP_COUNT): Increase to 37.
	(_DL_HWCAP_LAST): New define.
	(_DL_HWCAP2_LAST): New define.
	(_dl_procinfo): Add support for printing
	AT_HWCAP2 entries.
	(_dl_string_hwcap): Use _dl_hwcap_string.
2014-06-25 16:02:04 +01:00
Adhemerval Zanella 6eaa65cefb Update powerpc-fpu ULPs. 2014-06-25 09:57:39 -05:00
Joseph Myers cfd2ea5047 Update README and NEWS for ports directory removal.
This patch updates README to remove a mention of the ports directory.
It also adds a NEWS item for the merge of ports into the main sysdeps
tree (I think it's NEWS-worthy, although not strictly a user-visible
feature).

Other remaining ports references to resolve: a comment in
manual/signal.texi (not giving a literal path, but maybe should change
anyway); a comment in config.h.in (path should be updated);
scripts/list-sources.sh (appears to date back to ports being a
separate repository).

	* README: Do not mention ports directory.
2014-06-25 12:55:21 +00:00
Joseph Myers cecf2ed43a Remove __ASSUME_UTIMENSAT.
This patch removes the __ASSUME_UTIMENSAT macro, now it can be
unconditionally assumed to be true.

This shows that the only live uses of __ASSUME_UTIMES are in utimes.c
and they are only live for hppa.  I intend a followup patch to make
__ASSUME_UTIMES into an hppa-specific macro (not used or defined
outside sysdeps/unix/sysv/linux/hppa/).

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

	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_UTIMENSAT):
	Remove macro.
	* sysdeps/unix/sysv/linux/futimes.c: Do not include
	<kernel-features.h>.
	[__NR_utimensat && !__ASSUME_UTIMENSAT] (miss_utimensat): Remove
	conditional variable definition.
	(__futimes): Update comment.
	(__futimes) [__ASSUME_UTIMENSAT]: Make code unconditional.
	(__futimes) [!__ASSUME_UTIMENSAT]: Remove conditional code.
2014-06-25 11:36:10 +00:00
Joseph Myers a638de828d Fix exp10 spurious underflows (bug 16560).
This patch fixes spurious underflows from exp10 for arguments near 0
(part of bug 16560; that bug also includes spurious underflows from
exp2, which are not fixed by this patch).  The problem is underflows
in the internal computation converting the exp10 argument to arguments
for exp (with extra precision), and the fix is simply to return 1
early for arguments near enough to 0 (just as arguments with large
enough magnitude have their own overflow / underflow logic at the
start of the function).

Tested x86_64 and x86 and ulps updated accordingly; also tested for
powerpc32 and mips64 to validate the ldbl-128ibm and ldbl-128 changes.

	[BZ #16560]
	* sysdeps/ieee754/dbl-64/e_exp10.c (__ieee754_exp10): Return 1 for
	arguments close to 0.
	* sysdeps/ieee754/ldbl-128/e_exp10l.c (__ieee754_exp10l):
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_exp10l.c (__ieee754_exp10l):
	Likewise.
	* math/auto-libm-test-in: Add more tests of exp10.
	* math/auto-libm-test-out: Regenerated.
	* sysdeps/x86_64/fpu/libm-test-ulps: Update.
2014-06-25 11:33:22 +00:00
Joseph Myers 0f5b71850e Remove __ASSUME_COMPLETE_READV_WRITEV.
This patch removes the __ASSUME_COMPLETE_READV_WRITEV
kernel-features.h macro, now that it can be unconditionally assumed to
be true.  (The relevant kernel feature was added some time between 2.0
and 2.2, and this macro is only used in sysdeps/unix/sysv/linux/.)

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

	* sysdeps/unix/sysv/linux/kernel-features.h
	(__ASSUME_COMPLETE_READV_WRITEV): Remove macro.
	* sysdeps/unix/sysv/linux/readv.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code.
	[!UIO_FASTIOV] (UIO_FASTIOV): Remove macro.
	(__libc_readv) [__ASSUME_COMPLETE_READV_WRITEV]: Make code
	unconditional.
	(__libc_readv) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove
	conditional code.
	* sysdeps/unix/sysv/linux/writev.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_COMPLETE_READV_WRITEV]: Remove conditional code.
	[!UIO_FASTIOV] (UIO_FASTIOV): Remove macro.
	(__libc_writev) [__ASSUME_COMPLETE_READV_WRITEV]: Make code
	unconditional.
	(__libc_writev) [!__ASSUME_COMPLETE_READV_WRITEV]: Remove
	conditional code.
2014-06-25 11:31:51 +00:00
Will Newton c7aec4beb1 sysdeps/posix/tempname.c: Merge from gnulib
Partial merge from gnulib which fixes a number of -Wundef warnings.
The parts that differ from gnulib are the header comment, use of
__glibc_unlikely, a #define of __secure_getenv and the use of tabs.
The majority of the patch is cosmetic comment changes, the only runtime
change is an abort if an unknown kind is passed to __gen_tempname.

ChangeLog:

2014-06-25  Will Newton  <will.newton@linaro.org>

	* sysdeps/posix/tempname.c: Merge from gnulib, cosmetic
	comment changes throughout the file.  Remove checks
	for HAVE_*_H definitions that are not required.
	(__gen_tempname): Call abort if an unknown kind value is
	passed.
2014-06-25 10:52:51 +01:00
Andreas Schwab c5241f9575 m68k: Add compat symbols for scalbln* 2014-06-25 09:38:09 +02:00
Siddhesh Poyarekar 911422da02 Add compat symbols for scalb* in i386
Bring back symbols into libc.so for scalb* functions.  They are no
longer used but unfortunately they're now part of the ABI.
2014-06-25 08:47:13 +05:30
Roland McGrath 0d749bbeba x86: Consolidate unnecessary nptl/ subdirectories. 2014-06-24 19:17:43 -07:00
Joseph Myers 4060283dec Fix x86/x86_64 expm1l spurious underflow exceptions (bug 16539).
This patch fixes bug 16539, spurious underflow exceptions from x86 /
x86-64 expm1l.  The problem is that the computation of a base-2
exponent with extra precision involves spurious underflows for
arguments that are small but not subnormal, so a check is added to
just return the argument in those cases.  (If the argument *is*
subnormal, underflowing is correct and the existing code will always
underflow, so it suffices to keep using the existing code in that
case; some expm1 implementations have a bug (bug 16353) with missing
underflow exceptions, but I don't think there's such a bug in this
particular version.)

Tested x86_64 and x86; no ulps updates needed.

(auto-libm-test-out diffs omitted below.)

	[BZ #16539]
	* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]: Just
	return the argument for normal arguments with exponent below -64.
	* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]:
	Likewise.
	* math/auto-libm-test-in: Add another test of expm1.
	* math/auto-libm-test-out: Regenerated.
2014-06-24 21:00:08 +00:00
Joseph Myers e7dd3c8c1d Fix ldbl-128 erfl spurious underflows (bug 16287).
This patch fixes bug 16287, spurious underflows from ldbl-128 erfl
arising from it calling erfcl for arguments with absolute value at
least 1.0, although for large positive arguments erfcl correctly
underflows but erfl shouldn't.  The fix is simply to avoid calling
erfcl, and just return 1, for arguments above a cut-off large enough
that erfl correctly rounds to-nearest as 1 but not so large that erfcl
underflows.

Tested mips64.  Also tested x86_64 and x86 to confirm the new tests
(taken from the tests of erfc) don't cause any problems there; no ulps
updates needed.

	[BZ #16287]
	* sysdeps/ieee754/ldbl-128/s_erfl.c (__erfl): Return 1 without
	calling __erfcl for arguments at least 16.
	* math/auto-libm-test-in: Add more tests of erf.
	* math/auto-libm-test-out: Regenerated.
2014-06-24 20:56:56 +00:00
Joseph Myers 0ea5d373c7 Move architecture cases out of sysdeps/unix/sysv/linux/configure.ac.
Continuing the process of making non-ex-ports architectures follow the
preferred sysdeps practices followed by ex-ports architectures - that
is, putting things in architecture-specific sysdeps files rather than
having architecture-specific cases in architecture-independent files -
this patch moves architecture cases out of
sysdeps/unix/sysv/linux/configure.ac into (new or existing) configure
fragments for each architecture.  (In the case of the
arch_minimum_kernel setting for x32,
sysdeps/unix/sysv/linux/x86_64/x32/configure already has such a
setting so the setting in sysdeps/unix/sysv/linux/configure.ac was a
duplicate that could just be removed - though I haven't tested for
x32.)

Tested for x86_64 and x86 that the patch causes no changes to the
installed shared libraries or ldd (or any part of the installation
except for the parts that always change because the files contain
timestamps - nscd and static libraries).

	* sysdeps/unix/sysv/linux/configure.ac: Remove cases for
	individual architectures.
	* sysdeps/unix/sysv/linux/configure: Regenerated.
	* sysdeps/unix/sysv/linux/i386/configure.ac: New file.
	* sysdeps/unix/sysv/linux/i386/configure: New generated file.
	* sysdeps/unix/sysv/linux/powerpc/configure.ac
	(ldd_rewrite_script): Define variable.
	* sysdeps/unix/sysv/linux/powerpc/configure: Regenerated.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/configure.ac: New
	file.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/configure: New
	generated file.
	* sysdeps/unix/sysv/linux/s390/configure.ac: New file.
	* sysdeps/unix/sysv/linux/s390/configure: New generated file.
	* sysdeps/unix/sysv/linux/sh/configure.ac: New file.
	* sysdeps/unix/sysv/linux/sh/configure: New generated file.
	* sysdeps/unix/sysv/linux/sparc/configure.ac: New file.
	* sysdeps/unix/sysv/linux/sparc/configure: New generated file.
	* sysdeps/unix/sysv/linux/x86_64/configure.ac: New file.
	* sysdeps/unix/sysv/linux/x86_64/configure: New generated file.
2014-06-24 20:53:03 +00:00
Siddhesh Poyarekar 2307e1261e Fix namespace violation in pthreadtypes.h (BZ #17084)
This was causing conformtest failures on i386.
2014-06-24 22:43:34 +05:30
Wilco c0a4ed7799 Add bug 16918 to NEWS. 2014-06-24 15:40:29 +00:00
Marcus Shawcroft 56046ce637 Revert "Add bug 16918 to NEWS."
This reverts commit 222b787a6f.
2014-06-24 16:28:06 +01:00
Wilco b8c005732e Optimize fesetenv
Improve fesetenv to use an optimized implementation similar to
feupdateenv.

2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fesetenv.c (fesetenv): Optimize implementation.
2014-06-24 15:05:23 +00:00
Wilco b5570d92d6 Add _FPU_MASK_RM and use it instead of FE_TOWARDZERO.
2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fpu_control.h (_FPU_MASK_RM): Define.
	* sysdeps/arm/fenv_private.h (libc_fesetround_vfp)
	(libc_feholdexcept_setround_vfp) (libc_feholdsetround_vfp)
	(libc_feresetround_vfp) (libc_feholdsetround_vfp_ctx)
	(libc_feresetround_vfp_ctx): Use _FPU_MASK_RM.
	* sysdeps/arm/fesetround.c (fesetround): Use _FPU_MASK_RM.
	* sysdeps/arm/get-rounding-mode.h (get_rounding_mode):
	Use _FPU_MASK_RM.
2014-06-24 15:02:51 +00:00
Wilco 947bdca24d Remove an unused include.
2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fsetexcptflg.c (fesetexceptflag): Remove unused include.
2014-06-24 15:00:01 +00:00
Wilco 00f669edb8 Cleanup fenv implementation
Remove some spaces before libm_hidden_def.

2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/feholdexcpt.c (feholdexcept): Remove space.
	* sysdeps/arm/fesetenv.c (fesetenv): Remove space.
	* sysdeps/arm/fesetround.c (fesetround): Remove space.
	* sysdeps/arm/fraiseexcpt.c (feraiseexcept): Remove space.
2014-06-24 14:57:32 +00:00
Wilco 222b787a6f Add bug 16918 to NEWS. 2014-06-24 14:48:05 +00:00
Wilco db59bad394 Rewrite feupdateenv
This patch rewrites feupdateenv to improve performance by avoiding
unnecessary FPSCR reads/writes. It fixes bug 16918 by passing the
correct return value.

2014-06-24  Wilco  <wdijkstr@arm.com>

	[BZ #16918]
	* sysdeps/arm/feupdateenv.c (feupdateenv):
	Rewrite to reduce FPSCR accesses and fix return value.
2014-06-24 13:53:04 +00:00
Wilco 001f7b773c Speed up the ARM fenv implementation by avoiding unnecessary FPSCR
writes if the FPSCR remains unchanged.

2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fclrexcpt.c (feclearexcept):
	Optimize to avoid unnecessary FPSCR writes.
	* sysdeps/arm/fedisblxcpt.c (fedisableexcept): Likewise.
	* sysdeps/arm/feenablxcpt.c (feenableexcept): Likewise.
	* sysdeps/arm/fsetexcptflg.c (fesetexceptflag): Likewise.
	* sysdeps/arm/setfpucw.c (__setfpucw): Likewise.
2014-06-24 12:04:27 +00:00
Wilco 4841e6a6c2 Use libc calls defined by fenv_private.h to implement several fenv functions
rather than duplicating functionality. To make this work for softfp builds,
ensure functions in fenv_private are not conditionally compiled.

2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fegetround.c (fegetround): Call get_rounding_mode.
	* sysdeps/arm/feholdexcpt.c (feholdexcept): Call libc_feholdexcept_vfp.
	* sysdeps/arm/fesetround.c (fesetround): Call libc_fesetround_vfp.
	* sysdeps/arm/fgetexcptflg.c (fegetexceptflag):
	Call libc_fetestexcept_vfp.
	* sysdeps/arm/ftestexcept.c (fetestexcept): Call libc_fetestexcept_vfp.
	* sysdeps/arm/fenv_private.h: Move libc_*_vfp functions outside of
	__SOFTFP__ ifdef so that they can be built for softfp.
2014-06-24 11:13:08 +00:00
Siddhesh Poyarekar 08e5862f5f Fix build warning in pthread_rwlock_*
The first argument of elision_adapt and that of ELISION_*LOCK have
different signs since __elision_rwcount is signed char * and the
argument of elision_adapt is uint8_t *.  Modified elision_adapt to
accept signed char * instead of uint8_t *.
2014-06-24 16:12:43 +05:30
Siddhesh Poyarekar 0813022c79 Print offending diff when check-abi fails
The earlier version of check-abi would print a diff of the expected
ABI vs the built ABI when there was a difference.  Bring back this
behaviour.
2014-06-24 13:27:13 +05:30
Roland McGrath aba8ef95b5 Add missing #include in get-rounding-mode.h 2014-06-23 14:07:59 -07:00
Roland McGrath 3fc7236a28 Remove an unused variable in fstatvfs. 2014-06-23 14:05:14 -07:00
Joseph Myers 4648909d56 Fix cosh spurious underflows from expm1 (bug 16354), inaccurate results near 0 (bug 17061).
This patch fixes bug 16354, spurious underflows from cosh when a tiny
argument is passed to expm1 and expm1 correctly underflows although
the final result of cosh should be 1.  As noted in that bug, some
cases are latent because of expm1 implementations not raising
underflow (bug 16353), but all the implementations are fixed
similarly.  They already contained checks for tiny arguments, but the
checks were too late to avoid underflow from expm1 (although they
would avoid underflow from subsequent squaring of the result of
expm1); they are moved before the expm1 calls.

The thresholds used for considering arguments tiny are not
particularly consistent in how they relate to the precision of the
floating-point format in question.  They are, however, all sufficient
to ensure that the round-to-nearest result of cosh is indeed 1 below
the threshold (although sometimes they are smaller than necessary).
But the previous logic did not return 1, but the previously computed 1
+ expm1(abs(x)) value.  And the thresholds in the ldbl-128 and
ldbl-128ibm code (0x1p-71L - I suspect 0x3f8b was intended in the code
instead of 0x3fb8 - and (roughly) 0x1p-55L) are not sufficient for
that value to be 1.  So by moving the test for tiny arguments, and
consequently returning 1 directly now the expm1 value hasn't been
computed by that point, this patch also fixes bug 17061, the (large
number of ulps) inaccuracy for small arguments in those
implementations.  Tests for that bug are duly added.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 and powerpc32 to validate the ldbl-128 and ldbl-128ibm changes.

	[BZ #16354]
	[BZ #17061]
	* sysdeps/ieee754/dbl-64/e_cosh.c (__ieee754_cosh): Check for
	small arguments before calling __expm1.
	* sysdeps/ieee754/flt-32/e_coshf.c (__ieee754_coshf): Check for
	small arguments before calling __expm1f.
	* sysdeps/ieee754/ldbl-128/e_coshl.c (__ieee754_coshl): Check for
	small arguments before calling __expm1l.
	* sysdeps/ieee754/ldbl-128ibm/e_coshl.c (__ieee754_coshl):
	Likewise.
	* sysdeps/ieee754/ldbl-96/e_coshl.c (__ieee754_coshl): Likewise.
	* math/auto-libm-test-in: Add more cosh tests.  Do not allow
	spurious underflow for some cosh tests.
	* math/auto-libm-test-out: Regenerated.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
2014-06-23 20:20:10 +00:00
Joseph Myers 46a3d3c7d6 Set errno for y1 overflow (bug 17050).
This patch fixes bug 17050, missing errno setting for y1 overflow (for
small positive arguments).  An appropriate check is added for overflow
directly in the __ieee754_y1 implementation, similar to the check
present for yn (doing it there rather than in the wrapper also avoids
yn needing to repeat the check when called for order 1 or -1 and it
uses __ieee754_y1).

Tested x86_64 and x86; no ulps update needed.  Also tested for mips64
to verify the ldbl-128 fix (the ldbl-128ibm code just #includes the
ldbl-128 file).

	[BZ #17050]
	* sysdeps/ieee754/dbl-64/e_j1.c: Include <errno.h>.
	(__ieee754_y1): Set errno if return value overflows.
	* sysdeps/ieee754/flt-32/e_j1f.c: Include <errno.h>.
	(__ieee754_y1f): Set errno if return value overflows.
	* sysdeps/ieee754/ldbl-128/e_j1l.c: Include <errno.h>.
	(__ieee754_y1l): Set errno if return value overflows.
	* sysdeps/ieee754/ldbl-96/e_j1l.c: Include <errno.h>.
	(__ieee754_y1l): Set errno if return value overflows.
	* math/auto-libm-test-in: Add more tests of y0, y1 and yn.
	* math/auto-libm-test-out: Regenerated.
2014-06-23 20:17:13 +00:00
Joseph Myers 863893ec95 Test cpow in all rounding modes.
This patch enables testing of cpow in all rounding modes using
ALL_RM_TEST.  There were two reasons this was previously deferred:

* MPC has complicated rounding-mode-dependent rules for the signs of
  exact zero real or imaginary parts in the result of mpc_pow.  Annex
  G does not impose any such requirements and I don't think glibc
  should try to implement any particular logic here.  This patch adds
  support for gen-auto-libm-tests passing the IGNORE_ZERO_INF_SIGN
  flag to libm-test.inc.

* Error accumulations in some tests in non-default rounding modes
  exceed the maximum error permitted in libm-test.inc.  This patch
  marks the problem tests with xfail-rounding.  (It might be possible
  to reduce the accumulations a bit by using round-to-nearest when
  cpow calls clog, but I don't think there's much point; the
  implementation approach for cpow is fundamentally deficient, as
  discussed in the existing bug for cpow inaccuracy which can
  reasonably be considered to cover these less-inaccurate cases as
  well.  It's possible that the test "cpow 2 0 10 0" will also need
  xfail-rounding on some platforms.)

Tested x86_64 and x86 and ulps updated accordingly.

	* math/gen-auto-libm-tests.c: Document use of
	ignore-zero-inf-sign.
	(input_flag_type): Add value flag_ignore_zero_inf_sign.
	(input_flags): Add ignore-zero-inf-sign.
	(output_for_one_input_case): Handle flag_ignore_zero_inf_sign.
	* math/gen-libm-test.pl (generate_testfile): Handle
	ignore-zero-inf-sign.
	* math/auto-libm-test-in: Mark some cpow tests with
	ignore-zero-inf-sign and some with xfail-rounding.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (cpow_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-06-23 20:15:14 +00:00
Joseph Myers 4da6db5188 Fix pow overflow in non-default rounding modes (bug 16315).
This patch fixes bug 16315, bad pow handling of overflow/underflow in
non-default rounding modes.  Tests of pow are duly converted to
ALL_RM_TEST to run all tests in all rounding modes.

There are two main issues here.  First, various implementations
compute a negative result by negating a positive result, but this
yields inappropriate overflow / underflow values for directed
rounding, so either overflow / underflow results need recomputing in
the correct sign, or the relevant overflowing / underflowing operation
needs to be made to have a result of the correct sign.  Second, the
dbl-64 implementation sets FE_TONEAREST internally; in the overflow /
underflow case, the result needs recomputing in the original rounding
mode.

Tested x86_64 and x86 and ulps updated accordingly.

	[BZ #16315]
	* sysdeps/i386/fpu/e_pow.S (__ieee754_pow): Ensure possibly
	overflowing or underflowing operations take place with sign of
	result.
	* sysdeps/i386/fpu/e_powf.S (__ieee754_powf): Likewise.
	* sysdeps/i386/fpu/e_powl.S (__ieee754_powl): Likewise.
	* sysdeps/ieee754/dbl-64/e_pow.c: Include <math.h>.
	(__ieee754_pow): Recompute overflowing and underflowing results in
	original rounding mode.
	* sysdeps/x86/fpu/powl_helper.c: Include <stdbool.h>.
	(__powl_helper): Allow negative argument X and scale negated value
	as needed.  Avoid passing value outside [-1, 1] to f2xm1.
	* sysdeps/x86_64/fpu/e_powl.S (__ieee754_powl): Ensure possibly
	overflowing or underflowing operations take place with sign of
	result.
	* sysdeps/x86_64/fpu/multiarch/e_pow.c [HAVE_FMA4_SUPPORT]:
	Include <math.h>.
	* math/auto-libm-test-in: Add more tests of pow.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (pow_test): Use ALL_RM_TEST.
	(pow_tonearest_test_data): Remove.
	(pow_test_tonearest): Likewise.
	(pow_towardzero_test_data): Likewise.
	(pow_test_towardzero): Likewise.
	(pow_downward_test_data): Likewise.
	(pow_test_downward): Likewise.
	(pow_upward_test_data): Likewise.
	(pow_test_upward): Likewise.
	(main): Don't call removed functions.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-06-23 20:12:33 +00:00
Roland McGrath 5686b236cc powerpc: Consolidate nptl/ subdirectories under linux/.... 2014-06-23 09:40:01 -07:00
Wilco Dijkstra e6d90d675d Add generic HAVE_RM_CTX implementation
This patch adds a generic implementation of HAVE_RM_CTX using standard
fenv calls. As a result math functions using SET_RESTORE_ROUND* macros
do not suffer from a large slowdown on targets which do not implement
optimized libc_fe*_ctx inline functions. Most of the libc_fe* inline
functions are now unused and could be removed in the future (there are
a few math functions left which use a mixture of standard fenv calls
and libc_fe* inline functions - they could be updated to use
SET_RESTORE_ROUND or improved to avoid expensive fenv manipulations
across just a few FP instructions).

libc_feholdsetround*_noex_ctx is added to enable better optimization of
SET_RESTORE_ROUND_NOEX* implementations.

Performance measurements on ARM and x86 of sin() show significant gains
over the current default, fairly close to a highly optimized fenv_private:

                        ARM   x86
no fenv_private      : 100%  100%
generic HAVE_RM_CTX  : 250%  350%
fenv_private (CTX)   : 250%  450%

2014-06-23  Will Newton  <will.newton@linaro.org>
	    Wilco  <wdijkstr@arm.com>

	* sysdeps/generic/math_private.h: Add generic HAVE_RM_CTX
	implementation.  Include get-rounding-mode.h.
	[!HAVE_RM_CTX]: Define HAVE_RM_CTX to zero.
	[!libc_feholdsetround_noex_ctx]: Define
	libc_feholdsetround_noex_ctx.
	[!libc_feholdsetround_noexf_ctx]: Define
	libc_feholdsetround_noexf_ctx.
	[!libc_feholdsetround_noexl_ctx]: Define
	libc_feholdsetround_noexl_ctx.
	(libc_feholdsetround_ctx): New function.
	(libc_feresetround_ctx): New function.
	(libc_feholdsetround_noex_ctx): New function.
	(libc_feresetround_noex_ctx): New function.
2014-06-23 17:29:00 +01:00
Roland McGrath 88a4647493 MIPS: Move NPTL public headers to sysdeps/mips/nptl/. 2014-06-23 09:25:41 -07:00
Roland McGrath 15bed4728f m68k: Consolidate nptl/ subdirectories under linux/... 2014-06-23 09:24:18 -07:00
Roland McGrath d42df55520 SH: Consolidate nptl/ subdirectories under linux/..... 2014-06-23 09:23:12 -07:00
Joseph Myers 76e5216e31 Update headers for Linux 3.15.
This patch updates glibc headers for changes / new definitions in
Linux 3.15.  In the course of my review I noticed that
IPV6_PMTUDISC_INTERFACE was absent from glibc despite the inclusion of
IP_PMTUDISC_INTERFACE; I added it along with IP_PMTUDISC_OMIT and
IPV6_PMTUDISC_OMIT.  I did not add FALLOC_FL_NO_HIDE_STALE given the
kernel header comment that it is reserved.

Tested x86_64.

	* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_GNU]
	(FALLOC_FL_COLLAPSE_RANGE): New macro.
	[__USE_GNU] (FALLOC_FL_ZERO_RANGE): Likewise.
	* sysdeps/unix/sysv/linux/bits/in.h (IP_PMTUDISC_OMIT): Likewise.
	(IPV6_PMTUDISC_INTERFACE): Likewise.
	(IPV6_PMTUDISC_OMIT): Likewise.
2014-06-23 15:48:42 +00:00
Andreas Schwab 7a81cbcc39 Remove unused label 2014-06-23 17:15:37 +02:00
Adhemerval Zanella db22400947 PowerPC: sync hwcap.h capabilities
Linux commit dd58a092c4202f2bd490adab7285b3ff77f8e467 added the
PPC_FEATURE2_VEC_CRYPTO auvx capability to indicate whether to
hardware supports vector crypto hardware instructions.  This patch
adds its definition to powerpc hwcap bits.
2014-06-23 09:40:05 -05:00
Will Newton cc7d044752 elf/dl-lookup.c: Use __glibc_likely and __glibc_unlikely
Convert all uses of __builtin_expect to __glibc_likely and
__glibc_unlikely. Most of these are trivial boolean expressions
but a few were not. In particular the use of __builtin_expect in
the switch expression in do_lookup_x has been removed. Verified
that there are no code changes on x86_64 and ARM aside from line
numbers.

ChangeLog:

2014-06-23  Will Newton  <will.newton@linaro.org>

	* elf/dl-lookup.c: Use __glibc_unlikely and __glibc_likely
	rather than __builtin_expect.
2014-06-23 14:13:31 +01:00
Will Newton d6d0622554 elf/dl-lookup.c: Remove unnecessary static variable
undefined_msg is only used once contrary to the comment.

ChangeLog:

2014-06-23  Will Newton  <will.newton@linaro.org>

	* elf/dl-lookup.c (undefined_msg): Remove variable.
	(_dl_lookup_symbol_x): Replace undefined_msg with string
	literal.
2014-06-23 14:13:30 +01:00
Will Newton f393b4aaed elf/dl-lookup.c: Move STB_GNU_UNIQUE handling to a function
Move handling of STB_GNU_UNIQUE symbols to a separate function
from do_lookup_x in order to make the code more readable.

The new function gets inlined with gcc 4.8 on ARM and the
do_lookup_x code becomes a few bytes smaller.

ChangeLog:

2014-06-23  Will Newton  <will.newton@linaro.org>

	* elf/dl-lookup.c (do_lookup_unique): New function.
	(do_lookup_x): Move STB_GNU_UNIQUE handling code
	to a separate function.
2014-06-23 14:13:30 +01:00
Andreas Schwab ac60763eac Don't ignore too long lines in nss_files (BZ #17079) 2014-06-23 12:29:51 +02:00
Will Newton c5c1335513 test-skeleton.c: Use stdout for error messages
At the moment the test skeleton uses a mixture of stdout and
stderr for error message output. Using stdout for all test output
keeps all output correctly ordered and properly redirected to the
output file. The suggestion to use stdout is also made on the wiki:

https://sourceware.org/glibc/wiki/Testing/Testsuite#Writing_a_test_case

ChangeLog:

2014-06-23  Will Newton  <will.newton@linaro.org>

	* test-skeleton.c (signal_handler): Use printf and %m
	rather than perror.  Use printf rather than fprintf to
	stderr.  Use puts rather than fputs to stderr.
	(main): Likewise.
2014-06-23 11:21:31 +01:00
Ludovic Courtès bd3675f9a3 nscd: Remove unused typedef and variable.
The attached patch removed the unused ‘thread_info_t’ typedef and the
‘thread_info’ variable from nscd.c.  The former conflicts with a GNU Mach
typedef, and the latter conflicts with a GNU Mach function declaration:
<https://lists.gnu.org/archive/html/bug-hurd/2014-06/msg00101.html>.

Tested on x86_64-linux-gnu.
2014-06-22 13:46:14 +02:00
Allan McRae d03efb2f97 Mention CVE-2014-4043 in NEWS 2014-06-21 17:23:55 +10:00
Roland McGrath dc9a54f800 Move generic smp.h to nptl/ 2014-06-20 20:22:44 -07:00
Roland McGrath bd7022c44e Remove unused file rtld-lowlevel.h. 2014-06-20 20:17:28 -07:00
Roland McGrath 26ffd5e6c7 Clean up HAVE_CONFIG_H and STDC_HEADERS. 2014-06-20 20:04:47 -07:00
Roland McGrath 93a6d08204 Clean up stack-coloring macros. 2014-06-20 19:50:16 -07:00
Roland McGrath bc4a86fa21 Move linux bits/ files out of nptl/. 2014-06-20 18:36:49 -07:00
Joseph Myers 2272ffc116 Remove ARM __ASSUME_SIGFRAME_V2.
This patch removes ARM __ASSUME_SIGFRAME_V2 now that the
2.6.18-and-later signal frame layout can be assumed, renaming the
affected functions accordingly now only one version of them is needed
in glibc.  (sigrestorer.S did not in fact include <kernel-features.h>
and it appears that, unlike other such cases, it didn't get the header
indirectly, so the v1 functions would have been compiled in even when
sigaction.c didn't reference them.)

(alpha and hppa also have architecture-specific __ASSUME_* macros that
should now be removed: __ASSUME_FDATASYNC and __ASSUME_LWS_CAS
respectively.  I don't have any plans to do anything on that myself.)

Tested on ARM.

	* sysdeps/unix/sysv/linux/arm/kernel-features.h
	(__ASSUME_SIGFRAME_V2): Remove macro.
	* sysdeps/unix/sysv/linux/arm/sigrestorer.S: Update comment.
	[!__ASSUME_SIGFRAME_V2]: Remove conditional code.
	(__default_sa_restorer_v2): Rename to __default_sa_restorer.
	(__default_rt_sa_restorer_v2): Rename to __default_rt_sa_restorer.
	* sysdeps/unix/sysv/linux/arm/sigaction.c (__default_sa_restorer):
	Declare as function.  Remove conditional macro definitions.
	(__default_rt_sa_restorer): Likewise.
	(__default_sa_restorer_v1): Remove declaration.
	(__default_sa_restorer_v2): Likewise.
	(__default_rt_sa_restorer_v1): Likewise.
	(__default_rt_sa_restorer_v2): Likewise.
	* sysdeps/unix/sysv/linux/arm/Versions (GLIBC_PRIVATE): Remove
	__default_sa_restorer_v1, __default_rt_sa_restorer_v1,
	__default_sa_restorer_v2 and __default_rt_sa_restorer_v2.
2014-06-21 00:58:56 +00:00
Roland McGrath 4b88139b6f Move remaining SPARC code out of nptl/. 2014-06-20 17:13:47 -07:00
Joseph Myers 9bc6103d04 Include <kernel-features.h> explicitly where required.
This patch makes files using __ASSUME_* macros include
<kernel-features.h> explicitly, rather than relying on some other
header (such as tls.h, lowlevellock.h or pthreadP.h) to include it
implicitly.  (I omitted cases where I've already posted or am testing
the patch that stops the file from needing __ASSUME_* at all.)  This
accords with the general principle of making source files include the
headers for anything they use, and also helps make it safe to remove
<kernel-features.h> includes from any file that doesn't use
__ASSUME_* (some of those may be stray includes left behind after
increasing the minimum kernel version, others may never have been
needed or may have become obsolete after some other change).

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

	* nptl/pthread_cond_wait.c: Include <kernel-features.h>.
	* nptl/pthread_rwlock_timedrdlock.c: Likewise.
	* nptl/pthread_rwlock_timedwrlock.c: Likewise.
	* nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c: Likewise.
	* nscd/nscd.c: Likewise.
	* sysdeps/i386/nptl/tcb-offsets.sym: Likewise.
	* sysdeps/powerpc/nptl/tcb-offsets.sym: Likewise.
	* sysdeps/sh/nptl/tcb-offsets.sym: Likewise.
	* sysdeps/x86_64/nptl/tcb-offsets.sym: Likewise.
2014-06-20 23:24:00 +00:00
Joseph Myers d710902750 Remove __ASSUME_SOCK_CLOEXEC / SOCK_CLOEXEC conditionals in Linux-specific code.
This patch removes conditionals on __ASSUME_SOCK_CLOEXEC, and on
SOCK_CLOEXEC being defined, in Linux-specific code, now that all
supported Linux kernel versions can be assumed to have this
functionality.  (The macro is also used in OS-independent code and is
not defined for Hurd.)

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

	* nptl/sysdeps/unix/sysv/linux/mq_notify.c: Do not include
	<kernel-features.h>.
	(init_mq_netlink): Remove conditional have_sock_cloexec
	definitions.  Remove code conditional on have_sock_cloexec < 0.
	(init_mq_netlink) [!SOCK_CLOEXEC]: Remove conditional code.
	(init_mq_netlink) [!__ASSUME_SOCK_CLOEXEC]: Likewise.
	* sysdeps/unix/sysv/linux/opensock.c: Do not include
	<kernel-features.h>.
	(__opensock) [SOCK_CLOEXEC]: Make code unconditional.
	(__opensock) [!__ASSUME_SOCK_CLOEXEC]: Remove conditional code.
2014-06-20 23:22:08 +00:00
H.J. Lu d92d8f8a42 Add ifunc tests for x86_64 memset_chk and memset
This patch adds ifunc tests for x86_64 memset_chk and memset.  It also
defines HAS_AVX2 with AVX2_Usable since AVX2 may not be usable even if
processor has AVX2.

	* sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list):
	Add tests for memset_chk and memset.

	* sysdeps/x86_64/multiarch/init-arch.h (HAS_AVX2): Defined
	with AVX2_Usable.
2014-06-20 14:52:29 -07:00
Maciej W. Rozycki 257ce7127e [BZ #16046] dl_iterate_phdr static executable test 2014-06-20 21:52:53 +01:00
Maciej W. Rozycki 4e6d234712 stdlib/tst-qsort2.c: Fix off-by-one argc interpretation error
This fixes an off-by-one argc interpretation error (argv[0] is included
in the count) in stdlib/tst-qsort2.c causing a segfault if the program
is called with one command-line argument only (argv[2] is NULL in that
case).
2014-06-20 21:29:33 +01:00
Joseph Myers 7fd00f9980 Remove __ASSUME_F_GETOWN_EX.
This patch removes __ASSUME_F_GETOWN_EX now it can be assumed to be
true unconditionally.

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

	* sysdeps/unix/sysv/linux/kernel-features.h
	(__ASSUME_F_GETOWN_EX): Remove macro.
	* sysdeps/unix/sysv/linux/fcntl.c: Do not include
	<kernel-features.h>.
	(miss_F_GETOWN_EX): Remove variable or macro.
	(do_fcntl): Do not check miss_F_GETOWN_EX.
	(do_fcntl) [!__ASSUME_F_GETOWN_EX]: Remove conditional code.
2014-06-20 20:04:33 +00:00
Joseph Myers 4a103975c4 Remove __ASSUME_AT_RANDOM.
This patch removes __ASSUME_AT_RANDOM now it can be assumed to be true
unconditionally.

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

	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_AT_RANDOM):
	Remove macro.
	* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard)
	[!__ASSUME_AT_RANDOM]: Remove conditional code.
	(_dl_setup_pointer_guard) [!__ASSUME_AT_RANDOM]: Likewise.
2014-06-20 20:02:34 +00:00
Joseph Myers a2a76afe91 Remove __ASSUME_ADJ_OFFSET_SS_READ.
This patch removes the __ASSUME_ADJ_OFFSET_SS_READ macro (and
conditionals on whether ADJ_OFFSET_SS_READ is defined), now it can be
unconditionally assumed to be true and ADJ_OFFSET_SS_READ can be
assumed to be defined.

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

	* sysdeps/unix/sysv/linux/kernel-features.h
	(__ASSUME_ADJ_OFFSET_SS_READ): Remove macro.
	* sysdeps/unix/sysv/linux/adjtime.c (ADJTIME)
	[ADJ_OFFSET_SS_READ]: Make code unconditional.
	(ADJTIME) [!ADJ_OFFSET_SS_READ]: Remove conditional code.
2014-06-20 20:00:51 +00:00
Maciej W. Rozycki 90e5dd482f [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC
This fixes the calculation of R_ARM_TLS_DESC relocations for lazy global
symbol references, i.e. created with `-z lazy' in effect with the static
linker, where immediate resolution is requested with LD_BIND_NOW.
2014-06-20 20:22:42 +01:00
Joseph Myers 809fdf0d23 Remove __ASSUME_ATFCTS conditionals in sysdeps/unix/sysv/linux/.
This patch cleans up for __ASSUME_ATFCTS now always being true for the
supported Linux kernel versions by removing conditional code in
sysdeps/unix/sysv/linux.  Several fchownat.c files that were only
present because of differences in the fallback syscalls used
(depending on the architecture-specific names of chown-related
syscalls for 32-bit uids) are removed.  Files that looks like they
could be replaced by syscalls.list entries have the standard "Consider
moving to syscalls.list." comment (see bug 14138) added.  Conditionals
on the relevant __NR_* syscall numbers being defined are also removed,
since my analysis indicated that the relevant syscalls are always
defined for all relevant kernel versions using any affected file.
Much of the removed fallback code had unbounded stack allocations, so
this reduces the number of cases to consider for anyone reviewing uses
of alloca and VLAs in glibc.

There remain tests of __ASSUME_ATFCTS in io/openat.c (to determine
whether to define __have_atfcts) and sysdeps/posix/getcwd.c (which
also uses __have_atfcts); thus, the definition of __ASSUME_ATFCTS
remains in kernel-features.h.  The logical condition relevant there is
whether openat64_not_cancel_3 is known to work.  Hurd doesn't use this
version of getcwd at all, so the conditionals in getcwd.c are always
true in glibc.  However, this code is also used in gnulib.  So the
best way to deal with the conditionals there may be for gnulib people
to deal with merging all relevant changes in both directions between
the glibc and gnulib versions of this file, at the end of which the
openat conditionals should be in whatever form is best for gnulib, and
hardcoded in the _LIBC case to having openat supported.

Tested by comparing before-and-after disassembly of installed
(stripped) shared libraries, on x86_64 and x86.  On x86 the patch made
no change to the disassembly; on x86_64, the only changes were in
readlinkat, where formerly the return value from the readlinkat
syscall was stored in an int variable before being converted to
ssize_t for the return, and now the return value is returned directly
without truncation to int.  I think it's clearly correct not to
truncate the return value (although I also think the truncation would
not have been a user-visible bug because the kernel would never have
returned a value it could have affected).

	* include/fcntl.h (__atfct_seterrno): Remove prototype.
	(__atfct_seterrno_2): Likewise.
	* sysdeps/unix/sysv/linux/alpha/dl-fxstatat64.c: Do not include
	<kernel-features.h>.
	(__ASSUME_ATFCTS): Do not undefine and redefine.
	* sysdeps/unix/sysv/linux/alpha/fxstatat.c [__ASSUME_ATFCTS]
	(__have_atfcts): Remove conditional definition.
	(__fxstatat([__NR_fstatat64]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code and code
	unreachable if [__ASSUME_ATFCTS].
	* sysdeps/unix/sysv/linux/dl-fxstatat64.c (__ASSUME_ATFCTS): Do
	not undefine and redefine.
	* sysdeps/unix/sysv/linux/faccessat.c: Do not include
	<kernel-features.h>.
	(faccessat) [__NR_faccessat]: Make code unconditional.
	(faccessat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fchmodat.c: Do not include
	<kernel-features.h>.
	(fchmodat) [__NR_fchmodat]: Make code unconditional.
	(fchmodat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fchownat.c: Do not include
	<kernel-features.h>.
	(fchownat) [__NR_fchownat]: Make code unconditional.
	(fchownat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/futimesat.c: Do not include
	<kernel-features.h>.
	(futimesat) [__NR_futimesat]: Make code unconditional.
	(futimesat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fxstatat.c: Do not include
	<kernel-features.h>.
	(__fxstatat) [__NR_newfstatat]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/fxstatat64.c: Do not include
	<kernel-features.h>.
	(__fxstatat64) [__NR_fstatat64]: Make code unconditional.
	(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/i386/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/i386/fxstatat.c: Do not include
	<kernel-features.h>.
	(__fxstatat) [__NR_fstatat64]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/linkat.c: Do not include
	<kernel-features.h>.
	(linkat) [__NR_linkat]: Make code unconditional.
	(linkat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/m68k/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c: Do not include
	<kernel-features.h>.
	(__fxstatat64) [__NR_newfstatat]: Make code unconditional.
	(__fxstatat64) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/mkdirat.c: Do not include
	<kernel-features.h>.
	(mkdirat) [__NR_mkdirat]: Make code unconditional.
	(mkdirat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/openat.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_ATFCTS] (__atfct_seterrno): Remove function.
	[!__ASSUME_ATFCTS] (__have_atfcts): Remove variable.
	(OPENAT_NOT_CANCEL) [__NR_openat]: Make code unconditional.
	(OPENAT_NOT_CANCEL) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/powerpc/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/readlinkat.c: Do not include
	<kernel-features.h>.
	(readlinkat) [__NR_readlinkat]: Make code unconditional.
	(readlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.  Return
	result of INLINE_SYSCALL directly, not via int variable.
	* sysdeps/unix/sysv/linux/renameat.c: Do not include
	<kernel-features.h>.
	[!__ASSUME_ATFCTS] (__atfct_seterrno_2): Remove function.
	(renameat) [__NR_renameat]: Make code unconditional.
	(renameat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/s390/s390-32/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/sh/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/fchownat.c: Remove file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/dl-fxstatat64.c
	(__ASSUME_ATFCTS): Do not undefine and redefine.
	* sysdeps/unix/sysv/linux/symlinkat.c: Do not include
	<kernel-features.h>.
	(symlinkat) [__NR_symlinkat]: Make code unconditional.
	(symlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/unlinkat.c: Do not include
	<kernel-features.h>.
	(unlinkat) [__NR_unlinkat]: Make code unconditional.
	(unlinkat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/wordsize-64/dl-fxstatat64.c
	(__ASSUME_ATFCTS): Do not undefine and redefine.
	* sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Do not include
	<kernel-features.h>.
	(__fxstatat) [__NR_newfstatat]: Make code unconditional.
	(__fxstatat) [!__ASSUME_ATFCTS]: Remove conditional code.
	* sysdeps/unix/sysv/linux/xmknodat.c: Do not include
	<kernel-features.h>.
	(__xmknodat) [__NR_mknodat]: Make code unconditional.
	(__xmknodat) [!__ASSUME_ATFCTS]: Remove conditional code.
2014-06-20 15:41:35 +00:00
H.J. Lu 224c6c51c5 Remove sysdeps/x86_64/multiarch/rtld-strlen.S
Since there is no sysdeps/x86_64/multiarch/strlen.S,
sysdeps/x86_64/rtld-strlen.S will be used.

	* sysdeps/x86_64/multiarch/rtld-strlen.S: Removed.
2014-06-20 08:10:07 -07:00
Andreas Schwab aa6ec754f3 Fix another memory leak in regexp compiler (BZ #17069) 2014-06-20 14:03:40 +02:00
Siddhesh Poyarekar 7892406e35 Fix ChangeLog and NEWS goof-up
The ChangeLog belonged to localedata and the bug is not completely
fixed, so it didn't deserve to enter the NEWS yet.
2014-06-20 17:12:10 +05:30
Stefan Liebler 3ef6b85059 [BZ #6803] Set errno for scalbln, scalbn
Errno is not set and the testcases will fail.

Now the scalbln-aliases are removed in i386/m68
and the wrappers are used when calling the scalbln-functions.

On ia64 only scalblnf has its own implementation.
For scalbln and scalblnl the ieee754/dbl-64 and ieee754/ldbl-96 are used, thus
the wrappers are needed, too.
2014-06-20 07:48:20 +05:30
Stefan Liebler d8c2869d44 Generate en_GB.UTF-8 during testing
This patch generates en_GB.UTF-8, which is used in
tst-strcoll-overflow.  This solves the issue of failing xtests on
s390/s390x.
2014-06-20 07:44:42 +05:30
H.J. Lu c8daec5c7c Use 3 bytes for __pad1 in pthread_rwlock_t for x32
Since long is 4 bytes for x32, we should use 3 bytes for __pad1 when
a long __pad1 is replaced by a byte __rwelision and __pad1.

	* sysdeps/x86/nptl/bits/pthreadtypes.h (pthread_rwlock_t): Use
	3 bytes for __pad1 for x32.
	(__PTHREAD_RWLOCK_ELISION_EXTRA): Likewise.
2014-06-19 15:24:33 -07:00
Ling Ma 5c74e47cd6 Add x86_64 memset optimized for AVX2
In this patch we take advantage of HSW memory bandwidth, manage to
reduce miss branch prediction by avoiding using branch instructions and
force destination to be aligned with avx & avx2 instruction.

The CPU2006 403.gcc benchmark indicates this patch improves performance
from 26% to 59%.

	* sysdeps/x86_64/multiarch/Makefile: Add memset-avx2.
	* sysdeps/x86_64/multiarch/memset-avx2.S: New file.
	* sysdeps/x86_64/multiarch/memset.S: Likewise.
	* sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
	* sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.
2014-06-19 15:14:08 -07:00
Andreas Schwab 4d43ef1e74 Fix memory leak in regexp compiler (BZ #17069) 2014-06-19 19:00:03 +02:00
Will Newton 51a7380b89 malloc/malloc.c: Avoid calling sbrk unnecessarily with zero
Due to my bad review suggestion for the fix for BZ #15089 a check
was removed from systrim to prevent sbrk being called with a zero
argument. Add the check back to avoid this useless work.

ChangeLog:

2014-06-19  Will Newton  <will.newton@linaro.org>

	* malloc/malloc.c (systrim): If extra is zero then return
	early.
2014-06-19 14:34:08 +01:00
Siddhesh Poyarekar 91b84fe588 Remove unnecessary $(.)
The variable is not necessary, especially since it does not exist.
2014-06-19 17:02:48 +05:30
Richard Earnshaw f940b96522 [AArch64] Add optimized strchr.
Implementation of strchr for AArch64.  Speedups taken from micro-bench
show the improvements relative to the standard C code.

The use of LD1 means we have identical code for both big- and
little-endian systems.
2014-06-19 11:03:59 +01:00
Joseph Myers 4ba7a00fe3 Fix __ieee754_logl (-LDBL_MAX) in FE_DOWNWARD mode (bug 17022).
This patch fixes __ieee754_logl (-LDBL_MAX) on x86_64 and x86 not to
subtract 1 from its argument and so cause spurious overflow in
FE_DOWNWARD mode.  (For any argument strictly less than -1, it doesn't
matter whether or not 1 is subtracted before computing log1p, as long
as the result doesn't overflow to -Inf.)

Tested x86_64 and x86.  (This particular case lacks test coverage,
since the testsuite doesn't cover -lieee, but it will be covered by
tests after the following patch to test pow in all rounding modes,
which was the context in which this bug was found.)

	[BZ #17022]
	* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Do not subtract 1
	from arguments -2 or below.
	* sysdeps/i386/i686/fpu/e_logl.S (__ieee754_logl): Likewise.
	* sysdeps/x86_64/fpu/e_logl.S (__ieee754_logl): Likewise.
2014-06-18 12:32:01 +00:00
Andreas Schwab b3a9f56ba5 Don't read past end of pattern in fnmatch (BZ #17062) 2014-06-18 14:20:02 +02:00
Joseph Myers 85d8927856 Use $(rtld-prefix) more consistently.
The glibc makefiles have a standard variable, $(rtld-prefix), to run
the dynamic linker with a default --library-path option; this is used
as the basis of lots of other variables for running programs compiled
with the newly built library.

A few places however use $(elf-objpfx)ld.so or
$(elf-objpfx)${rtld-installed-name} directly, with such a
--library-path option.  This patch makes such places use
$(rtld-prefix) instead.  I'm not aware of any significance in these
cases to the choice of ld.so or ${rtld-installed-name} when running
the dynamic linker, or to whether $(patsubst
%,:%,$(sysdep-library-path)) is included in the library-path as it is
in $(rtld-prefix) and just one of the places being changed.

Tested x86_64.

	* elf/Makefile ($(objpfx)tst-unused-dep.out): Use $(rtld-prefix).
	* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Likewise.
	* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Likewise.

localedata/ChangeLog:
	* Makefile (LOCALEDEF): Use $(rtld-prefix).
2014-06-18 10:35:29 +00:00
Rajalakshmi Srinivasaraghavan 754c5a08aa PowerPC: Fix nearbyintl failure for few inputs
This patch fixes few failures in nearbyintl() where the fraction part is
close to 0.5.i  The new tests added report few extra failures in
nearbyint_downward and nearbyint_towardzero which is a known issue.

Fixes #17031.
2014-06-17 08:46:25 -05:00
Adhemerval Zanella 556f529dab PowerPC: Move powerpc code out of nptl/ subdirectory 2014-06-17 07:54:22 -05:00
Adhemerval Zanella 4b26620076 Fix ChangeLog indentation. 2014-06-17 07:50:37 -05:00
Joseph Myers 91c03c5389 Add CFI to x86 ceil / floor / trunc (bug 16681).
This patch adds CFI to the sysdeps/i386/fpu/ implementations of ceil,
floor and trunc functions, for consistency with other x86 .S files in
glibc which have CFI for stack adjustments.

Tested x86.

	[BZ #16681]
	* sysdeps/i386/fpu/s_ceil.S (__ceil): Add CFI.
	* sysdeps/i386/fpu/s_ceilf.S (__ceilf): Likewise.
	* sysdeps/i386/fpu/s_ceill.S (__ceill): Likewise.
	* sysdeps/i386/fpu/s_floor.S (__floor): Likewise.
	* sysdeps/i386/fpu/s_floorf.S (__floorf): Likewise.
	* sysdeps/i386/fpu/s_floorl.S (__floorl): Likewise.
	* sysdeps/i386/fpu/s_trunc.S (__trunc): Likewise.
	* sysdeps/i386/fpu/s_truncf.S (__truncf): Likewise.
	* sysdeps/i386/fpu/s_truncl.S (__truncl): Likewise.
2014-06-16 22:54:46 +00:00
Andreas Schwab a76e63c586 m68k: update libm test ULPs 2014-06-17 00:29:23 +02:00
Andreas Schwab ea8a15f628 Fix typo in preprocessor conditional 2014-06-16 23:44:34 +02:00
Andreas Schwab f2f6d82fe1 Pass $TIMEOUTFACTOR to tests also in cross testing 2014-06-16 21:47:25 +02:00
Florian Weimer a729111732 Fix tautological comparison in non-executed part of tst-setuid2 (BZ #17058)
This part never runs with the current implementation
because the setresuid call currently aborts (as intended).
2014-06-16 18:00:09 +02:00
Andreas Schwab 3d7c00e3a9 Update feature guard for strdup/strndup in <bits/string2.h> 2014-06-16 10:21:31 +02:00