Commit Graph

17177 Commits

Author SHA1 Message Date
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
David S. Miller 6957fb3150 Update Sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2014-06-14 13:14:54 -07:00
Andreas Schwab 1d2a049204 m68k: Consolidate NPTL/non versions of clone 2014-06-14 21:37:49 +02:00
Andreas Schwab 11b9e55b67 m68k: Consolidate NPTL/non versions of vfork 2014-06-14 21:37:34 +02:00
Andi Kleen 0f6901d0a1 Add fallback file for elide.h
Add the missing fallback file for elide.h to fix non x86 builds.
Sorry about that. This is just a noop macro file that makes
all elision code to be optimized out.
2014-06-14 09:27:09 -07:00
Stefan Liebler 38bbbb9f32 Fix pthread.h in installed-headers list. 2014-06-13 16:39:23 -07:00
Roland McGrath 9a25fd1ed3 S390: Move NPTL public headers to sysdeps/s390/nptl/. 2014-06-13 16:27:11 -07:00
Roland McGrath 4004f7e4bf Move S390 code out of nptl/sysdeps/s390/. 2014-06-13 16:26:56 -07:00
Roland McGrath 45193bb814 S390: Convert fork.c to arch-fork.h 2014-06-13 16:26:38 -07:00
David S. Miller f6fdf53382 Consolidate sparc clone, fork, and vfork implementations.
* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Moved ...
	* sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: ... here.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Delete.
	* nptl/sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Moved ...
	* sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: ... here.
	* sysdeps/unix/sysv/linux/sparc/fork.S: Delete.
	* sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/clone.S (__thread_start):
	Remove RESET_PID cpp guards.
	* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S (__thread_start):
	Remove RESET_PID cpp guards.
	* sysdeps/unix/sysv/linux/sparc/vfork.S: Delete.
2014-06-13 14:47:53 -07:00
Andreas Schwab f5d71e140d m68k: avoid pointer to integer conversion warning 2014-06-13 23:32:13 +02:00
Andreas Schwab 03ed7738e7 ChangeLog fix 2014-06-13 23:32:13 +02:00
Andi Kleen b7aa8caace Remove x86 assembler rwlock code
With the recent tuning the C version of rwlocks is basically the same
performance as the x86 assembler version for uncontended locks (with a
a few cycles near the run-to-run variability). For others it should not
matter anyways.

So remove the assembler code and use the C version like other
architectures.
2014-06-13 13:16:06 -07:00
Andi Kleen 8491ed6d70 Add adaptive elision to rwlocks
This patch relies on the C version of the rwlocks posted earlier.
With C rwlocks it is very straight forward to do adaptive elision
using TSX. It is based on the infrastructure added earlier
for mutexes, but uses its own elision macros. The macros
are fairly general purpose and could be used for other
elision purposes too.

This version is much cleaner than the earlier assembler based
version, and in particular implements adaptation which makes
it safer.

I changed the behavior slightly to not require any changes
in the test suite and fully conform to all expected
behaviors (generally at the cost of not eliding in
various situations). In particular this means the timedlock
variants are not elided.  Nested trylock aborts.
2014-06-13 13:15:28 -07:00
Andi Kleen a832bdd362 Add a fast path for C rd/wrlock v2
One difference of the C versions to the assembler wr/rdlock
is that the C compiler saves some registers which are unnecessary
for the fast path in the prologue of the functions. Split the
uncontended fast path out into a separate function. Only when contention is
detected is the full featured function called. This makes
the fast path code (nearly) identical to the assembler version,
and gives uncontended performance within a few cycles.

v2: Rename some functions and add space.
2014-06-13 12:49:03 -07:00
Meador Inge 995a46bbfb get_nprocs: Only return explictly set cache values (BZ #16996)
The implementation of __get_nprocs uses a stactic variable to cache
the value of the current number of processors.  The caching breaks when
'time (NULL) == 0':

  $ cat nproc.c
  #include <stdio.h>
  #include <time.h>
  #include <sys/time.h>

  int main(int argc, char *argv[])
  {
    time_t t;
    struct timeval tv = {0, 0};
    printf("settimeofday({0, 0}, NULL) = %d\n", settimeofday(&tv, NULL));
    t = time(NULL);
    printf("Time: %d, CPUs: %d\n", (unsigned int)t, get_nprocs());
    return 0;
  }
  $ gcc -O3 nproc.c
  $ ./a.out
  settimeofday({0, 0}, NULL) = -1
  Time: 1401311578, CPUs: 4
  $ sudo ./a.out
  settimeofday({0, 0}, NULL) = 0
  Time: 0, CPUs: 0

The problem is with the condition used to check whether a cached
value should be returned or not:

  static int cached_result;
  static time_t timestamp;

  time_t now = time (NULL);
  time_t prev = timestamp;
  atomic_read_barrier ();
  if (now == prev)
    return cached_result;

This patch fixes the problem by ensuring that 'cached_result' has
been set at least once before returning it.
2014-06-13 14:02:04 +05:30
Roland McGrath febf6cc58c Move SPARC public headers out of nptl/ 2014-06-12 15:04:34 -07:00
Roland McGrath e26822463f Move SPARC code out of nptl/sysdeps/sparc/. 2014-06-12 14:33:59 -07:00
Roland McGrath b0725f4324 SPARC: Define TLS_DEFINE_INIT_TP 2014-06-12 14:33:43 -07:00
Roland McGrath b14368b895 SPARC: Convert fork.c to arch-fork.h 2014-06-12 14:19:50 -07:00
Roland McGrath c5620eb3a3 Use list.h in posix-timer code. 2014-06-12 14:17:14 -07:00
Roland McGrath 463dc947b4 Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
Roland McGrath e876b09076 Consolidate NPTL sigprocmask. 2014-06-12 10:32:18 -07:00
Roland McGrath f6b07b3d48 Move i386 code out of nptl/ subdirectory. 2014-06-12 10:08:24 -07:00
Roland McGrath 45262aeedf Move SH code out of nptl/ subdirectory. 2014-06-12 09:05:54 -07:00
Stefan Liebler 35a5e3e338 posix_spawn_faction_addopen: Add missing string.h include directive
This is needed to avoid a PLT call on s390.
2014-06-12 14:20:07 +02:00
Roland McGrath 14642b8511 Move x86_64 code out of nptl/ subdirectory. 2014-06-11 21:33:32 -07:00
Adhemerval Zanella 31c44fea31 Update powerpc-fpu ULPs. 2014-06-11 21:22:49 -05:00
Joseph Myers e81a4f9a54 conformtest: clean up POSIX expectations for sys/mman.h, sys/stat.h, sys/types.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for sys/mman.h, sys/stat.h
and sys/types.h.  Tested x86_64; no new XFAILs needed.

	* conform/data/sys/mman.h-data [POSIX] (size_t): Do not require
	type.
	[POSIX] (off_t): Likewise.
	* conform/data/sys/stat.h-data (S_IRGRP): Require constant.
	[POSIX] (S_ISBLK): Require macro.
	[POSIX] (S_ISCHR): Likewise.
	[POSIX] (S_ISDIR): Likewise.
	[POSIX] (S_ISFIFO): Likewise.
	[POSIX] (S_ISREG): Likewise.
	[POSIX || XPG3 || XPG4 || UNIX98] (S_TYPEISTMO): Do not list
	optional-macro.
	* conform/data/sys/types.h-data [POSIX] (blkcnt_t): Do not require
	type.
	[POSIX] (time_t): Likewise.
	[POSIX] (timer_t): Likewise.
2014-06-11 23:16:23 +00:00
Florian Weimer 89e435f355 posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
POSIX requires that we make a copy, so we allocate a new string
and free it in posix_spawn_file_actions_destroy.

Reported by David Reid, Alex Gaynor, and Glyph Lefkowitz.  This bug
may have security implications.
2014-06-11 23:13:42 +02:00
Chris Metcalf c3a2ebe1f7 tile: Consolidate NPTL/non versions of vfork 2014-06-11 15:52:53 -04:00
Roland McGrath c9cab3d2f9 Tile: Define TLS_DEFINE_INIT_TP 2014-06-11 12:25:27 -07:00
Roland McGrath d3996c7905 S390: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:56 -07:00
Roland McGrath ba5ec6116c Alpha: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:35 -07:00
Roland McGrath f12b481486 PowerPC: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:17 -07:00
Roland McGrath 9503784a07 AArch64: Define TLS_DEFINE_INIT_TP 2014-06-11 12:23:01 -07:00
Vidya Ranganathan e23d3d2690 PowerPC: Optimized strcmp for PPC64/POWER7
Optimization is achieved on 8 byte aligned strings with double word
comparison using cmpb instruction. On unaligned strings loop unrolling
is applied for Power7 gain.
2014-06-11 08:39:31 -05:00
Siddhesh Poyarekar 42b1161e8c Validate bench.out against a JSON schema
This patch adds a JSON schema for the benchmark output file and also
adds a script that validates the generated output against the schema.
2014-06-11 14:16:29 +05:30
Adhemerval Zanella 4a594c3435 Fix ChangeLog indentation. 2014-06-10 14:13:12 -05:00
Chris Metcalf 2d0fc4dcfc tile: move sysdeps/unix/sysv/linux/tile nptl files. 2014-06-10 14:10:17 -04:00
Wilco 0570cfed7f Add FE_NOMASK_ENV return value test. 2014-06-10 15:50:25 +01:00
Joseph Myers f8ba1b5654 Fix log2 (1) in round-downward mode (bug 17042).
As with other issues of this kind, bug 17042 is log2 (1) wrongly
returning -0 instead of +0 in round-downward mode because of
implementations effectively in terms of log1p (x - 1).  This patch
fixes the issue in the same way used for log and log10.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 to confirm a fix was needed for ldbl-128 and to validate that
fix (also applied to ldbl-128ibm since that version of log2l is
essentially the same as the ldbl-128 one).

	[BZ #17042]
	* sysdeps/i386/fpu/e_log2.S (__ieee754_log2): Take absolete value
	when x - 1 is zero.
	* sysdeps/i386/fpu/e_log2f.S (__ieee754_log2f): Likewise.
	* sysdeps/i386/fpu/e_log2l.S (__ieee754_log2l): Likewise.
	* sysdeps/ieee754/ldbl-128/e_log2l.c (__ieee754_log2l): Return
	0.0L for an argument of 1.0L.
	* sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l):
	Likewise.
	* sysdeps/x86_64/fpu/e_log2l.S (__ieee754_log2l): Take absolute
	value when x - 1 is zero.
	* math/libm-test.inc (log2_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-06-10 12:07:15 +00:00
Bernard Ogden 2c3520d98d hppa: Remove lowlevellock.c.
The hppa port has no need of a custom lowlevellock.c, it should
use the generic version which is updated and correct. This
similarly fixes bug 15119 for hppa.
2014-06-09 23:22:20 -04:00
Roland McGrath acaa4d24f5 SH: Define TLS_DEFINE_INIT_TP 2014-06-09 15:54:23 -07:00
Roland McGrath d752f0ccd7 m68k: Define TLS_DEFINE_INIT_TP 2014-06-09 15:54:19 -07:00
Roland McGrath 34eda6d1ba HPPA: Define TLS_DEFINE_INIT_TP 2014-06-09 14:04:45 -07:00
Roland McGrath 50f0a637b7 MIPS: Define TLS_DEFINE_INIT_TP 2014-06-09 13:47:38 -07:00
Roland McGrath 08f41f047c ARM: Define TLS_DEFINE_INIT_TP 2014-06-09 12:53:16 -07:00
Roland McGrath 962b744d06 Start cleaning up TLS initial value for pthread_create. 2014-06-09 12:52:55 -07:00
Joseph Myers 09f19b0552 conformtest: clean up POSIX expectations for termios.h, time.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for termios.h and time.h.
Tested x86_64; no new XFAILs needed.

	* conform/data/termios.h-data [POSIX] (IUCLC): Do not expect
	constant.
	[POSIX] (IXANY): Likewise.
	[POSIX] (OLCUC): Likewise.
	[POSIX || POSIX2008] (CBAUD): Do not allow.
	[POSIX || POSIX2008] (DEFECHO): Likewise.
	[POSIX || POSIX2008] (ECHOCTL): Likewise.
	[POSIX || POSIX2008] (ECHOKE): Likewise.
	[POSIX || POSIX2008] (ECHOPRT): Likewise.
	[POSIX || POSIX2008] (EXTA): Likewise.
	[POSIX || POSIX2008] (EXTB): Likewise.
	[POSIX || POSIX2008] (FLUSHO): Likewise.
	[POSIX || POSIX2008] (LOBLK): Likewise.
	[POSIX || POSIX2008] (PENDIN): Likewise.
	[POSIX || POSIX2008] (SWTCH): Likewise.
	[POSIX || POSIX2008] (VDISCARD): Likewise.
	[POSIX || POSIX2008] (VDSUSP): Likewise.
	[POSIX || POSIX2008] (VLNEXT): Likewise.
	[POSIX || POSIX2008] (VREPRINT): Likewise.
	[POSIX || POSIX2008] (VSTATUS): Likewise.
	[POSIX || POSIX2008] (VWERASE): Likewise.
	(B*): Change to B[0123456789]*.
	* conform/data/time.h-data [POSIX || UNIX98]
	(CLOCK_PROCESS_CPUTIME_ID): Do not expect constant.
	[POSIX || UNIX98] (CLOCK_THREAD_CPUTIME_ID): Likewise.
	[POSIX || UNIX98] (CLOCK_MONOTONIC): Likewise.
	[POSIX] (tm_*): Do not allow.
2014-06-09 11:39:33 +00:00
Joseph Myers 686554bff6 Remove redundant C locale settings.
Various glibc build / install / test code has C locale settings that
are redundant with LC_ALL=C.

LC_ALL takes precedence over LANG, so anywhere that sets LC_ALL=C
(explicitly, or through it being in the default environment for
running tests) does not need to set LANG=C.  LC_ALL=C also takes
precedence over LANGUAGE, since

2001-01-02  Ulrich Drepper  <drepper@redhat.com>

	* intl/dcigettext.c (guess_category_value): Rewrite so that LANGUAGE
	value is ignored if the selected locale is the C locale.
	* intl/tst-gettext.c: Set locale for above change.
	* intl/tst-translit.c: Likewise.

and so settings of LANGUAGE=C are also redundant when LC_ALL=C is
set.  One test also had LC_ALL=C in its -ENV setting, although it's
part of the default environment used for tests.

This patch removes the redundant settings.  It removes a suggestion in
install.texi of setting LANGUAGE=C LC_ALL=C for "make install"; the
Makefile.in target "install" already sets LC_ALL_C so there's no need
for the user to set it (and nor should there be any need for the user
to set it).

If some build machine tool used by "make install" uses a version of
libintl predating that 2001 change, and the user has LANGUAGE set, the
removal of LANGUAGE=C from the Makefile.in "install" rule could in
principle affect the user's installation.  However, I don't think we
need to be concerned about pre-2001 build tools.

Tested x86_64.

	* Makefile (install): Don't set LANGUAGE.
	* Makefile.in (install): Likewise.
	* assert/Makefile (test-assert-ENV): Remove variable.
	(test-assert-perr-ENV): Likewise.
	* elf/Makefile (neededtest4-ENV): Likewise.
	* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Don't set LANGUAGE.
	* io/ftwtest-sh (LANG): Remove variable.
	* libio/Makefile (tst-widetext-ENV): Likewise.
	* manual/install.texi (Running make install): Don't refer to
	environment settings for make install.
	* INSTALL: Regenerated.
	* nptl/tst-tls6.sh: Don't set LANG.
	* posix/globtest.sh (LANG): Remove variable.
	* string/Makefile (tester-ENV): Likewise.
	(inl-tester-ENV): Likewise.
	(noinl-tester-ENV): Likewise.
	* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Don't set LANGUAGE.
	* timezone/Makefile (build-testdata): Use $(built-program-cmd)
	without explicit environment settings.

localedata/ChangeLog:
	* tst-fmon.sh: Don't set LANGUAGE.
	* tst-locale.sh: Likewise.
2014-06-07 19:58:36 +00:00
Roland McGrath 68e6b6b1bf Move NPTL public ABI headers for SH to sysdeps/sh/nptl/. 2014-06-06 23:08:16 -07:00
Chris Metcalf 4d3ae034b7 crypt: don't include ufc-crypt.h multiple times
The file has no inclusion guards, and contains typedefs that
cause errors when included multiple times with older (pre-C11)
compilers such as gcc 4.4.

Save the "#ifdef DOS" content to crypt-private.h even though
it's likely not particularly useful.
2014-06-06 18:25:31 -04:00
Joseph Myers 8540f6d2a7 Don't require test wrappers to preserve environment variables, use more consistent environment.
One wart in the original support for test wrappers for cross testing,
as noted in
<https://sourceware.org/ml/libc-alpha/2012-10/msg00722.html>, is the
requirement for test wrappers to pass a poorly-defined set of
environment variables from the build system to the system running the
glibc under test.  Although some variables are passed explicitly via
$(test-wrapper-env), including LD_* variables that simply can't be
passed implicitly because of the side effects they'd have on the build
system's dynamic linker, others are passed implicitly, including
variables such as GCONV_PATH and LOCPATH that could potentially affect
the build system's libc (so effectively relying on any such effects
not breaking the wrappers).  In addition, the code in
cross-test-ssh.sh for preserving environment variables is fragile (it
depends on how bash formats a list of exported variables, and could
well break for multi-line variable definitions where the contents
contain things looking like other variable definitions).

This patch moves to explicitly passing environment variables via
$(test-wrapper-env).  Makefile variables that previously used
$(test-wrapper) are split up into -before-env and -after-env parts
that can be passed separately to the various .sh files used in
testing, so those files can then insert environment settings between
the two parts.

The common default environment settings in make-test-out are made into
a separate makefile variable that can also be passed to scripts,
rather than many scripts duplicating those settings (for testing an
installed glibc, it is desirable to have the GCONV_PATH setting on
just one place, so just that one place needs to support it pointing to
an installed sysroot instead of the build tree).  The default settings
are included in the variables such as $(test-program-prefix), so that
if tests do not need any non-default settings they can continue to use
single variables rather than the split-up variables.

Although this patch cleans up LC_ALL=C settings (that being part of
the common defaults), various LANG=C and LANGUAGE=C settings remain.
Those are generally unnecessary and I propose a subsequent cleanup to
remove them.  LC_ALL takes precedence over LANG, and while LANGUAGE
takes precedence over LC_ALL, it only does so for settings other than
LC_ALL=C.  So LC_ALL=C on its own is sufficient to ensure the C
locale, and anything that gets LC_ALL=C does not need the other
settings.

While preparing this patch I noticed some tests with .sh files that
appeared to do nothing beyond what the generic makefile support for
tests can do (localedata/tst-wctype.sh - the makefiles support -ENV
variables and .input files - and localedata/tst-mbswcs.sh - just runs
five tests that could be run individually from the makefile).  So I
propose another subsequent cleanup to move those to using the generic
support instead of special .sh files.

Tested x86_64 (native) and powerpc32 (cross).

	* Makeconfig (run-program-env): New variable.
	(run-program-prefix-before-env): Likewise.
	(run-program-prefix-after-env): Likewise.
	(run-program-prefix): Define in terms of new variables.
	(built-program-cmd-before-env): New variable.
	(built-program-cmd-after-env): Likewise.
	(built-program-cmd): Define in terms of new variables.
	(test-program-prefix-before-env): New variable.
	(test-program-prefix-after-env): Likewise.
	(test-program-prefix): Define in terms of new variables.
	(test-program-cmd-before-env): New variable.
	(test-program-cmd-after-env): Likewise.
	(test-program-cmd): Define in terms of new variables.
	* Rules (make-test-out): Use $(run-program-env).
	* scripts/cross-test-ssh.sh (env_blacklist): Remove variable.
	(help): Do not mention environment variables.  Mention
	--timeoutfactor option.
	(timeoutfactor): New variable.
	(blacklist_exports): Remove function.
	(exports): Remove variable.
	(command): Do not include ${exports}.
	* manual/install.texi (Configuring and compiling): Do not mention
	test wrappers preserving environment variables.  Mention that last
	assignment to a variable must take precedence.
	* INSTALL: Regenerated.
	* benchtests/Makefile (run-bench): Use $(run-program-env).
	* catgets/Makefile ($(objpfx)test1.cat): Use
	$(built-program-cmd-before-env), $(run-program-env) and
	$(built-program-cmd-after-env).
	($(objpfx)test2.cat): Do not specify environment variables
	explicitly.
	($(objpfx)de/libc.cat): Use $(built-program-cmd-before-env),
	$(run-program-env) and $(built-program-cmd-after-env).
	($(objpfx)test-gencat.out): Use $(test-program-cmd-before-env),
	$(run-program-env) and $(test-program-cmd-after-env).
	($(objpfx)sample.SJIS.cat): Do not specify environment variables
	explicitly.
	* catgets/test-gencat.sh: Use test_program_cmd_before_env,
	run_program_env and test_program_cmd_after_env arguments.
	* elf/Makefile ($(objpfx)tst-pathopt.out): Use $(run-program-env).
	* elf/tst-pathopt.sh: Use run_program_env argument.
	* iconvdata/Makefile ($(objpfx)iconv-test.out): Use
	$(test-wrapper-env) and $(run-program-env).
	* iconvdata/run-iconv-test.sh: Use test_wrapper_env and
	run_program_env arguments.
	* iconvdata/tst-table.sh: Do not set GCONV_PATH explicitly.
	* intl/Makefile ($(objpfx)tst-gettext.out): Use
	$(test-program-prefix-before-env), $(run-program-env) and
	$(test-program-prefix-after-env).
	($(objpfx)tst-gettext2.out): Likewise.
	* intl/tst-gettext.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	* intl/tst-gettext2.sh: Likewise.
	* intl/tst-gettext4.sh: Do not set environment variables
	explicitly.
	* intl/tst-gettext6.sh: Likewise.
	* intl/tst-translit.sh: Likewise.
	* malloc/Makefile ($(objpfx)tst-mtrace.out): Use
	$(test-program-prefix-before-env), $(run-program-env) and
	$(test-program-prefix-after-env).
	* malloc/tst-mtrace.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	* math/Makefile (run-regen-ulps): Use $(run-program-env).
	* nptl/Makefile ($(objpfx)tst-tls6.out): Use $(run-program-env).
	* nptl/tst-tls6.sh: Use run_program_env argument.  Set LANG=C
	explicitly with each use of ${test_wrapper_env}.
	* posix/Makefile ($(objpfx)wordexp-tst.out): Use
	$(test-program-prefix-before-env), $(run-program-env) and
	$(test-program-prefix-after-env).
	* posix/tst-getconf.sh: Do not set environment variables
	explicitly.
	* posix/wordexp-tst.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	* stdio-common/tst-printf.sh: Do not set environment variables
	explicitly.
	* stdlib/Makefile ($(objpfx)tst-fmtmsg.out): Use
	$(test-program-prefix-before-env), $(run-program-env) and
	$(test-program-prefix-after-env).
	* stdlib/tst-fmtmsg.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	Split $test calls into $test_pre and $test.
	* timezone/Makefile (build-testdata): Use
	$(built-program-cmd-before-env), $(run-program-env) and
	$(built-program-cmd-after-env).

localedata/ChangeLog:
	* Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use
	$(built-program-cmd-before-env), $(run-program-env) and
	$(built-program-cmd-after-env).
	($(objpfx)sort-test.out): Use $(test-program-prefix-before-env),
	$(run-program-env) and $(test-program-prefix-after-env).
	($(objpfx)tst-fmon.out): Use $(run-program-prefix-before-env),
	$(run-program-env) and $(run-program-prefix-after-env).
	($(objpfx)tst-locale.out): Use $(built-program-cmd-before-env),
	$(run-program-env) and $(built-program-cmd-after-env).
	($(objpfx)tst-trans.out): Use $(run-program-prefix-before-env),
	$(run-program-env), $(run-program-prefix-after-env),
	$(test-program-prefix-before-env) and
	$(test-program-prefix-after-env).
	($(objpfx)tst-ctype.out): Use $(test-program-cmd-before-env),
	$(run-program-env) and $(test-program-cmd-after-env).
	($(objpfx)tst-wctype.out): Likewise.
	($(objpfx)tst-langinfo.out): Likewise.
	($(objpfx)tst-langinfo-static.out): Likewise.
	* gen-locale.sh: Use localedef_before_env, run_program_env and
	localedef_after_env arguments.
	* sort-test.sh: Use test_program_prefix_before_env,
	run_program_env and test_program_prefix_after_env arguments.
	* tst-ctype.sh: Use tst_ctype_before_env, run_program_env and
	tst_ctype_after_env arguments.
	* tst-fmon.sh: Use run_program_prefix_before_env, run_program_env
	and run_program_prefix_after_env arguments.
	* tst-langinfo.sh: Use tst_langinfo_before_env, run_program_env
	and tst_langinfo_after_env arguments.
	* tst-locale.sh: Use localedef_before_env, run_program_env and
	localedef_after_env arguments.
	* tst-mbswcs.sh: Do not set environment variables explicitly.
	* tst-numeric.sh: Likewise.
	* tst-rpmatch.sh: Likewise.
	* tst-trans.sh: Use run_program_prefix_before_env,
	run_program_env, run_program_prefix_after_env,
	test_program_prefix_before_env and test_program_prefix_after_env
	arguments.
	* tst-wctype.sh: Use tst_wctype_before_env, run_program_env and
	tst_wctype_after_env arguments.
2014-06-06 22:19:27 +00:00
Adhemerval Zanella ed36bfa18f PowerPC: Fix optimized strncat strlen call
This patch fixes the optimized ppc64/power7 strncat strlen call for
static build without ifunc enabled.  The strlen symbol to call in such
situation is just strlen, instead of __GI_strlen (since the __GI_
alias is just created for shared objects).
2014-06-06 09:37:07 -05:00
Siddhesh Poyarekar fc75bf464d Inline nested function check_list 2014-06-06 03:04:05 +05:30
Ondřej Bílka d89b3d80f9 Fix memory overrun in getifaddrs_internal. Fixes bug 15698. 2014-06-05 19:25:23 +02:00
Joseph Myers 2bf1804182 Include LOCPATH in default test environment.
Tests run using the default $(make-test-out) automatically get
GCONV_PATH and LC_ALL set, whether or not those environment variables
are actually needed for the individual test.  However, they do not get
LOCPATH set, meaning that a large number of tests have -ENV settings
just to set LOCPATH.

This patch moves LOCPATH into the default environment used for all
tests, on the principle that like GCONV_PATH any settings needed to
use files associated with the newly built library, rather than any old
installed files, are appropriate to use by default.

A further motivation is that various tests using .sh files also set
some combination of LC_ALL, GCONV_PATH and LOCPATH.  Preferably .sh
files should also use the default environment with any additions
required for the individual test.  Now, it was suggested in
<https://sourceware.org/ml/libc-alpha/2014-05/msg00715.html> that
various Makefile variables used in testing should be derived by
composing the -before-env and -after-env variables used when explicit
environment settings are required.  With such a change, it's also
natural for those variables to include the default settings (via some
intermediate makefile variable also used in make-test-out).

Because some .sh files only set variables that correspond to the
default settings, or a subset thereof, and this applies to more of the
.sh files once LOCPATH is in the default settings, doing so reduces
the size of a revised version of
<https://sourceware.org/ml/libc-alpha/2014-05/msg00596.html>: scripts
only needing the (expanded) default settings will not need to receive
the separate -before-env and -after-env variables, only the single
variable they do at present.  So moving LOCPATH into the default
settings can reduce churn caused by subsequent patches.

Tested x86_64 and x86.

	* Rules (make-test-out): Include
	LOCPATH=$(common-objpfx)localedata in default environment.
	* debug/Makefile (tst-chk1-ENV): Remove variable.
	(tst-chk2-ENV): Likewise.
	(tst-chk3-ENV): Likewise.
	(tst-chk4-ENV): Likewise.
	(tst-chk5-ENV): Likewise.
	(tst-chk6-ENV): Likewise.
	(tst-lfschk1-ENV): Likewise.
	(tst-lfschk2-ENV): Likewise.
	(tst-lfschk3-ENV): Likewise.
	(tst-lfschk4-ENV): Likewise.
	(tst-lfschk5-ENV): Likewise.
	(tst-lfschk6-ENV): Likewise.
	* iconvdata/Makefile (bug-iconv6-ENV): Likewise.
	(tst-iconv7-ENV): Likewise.
	* intl/Makefile (LOCPATH-ENV): Likewise.
	(tst-codeset-ENV): Likewise.
	(tst-gettext3-ENV): Likewise.
	(tst-gettext5-ENV): Likewise.
	* libio/Makefile (tst-widetext-ENV): Don't set LOCPATH.
	(tst-fopenloc-ENV): Likewise.
	(tst-fgetws-ENV): Remove variable.
	(tst-ungetwc1-ENV): Likewise.
	(tst-ungetwc2-ENV): Likewise.
	(bug-ungetwc2-ENV): Likewise.
	(tst-swscanf-ENV): Likewise.
	(bug-ftell-ENV): Likewise.
	(tst-fgetwc-ENV): Likewise.
	(tst-fseek-ENV): Likewise.
	(tst-ftell-partial-wide-ENV): Likewise.
	(tst-ftell-active-handler-ENV): Likewise.
	(tst-ftell-append-ENV): Likewise.
	* posix/Makefile (tst-fnmatch-ENV): Likewise.
	(tst-regexloc-ENV): Likewise.
	(bug-regex1-ENV): Likewise.
	(tst-regex-ENV): Likewise.
	(tst-regex2-ENV): Likewise.
	(bug-regex5-ENV): Likewise.
	(bug-regex6-ENV): Likewise.
	(bug-regex17-ENV): Likewise.
	(bug-regex18-ENV): Likewise.
	(bug-regex19-ENV): Likewise.
	(bug-regex20-ENV): Likewise.
	(bug-regex22-ENV): Likewise.
	(bug-regex23-ENV): Likewise.
	(bug-regex25-ENV): Likewise.
	(bug-regex26-ENV): Likewise.
	(bug-regex30-ENV): Likewise.
	(bug-regex32-ENV): Likewise.
	(bug-regex33-ENV): Likewise.
	(bug-regex34-ENV): Likewise.
	(bug-regex35-ENV): Likewise.
	(tst-rxspencer-ENV): Likewise.
	(tst-rxspencer-no-utf8-ENV): Likewise.
	* stdio-common/Makefile (tst-sprintf-ENV): Likewise.
	(tst-sscanf-ENV): Likewise.
	(tst-swprintf-ENV): Likewise.
	(tst-swscanf-ENV): Likewise.
	(test-vfprintf-ENV): Likewise.
	(scanf13-ENV): Likewise.
	(bug14-ENV): Likewise.
	(tst-grouping-ENV): Likewise.
	* stdlib/Makefile (tst-strtod-ENV): Likewise.
	(tst-strtod3-ENV): Likewise.
	(tst-strtod4-ENV): Likewise.
	(tst-strtod5-ENV): Likewise.
	(testmb2-ENV): Likewise./
	* string/Makefile (tst-strxfrm-ENV): Likewise.
	(tst-strxfrm2-ENV): Likewise.
	(bug-strcoll1-ENV): Likewise.
	(test-strcasecmp-ENV): Likewise.
	(test-strncasecmp-ENV): Likewise.
	* time/Makefile (tst-strptime-ENV): Likewise.
	(tst-ftime_l-ENV): Likewise.
	* wcsmbs/Makefile (tst-btowc-ENV): Likewise.
	(tst-mbrtowc-ENV): Likewise.
	(tst-wcrtomb-ENV): Likewise.
	(tst-mbrtowc2-ENV): Likewise.
	(tst-c16c32-1-ENV): Likewise.
	(tst-mbsnrtowcs-ENV): Likewise.

localedata/ChangeLog:
	* Makefile (TEST_MBWC_ENV): Remove variable.
	(tst_iswalnum-ENV): Likewise.
	(tst_iswalpha-ENV): Likewise.
	(tst_iswcntrl-ENV): Likewise.
	(tst_iswctype-ENV): Likewise.
	(tst_iswdigit-ENV): Likewise.
	(tst_iswgraph-ENV): Likewise.
	(tst_iswlower-ENV): Likewise.
	(tst_iswprint-ENV): Likewise.
	(tst_iswpunct-ENV): Likewise.
	(tst_iswspace-ENV): Likewise.
	(tst_iswupper-ENV): Likewise.
	(tst_iswxdigit-ENV): Likewise.
	(tst_mblen-ENV): Likewise.
	(tst_mbrlen-ENV): Likewise.
	(tst_mbrtowc-ENV): Likewise.
	(tst_mbsrtowcs-ENV): Likewise.
	(tst_mbstowcs-ENV): Likewise.
	(tst_mbtowc-ENV): Likewise.
	(tst_strcoll-ENV): Likewise.
	(tst_strfmon-ENV): Likewise.
	(tst_strxfrm-ENV): Likewise.
	(tst_swscanf-ENV): Likewise.
	(tst_towctrans-ENV): Likewise.
	(tst_towlower-ENV): Likewise.
	(tst_towupper-ENV): Likewise.
	(tst_wcrtomb-ENV): Likewise.
	(tst_wcscat-ENV): Likewise.
	(tst_wcschr-ENV): Likewise.
	(tst_wcscmp-ENV): Likewise.
	(tst_wcscoll-ENV): Likewise.
	(tst_wcscpy-ENV): Likewise.
	(tst_wcscspn-ENV): Likewise.
	(tst_wcslen-ENV): Likewise.
	(tst_wcsncat-ENV): Likewise.
	(tst_wcsncmp-ENV): Likewise.
	(tst_wcsncpy-ENV): Likewise.
	(tst_wcspbrk-ENV): Likewise.
	(tst_wcsrtombs-ENV): Likewise.
	(tst_wcsspn-ENV): Likewise.
	(tst_wcsstr-ENV): Likewise.
	(tst_wcstod-ENV): Likewise.
	(tst_wcstok-ENV): Likewise.
	(tst_wcstombs-ENV): Likewise.
	(tst_wcswidth-ENV): Likewise.
	(tst_wcsxfrm-ENV): Likewise.
	(tst_wctob-ENV): Likewise.
	(tst_wctomb-ENV): Likewise.
	(tst_wctrans-ENV): Likewise.
	(tst_wctype-ENV): Likewise.
	(tst_wcwidth-ENV): Likewise.
	(tst-digits-ENV): Likewise.
	(tst-mbswcs6-ENV): Likewise.
	(tst-xlocale1-ENV): Likewise.
	(tst-xlocale2-ENV): Likewise.
	(tst-strfmon1-ENV): Likewise.
	(tst-strptime-ENV): Likewise.
	(tst-setlocale-ENV): Don't set LOCPATH.
	(bug-iconv-trans-ENV): Remove variable.
	(tst-sscanf-ENV): Likewise.
	(tst-leaks-ENV): Don't set LOCPATH.
	(bug-setlocale1-ENV): Remove variable.
	(bug-setlocale1-static-ENV): Likewise.
	(tst-setlocale2-ENV): Likewise.
2014-06-04 23:37:25 +00:00
Ondřej Bílka cd1fb60464 Fix typo in manual. 2014-06-05 01:13:04 +02:00
David S. Miller 902b71f9af Fixup ChangeLog and add missing NEWS entry for previous commits. 2014-06-03 16:14:06 -07:00
Guo Yixuan 196939fb0e New test for pthread_spin_lock (bug 16882)
* nptl/tst-spin4.c: New test.
	* nptl/Makefile (tests): Add tst-spin4.
2014-06-03 16:10:48 -07:00
Guo Yixuan b42eca7d39 Fixed pthread_spin_lock on sparc32/64 (bug 16882)
[BZ #16882]
	* nptl/sysdeps/sparc/sparc32/pthread_spin_lock.S
	(pthread_spin_lock): Branch out of spin loop to proper location.
	* nptl/sysdeps/sparc/sparc64/pthread_spin_lock.S
	(pthread_spin_lock): Likewise.
2014-06-03 16:10:48 -07:00
Andreas Schwab f9d2d03254 Fix invalid file descriptor reuse while sending DNS query (BZ #15946) 2014-06-03 18:03:39 +02:00
Richard Henderson 71840409ea aarch64: Remove nptl/vfork.S 2014-06-03 11:28:11 -04:00
Stefan Liebler cf7bfd28b7 S/390: Regenerate ULPs. 2014-06-03 17:27:13 +02:00
Richard Henderson 89b4bd6b60 aarch64: Consolidate NPTL/non versions of vfork
At the same time, incorporate the 0 -> 0x80000000 mapping
of the pid expected by raise.c.
2014-06-03 11:09:20 -04:00
Richard Henderson 111cc71489 aarch64: Consolidate NPTL/non versions of clone
At the same time, rely on non-clobbered registers across syscall
so that we eliminate the stack frame that we previously ignored
in the unwind info.
2014-06-03 11:04:04 -04:00
Marcus Shawcroft ccc3991113 [AArch64] Regenerate libm-test-ulps 2014-06-03 12:45:10 +00:00
Wilco 693096cc7b [AArch64] Switch from FE_TOWARDZERO to _FPU_FPCR_RM_MASK 2014-06-03 12:44:50 +00:00
Wilco 0b4366bc9b [AArch64] Cleanup declarations in math_private.h. 2014-06-03 12:44:49 +00:00
Konstantin Serebryany 8747cd034a Remove redundant nested function b64_from_24bit
Move multiple definitions of the nested function b64_from_24bit into a
single function __b64_from_24bit.
2014-06-03 16:39:08 +05:30
Roland McGrath d936d379eb SH: Consolidate NPTL/non versions of vfork 2014-06-02 14:29:19 -07:00
Siddhesh Poyarekar 9fa76613d0 Fix format specifier for n_mmaps 2014-06-02 23:38:32 +05:30
Wilco a88dadbed5 [AArch64] Remove ISB after FPCR write. 2014-06-02 12:44:21 +01:00
Wilco c95b301101 [AArch64] Rewrite feupdateenv (BZ 17009). 2014-06-02 12:36:34 +01:00
David S. Miller 6b4d7a909f Update Sparc ULPS.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2014-06-01 19:19:18 -07:00
David S. Miller 30f3d07cbb Fix excessive ULP for y1_upward (0x2p+0) in test-float and test-ifloat.
* sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_y1f): Force computations
	to occur in round to nearest mode when |x| >= 2.0
2014-05-31 20:05:00 -07:00
Richard Henderson f0712b543e aarch64: Remove PSEUDO_RET 2014-05-30 14:11:51 -04:00
Richard Henderson 74f31c1859 aarch64: Fix error return from __ioctl
Forgotten in ca3cfa40c1
where the error branch was moved from PSEUDO_RET.
2014-05-30 14:09:34 -04:00
Marko Myllynen 30477995dc Replace __int128 with __int128_t
* sysdeps/x86_64/link-defines.sym (BND_SIZE): Replace __int128
	with __int128_t.
2014-05-30 10:50:21 -07:00
Siddhesh Poyarekar 62a5881678 Fix formatting in malloc_info 2014-05-30 22:44:45 +05:30
Siddhesh Poyarekar 4d653a59ff Add mmap usage in malloc_info output
The current malloc_info xml output only has information about
allocations on the heap.  Display information about number of mappings
and total mmapped size to this to complete the picture.
2014-05-30 22:43:52 +05:30
Roland McGrath 5190c17f22 m68k: Convert fork.c to arch-fork.h 2014-05-30 18:44:55 +02:00
Ondřej Bílka 987c02692a Remove mi_arena nested function. 2014-05-30 13:25:43 +02:00
Richard Henderson 1670e207c5 aarch64: Rely on syscalls preserving registers
In several cases we've had asm routines rely on syscalls not clobbering
call-clobbered registers, and that's now deemed ABI.  So take advantage
of this in the INLINE_SYSCALL path as well.

Shrinks libc.so by about 1k.
2014-05-29 12:53:27 -04:00
Richard Henderson 11a28aee60 aarch64: Use tpidr_el0 rather than __errno_location in librt 2014-05-29 12:41:08 -04:00
Richard Henderson a17e5ffb80 aarch64: Use tpidr_el0 rather than __read_tp in librt 2014-05-29 12:39:03 -04:00
Richard Henderson b5be459771 aarch64: Improve syscall-cancel stack frame
One push instead of N; use stp/ldp to halve the insns.
2014-05-29 12:37:24 -04:00
Richard Henderson 645d44abe3 aarch64: Pass regno parameter to SINGLE_THREAD_P
Use cbz instead of cmp+b.eq.
2014-05-29 12:33:06 -04:00
Richard Henderson a8b4f04ad7 aarch64: Share code in syscall-cancel.h
Fold nocancel and error handling paths.
2014-05-29 12:31:07 -04:00
Richard Henderson af4e8ef944 aarch64: Tabify sysdep-cancel.h 2014-05-29 12:28:59 -04:00
Eric Wong 26b0d2e1a1 Avoid stat/fstat in statvfs/fstatvfs (BZ #15132)
Delay the use of stat/fstat until stat data is required.  When the
kernel returns ST_VALID, stat data is not used by __internal_statvfs.
2014-05-29 09:41:29 +05:30
Roland McGrath 0d3b7a190c SH: Consolidate NPTL/non versions of clone 2014-05-28 17:23:19 -07:00
Roland McGrath 1efe2bd9dc tile: Convert fork.c to arch-fork.h 2014-05-28 14:23:16 -04:00
Roland McGrath 30b6629ede IA64: Convert fork.c to arch-fork.h 2014-05-27 15:43:45 -07:00
Roland McGrath a6bea3ca7b SH: Convert fork.c to arch-fork.h 2014-05-27 12:58:01 -07:00
Ondřej Bílka 3dfb9a5cbe Remove duplicate code in elf/dl-deps.c. 2014-05-27 16:56:39 +02:00
Andreas Schwab 774f928582 Remove second argument from TLS_INIT_TP macro 2014-05-27 14:48:46 +02:00
Will Newton 36ffe7398a ARM: Fix handling of concurrent TLS descriptor resolution
The current code for handling concurrent resolution says that the
ABI for _dl_tlsdesc_resolve_hold is the same as that of
_dl_tlsdesc_lazy_resolver. However _dl_tlsdesc_resolve_hold is
called from the trampoline directly rather than the lazy resolver
stub so, for example, r2 has not been pushed so does not needed
to be restored.

This fixes an intermittent failure in nptl/tst-tls3 when building
glibc for arm-linux-gnueabihf with -mtls-dialect=gnu2.

ChangeLog:

2014-05-27  Will Newton  <will.newton@linaro.org>

	[BZ #16990]
	* sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_resolve_hold): Save
	and restore r2 rather than just restoring.
2014-05-27 10:39:18 +01:00
Siddhesh Poyarekar 2482ae433a Fix offset computation for append+ mode on switching from read (BZ #16724)
The offset computation in write mode uses the fact that _IO_read_end
is kept in sync with the external file offset.  This however is not
true when O_APPEND is in effect since switching to write mode ought to
send the external file offset to the end of file without making the
necessary adjustment to _IO_read_end.

Hence in append mode, offset computation when writing should only
consider the effect of unflushed writes, i.e. from _IO_write_base to
_IO_write_ptr.

The wiki has a detailed document that describes the rationale for
offsets returned by ftell in various conditions:

https://sourceware.org/glibc/wiki/File%20offsets%20in%20a%20stdio%20stream%20and%20ftell
2014-05-27 13:54:19 +05:30
Adhemerval Zanella bab900166e Update powerpc-fpu ULPs. 2014-05-26 12:40:08 -05:00
Adhemerval Zanella c7a8d66787 PowerPC: Move remaining nptl/sysdeps/unix/sysv/linux/powerpc/ files. 2014-05-26 11:45:14 -05:00
Adhemerval Zanella daee7851e2 PowerPC: Move NPTL ABI headers to sysdeps. 2014-05-26 11:41:47 -05:00
Adhemerval Zanella 50a4081954 PowerPC: Move powerpc64 timer_*.c out of nptl/ 2014-05-26 11:41:46 -05:00
Adhemerval Zanella 8464c2a110 PowerPC: Consolidate NPTL/non versions of clone 2014-05-26 11:41:46 -05:00
Adhemerval Zanella 3d1024e8d1 PowerPC: Consolidate NPTL/non versions of vfork 2014-05-26 11:41:28 -05:00
Carlos O'Donell fdfd175d46 Remove nested function mi_arena from malloc_info.
The nested function mi_arena was removed from malloc_info
and made into a non-nested static inline function of the same
name with the correct set of arguments passed from malloc_info.
This enables building glibc with compilers that don't support
nested functions. Future work on malloc_info should remove these
functions entirely to support JSON format output. Therefore we
do the minimum required to remove the nested function.
2014-05-26 11:32:09 -04:00
Adhemerval Zanella d298c41635 PowerPC: Remove 64 bits instructions in PPC32 code
This patch replaces the insrdi by insrwi in powerpc32 assembly.
2014-05-26 09:09:21 -05:00
Andreas Schwab b60ea6fff5 Fix searching localedef input on I18NPATH (BZ #16984) 2014-05-26 12:32:57 +02:00
Stefan Liebler 673659263d Disable lock elision for PTHREAD_MUTEX_NORMAL. 2014-05-26 11:14:25 +02:00
Stefan Liebler f8bdf1f0b6 Fix typo in tst-mutex5 ifndef -> ifdef 2014-05-26 11:12:44 +02:00
Siddhesh Poyarekar 15eaf6ffe3 benchtests: Add new directive for benchmark initialization hook
Add a new 'init' directive that specifies the name of the function to
call to do function-specific initialization.  This is useful for
benchmarks that need to do a one-time initialization before the
functions are executed.
2014-05-26 12:37:29 +05:30
Kyle McMartin 75f11331f9 [AARCH64] correct alignment of TLS_TCB_ALIGN (BZ #16796)
This fixes a variety of testsuite failures for me:
tststatic.out Error 1
tststatic2.out Error 1
tst-tls9-static.out Error 1
tst-audit8.out Error 127
tst-audit9.out Error 127
tst-audit1.out Error 127
and also has the added benefit of making LD_AUDIT/sotruss work on
AArch64.

Otherwise, we bail out early in _dl_try_allocate_static_tls as the
alignment requirement of the PT_TLS section in libc is 16.
2014-05-26 12:37:19 +05:30
Siddhesh Poyarekar c3ec475c5d Use NSS_STATUS_TRYAGAIN to indicate insufficient buffer (BZ #16878)
The netgroups nss modules in the glibc tree use NSS_STATUS_UNAVAIL
(with errno as ERANGE) when the supplied buffer does not have
sufficient space for the result.  This is wrong, because the canonical
way to indicate insufficient buffer is to set the errno to ERANGE and
the status to NSS_STATUS_TRYAGAIN, as is used by all other modules.

This fixes nscd behaviour when the nss_ldap module returns
NSS_STATUS_TRYAGAIN to indicate that a netgroup entry is too long to
fit into the supplied buffer.
2014-05-26 11:40:08 +05:30
Richard Henderson aa2f176d6f arm,aarch64: Remove SINGLE_THREAD_P_PIC
This macro was removed by

2005-11-16  Daniel Jacobowitz  <dan@codesourcery.com>

but not applied to the (still separate) eabi port so necro'd
when the eabi port superceded the old abi.  It was thence
copied into the new AArch64 port.
2014-05-25 12:50:41 -04:00
Richard Henderson ca3cfa40c1 aarch64: Tidy syscall error check
Move the error branch from the PSEUDO_RET macro to the PSEUDO macro.
This is in line with other architectures, and will enable further improvments.
2014-05-25 12:46:50 -04:00
Richard Henderson 6e6c2d01eb aarch64: Remove DOARGS/UNDOARGS macros
While they do something for AArch32, they're useless for AArch64.
2014-05-25 12:37:29 -04:00
Richard Henderson c69abcee72 aarch64: Fix DO_CALL block comment 2014-05-25 12:33:00 -04:00
Richard Henderson 82aab97cbf alpha: Do non-default symbols in pt-vfork.S 2014-05-25 09:04:54 -07:00
Richard Henderson 900e445fad Only provide non-default symbols in libpthread for vfork
* nptl/pt-vfork.c (vfork_resolve): Rename from vfork_ifunc.
	(vfork, __vfork): Define via compat_symbol.
2014-05-23 21:33:05 -07:00
Richard Henderson 8820e3acc3 Only support ifunc in nptl/pt-vfork.c
* nptl/pt-vfork.c: Error if !HAVE_IFUNC.
	[!HAVE_IFUNC] (vfork_compat): Remove.
	[!HAVE_IFUNC] (DEFINE_VFORK): Remove.
2014-05-23 21:33:05 -07:00
Joseph Myers e59252a58e Define TSVTX in tar.h for older POSIX (bug 16978).
As noted in bug 16978, older POSIX versions include

in the specified contents of <tar.h>, with only the 2001 edition
introducing the notion of XSI-conditional definitions and conditioning
that definition.  Thus, this macro should be defined for
!__USE_XOPEN2K as well as for __USE_XOPEN, and this patch duly defines
it in that case.  Tested x86_64.

	[BZ #16978]
	* posix/tar.h [!__USE_XOPEN2K] (TSVTX): Define macro.
	* conform/Makefile (test-xfail-POSIX/tar.h/conform): Remove
	variable.
2014-05-23 20:37:40 +00:00
Richard Henderson bc89e9625f alpha: Move remaining files out of sysdeps/unix/sysv/linux/alpha/nptl/ 2014-05-23 11:20:48 -07:00
Richard Henderson e2fa4bc2bb alpha: Consolidate NPTL/non versions of vfork 2014-05-23 11:20:44 -07:00
Richard Henderson 279b24e2e5 alpha: Merge standard and nptl clone.S 2014-05-23 11:20:41 -07:00
Richard Henderson 132c7f5f01 alpha: Remove nptl/fork.c
The merge at ab21431318 failed
to properly remove the file.
2014-05-23 11:20:37 -07:00
Joseph Myers b72592e75f Fix log10 (1) in round-downward mode (bug 16977).
As with various other issues of this kind, bug 16977 is log10 (1)
wrongly returning -0 rather than +0 in round-downward mode because of
an implementation effectively in terms of log1p (x - 1).  This patch
fixes the issue in the same way used for log.

Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
mips64 to confirm a fix was needed for ldbl-128 and to validate that
fix (also applied to ldbl-128ibm since that version of logl is
essentially the same as the ldbl-128 one).

	[BZ #16977]
	* sysdeps/i386/fpu/e_log10.S (__ieee754_log10): Take absolute
	value when x - 1 is zero.
	* sysdeps/i386/fpu/e_log10f.S (__ieee754_log10f): Likewise.
	* sysdeps/i386/fpu/e_log10l.S (__ieee754_log10l): Likewise.
	* sysdeps/ieee754/ldbl-128/e_log10l.c (__ieee754_log10l): Return
	0.0L for an argument of 1.0L.
	* sysdeps/ieee754/ldbl-128ibm/e_log10l.c (__ieee754_log10l):
	Likewise.
	* sysdeps/x86_64/fpu/e_log10l.S (__ieee754_log10l): Take absolute
	value when x - 1 is zero.
	* math/libm-test.inc (log10_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-05-23 12:07:50 +00:00
Rasmus Villemoes 2302d679ce manual: Update prototypes for alphasort and friends
The four functions {alpha,version}sort{,64} take parameters of type
const struct dirent{,64} **, not const void *.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
2014-05-23 11:26:06 +02:00
Adhemerval Zanella 32999d63fd PowerPC: Remove unneeded copysign[f] macros
This patch remove the unneeded copysign[f] macro from powerpc
math_private.h, since they are already covered in generic version.
2014-05-22 16:05:19 -05:00
Siddhesh Poyarekar f7bb179f77 Fix date in ChangeLog 2014-05-22 20:27:32 +05:30
Siddhesh Poyarekar 019324d0b7 Fix formatting 2014-05-22 20:26:19 +05:30
Konstantin Serebryany 34fff5c247 Remove nested functions: crypt/md5-crypt.c
This patch is the first in the series of patches that remove nested
functions from glibc.
Rationale: nested functions is a non-standard language feature;
removing nested functions
will allow to compile glibc with compilers other than GCC and thus
benefit from other compilers
and code analysis tools.
2014-05-22 20:26:19 +05:30
Adhemerval Zanella 3d2badacf1 PowerPC: Fix memchr ifunc hidden symbol for PPC32
This patch fixes a similar issue to
736c304a1a, where for PPC32 if the symbol
is defined as hidden (memchr) then compiler will create a local branc
(symbol@local) and the linker will not create a required PLT call to
make the ifunc work.  It changes the default hidden symbol (__GI_memchr)
to default memchr symbol for powerpc32 (__memchr_ppc32).
2014-05-22 07:53:44 -05:00
Roland McGrath df54acbb7b AArch64: Convert fork.c to arch-fork.h 2014-05-21 18:45:00 +01:00
Joseph Myers bb7d033799 Don't mention linuxthreads in Depend files.
I noticed that some of the Depend files, used to determine the
subdirectory build order in sysd-sorted, still mentioned linuxthreads,
although it hasn't been supported for many years.  This patch removes
those references.  In the case of nscd, it substitutes an nptl
reference, since I believe there is a fact a thread library dependence
there; the others already mentioned nptl.

Note that I am not at all confident in the completeness of these
Depend files.

Note also that references to linuxthreads remain in a comment in
sysdeps/unix/sysv/linux/ia64/Versions, and in manual/maint.texi,
manual/signal.texi and scripts/documented.sh.

Tested x86_64 that the installed shared libraries are unchanged by the
patch (as is sysd-sorted).

	* nscd/Depend (linuxthreads): Remove.
	(nptl): Add.
	* resolv/Depend (linuxthreads): Remove.
	* rt/Depend (linuxthreads): Remove.
2014-05-21 16:53:11 +00:00
Joseph Myers 4134b50d67 Consistently use $(elf-objpfx).
As previously noted
<https://sourceware.org/ml/libc-alpha/2013-05/msg00696.html>,
$(elf-objpfx) and $(elfobjdir) are redundant and should be
consolidated.  This patch consolidates on $(elf-objpfx) (for
consistency with $(csu-objpfx)), also changing direct uses of
$(common-objpfx)elf/ to use $(elf-objpfx).

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

	* Makeconfig [$(build-hardcoded-path-in-tests) = yes]
	(rtld-tests-LDFLAGS): Use $(elf-objpfx) instead of
	$(common-objpfx)elf/.
	(link-libc-before-gnulib): Likewise.
	(elfobjdir): Remove variable.
	* Makefile (install): Use $(elf-objpfx) instead of
	$(common-objpfx)elf/.
	* Makerules (link-libc-args): Use $(elf-objpfx) instead of
	$(elfobjdir)/.
	(link-libc-deps): Likewise.
	($(common-objpfx)libc.so): Likewise.
	($(common-objpfx)linkobj/libc.so): Likewise.
	[$(cross-compiling) = no] (symbolic-link-prog): Use $(elf-objpfx)
	instead of $(common-objpfx)elf/.
	(symbolic-link-list): Likewise.
	* iconvdata/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Likewise.
	* sysdeps/arm/Makefile (gnulib-arch): Use $(elf-objpfx) instead of
	$(elfobjdir)/.
	(static-gnulib-arch): Likewise.
	* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules)
	[$(cross-compiling) = no]: Use $(elf-objpfx) instead of
	$(common-objpfx)elf/.

localedata/ChangeLog:
	* Makefile (LOCALEDEF): Use $(elf-objpfx) instead of
	$(common-objpfx)elf/.
2014-05-21 16:52:08 +00:00
Richard Henderson a6b3657be6 aarch64: Merge __local_multiple_threads offset with memory reference
This also highlights that we'd been loading 64-bits instead of
the proper 32-bits.  Caught by the linker as a relocation error,
since the variable happened to be unaligned for 64-bits.
2014-05-21 11:36:51 -04:00
Richard Henderson 3612eb8f25 aarch64: Merge rtld_errno offset with memory reference 2014-05-21 11:36:03 -04:00
Joseph Myers 175cef4163 Fix ARM build with GCC trunk.
sysdeps/unix/sysv/linux/arm/unwind-resume.c and
sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
variables that are written in C code but only read from toplevel asms.
Current GCC trunk now optimizes away such apparently write-only static
variables, so causing a build failure.  This patch marks those
variables with __attribute_used__ to avoid that optimization.

Tested that this fixes the build for ARM.

	* sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
	(libgcc_s_resume): Use __attribute_used__.
	* sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
	Likewise.
2014-05-20 21:27:13 +00:00
Adhemerval Zanella 7c112a3812 Update powerpc-fpu ULPs. 2014-05-20 16:21:51 -05:00
Adhemerval Zanella e13bccd3de PowerPC: Fix copysignf optimization macro
This patch fixes the __copysignf optimized macro meant to internal libm
usage when used with constant value.  Without the explicit cast to
float, if it is used with const double value (for instance, on
s_casinhf.c) double constants will be used and it may lead to precision
issues in some algorithms.

It fixes the following failures on PPC64/POWER7:

Failure: Test: Real part of: cacos_downward (inf + 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_downward (inf - 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_downward (inf + 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_downward (inf - 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf + 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf - 0 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf + 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
Failure: Test: Real part of: cacos_towardzero (inf - 0.5 i)
Result:
 is:          1.19209289550781250000e-07   0x1.00000000000000000000p-23
 should be:   0.00000000000000000000e+00   0x0.00000000000000000000p+0
2014-05-20 16:07:49 -05:00
Aurelien Jarno 4406c41c1d Fix strtold on 32-bit sparc (and probably others) (BZ #16965)
This patch fixes an issue observed running the tst-strtod-round test on
32 bit sparc. In some conditions, strtold calls round_and_return, which in
turn calls __mpn_rshift with cnt = 0, while stdlib/rshift.c explicitly says
that cnts should satisfy 0 < CNT < BITS_PER_MP_LIMB. In this case, the code
end up doing a logical shift right of the same amount than the register,
which is undefined in the C standard.

Due to this bug, 32-bit sparc does not correctly convert the value
"0x1p-16446", but it is likely that other architectures are also
affected for other input values.
2014-05-20 18:44:28 +02:00
Aurelien Jarno ae75a883f2 fix nl_langinfo with static linking (BZ #16915)
For static linking the locale code avoids linking code and data for
unused categories. However for nl_langinfo we know only at runtime which
categories are used, so direct reference to every nl_current_CATEGORY
symbol should be done.

This was broken by commit bc3e1c1273 where
nl_langinfo_l and nl_langinfo have been merged and some code has been
lost in the process.

In order to detect locales issues with static linking, compile a version
of tst-langinfo with static linking.

Note: this is Debian bug#747103 reported by Raphael <raphael.astier@eliot-sa.com>
2014-05-20 18:43:14 +02:00
Richard Henderson de9d8f2098 alpha: fix sa_flags type (BZ 16967) 2014-05-20 07:17:27 -07:00
Richard Henderson 4c0a1e6392 alpha: Remove bits/siginfo.h (BZ 16966)
Using the default header instead.  This matches the kernel, which also
uses the generic header.  Fixes the sys/wait.h conform issue, where
si_band had the wrong type.
2014-05-20 07:17:24 -07:00
Richard Henderson 57cce7060a alpha: Define ELF_MACHINE_NO_RELA 2014-05-20 07:17:21 -07:00
Will Newton a60339aaff AArch64: Fix handling of nocancel syscall failures
The current code for nocancel syscalls does not do a comparison of
the system call return value. This leads to code being generated
where the b.cs follows the svc instruction directly without setting
the flags on which the branch depends.

ChangeLog:

2014-05-20  Will Newton  <will.newton@linaro.org>

	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
	Test the return value of the system call in the nocancel case.
2014-05-20 13:48:23 +01:00
Yvan Roux 7d05a8168b AArch64: Remove asm/ptrace.h inclusion in sys/user.h and sys/procfs.h
This patch fixes an issue observed by the Xen project, where including
signal.h exposes various PSR_MODE #defines.  This is due to the usage
in sys/user.h and sys/procfs.h of the struct user_pt_regs and
user_fpsimd_state included via asm/ptrace.h.  The namespace pollution
this inclusion introduce is already partially fixed with some #undef
of the PTRACE_* symbols, but other symbols like the PSR_MODE ones are
still present, and undefining them is not safe since a user can
include ptrace.h before user.h.

My proposition is to define the 2 structures we need in user.h and get
rid of the asm/ptrace.h inclusion.

Build and make check are clean on AArch64.

2014-05-20  Will Newton  <will.newton@linaro.org>
	    Yvan Roux  <yvan.roux@linaro.org>

	* sysdeps/unix/sysv/linux/aarch64/sys/user.h: Remove unused
	#include of asm/ptrace.h.
	(PTRACE_GET_THREAD_AREA): Remove #undef.
	(PTRACE_GETHBPREGS): Likewise.
	(PTRACE_SETHBPREGS): Likewise.
	(struct user_regs_struct): New structure.
	(struct user_fpsimd_struct): New structure.
	* sysdeps/unix/sysv/linux/aarch64/sys/procfs.h: Remove unused
	#include of asm/ptrace.h and second #include of sys/user.h.
	(PTRACE_GET_THREAD_AREA): Remove #undef.
	(PTRACE_GETHBPREGS): Likewise.
	(PTRACE_SETHBPREGS): Likewise.
	(ELF_NGREG): Use new struct user_regs_struct.
	(elf_fpregset_t): Use new struct user_fpsimd_struct.
2014-05-20 13:45:22 +01:00
Adhemerval Zanella af121e371d PowerPC: Fix multiarch hypotf PPC64 path
This patch moves the hypotf multiarch implementation to correct path.
2014-05-19 18:06:40 -05:00
Marcus Shawcroft 18f8524d2c Revert "ARM: Improve fenv implementation"
This reverts commit c0c08d02c8.
2014-05-19 09:08:59 +01:00
Jose E. Marchesi 834caf06f3 Fix sparc memcpy data corruption when using niagara2 optimized routines.
* sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S: Add missing
	membar to avoid block loads/stores to overlap previous stores.
2014-05-17 14:09:55 -07:00
Richard Henderson e184a918bb alpha: Create __syscall_nocancel entry points 2014-05-17 11:25:19 -07:00
Richard Henderson ab21431318 Merge remote-tracking branch 'origin/roland/nptl-alpha' 2014-05-17 11:20:44 -07:00
David S. Miller f56c7a6ac4 Fix some termios.h conformtest failures on sparc.
* sysdeps/unix/sysv/linux/sparc/bits/termios.h (PAGEOUT, WRAP):
	Protect with __USE_GNU.
	(TIOCSET_TEMPT): Likewise.
	(TIOCM_LE, TIOCM_DTR, TIOCM_RTS, TIOCM_ST, TIOCM_SR, TIOCM_CTS,
	TIOCM_CAR, TIOCM_RNG, TIOCM_DSR, TIOCM_CD, TIOCM_RI): Remove as
	these are already provided in bits/ioctl-types.h
2014-05-17 11:11:53 -07:00
Roland McGrath f75616b2b1 Fix __waitpid_nocancel link error. 2014-05-16 15:45:58 -07:00
Maciej W. Rozycki deb0f7f6a8 ARM: soft-fp NaN representation correction
Commit 7d92b78723 [Fix ARM NAN fraction
bits.] removed all the bits set from NANFRAC macros and, when propagated
to libgcc, regressed gcc.dg/torture/builtin-math-7.c on soft-fp arm-eabi
targets, currently ARMv6-M (`-march=armv6-m -mthumb') only.  This is
because when used to construct a NaN in the semi-raw mode, they now
build an infinity instead.  Consequently operations such as (Inf - Inf)
now produce Inf rather than NaN.  The change worked for the original
test case, posted with PR libgcc/60166, because division is made in the
canonical mode, where the quiet bit is set separately, from the fp
class.

This change brings the quiet bit back to these macros, making semi-raw
mode calculations produce the expected results again.
2014-05-16 23:10:29 +01:00
Joseph Myers 79520f4bd6 Use existing makefile variables for dependencies on glibc libraries.
glibc's Makeconfig defines some variables such as $(libm) and $(libdl)
for linking with libraries built by glibc, and nptl/Makeconfig
(included by the toplevel Makeconfig) defines others such as
$(shared-thread-library).

In some places glibc's Makefiles use those variables when linking
against the relevant libraries, but in other places they hardcode the
location of the libraries in the build tree.  This patch cleans up
various places to use the variables that already exist (in the case of
libm, replacing several duplicate definitions of a $(link-libm)
variable in subdirectory Makefiles).  (It's not necessarily exactly
equivalent to what the existing code does - in particular,
$(shared-thread-library) includes libpthread_nonshared, but is
replacing places that just referred to libpthread.so.  But I think
that change is desirable on the general principle of linking things as
close as possible to the way in which they would be linked with an
installed library, unless there is a clear reason not to do so.)

To support running tests with an installed copy of glibc without
needing the full build tree from when that copy was built, I think it
will be useful to use such variables more generally and systematically
- every time the rules for building a test refer to some file from the
build tree that's also installed by glibc, use a makefile variable so
that the installed-testing case can point those variables to installed
copies of the files.  This patch just deals with straightforward cases
where such variables already exist.

It's quite possible some uses of $(shared-thread-library) should
actually be a new $(thread-library) variable that's set appropriately
in the --disable-shared case, if those uses would in fact work without
shared libraries.  I didn't change the status quo that those cases
hardcode use of a shared library whether or not it's actually needed
(but other uses such as $(libm) and $(libdl) would now get the static
library if the shared library isn't built, when some previously
hardcoded use of the shared library - if they actually need shared
libraries, the test itself needs an enable-shared conditional anyway).

Tested x86_64.

	* benchtests/Makefile
	($(addprefix $(objpfx)bench-,$(bench-math))): Depend on $(libm),
	not $(common-objpfx)math/libm.so.
	($(addprefix $(objpfx)bench-,$(bench-pthread))): Depend on
	$(shared-thread-library), not $(common-objpfx)nptl/libpthread.so.
	* elf/Makefile ($(objpfx)noload): Depend on $(libdl), not
	$(common-objpfx)dlfcn/libdl.so.
	($(objpfx)tst-audit8): Depend on $(libm), not
	$(common-objpfx)math/libm.so.
	* malloc/Makefile ($(objpfx)libmemusage.so): Depend on $(libdl),
	not $(common-objpfx)dlfcn/libdl.so.
	* math/Makefile
	($(addprefix $(objpfx),$(filter-out $(tests-static),$(tests)))):
	Depend on $(libm), not $(objpfx)libm.so.  Do not condition on
	[$(build-shared) = yes].
	($(objpfx)test-fenv-tls): Depend on $(shared-thread-library), not
	$(common-objpfx)nptl/libpthread.so.
	* misc/Makefile ($(objpfx)tst-tsearch): Depend on $(libm), not
	$(common-objpfx)math/libm.so$(libm.so-version) or
	$(common-objpfx)math/libm.a depending on [$(build-shared) = yes].
	* nptl/Makefile ($(objpfx)tst-unload): Depend on $(libdl), not
	$(common-objpfx)dlfcn/libdl.so.
	* setjmp/Makefile (link-libm): Remove variable.
	($(objpfx)tst-setjmp-fp): Depend on $(libm), not $(link-libm).
	* stdio-common/Makefile (link-libm): Remove variable.
	($(objpfx)tst-printf-round): Depend on $(libm), not $(link-libm).
	* stdlib/Makefile (link-libm): Remove variable.
	($(objpfx)bug-getcontext): Depend on $(libm), not $(link-libm).
	($(objpfx)tst-strtod-round): Likewise.
	($(objpfx)tst-tininess): Likewise.
	($(objpfx)tst-strtod-underflow): Likewise.
	($(objpfx)tst-strtod6): Likewise.
	($(objpfx)tst-tls-atexit): Depend on $(shared-thread-library) and
	$(libdl), not $(common-objpfx)nptl/libpthread.so and
	$(common-objpfx)dlfcn/libdl.so.
2014-05-16 21:38:08 +00:00
Adhemerval Zanella 026b0fe4e7 PowerPC: clean BSD Terminal Modes expectation in termios.h
This patch guard the BSD definition for terminal modes in PowerPC
specific header fixing the following conformance failures:

FAIL: conform/POSIX/termios.h/conform
FAIL: conform/POSIX2008/termios.h/conform
FAIL: conform/UNIX98/termios.h/conform
2014-05-16 15:54:30 -05:00
Roland McGrath 3edeca8684 Alpha: Convert fork.c to arch-fork.h 2014-05-16 13:03:08 -07:00
Roland McGrath fe39b021f4 ARM: Convert fork.c to arch-fork.h 2014-05-16 12:51:39 -07:00
Roland McGrath 1d1fc46ed1 Add stub arch-fork.h header. 2014-05-16 11:47:13 -07:00
Roland McGrath def4bcb29d Split arch-fork.h from fork.h 2014-05-16 11:17:41 -07:00
Allan McRae d51d659d11 Update Swedish translations 2014-05-16 14:21:12 +10:00
Allan McRae c72399fbc5 Fix variable used in sed expression in timezone/Makefile 2014-05-16 13:58:31 +10:00
Aurelien Jarno d16e6ec7ca SPARC: add prlimit and prlimit64 in <bits/resource.h> (BZ #16943)
prlimit and prlimit64 have been added in the main <bits/resource.h>, but
not in the SPARC specific version. Fix that.

Note: this is Debian bug#703559, reported by Emilio Pozuelo Monfort
<pochu@debian.org>
2014-05-16 00:07:32 +02:00
Aurelien Jarno d0583c4039 ptsname_r: don't leak uninitialized memory (BZ #16917)
If the fd refers to a terminal device, but not a pty master, the
TIOCGPTN ioctl returns with ENOTTY. This error is not caught, and the
possibly undefined buffer passed to ptsname_r is sent directly to the
stat64 syscall.

Fix this by using a fallback to the old method only if the TIOCGPTN
ioctl fails with EINVAL. This also fix the return value in that specific
case (it return ENOENT without this patch).

Also add tests to the ptsname_r function (and ptsname at the same time).

Note: this is Debian bug#741482, reported by Jakub Wilk <jwilk@debian.org>
2014-05-16 00:07:29 +02:00
Wilco c0c08d02c8 ARM: Improve fenv implementation 2014-05-15 15:23:27 +01:00
Wilco 1a2f40e5d1 ARM: Improve fenv implementation 2014-05-15 15:23:27 +01:00
Siddhesh Poyarekar cf26a0cb6a Return EAI_AGAIN for AF_UNSPEC when herrno is TRY_AGAIN (BZ #16849)
getaddrinfo correctly returns EAI_AGAIN for AF_INET and AF_INET6
queries.  For AF_UNSPEC however, an older change
(a682a1bf55) broke the check and due to
that the returned error was EAI_NONAME.

This patch fixes the check so that a non-authoritative not-found is
returned as EAI_AGAIN to the user instead of EAI_NONAME.
2014-05-15 12:33:11 +05:30
Roland McGrath a5d87b3db4 x86: Move abilist files out of nptl/ subdirectories. 2014-05-14 15:45:23 -07:00
Roland McGrath 039890a678 Move remaining files out of nptl/sysdeps/unix/sysv/linux/x86/. 2014-05-14 15:32:18 -07:00
Roland McGrath 65c89320e2 Fix mips fork after i386 reorganization. 2014-05-14 14:00:23 -07:00
Roland McGrath 348f8e8c26 Move remaining nptl/sysdeps/unix/sysv/linux/i386/ files. 2014-05-14 13:37:40 -07:00
Roland McGrath 5085af05bd Fix powerpc fork after i386 reorganization. 2014-05-14 13:28:40 -07:00
Roland McGrath 5aa618fb5b Update alpha and ia64 timer_*.c files for x86_64 file moves. 2014-05-14 13:26:25 -07:00
Roland McGrath 708f08135d i386: Remove useless pthread_spin_{init,unlock} wrapper files. 2014-05-14 12:57:21 -07:00
Roland McGrath c96067bce5 Move remaining nptl/sysdeps/unix/sysv/linux/x86_64/ files. 2014-05-14 12:33:43 -07:00
Roland McGrath ec136444ca x86: Consolidate NPTL fork. 2014-05-14 11:31:37 -07:00
Roland McGrath 2fbdf5339a Consolidate not-cancel.h files. 2014-05-14 11:06:36 -07:00
Roland McGrath 4ef6befaf5 Update s390 timer_*.c files for x86_64 file moves. 2014-05-14 10:57:40 -07:00
Roland McGrath 4c68138bc4 x86_64: Remove useless pthread_spin_{init,unlock} wrapper files. 2014-05-14 10:53:52 -07:00
Roland McGrath 4eaae76517 Move x86_64 compat-timer.h out of nptl/ 2014-05-14 10:43:54 -07:00
Roland McGrath 3a51fb6047 Move x86_64 timer_*.c out of nptl/ 2014-05-14 10:35:39 -07:00
Roland McGrath 941d7dfd24 x86: Consolidate NPTL/non versions of clone 2014-05-14 10:16:27 -07:00
Roland McGrath 1b731c35e6 Move NPTL public ABI headers for x86 to sysdeps/x86/nptl/. 2014-05-14 09:44:56 -07:00
Roland McGrath e27871374e x86: Consolidate NPTL/non versions of vfork 2014-05-14 09:44:39 -07:00
Roland McGrath 5675da1e84 ARM: Consolidate NPTL/non versions of vfork 2014-05-14 09:44:24 -07:00
Will Newton 4f02e2b8f9 stdlib/gmp-impl.h: Silence -Wundef warning for USE_STACK_ALLOC
The upstream version of GMP has long removed this conditional
altogether in this commit:

changeset:   5254:88618a4694ac
user:        Kevin Ryde <user42@zip.com.au>
date:        Sun Jun 17 01:37:27 2001 +0200

So just turn the #if into an #ifdef to silence the warning.

ChangeLog:

2014-05-14  Will Newton  <will.newton@linaro.org>

	* stdlib/gmp-impl.h: Test USE_STACK_ALLOC #ifdef
	rather than #if.
2014-05-14 14:11:48 +01:00
Joseph Myers 1a84c3d6d4 Fix log1pl (LDBL_MAX) in FE_UPWARD mode (bug 16564).
Bug 16564 is spurious overflow of log1pl (LDBL_MAX) in FE_UPWARD mode,
resulting from log1pl adding 1 to its argument (for arguments not
close to 0), which overflows in that mode.  This patch fixes this by
avoiding adding 1 to large arguments (precisely what counts as large
depends on the floating-point format).

Tested x86_64 and x86, and spot-checked log1pl tests on mips64 and
powerpc64.

	[BZ #16564]
	* sysdeps/i386/fpu/s_log1pl.S (__log1pl): Do not add 1 to positive
	arguments with exponent 65 or above.
	* sysdeps/ieee754/ldbl-128/s_log1pl.c (__log1pl): Do not add 1 to
	arguments 0x1p113L or above.
	* sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Do not add 1
	to arguments 0x1p107L or above.
	* sysdeps/x86_64/fpu/s_log1pl.S (__log1pl): Do not add 1 to
	positive arguments with exponent 65 or above.
	* math/auto-libm-test-in: Add more tests of log1p.
	* math/auto-libm-test-out: Regenerated.
2014-05-14 12:38:56 +00:00
Joseph Myers 01dbacd22a Fix cacos (+Inf + finite*i) in round-downward mode (bug 16928).
According to C99/C11 Annex G, cacos applied to a value with real part
+Inf and finite imaginary part should produce a result with real part
+0.  glibc wrongly produces a result with real part -0 in FE_DOWNWARD
mode.  This patch fixes this by checking for zero results in the
relevant case of non-finite arguments (where there should never be a
result with -0 real part), and converts the tests of cacos to
ALL_RM_TEST.

Tested x86_64 and x86 and ulps updated accordingly.

	[BZ #16928]
	* math/s_cacos.c (__cacos): Ensure zero real part of result from
	non-finite arguments is +0.
	* math/s_cacosf.c (__cacosf): Likewise.
	* math/s_cacosl.c (__cacosl): Likewise.
	* math/libm-test.inc (cacos_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-05-14 12:37:24 +00:00
Joseph Myers 913d03c864 Fix acosh (1) in round-downward mode (bug 16927).
According to C99 and C11 Annex F, acosh (1) should be +0 in all
rounding modes.  However, some implementations in glibc wrongly return
-0 in round-downward mode (which is what you get if you end up
computing log1p (-0), via 1 - 1 being -0 in round-downward mode).
This patch fixes the problem implementations, by correcting the test
for an exact 1 value in the ldbl-96 implementation to allow for the
explicit high bit of the mantissa, and by inserting fabs instructions
in the i386 implementations; tests of acosh are duly converted to
ALL_RM_TEST.  I believe all the other sysdeps/ieee754 implementations
are already OK (I haven't checked the ia64 versions, but if buggy then
that will be obvious from the results of test runs after this patch is
in).

Tested x86_64 and x86 and ulps updated accordingly.

	[BZ #16927]
	* sysdeps/i386/fpu/e_acosh.S (__ieee754_acosh): Use fabs on x-1
	value.
	* sysdeps/i386/fpu/e_acoshf.S (__ieee754_acoshf): Likewise.
	* sysdeps/i386/fpu/e_acoshl.S (__ieee754_acoshl): Likewise.
	* sysdeps/ieee754/ldbl-96/e_acoshl.c (__ieee754_acoshl): Correct
	for explicit high bit of mantissa when testing for argument equal
	to 1.
	* math/libm-test.inc (acosh_test): Use ALL_RM_TEST.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-05-14 12:35:40 +00:00
Joseph Myers 0bf061d3e3 Fix erf underflow handling near 0 (bug 16516).
Bug 16516 reports spurious underflows from erf (for all floating-point
types), when the result is close to underflowing but does not actually
underflow.

erf (x) is about (2/sqrt(pi))*x for x close to 0, so there are
subnormal arguments for which it does not underflow.  The various
implementations do (x + efx*x) (for efx = 2/sqrt(pi) - 1), for greater
accuracy than if just using a single multiplication by an
approximation to 2/sqrt(pi) (effectively, this way there are a few
more bits in the approximation to 2/sqrt(pi)).  This can introduce
underflows when efx*x underflows even though the final result does
not, so a scaled calculation with 8*efx is done in these cases - but 8
is not a big enough scale factor to avoid all such underflows.  16 is
(any underflows with a scale factor of 16 would only occur when the
final result underflows), so this patch changes the code to use that
factor.  Rather than recomputing all the values of the efx8 variable,
it is removed, leaving it to the compiler's constant folding to
compute 16*efx.  As such scaling can also lose underflows when the
final scaling down happens to be exact, appropriate checks are added
to ensure underflow exceptions occur when required in such cases.

Tested x86_64 and x86; no ulps updates needed.  Also spot-checked for
powerpc32 and mips64 to verify the changes to the ldbl-128ibm and
ldbl-128 implementations.

	[BZ #16516]
	* sysdeps/ieee754/dbl-64/s_erf.c (efx8): Remove variable.
	(__erf): Scale by 16 instead of 8 in potentially underflowing
	case.  Ensure exception if result actually underflows.
	* sysdeps/ieee754/flt-32/s_erff.c (efx8): Remove variable.
	(__erff): Scale by 16 instead of 8 in potentially underflowing
	case.  Ensure exception if result actually underflows.
	* sysdeps/ieee754/ldbl-128/s_erfl.c: Include <float.h>.
	(efx8): Remove variable.
	(__erfl): Scale by 16 instead of 8 in potentially underflowing
	case.  Ensure exception if result actually underflows.
	* sysdeps/ieee754/ldbl-128ibm/s_erfl.c: Include <float.h>.
	(efx8): Remove variable.
	(__erfl): Scale by 16 instead of 8 in potentially underflowing
	case.  Ensure exception if result actually underflows.
	* sysdeps/ieee754/ldbl-96/s_erfl.c: Include <float.h>.
	(efx8): Remove variable.
	(__erfl): Scale by 16 instead of 8 in potentially underflowing
	case.  Ensure exception if result actually underflows.
	* math/auto-libm-test-in: Add more tests of erf.
	* math/auto-libm-test-out: Regenerated.
2014-05-14 12:34:03 +00:00
Andreas Schwab 3d8c8bff79 Remove last use of USE___THREAD 2014-05-14 09:49:00 +02:00
Andreas Schwab 73ba67cbc3 Fix macro warning on HAVE_PT_CHOWN 2014-05-14 09:46:54 +02:00
Joseph Myers 5e7698c6f1 Reduce kernel-features.h duplication.
This patch reduces duplication between different architectures'
kernel-features.h files by making the architecture-independent file
define various macros unconditionally (instead of only for a
particular list of architectures), with the architecture-specific
files then undefining the macros if necessary.

Specifically, __ASSUME_O_CLOEXEC (O_CLOEXEC flag to open) and
__ASSUME_SOCK_CLOEXEC (SOCK_NONBLOCK and SOCK_CLOEXEC flags to socket)
are supported on all architectures as of 2.6.32 or the minimum kernel
version for the architecture if later.  For __ASSUME_IN_NONBLOCK,
__ASSUME_PIPE2, __ASSUME_EVENTFD2, __ASSUME_SIGNALFD4 and
__ASSUME_DUP3, the relevant syscalls were added for alpha in 2.6.33
but otherwise the features are available as of 2.6.32.  For
__ASSUME_UTIMES, support is everywhere in 2.6.32 except for
asm-generic architectures and hppa.

Although those were the main cases of duplication among
kernel-features.h files, some other cases of unnecessary definitions
were also cleaned up: the hppa file defined various macros that were
either no longer used at all, or defined by the main file by default
anyway, the ia64 file had duplicative definitions of __ASSUME_PSELECT
and __ASSUME_PPOLL, while mips had such a definition of
__ASSUME_IPC64.

Really, rather than being defined in the main file then undefined for
asm-generic architectures, __ASSUME_UTIMES should become an
hppa-specific macro.  Given that __ASSUME_ATFCTS and
__ASSUME_UTIMENSAT are now always true, the only live __ASSUME_UTIMES
conditional is in sysdeps/unix/sysv/linux/utimes.c, which is not used
for asm-generic architectures.  I think the desired state would be an
hppa-specific file (that includes sysdeps/unix/sysv/linux/utimes.c if
__ASSUME_UTIMES, and otherwise has fallback code), with the fallback
code being removed from the main utimes.c.  But I think that's most
reasonably a separate cleanup once __ASSUME_ATFCTS and
__ASSUME_UTIMESAT have both had conditional code cleaned up.

Given this patch, I think it's straightforward to move non-ex-ports
architectures to having their own kernel-features.h files, like
ex-ports architectures, rather than conditionals in the main file
(i.e., such a move won't require the architecture-specific file to
contain anything that isn't genuinely architecture-specific), and
would encourage architecture maintainers to do so.

Tested x86_64 that the installed shared libraries are unchanged by
this patch.  Note that on some architectures this *will* cause
__ASSUME_* macros to be defined in cases where they weren't previously
but should have been (but this is just optimization, not a fix to a
user-visible bug, so doesn't need a bug report in Bugzilla).

	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_UTIMES):
	Define unconditionally.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/kernel-features.h
	(__ASSUME_DUP3): Do not define.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_UTIMES): Undefine.
	* sysdeps/unix/sysv/linux/alpha/kernel-features.h
	(__ASSUME_UTIMES): Do not define.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Undefine if [__LINUX_KERNEL_VERSION <
	0x020621] instead of defining if [__LINUX_KERNEL_VERSION >=
	0x020621].
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_DUP3): Undefine.
	* sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_UTIMES):
	Do not define.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	* sysdeps/unix/sysv/linux/hppa/kernel-features.h
	(__ASSUME_32BITUIDS): Likewise.
	(__ASSUME_TRUNCATE64_SYSCALL): Likewise.
	(__ASSUME_IPC64): Likewise.
	(__ASSUME_ST_INO_64_BIT): Likewise.
	(__ASSUME_GETDENTS64_SYSCALL): Likewise.
	[__LINUX_KERNEL_VERSION < 0x030e00] (__ASSUME_UTIMES): Undefine.
	* sysdeps/unix/sysv/linux/ia64/kernel-features.h
	(__ASSUME_UTIMES): Do not define.
	(__ASSUME_PSELECT): Likewise.
	(__ASSUME_PPOLL): Likewise.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	* sysdeps/unix/sysv/linux/m68k/kernel-features.h
	(__ASSUME_UTIMES): Likewise.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
	(__ASSUME_UTIMES): Likewise.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_IPC64):
	Likewise.
	(__ASSUME_UTIMES): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	* sysdeps/unix/sysv/linux/tile/kernel-features.h
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	(__ASSUME_UTIMES): Undefine.
2014-05-14 00:45:19 +00:00
Joseph Myers 5c521ecdda Clean up ARM old-ABI symbol versioning relics.
This patch cleans up some symbol versioning code in the ARM port that
exists only as relics of the old-ABI port, which was removed some time
ago.

The minimum symbol version in the ARM port is GLIBC_2.4 (the version
where the EABI port was introduced).  Thus, any SHLIB_COMPAT
conditionals where the later version is 2.4 or later are obsolete and
can be removed.  In addition, there is no need to set symbol versions
before 2.4 explicitly if the symbols would have a version of 2.4 by
default anyway.  This includes most of the entries in
sysdeps/unix/sysv/linux/arm/Versions: those for GLIBC_2.0 are for
libgcc unwind functions that aren't actually in ARM EABI glibc at all,
while those for GLIBC_2.2 and GLIBC_2.3.3 are for functions which for
the old-ABI port may have had versions different from the
architecture-independent default, but where for EABI the default
suffices (both the default and the version in that file map to 2.4, so
the entries in that file do nothing).  The GLIBC_2.1 entries are
needed (architecture-specific functions), but it seems less confusing
for those to say GLIBC_2.4, as the actual version those symbols in
fact have.

Various cases in the <fenv.h> functions where a function is defined as
__fe* with an fe* versioned alias are cleaned up just to define fe*
directly, as done e.g. on AArch64.  If in future we actually need an
__fe* name for use from C90 functions in libm as discussed recently,
of course we can add one on all architectures and make the fe* name
into a weak alias for that particular function, but for now the __fe*
names aren't needed.

In the case of posix_fadvise64, the __posix_fadvise64_l64 name and
posix_fadvise64 alias are kept as __posix_fadvise64_l64 is used in
posix_fadvise.  (For that to be a namespace-clean use, posix_fadvise64
needs to be a *weak* alias not a strong one as at present, but that's
an independent preexisting bug.)

(There remain references to GLIBC_2_2 in
sysdeps/unix/sysv/linux/arm/{msgctl.c,semctl.c,shmctl.c}.  As those
files are used by alpha which has a genuine 2.2 version for those
functions, I think those references need to stay as-is.)

Tested that the disassembly of installed shared libraries is unchanged
by this patch (though function names shown in disassembly change to no
longer have @@GLIBC_2.4, now those functions get versioned only by the
version map and not redundantly at assembler time) and that the ABI
tests pass.

	* sysdeps/arm/fclrexcpt.c (__feclearexcept): Rename to
	feclearexcept.  Remove symbol versioning code.
	* sysdeps/arm/fegetenv.c (__fegetenv): Rename to fegetenv.  Remove
	symbol versioning code.
	* sysdeps/arm/fesetenv.c (__fesetenv): Rename to fesetenv.  Remove
	symbol versioning code.
	* sysdeps/arm/feupdateenv.c (__feupdateenv): Rename to
	feupdateenv.  Remove symbol versioning code.
	* sysdeps/arm/fgetexcptflg.c (__fegetexceptflag): Rename to
	fegetexceptflag.  Remove symbol versioning code.
	* sysdeps/arm/fsetexcptflg.c (__fesetexceptflag): Rename to
	fesetexceptflag.  Remove symbol versioning code.
	* sysdeps/unix/sysv/linux/arm/Versions (libc): Remove GLIBC_2.0,
	GLIBC_2.2 and GLIBC_2.3.3 entries.  Change GLIBC_2.1 to GLIBC_2.4.
	* sysdeps/unix/sysv/linux/arm/posix_fadvise64.c
	(__posix_fadvise64_l32): Remove prototype.
	[SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)]: Remove conditional
	code.
2014-05-14 00:41:20 +00:00
Roland McGrath 5da9dfad43 Move NPTL public ABI headers for ARM to sysdeps/arm/nptl/. 2014-05-13 11:33:49 -07:00
Ondřej Bílka d1974695f6 fix changelog. 2014-05-13 19:40:15 +02:00
Sami Kerola 893b4f3756 tzselect: use zonedir instead of current working directory 2014-05-13 19:38:32 +02:00
Roland McGrath 58aa195d32 Verbatim NPTL file moves for ARM/Linux. 2014-05-13 10:04:20 -07:00
Roland McGrath 8c6d01f0b1 Consolidate NPTL configury for ARM/Linux. 2014-05-13 10:04:05 -07:00
Roland McGrath bba6da4e1b Consolidate NPTL vs non clone.S for ARM. 2014-05-13 10:03:45 -07:00
Roland McGrath e0db65176f Clean up __exit_thread. 2014-05-13 09:49:20 -07:00
Andreas Schwab 01eb16fdb6 Fix typo in assertion 2014-05-13 17:16:02 +02:00
Joseph Myers 637461d965 Clean up kernel version conditionals for pre-2.6.32 kernels.
This patch does some initial cleanup, following the move to 2.6.32
minimum kernel version, by removing __LINUX_KERNEL_VERSION
conditionals that are now always-true or always-false.  In the case of
__ASSUME_ARG_MAX_STACK_BASED, where the conditional used a kernel
version that was itself in a macro, the associated sysconf.c code is
also cleaned up and __ASSUME_ARG_MAX_STACK_BASED removed completely.

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

	* sysdeps/unix/sysv/linux/kernel-features.h [__s390__]
	(__ASSUME_UTIMES): Do not condition on kernel version.
	(__ASSUME_PSELECT): Define unconditionally.
	(__ASSUME_PPOLL): Likewise.
	(__ASSUME_ATFCTS): Likewise.
	(__ASSUME_SET_ROBUST_LIST): Do not condition on kernel version.
	(__ASSUME_COMPLETE_READV_WRITEV): Define unconditionally.
	(__ASSUME_FUTEX_LOCK_PI): Do not condition on kernel version.
	(__ASSUME_UTIMENSAT): Define unconditionally.
	(__ASSUME_PRIVATE_FUTEX): Likewise.
	(__ASSUME_FALLOCATE): Likewise.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL): Remove.
	(__ASSUME_ARG_MAX_STACK_BASED): Likewise.
	(__ASSUME_ADJ_OFFSET_SS_READ): Define unconditionally.
	(__ASSUME_SOCK_CLOEXEC): Do not condition on kernel version.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	[__x86_64__ || __sparc__] (__ASSUME_ACCEPT4_SYSCALL): Likewise.
	(__ASSUME_FUTEX_CLOCK_REALTIME): Define unconditionally.
	(__ASSUME_AT_RANDOM): Likewise.
	(__ASSUME_PREADV): Likewise.
	(__ASSUME_PWRITEV): Likewise.
	(__ASSUME_REQUEUE_PI): Do not condition on kernel version.
	(__ASSUME_F_GETOWN_EX): Define unconditionally.
	(__ASSUME_XFS_RESTRICTED_CHOWN): Likewise.
	* sysdeps/unix/sysv/linux/sysconf.c (__sysconf)
	[!__ASSUME_ARG_MAX_STACK_BASED]: Remove conditional code.
	* sysdeps/unix/sysv/linux/alpha/kernel-features.h
	(__ASSUME_O_CLOEXEC): Define unconditionally.
	(__ASSUME_PSELECT): Do not undefine conditionally.
	(__ASSUME_PPOLL): Likewise.
	(__ASSUME_ATFCTS): Likewise.
	(__ASSUME_SET_ROBUST_LIST): Likewise.
	(__ASSUME_UTIMENSAT): Likewise.
	(__ASSUME_FDATASYNC): Define unconditionally.
	* sysdeps/unix/sysv/linux/arm/kernel-features.h
	(__ASSUME_SIGFRAME_V2): Likewise.
	)__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_PSELECT): Do not undefine conditionally.
	(__ASSUME_PPOLL): Likewise.
	* sysdeps/unix/sysv/linux/ia64/kernel-features.h
	(__ASSUME_PSELECT): Define unconditionally.
	(__ASSUME_PPOLL): Likewise.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	* sysdeps/unix/sysv/linux/m68k/kernel-features.h
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel-features.h
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_ACCEPT4_SYSCALL): Likewise.
2014-05-12 22:48:25 +00:00
Andreas Schwab 315eb1d86a Fix unbound stack use in NIS NSS module 2014-05-12 15:17:51 +02:00
Will Newton 91df99f7f2 malloc: Add mallopt test.
ChangeLog:

2014-05-12  Will Newton  <will.newton@linaro.org>

	* malloc/Makefile (tests): Add tst-mallopt.
	* malloc/tst-mallopt.c: New file.
2014-05-12 12:48:41 +01:00
Roland McGrath 0a982a2905 Make armv7 strcmp assembly compatible with ARM mode and SFI. 2014-05-09 13:22:00 -07:00
Adhemerval Zanella 0ded08a566 Fix elf/tst-tls9-static build
This patch fixes the tst-tlsmod[5/6].so build in system that uses
-Wl,--as-needed as default in linker option.  Without this option
the testing shared library that does not have libc.so in DT_NEEDED
and the tst-tls9-static fails in architecture that use the
./sysdeps/unix/sysv/linux/<arch>/dl-static.c trick.
2014-05-09 15:35:28 -03:00
Roland McGrath 55d4d550c8 Silence a missing-noreturn warning for _Unwind_Resume. 2014-05-09 10:06:20 -07:00
Joseph Myers 77d08acaad Include SSE state in i386 fenv_t (bug 16064).
This patch fixes bug 16064, i386 fenv_t not including SSE state, using
the technique suggested there of storing the state in the existing
__eip field of fenv_t to avoid needing to increase the size of fenv_t
and add new symbol versions.  The included testcase, which previously
failed for i386 (but passed for x86_64), illustrates how the previous
state was buggy.

This patch causes the SSE state to be included *to the extent it is on
x86_64*.  Where some state should logically be included but isn't for
x86_64 (see bug 16068), this patch does not cause it to be included
for i386 either.  The idea is that any patch fixing that bug should
fix it for both x86_64 and i386 at once.

Tested i386 and x86_64.  (I haven't tested the case of a CPU without
SSE2 disabling the test.)

	[BZ #16064]
	* sysdeps/i386/fpu/fegetenv.c: Include <unistd.h>, <ldsodefs.h>
	and <dl-procinfo.h>.
	(__fegetenv): Save SSE state in envp->__eip if supported.
	* sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Save SSE state in
	envp->__eip if supported.
	* sysdeps/i386/fpu/fesetenv.c: Include <unistd.h>, <ldsodefs.h>
	and <dl-procinfo.h>.
	(__fesetenv): Always set __eip, __cs_selector, __opcode,
	__data_offset and __data_selector in environment to 0.  Set SSE
	state if supported.
	* sysdeps/x86/fpu/Makefile [$(subdir) = math] (tests): Add
	test-fenv-sse.
	[$(subdir) = math] (CFLAGS-test-fenv-sse.c): Add -msse2
	-mfpmath=sse.
	* sysdeps/x86/fpu/test-fenv-sse.c: New file.
2014-05-09 16:59:56 +00:00
Will Newton 28162f4dac ARM: Allow auto-detection of linker relro feature
Set values for libc_commonpagesize and libc_relro_required for the
ARM port to enable relro by default and suppress a warning at
configure time.

ChangeLog:

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

	* sysdeps/arm/preconfigure.ac: Set libc_commonpagesize
	and libc_relro_required for ARM.
	* sysdeps/arm/preconfigure: Regenerate.
2014-05-09 16:57:12 +01:00
Dominik Vogt 5a414ff70c S/390: Port of lock elision to System/z
Added support for TX lock elision of pthread mutexes on s390 and
s390x.  This may improve lock scaling of existing programs on TX
capable systems.  The lock elision code is only built with
--enable-lock-elision=yes and then requires a GCC version supporting
the TX builtins.  With lock elision default mutexes are elided via
__builtin_tbegin, if the cpu supports transactions. By default lock
elision is not enabled and the elision code is not built.
2014-05-09 16:58:46 +02:00
Will Newton f63c86fed0 ARM: Add optimized ARMv7 strcmp implementation
Add an optimized implementation of strcmp for ARMv7-A cores. This
implementation is significantly faster than the current generic C
implementation, particularly for strings of 16 bytes and longer.

Tested with the glibc string tests for arm-linux-gnueabihf and
armeb-linux-gnueabihf.

The code was written by ARM, who have agreed to assign the copyright
to the FSF for integration into glibc.

ChangeLog:

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

	* sysdeps/arm/armv7/strcmp.S: New file.
	* NEWS: Mention addition of ARMv7 optimized strcmp.
2014-05-09 10:01:28 +01:00
Roland McGrath 95afbbe5fc Some configure-related decrufting. 2014-05-08 11:27:14 -07:00
Roland McGrath 7a1a51b513 Fix -Wundef for _UTSNAME_DOMAIN_LENGTH. 2014-05-08 10:47:35 -07:00
Steve Ellcey 5057ad3b50 2014-05-07 Steve Ellcey <sellcey@mips.com>
[BZ# 16922]
	* sysdeps/mips/sys/asm.h (INT_SUB): Fix definition.
	(LONG_SUB): Ditto.
	(PTR_SUB): Ditto.
2014-05-07 13:10:48 -07:00
Andreas Schwab 8dc9751764 Fix parsing of getai result from nscd for IPv6-only request 2014-05-07 14:21:27 +02:00
Ondřej Bílka a11892631d Fix typo in nscd/selinux.c 2014-05-07 14:09:24 +02:00
Ondřej Bílka ce0c5b8f36 Fix typo in nptl/sockperf.c 2014-05-07 14:00:01 +02:00
Roland McGrath 0f58d25277 Move ARM internal unwind.h header to the right sysdeps directory. 2014-05-06 15:55:20 -07:00
Aurelien Jarno 83df9ad0cc SPARC: add EFD_SEMAPHORE in <bits/eventfd.h> (BZ #16916)
EFD_SEMAPHORE has been added in the main <bits/eventfd.h>, but not in
the SPARC specific version. Fix that.
2014-05-07 00:00:56 +02:00
Vidya Ranganathan f360f94a05 PowerPC: strncpy/stpncpy optimization for PPC64/POWER7
The optimization is achieved by following techniques:
  > data alignment [gain from aligned memory access on read/write]
  > POWER7 gains performance with loop unrolling/unwinding
    [gain by reduction of branch penalty].
  > zero padding done by calling optimized memset
2014-05-06 09:54:25 -05:00
Andreas Schwab 978a41c357 Don't use catomic functions in mcount (BZ #16912)
mcount cannot use catomic functions since it is called by
__libc_start_main before TLS is set up.  This reverts the change made by
commit 8099361.
2014-05-06 16:30:48 +02:00
Roland McGrath fe6588457a Move rules for Linux-specific pldd program to Linux-specific Makefile. 2014-05-05 13:16:08 -07:00
Roland McGrath eb1ed03daf Fix -Wundef issues in generated errlist.c. 2014-05-05 13:06:18 -07:00
Adhemerval Zanella 19c4bec0f4 PowerPC: ifunc improvement for internal calls
This patch changes de default symbol redirection for internal call of
memcpy, memset, memchr, and strlen to the IFUNC resolved ones.  The
performance improvement is noticeable in algorithms that uses these
symbols extensible, like the regex functions.
2014-05-05 13:30:16 -05:00
Adam Conrad 7776e6692f Revert incorrect removal of the XDR currency from locale/iso-4217.def
In 7447ccd98e, the XDR currency was
removed from locale/iso-4217.def, despite the fact that it's both
still a part of the standard, according to the official table:

http://www.currency-iso.org/dam/downloads/table_a1.xml

... and, more importantly, is referenced from localedata/i18n, so
any quick-and-dirty locale definition that uses "copy i18n" for
LC_MONETARY wouldn't work anymore.
2014-05-03 23:45:15 -06:00
Allan McRae d69aeb1239 Update Esperanto translations 2014-05-04 14:14:14 +10:00
Carlos O'Donell 8f1df5cf9d Fix -Wundef warning for FEATURE_INDEX_1.
Define FEATURE_INDEX_1 and FEATURE_INDEX_MAX as macros
for use by both assembly and C code. This fixes the
-Wundef error for cases where FEATURE_INDEX_1 was not
defined but used the correct value of 0 for an undefined
macro.
2014-05-03 00:25:21 -04:00
Steve Ellcey 13e402e77e 2014-05-01 Steve Ellcey <sellcey@mips.com>
* iconvdata/ansi_x3.110.c (ONE_DIRECTION): Define.
	* iconvdata/armscii-8.c (ONE_DIRECTION): Define.
	* iconvdata/big5.c (ONE_DIRECTION): Define.
	* iconvdata/big5hkscs.c (ONE_DIRECTION): Define.
	* iconvdata/cp1255.c (ONE_DIRECTION): Define.
	* iconvdata/cp1258.c (ONE_DIRECTION): Define.
	* iconvdata/cp932.c (ONE_DIRECTION): Define.
	* iconvdata/euc-cn.c (ONE_DIRECTION): Define.
	* iconvdata/euc-jisx0213.c (ONE_DIRECTION): Define.
	* iconvdata/euc-jp-ms.c (ONE_DIRECTION): Define.
	* iconvdata/euc-jp.c (ONE_DIRECTION): Define.
	* iconvdata/euc-kr.c (ONE_DIRECTION): Define.
	* iconvdata/euc-tw.c (ONE_DIRECTION): Define.
	* iconvdata/gb18030.c (ONE_DIRECTION): Define.
	* iconvdata/gbbig5.c (ONE_DIRECTION): Define.
	* iconvdata/gbgbk.c (ONE_DIRECTION): Define.
	* iconvdata/gbk.c (ONE_DIRECTION): Define.
	* iconvdata/ibm1364.c (ONE_DIRECTION): Define.
	* iconvdata/ibm930.c (ONE_DIRECTION): Define.
	* iconvdata/ibm932.c (ONE_DIRECTION): Define.
	* iconvdata/ibm933.c (ONE_DIRECTION): Define.
	* iconvdata/ibm935.c (ONE_DIRECTION): Define.
	* iconvdata/ibm937.c (ONE_DIRECTION): Define.
	* iconvdata/ibm939.c (ONE_DIRECTION): Define.
	* iconvdata/ibm943.c (ONE_DIRECTION): Define.
	* iconvdata/iso-2022-cn-ext.c (ONE_DIRECTION): Define.
	* iconvdata/iso-2022-cn.c (ONE_DIRECTION): Define.
	* iconvdata/iso-2022-jp-3.c (ONE_DIRECTION): Define.
	* iconvdata/iso-2022-jp.c (ONE_DIRECTION): Define.
	* iconvdata/iso-2022-kr.c (ONE_DIRECTION): Define.
	* iconvdata/iso646.c (ONE_DIRECTION): Define.
	* iconvdata/iso8859-1.c (ONE_DIRECTION): Define.
	* iconvdata/iso_11548-1.c (ONE_DIRECTION): Define.
	* iconvdata/iso_6937-2.c (ONE_DIRECTION): Define.
	* iconvdata/iso_6937.c (ONE_DIRECTION): Define.
	* iconvdata/johab.c (ONE_DIRECTION): Define.
	* iconvdata/shift_jisx0213.c (ONE_DIRECTION): Define.
	* iconvdata/sjis.c (ONE_DIRECTION): Define.
	* iconvdata/t.61.c (ONE_DIRECTION): Define.
	* iconvdata/tcvn5712-1.c (ONE_DIRECTION): Define.
	* iconvdata/tscii.c (ONE_DIRECTION): Define.
	* iconvdata/uhc.c (ONE_DIRECTION): Define.
	* iconvdata/unicode.c (ONE_DIRECTION): Define.
	* iconvdata/utf-16.c (ONE_DIRECTION): Define.
	* iconvdata/utf-32.c (ONE_DIRECTION): Define.
	* iconvdata/utf-7.c (ONE_DIRECTION): Define.
2014-05-01 13:42:40 -07:00
Roland McGrath 8f2f08d04f Fix -Wundef warnings for _IO_JUMPS_OFFSET. 2014-05-01 13:33:13 -07:00
Roland McGrath c727f03253 Deconditionalize use of LLL_LOCK_INITIALIZER in bits/libc-lock.h. 2014-05-01 13:08:30 -07:00
Andreas Schwab a849e80035 Fix implicit declaration 2014-05-01 22:02:27 +02:00
David S. Miller 5331255b6e Fix v9/64-bit strcmp when string ends in multiple zero bytes.
[BZ #16885]
	* sysdeps/sparc/sparc64/strcmp.S: Fix end comparison handling when
	multiple zero bytes exist at the end of a string.
	Reported by Aurelien Jarno <aurelien@aurel32.net>

	* string/test-strcmp.c (check): Add explicit test for situations where
	there are multiple zero bytes after the first.
2014-05-01 12:15:06 -07:00
Andreas Schwab 4fdfe821e2 Correctly handle %p in wprintf (BZ #16890) 2014-05-01 20:42:08 +02:00
Steve Ellcey 0cdddc25a4 2014-05-01 Steve Ellcey <sellcey@mips.com>
* intl/iconv/skeleton.c (ONE_DIRECTION): Remove define.
	* iconv/gconv_simple.c (ONE_DIRECTION): Define.
	* iconvdata/8bit-gap.c (ONE_DIRECTION): Ditto.
	* iconvdata/8bit-generic.c (ONE_DIRECTION): Ditto.
2014-05-01 10:22:35 -07:00
Steve Ellcey 6426d77e47 2014-05-01 Steve Ellcey <sellcey@mips.com>
* stdlib/longlong.h: Updated from GCC.
2014-05-01 10:09:04 -07:00
Will Newton 7470db0c8e NEWS: Add 15119 to fixed bug list 2014-05-01 16:26:35 +01:00
Will Newton 6d96f5e4c0 ARM: Remove lowlevellock.c
lowlevellock.c for arm differs from the generic lowlevellock.c only in
insignificant ways, so can be removed. Happily, this fixes BZ 15119
(unnecessary busy loop in __lll_timedlock_wait on arm).

The notable differences between the arm and generic implementations are:

1) arm __lll_timedlock_wait has a fast path out if futex has been set
to 0 between since the function was called. This seems unlikely to
happen very often, so it seems at worst harmless to lose this fast
path.

2) Some function in arm's lowlevellock.c set futex to 2 if it was 1.
The generic version always sets the futex to 2. As futex can only be
0, 1 or 2 on entry into these functions, the behaviour is equivalent.
(If the futex manages to be 0 on entry then we've just lost another
unlikely fast path out.)

There are no test suite regressions.

Note that hppa and sparc also have their own lowlevellock.c. I believe
hppa can also be removed, so I'll send a separate patch for that
shortly. sparc's seems to be genuinely needed as it uses a different
locking structure.

Also note that the analysis at
https://sourceware.org/ml/libc-ports/2013-02/msg00021.html indicates a
further locking performance bug to fix - I've got a partial patch for
that which I can submit once I've finished testing.

2014-05-01  Bernard Ogden <bernie.ogden@linaro.org>

	[BZ #15119]
	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.c: Remove file.
2014-05-01 14:25:44 +01:00
David S. Miller 4fa262fa9e Add round-mode context support to sparc.
* sysdeps/sparc/fpu/fenv_private.h (HAVE_RM_CTX): Define.
	(libc_feholdexcept_setround_sparc_ctx): New function.
	(libc_fesetenv_sparc_ctx): Likewise.
	(libc_feupdateenv_sparc_ctx): Likewise.
	(libc_feholdsetround_sparc_ctx): Likewise.
	(libc_feholdexcept_setround_ctx): Define.
	(libc_feholdexcept_setroundf_ctx): Likewise.
	(libc_feholdexcept_setroundl_ctx): Likewise.
	(libc_fesetenv_ctx): Likewise.
	(libc_fesetenvf_ctx): Likewise.
	(libc_fesetenvl_ctx): Likewise.
	(libc_feupdateenv_ctx): Likewise.
	(libc_feupdateenvf_ctx): Likewise.
	(libc_feupdateenvl_ctx): Likewise.
	(libc_feresetround_ctx): Likewise.
	(libc_feresetroundf_ctx): Likewise.
	(libc_feresetroundl_ctx): Likewise.
	(libc_feholdsetround_ctx): Likewise.
	(libc_feholdsetroundf_ctx): Likewise.
	(libc_feholdsetroundl_ctx): Likewise.
2014-04-30 15:14:58 -07:00
David S. Miller 1d3d93ef73 Correct sparc CPP guards for EMT_TAGOVF.
* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h (EMT_TAGOVF): Protect
	with __USE_GNU instead of XOPEN cpp guards.
2014-04-30 13:37:04 -07:00
David S. Miller 8aa583c3e0 Fix some sparc -Wundef build warnings.
* sysdeps/sparc/bits/string.h (_STRING_ARCH_unaligned): Define to
	0.
2014-04-30 11:39:47 -07:00
David S. Miller 211d653cb6 Fix some sparc conform test failures in siginfo.h
* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h (EMT_TAGOVF): Protect
	with XOPEN cpp guards.
2014-04-30 11:37:41 -07:00
Julian Brown 60c8f1f60b ARM: Fix R_ARM_IRELATIVE RELA relocations.
This patch fixes what I believe to be a bug in the handling of
R_ARM_IRELATIVE RELA relocations. At present, these are handled the
same as REL relocations: i.e. the addend is loaded from the relocation
address. Most of the time this isn't a problem because RELA relocations
aren't used on ARM (GNU/Linux at least) anyway, but it causes problems
with prelink, which uses RELA on all targets for its conflict table.
(Support for ifunc prelinking requires a prelink patch, not yet posted.)

Anyway, this patch works, though I'm not 100% sure if it is correct: I
notice that this code path received attention last year:

https://sourceware.org/ml/libc-ports/2013-07/msg00000.html

I'm not sure under what circumstances that patch would have had an
effect, nor if my patch conflicts with that case.

No regressions using Mentor's usual glibc cross-testing infrastructure.

	[BZ #16888]
	* sysdeps/arm/dl-machine.h (elf_machine_rela): Fix R_ARM_IRELATIVE
	handling.
2014-04-30 16:17:59 +00:00
Joseph Myers d0f5b3f851 Increase minimum Linux kernel version to 2.6.32.
This patch increases the minimum Linux kernel version for glibc to
2.6.32, as discussed in the thread starting at
<https://sourceware.org/ml/libc-alpha/2014-01/msg00511.html>.

This patch just does the minimal change to arch_minimum_kernel
settings (and LIBC_LINUX_VERSION, which determines the minimum kernel
headers version, as it doesn't make sense for that to be older than
the minimum kernel that can be used at runtime).  Followups would be
expected to do, roughly and not necessarily precisely in this order:

* Remove __LINUX_KERNEL_VERSION checks in kernel-features.h files
  where those checks are always true / always false for kernels 2.6.32
  and above.

* Otherwise simplify/improve conditionals in those files (for example,
  where defining once in the main file then undefining in
  architecture-specific files makes things clearer than having lots of
  separate definitions of the same macro), possibly fixing in the
  process cases where a macro should optimally have been defined for a
  given architecture but wasn't.  (In the review in preparation for
  this version increase I checked what the right conditions should be
  for all macros in the main kernel-features.h whose definitions there
  would have been affected by the increase - but I only fixed that
  subset of the issues found where --enable-kernel=2.6.32 would have
  caused a kernel feature to be wrongly assumed to be present, not any
  cases where a feature is not assumed but could be assumed.)

* Remove conditionals on __ASSUME_* where they can now be taken to be
  always-true, and the definitions when the macros are only used in
  Linux-specific files.

* Split more architectures out of the main kernel-features.h (like
  ex-ports architectures), once various of the architecture
  conditionals there have been eliminated so the new
  architecture-specific files are no larger than actually necessary.

Tested x86_64.

2014-03-27  Joseph Myers  <joseph@codesourcery.com>

	[BZ #9894]
	* sysdeps/unix/sysv/linux/configure.ac (LIBC_LINUX_VERSION):
	Change to 2.6.32.
	(arch_minimum_kernel): Change all 2.6.16 settings to 2.6.32.
	* sysdeps/unix/sysv/linux/configure: Regenerated.
	* sysdeps/unix/sysv/linux/microblaze/configure.ac: Remove file.
	* sysdeps/unix/sysv/linux/microblaze/configure: Likewise.
	* sysdeps/unix/sysv/linux/tile/configure.ac: Likewise.
	* sysdeps/unix/sysv/linux/tile/configure: Likewise.
	* README: Update reference to required Linux kernel version.
	* manual/install.texi (Linux): Update reference to required Linux
	kernel headers version.
	* INSTALL: Regenerated.
2014-04-30 15:41:03 +00:00
Joseph Myers 9a461d467f conformtest: clean up POSIX expectations for stdlib.h, string.h.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for stdlib.h and
string.h.  Tested x86_64; no new XFAILs needed.

	* conform/data/stdlib.h-data [POSIX] (stddef.h): Do not allow
	header inclusion.
	[POSIX] (limits.h): Likewise.
	[POSIX] (math.h): Likewise.
	[POSIX] (sys/wait.h): Likewise.
	* conform/data/string.h-data [POSIX || UNIX98] (strtok_r): Require
	function.
	[POSIX] (stddef.h): Do not allow header inclusion.
2014-04-30 15:35:18 +00:00
Andreas Schwab 57f41c4097 ChangeLog cleanup 2014-04-30 16:24:31 +02:00
Adhemerval Zanella 1775babf2b More fixes for unsafe compiler optimization
GCC 4.9 -ftree-loop-distribute-patterns now may transform loops in
memcpy.  Add the alias to internal GLIBC symbol to avoid PLT creation.
2014-04-30 08:41:42 -05:00
Yang Yingliang 8f630cca5c Fix lll_unlock twice in pthread_cond_broadcast
lll_unlock() will be called again if it goes to "wake_all" in
pthread_cond_broadcast(). This may make another thread which is
waiting for lock in pthread_cond_timedwait() unlock.  So there are
more than one threads get the lock, it will break the shared data.

It's introduced by commit 8313cb997d2d("FUTEX_*_REQUEUE_PI support for
non-x86 code")
2014-04-30 15:46:19 +05:30
Siddhesh Poyarekar bc8f194c8c Initialize all of datahead structure in nscd (BZ #16791)
The datahead structure has an unused padding field that remains
uninitialized.  Valgrind prints out a warning for it on querying a
netgroups entry.  This is harmless, but is a potential data leak since
it would result in writing out an uninitialized byte to the cache
file.  Besides, this happens only when there is a cache miss, so we're
not adding computation to any fast path.
2014-04-30 12:00:39 +05:30
Siddhesh Poyarekar 1cdeb2372d Consolidate code to initialize nscd dataset header
This patch consolidates the code to initialize the header of a dataset
into a single set of functions (one for positive and another for
negative datasets) primarily to reduce repetition of code.  The
secondary reason is to simplify Patch 2/2 which fixes the problem of
an uninitialized byte in the header by initializing an unused field in
the structure and hence preventing a possible data leak into the cache
file.
2014-04-30 11:57:09 +05:30
Siddhesh Poyarekar 16b293a7a6 Do not fail if one of the two responses to AF_UNSPEC fails (BZ #14308)
[Fixes BZ #14308, #12994, #13651]

AF_UNSPEC results in sending two queries in parallel, one for the A
record and the other for the AAAA record.  If one of these is a
referral, then the query fails, which is wrong.  It should return at
least the one successful response.

The fix has two parts.  The first part makes the referral fall back to
the SERVFAIL path, which results in using the successful response.
There is a bug in that path however, due to which the second part is
necessary.  The bug here is that if the first response is a failure
and the second succeeds, __libc_res_nsearch does not detect that and
assumes a failure.  The case where the first response is a success and
the second fails, works correctly.

This condition is produced by buggy routers, so here's a crude
interposable library that can simulate such a condition.  The library
overrides the recvfrom syscall and modifies the header of the packet
received to reproduce this scenario.  It has two key variables:
mod_packet and first_error.

The mod_packet variable when set to 0, results in odd packets being
modified to be a referral.  When set to 1, even packets are modified
to be a referral.

The first_error causes the first response to be a failure so that a
domain-appended search is performed to test the second part of the
__libc_nsearch fix.

The driver for this fix is a simple getaddrinfo program that does an
AF_UNSPEC query.  I have omitted this since it should be easy to
implement.

I have tested this on x86_64.

The interceptor library source:

/* Override recvfrom and modify the header of the first DNS response to make it
   a referral and reproduce bz #845218.  We have to resort to this ugly hack
   because we cannot make bind return the buggy response of a referral for the
   AAAA record and an authoritative response for the A record.  */
 #define _GNU_SOURCE
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdio.h>
 #include <stdbool.h>
 #include <endian.h>
 #include <dlfcn.h>
 #include <stdlib.h>

/* Lifted from resolv/arpa/nameser_compat.h.  */
typedef struct {
    unsigned        id :16;         /*%< query identification number */
 #if BYTE_ORDER == BIG_ENDIAN
    /* fields in third byte */
    unsigned        qr: 1;          /*%< response flag */
    unsigned        opcode: 4;      /*%< purpose of message */
    unsigned        aa: 1;          /*%< authoritive answer */
    unsigned        tc: 1;          /*%< truncated message */
    unsigned        rd: 1;          /*%< recursion desired */
    /* fields
     * in
     * fourth
     * byte
     * */
    unsigned        ra: 1;          /*%< recursion available */
    unsigned        unused :1;      /*%< unused bits (MBZ as of 4.9.3a3) */
    unsigned        ad: 1;          /*%< authentic data from named */
    unsigned        cd: 1;          /*%< checking disabled by resolver */
    unsigned        rcode :4;       /*%< response code */
 #endif
 #if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
    /* fields
     * in
     * third
     * byte
     * */
    unsigned        rd :1;          /*%< recursion desired */
    unsigned        tc :1;          /*%< truncated message */
    unsigned        aa :1;          /*%< authoritive answer */
    unsigned        opcode :4;      /*%< purpose of message */
    unsigned        qr :1;          /*%< response flag */
    /* fields
     * in
     * fourth
     * byte
     * */
    unsigned        rcode :4;       /*%< response code */
    unsigned        cd: 1;          /*%< checking disabled by resolver */
    unsigned        ad: 1;          /*%< authentic data from named */
    unsigned        unused :1;      /*%< unused bits (MBZ as of 4.9.3a3) */
    unsigned        ra :1;          /*%< recursion available */
 #endif
    /* remaining
     * bytes
     * */
    unsigned        qdcount :16;    /*%< number of question entries */
    unsigned        ancount :16;    /*%< number of answer entries */
    unsigned        nscount :16;    /*%< number of authority entries */
    unsigned        arcount :16;    /*%< number of resource entries */
} HEADER;

static int done = 0;

/* Packets to modify.  0 for the odd packets and 1 for even packets.  */
static const int mod_packet = 0;

/* Set to true if the first request should result in an error, resulting in a
   search query.  */
static bool first_error = true;

static ssize_t (*real_recvfrom) (int sockfd, void *buf, size_t len, int flags,
			  struct sockaddr *src_addr, socklen_t *addrlen);

void
__attribute__ ((constructor))
init (void)
{
  real_recvfrom = dlsym (RTLD_NEXT, "recvfrom");

  if (real_recvfrom == NULL)
    {
      printf ("Failed to get reference to recvfrom: %s\n", dlerror ());
      printf ("Cannot simulate test\n");
      abort ();
    }
}

/* Modify the second packet that we receive to set the header in a manner as to
   reproduce BZ #845218.  */
static void
mod_buf (HEADER *h, int port)
{
  if (done % 2 == mod_packet || (first_error && done == 1))
    {
      printf ("(Modifying header)");

      if (first_error && done == 1)
	h->rcode = 3;
      else
	h->rcode = 0;	/* NOERROR == 0.  */
      h->ancount = 0;
      h->aa = 0;
      h->ra = 0;
      h->arcount = 0;
    }
  done++;
}

ssize_t
recvfrom (int sockfd, void *buf, size_t len, int flags,
	  struct sockaddr *src_addr, socklen_t *addrlen)
{
  ssize_t ret = real_recvfrom (sockfd, buf, len, flags, src_addr, addrlen);
  int port = htons (((struct sockaddr_in *) src_addr)->sin_port);
  struct in_addr addr = ((struct sockaddr_in *) src_addr)->sin_addr;
  const char *host = inet_ntoa (addr);
  printf ("\n*** From %s:%d: ", host, port);

  mod_buf (buf, port);

  printf ("returned %zd\n", ret);
  return ret;
}
2014-04-30 11:48:43 +05:30
Steve Ellcey a28a9b94c2 2014-04-29 Steve Ellcey <sellcey@mips.com>
* iconf/skeleton.c (ONE_DIRECTION): Set default value if not set.
2014-04-29 10:19:30 -07:00
Stefan Liebler 2ca180e97a [BZ #16823] Fix log1pl returning wrong infinity sign 2014-04-29 15:43:36 +02:00
Adhemerval Zanella 18f2945ae9 PowerPC: Suppress unnecessary FPSCR write
This patch optimizes the FPSCR update on exception and rounding change
functions by just updating its value if new value if different from
current one.  It also optimizes fedisableexcept and feenableexcept by
removing an unecessary FPSCR read.
2014-04-29 07:05:39 -05:00
Carlos O'Donell 5abebba403 Relocate hppa from ports to libc. 2014-04-29 04:20:39 -04:00
Ondřej Bílka fff763a512 Fix types of stream hook functions in manual. 2014-04-28 18:54:24 +02:00
Ondřej Bílka f7ed60c252 Fix recvmmsg comment. 2014-04-28 18:16:07 +02:00
Wilco Dijkstra df639d73f4 [ARM] Add support for fenv_private on ARM. 2014-04-28 10:53:04 +01:00
H.J. Lu 48332d8220 Replace __int128 with __int128_t in bits/link.h
__int128 was added in GCC 4.6 and __int128_t was added before x86-64
was supported.  This patch replaces __int128 with __int128_t so that
the installed bits/link.h can be used with older GCC.

	* sysdeps/x86/bits/link.h (La_x86_64_regs): Replace __int128
	with __int128_t.
	(La_x86_64_retval): Likewise.
2014-04-25 09:33:41 -07:00
Ian Bolton e5e0d9a4f6 [AArch64] Suppress unnecessary FPSR and FPCR writes. 2014-04-24 07:15:33 +01:00
Siddhesh Poyarekar bacc75f7be Use test-skeleton.c in tst-sem3 and tst-sem4 2014-04-23 12:21:00 +05:30
David S. Miller a059d359d8 Fix sigaction conform test failures on sparc.
* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h
	(struct sigaction): New struct member __glibc_reserved0, change
	type of sa_flags to int.
2014-04-22 17:47:12 -07:00
Yufeng Zhang ea6c92f3be [AArch64] Use GCC builtins to count leading/tailing zeros. 2014-04-22 17:26:59 +01:00
Siddhesh Poyarekar 766c4a363d Include atomic.h in sem_wait.c and sem_trywait.c 2014-04-22 16:57:49 +05:30
Venkataramanan Kumar 140cc7abf7 aarch64: Add setjmp and longjmp SystemTap probes
Add setjmp, longjmp and longjmp_target SystemTap probes.

ChangeLog:

2014-04-22  Will Newton  <will.newton@linaro.org>
	    Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>

	* sysdeps/aarch64/__longjmp.S: Include stap-probe.h.
	(__longjmp): Add longjmp and longjmp_target SystemTap
	probes.
	* sysdeps/aarch64/setjmp.S: Include stap-probe.h.
	(__sigsetjmp): Add setjmp SystemTap probe.
2014-04-22 11:13:16 +01:00
Carlos O'Donell c54e5cf7db manual: Sort overview listing by manual order.
In the glibc manual we have a "Roadmap to the manual" section at
the end of the "Introduction" chapter.

The introductory text says "Here is an overview of the contents
of the remaining chapters of this manual.", but then proceeds to
list chapters out of order and some chapter are never referenced.

This commit reorders the overview to correctly match the manual
order.

See:
https://sourceware.org/ml/libc-alpha/2014-02/msg00823.html
2014-04-17 19:41:09 -04:00
Adhemerval Zanella 75ffb047f6 PowerPC: Sync pthread_once with default implementation
This patch removes the arch specific powerpc implementation and instead
uses the linux default one.  Although the current powerpc implementation
already constains the required memory barriers for correct
initialization, the default implementation shows a better performance on
newer chips.
2014-04-17 14:42:57 -05:00
Adhemerval Zanella 2cd925f743 PowerPC: Add fenv macros for long double
This patch add the missing libc_<function>l_ctx macros for long
double.  Similar for float, they point to default double versions.
2014-04-17 14:01:51 -05:00
Ian Bolton 39e6cd8d64 Add fenv test support for AArch64. 2014-04-17 16:58:35 +01:00
Sihai Yao f9281df995 Detect if AVX2 is usable
This patch checks and sets bit_AVX2_Usable in __cpu_features.feature.

	* sysdeps/x86_64/multiarch/ifunc-defines.sym (COMMON_CPUID_INDEX_7):
	New.
	* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):
	Check and set bit_AVX2_Usable.
	* sysdeps/x86_64/multiarch/init-arch.h (bit_AVX2_Usable): New
	macro.
	(bit_AVX2): Likewise.
	(index_AVX2_Usable): Likewise.
	(CPUID_AVX2): Likewise.
	(HAS_AVX2): Likewise.
2014-04-17 08:00:21 -07:00
Will Newton 7c6776620d manual/setjmp.texi: Clarify setcontext and signal handlers text
Calling setcontext from a signal handler can be done safely so
it is sufficient to note that it is not recommended.

Also mention in setcontext documentation that the behaviour of
setcontext when restoring a context created by a call to a signal
handler is unspecified.

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

	* manual/setjmp.texi (System V contexts): Add note that
	calling setcontext on a context created by a call to a
	signal handler is undefined.  Update text to note that
	setcontext from a signal handler is possible but not
	recommended.
2014-04-17 11:40:36 +01:00
Will Newton e04a4e9d2e stdlib/tst-setcontext.c: Check for clobbering of signal stack
On aarch64 calling swapcontext clobbers the state of the signal
stack (BZ #16629). Check that the address and size of the signal
stack before and after the call to swapcontext remains the same.

ChangeLog:

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

	[BZ #16629]
	* stdlib/tst-setcontext.c: Include signal.h.
	(main): Check that the signal stack before and
	after swapcontext is the same.
2014-04-17 11:39:50 +01:00
Will Newton 37d3500738 aarch64: Re-implement setcontext without rt_sigreturn syscall
The current implementation of setcontext uses rt_sigreturn to restore
the contents of registers. This contrasts with the way most other
architectures implement setcontext:

  powerpc64, mips, tile:

  Call rt_sigreturn if context was created by a call to a signal handler,
  otherwise restore in user code.

  powerpc32:

  Call swapcontext system call and don't call sigreturn or rt_sigreturn.

  x86_64, sparc, hppa, sh, ia64, m68k, s390, arm:

  Only support restoring "synchronous" contexts, that is contexts
  created by getcontext, and restoring in user code and don't call
  sigreturn or rt_sigreturn.

  alpha:

  Call sigreturn (but not rt_sigreturn) in all cases to do the restore.

The text of the setcontext manpage suggests that the requirement to be
able to restore a signal handler created context has been dropped from
SUSv2:

  If  the context was obtained by a call to a signal handler, then old
  standard text says that "program execution continues with the program
  instruction following the instruction interrupted by the signal".
  However, this sentence was removed in SUSv2, and the present verdict
  is "the result is unspecified".

Implementing setcontext by calling rt_sigreturn unconditionally causes
problems when used with sigaltstack as in BZ #16629. On this basis it
seems that aarch64 is broken and that new ports should only support
restoring contexts created with getcontext and do not need to call
rt_sigreturn at all.

This patch re-implements the aarch64 setcontext function to restore
the context in user code in a similar manner to x86_64 and other ports.

ChangeLog:

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

	[BZ #16629]
	* sysdeps/unix/sysv/linux/aarch64/setcontext.S (__setcontext):
	Re-implement to restore registers in user code and avoid
	rt_sigreturn system call.
2014-04-17 11:38:50 +01:00
Wilco 423a7160af Add fenv test support for targets which don't have FP traps. 2014-04-17 09:39:27 +01:00
Ian Bolton bc93ab2946 [AArch64] Define HAVE_RM_CTX and related hooks. 2014-04-17 08:30:07 +01:00
Ian Bolton 7e0b6763e9 [AArch64] Provide initial implementation of math_private.h. 2014-04-17 08:28:41 +01:00
Richard Henderson ddb04724ed alpha: Remove alpha-linux pthread_once.c 2014-04-16 21:36:33 -07:00
Richard Henderson d77c0899db alpha: Enable unwind tables for backtrace.c 2014-04-16 21:35:29 -07:00
Richard Henderson a3df56fcae alpha: Fix __pointer_chk_guard definition for the testsuite 2014-04-16 21:35:27 -07:00
Richard Henderson 95fc5fa3db alpha: Regenerate sysdeps/alpha/libm-test-ulps 2014-04-16 21:35:24 -07:00
Marcus Shawcroft a9ea2e0cbe [AArch64] Regenerate libm-test-ulps. 2014-04-16 23:08:51 +01:00
Igor Zamyatin ea8ba7cd14 Save/restore bound registers for _dl_runtime_profile
This patch saves and restores bound registers in x86-64 PLT for
ld.so profile and LD_AUDIT:

	* sysdeps/x86_64/bits/link.h (La_x86_64_regs): Add lr_bnd.
	(La_x86_64_retval): Add lrv_bnd0 and lrv_bnd1.
	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Save
	Intel MPX bound registers before _dl_profile_fixup.
	* sysdeps/x86_64/dl-trampoline.h: Restore Intel MPX bound
	registers after _dl_profile_fixup.  Save and restore bound
	registers bnd0/bnd1 when calling _dl_call_pltexit.
	* sysdeps/x86_64/link-defines.sym (BND_SIZE): New.
	(LR_BND_OFFSET): Likewise.
	(LRV_BND0_OFFSET): Likewise.
	(LRV_BND1_OFFSET): Likewise.
2014-04-16 14:46:49 -07:00
Samuel Thibault 3c799e9131 hurd: Add i386 fields to TLS structure
* sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add multiple_threads,
	sysinfo, stack_guard, pointer_guard, gscope_flag, private_futex,
	__private_tm, __private_ss fields.
2014-04-16 23:45:36 +02:00
Samuel Thibault 9f2a4fbc3c hurd: Move dtv, dtv_t, tcbhead_t declaration to per-arch file. 2014-04-16 23:43:28 +02:00
Samuel Thibault fd15a59b20 hurd: Do not allow unmapping address 0
* sysdeps/mach/munmap.c (__munmap): Return EINVAL if `addr' is 0.
2014-04-16 23:16:15 +02:00
Stefan Liebler f19dfa0afd S/390: Regenerate ULPs 2014-04-16 13:04:34 +02:00
Stefan Liebler 4fa8bc3b35 [BZ #14770] S/390: Require Binutils >= 2.24 for target S/390. 2014-04-16 13:04:33 +02:00
Stefan Liebler 8ea587db2b [BZ #16824] Fix failing y1 due to too large ulps in downward/upward rounding mode. 2014-04-16 13:03:46 +02:00
Alan Modra 9860b04502 Update fixed bug list 2014-04-16 19:47:02 +09:30
Alan Modra aa5f0ff11a Correct IBM long double frexpl.
Besides fixing the bugzilla, this also fixes corner-cases where the high
and low double differ greatly in magnitude, and handles a denormal
input without resorting to a fp rescale.

	[BZ #16740]
	[BZ #16619]
	* sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Rewrite.
	* math/libm-test.inc (frexp_test_data): Add tests.
2014-04-16 19:33:32 +09:30
Siddhesh Poyarekar bb9c256fb0 benchtests: Link against objects in build directory
Using -lm and -lpthread results in the shared objects in the system
being used to link against.  This happened to work for libm because
there haven't been any changes to the libm ABI recently that could
break the existing benchmarks.  This doesn't always work for the
pthread benchmarks.  The correct way to build against libraries in the
build directory is to have the binaries explicitly depend on them so
that $(+link) can pick them up.
2014-04-15 14:33:06 +05:30
Carlos O'Donell f737dfd071 Support _r_debug for static binaries.
We initialize _r_debug for static binaries to allows debug
agents to treat static binaries a little more like dyanmic
ones. This simplifies the work a debug agent has to do to
access TLS in a static binary via libthread_db.

Tested on x86_64.

See:
https://sourceware.org/ml/libc-alpha/2014-04/msg00183.html

	[BZ #16831]
	* csu/libc-start.c (LIBC_START_MAIN) [!SHARED]: Call
	_dl_debug_initialize.
2014-04-14 15:45:40 -04:00
Carlos O'Donell 0699f766b1 nscd: Make SELinux checks dynamic.
The SELinux team has indicated to me that glibc's SELinux checks
in nscd are not being carried out as they would expect the API
to be used today. They would like to move away from static header
defines for class and permissions and instead use dynamic checks
at runtime that provide an answer which is dependent on the runtime
status of SELinux i.e. more dynamic.

The following patch is a minimal change that moves us forward in
this direction.

It does the following:

* Stop checking for SELinux headers that define NSCD__SHMEMHOST.
  Check only for the presence or absence of the library.

* Don't encode the specific SELinux permission constants into a
  table at build time, and instead use the symbolic name for the
  permission as expected.

* Lookup the "What do we do if we don't know this permission?"
  policy and use that if we find SELinux's policy is older than
  the glibc policy e.g. we make a request for a permission that
  SELinux doesn't know about.

* Lastly, translate the class and permission and then make
  the permission check. This is done every time we lookup
  a permission, and this is the expected way to use the API.
  SELinux will optimize this for us, and we expect the network
  latencies to hide these extra library calls.

Tested on x86, x86-64, and via Fedora Rawhide since November 2013.

See:
https://sourceware.org/ml/libc-alpha/2014-04/msg00179.html
2014-04-14 04:10:39 -04:00
David S. Miller 809bd45fa9 Regenerate sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Update.
2014-04-13 18:27:19 -07:00
Allan McRae 89e691f2ae Fix qsort argument order in collation example 2014-04-12 14:26:29 +10:00
Paul Pluzhnikov fe8d072cb7 Fix typo on ChangeLog. 2014-04-11 12:16:38 -07:00
Chris Metcalf 9c9daaeb83 math: make test-fenv-preserve.c a no-op if FE_ALL_EXCEPT == 0.
This fixes a testsuite failure for tile (and possibly microblaze).
2014-04-11 15:13:42 -04:00
Paul Pluzhnikov 95561fb9c5 2014-04-11 Paul Pluzhnikov <ppluzhnikov@google.com>
* elf/Makefile (tests): make tst-dlopen-aout conditional on
	enable-hardcoded-path-in-tests
2014-04-11 11:25:53 -07:00
Will Newton 970c602aa6 benchtests: Improve readability of JSON output
Add a small library to print JSON values and use it to improve the
readability of the benchmark output and the readability of the
benchmark code.

ChangeLog:

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

	* benchtests/Makefile (extra-objs): Add json-lib.o.
	(bench-func): Tidy up JSON output.
	* benchtests/bench-skeleton.c: Include json-lib.h.
	(main): Use JSON library functions to do output of
	benchmark results.
	* benchtests/bench-timing-type.c (main): Output the
	timing type simply, leaving formatting to the user.
	* benchtests/json-lib.c: New file.
	* benchtests/json-lib.h: Likewise.
2014-04-11 16:05:03 +01:00
Torvald Riegel 36875b06e0 Fixed and unified pthread_once.
[BZ #15215] This unifies various pthread_once architecture-specific
implementations which were using the same algorithm with slightly different
implementations.  It also adds missing memory barriers that are required for
correctness.
2014-04-11 15:54:19 +02:00