Commit Graph

16215 Commits

Author SHA1 Message Date
H.J. Lu 409e00bd69 Disable x87 inline functions for SSE2 math
When i386 and x86-64 mathinline.h was merged into a single mathinline.h,
"gcc -m32" enables x87 inline functions on x86-64 even when -mfpmath=sse
and SSE2 is enabled.  It is a regression on x86-64.  We should check
__SSE2_MATH__ instead of __x86_64__ when disabling x87 inline functions.
2014-01-29 11:19:05 -08:00
Alexandre Oliva 86e60666b6 * manual/charset.texi: Document MTASC-safety properties. 2014-01-29 15:29:59 -02:00
Alexandre Oliva 7616763710 * manual/crypt.texi: Document MTASC-safety properties. 2014-01-29 05:27:54 -02:00
Alexandre Oliva e567f2a0b4 * manual/conf.texi: Document MTASC-safety properties. 2014-01-29 05:26:47 -02:00
Alexandre Oliva b719dafd3c * manual/arith.texi: Document MTASC-safety properties. 2014-01-29 05:25:36 -02:00
Alexandre Oliva 4a16c66218 * manual/argp.texi: Document MTASC-safety properties. 2014-01-29 05:24:32 -02:00
Alexandre Oliva 0a57b83e4a * manual/macros.texi: Introduce macros to document multi
thread, asynchronous signal and asynchronous cancellation
safety properties.
* manual/intro.texi: Introduce the properties themselves.
2014-01-29 05:20:37 -02:00
Kaz Kojima feab239727 Add -mieee to SH sysdep-CFLAGS for older SH compilers. 2014-01-28 09:03:14 +09:00
Andreas Schwab 1c0d11bce5 Let gen-libm-test.pl find itself when run outside source directory 2014-01-27 18:43:22 +01:00
Siddhesh Poyarekar d7b00f9810 Fix invalid memory access when parsing netgroup files with blank lines (BZ #16506)
The netgroups file parsing code tries to access the character before
the newline in parsed lines to see if it is a backslash (\).  This
results in an access before the block allocated for the line if the
line is blank, i.e. does not have anything other than the newline
character.  This doesn't seem like it will cause any crashes because
the byte belongs to the malloc metadata block and hence access to it
will always succeed.

There could be an invalid alteration in code flow where a blank line
is seen as a continuation due to the preceding byte *happening* to be
'\\'.  This could be done by interposing malloc, but that's not really
a security problem since one could interpose getnetgrent_r itself and
achieve a similar 'exploit'.

The possibility of actually exploiting this is remote to impossible
since it also requires the previous line to end with a '\\', which
would happen only on invalid configurations.
2014-01-27 16:49:33 +05:30
Siddhesh Poyarekar af37a8a349 Avoid undefined behaviour in netgroupcache
Using a buffer after it has been reallocated is undefined behaviour,
so get offsets of the triplets in the old buffer before reallocating
it.
2014-01-27 11:32:44 +05:30
Allan McRae 0c00f062dd Update French translations 2014-01-27 11:28:02 +10:00
Kaz Kojima 7d69a1b092 Regenerate SH libm-test-ulps with proper compiler options. 2014-01-27 08:50:47 +09:00
David S. Miller 6e697ff746 Rebuild sparc ULPs.
* sysdeps/sparc/fpu/libm-test-ulps: Regenerate.
2014-01-24 18:32:53 -08:00
Kaz Kojima 9cadb35cbb Move SH libm-test-ulps to sysdeps/sh and regenerate it. 2014-01-25 10:22:14 +09:00
Siddhesh Poyarekar 5d41dadf31 Adjust pointers to triplets in netgroup query data (BZ #16474)
The _nss_*_getnetgrent_r query populates the netgroup results in the
allocated buffer and then sets the result triplet to point to strings
in the buffer.  This is a problem when the buffer is reallocated since
the pointers to the triplet strings are no longer valid.  The pointers
need to be adjusted so that they now point to strings in the
reallocated buffer.
2014-01-24 13:51:15 +05:30
Kaz Kojima 0bad441c77 Restore ucontext ABI for soft-float sh4. 2014-01-24 12:56:12 +09:00
Kaz Kojima 7007c661ad Adjust SH specific fpu_control.h and ucontext.h files. 2014-01-23 14:22:58 +09:00
Andreas Krebbel 0f0c35e46e S/390: Merge 32 and 64 bit ucontext.h. 2014-01-22 18:44:35 +01:00
H.J. Lu 4959e284ca Include generic symbol-hacks.h for x32
In BZ #15605 fix with addding memset/memmove alias in symbol-hacks.h,
x32 symbol-hacks.h change was missing.  Fixed by including
<sysdeps/generic/symbol-hacks.h> in x32 symbol-hacks.h.
2014-01-20 11:11:01 -08:00
Adhemerval Zanella d98720e07f PowerPC: Fix gettimeofday ifunc selection
The IFUNC selector for gettimeofday runs before _libc_vdso_platform_setup where
__vdso_gettimeofday is set. The selector then sets __gettimeofday (the internal
version used within GLIBC) to use the system call version instead of the vDSO one.
This patch changes the check if vDSO is available to get its value directly
instead of rely on __vdso_gettimeofday.

This patch changes it by getting the vDSO value directly.

It fixes BZ#16431.
2014-01-20 12:29:51 -06:00
Allan McRae 91cbd0bc72 Update Catalan translations 2014-01-20 11:36:37 +10:00
Adam Conrad 6e077ee5c3 Fix incorrect ChangeLog formatting 2014-01-17 13:11:26 -07:00
Mike Frysinger 7a02cfade8 s390: implement sotruss support
See commit 41b1792698 for testcase.

Note: while this works on s390x, the s390 code hangs when using -e.
But it hangs regardless of this code (the hang seems to occur before
the exit func is even called).  I didn't look too closely at it as
it seems to be an issue external to this file, so this code shouldn't
make the situation any worse.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-16 15:10:14 -05:00
Adhemerval Zanella 736c304a1a PowerPC: Fix ftime gettimeofday internal call returning bogus data
This patches fixes BZ#16430 by setting a different symbol for internal
GLIBC calls that points to ifunc resolvers. For PPC32, if the symbol
is defined as hidden (which is the case for gettimeofday and time) the
compiler will create local branches (symbol@local) and linker will not
create PLT calls (required for IFUNC). This will leads to internal symbol
calling the IFUNC resolver instead of the resolved symbol.
For PPC64 this behavior does not occur because a call to a function in
another translation unit might use a different toc pointer thus requiring
a PLT call.
2014-01-16 06:53:18 -06:00
Joseph Myers 94d0cea0ad Fix math/test-fpucw-*.c for sysdeps test-fpucw.c overrides.
ARM has an override of the test math/test-fpucw.c, to disable (for
soft-float testing) definitions of hard-float macros in fpu_control.h
that the header normally defines not only when building for
hard-float, but also when building for soft-float with _LIBC defined
so that libc code can dynamically test whether VFP hardware is
present.  (_LIBC is defined when building tests, although ideally it
wouldn't be.)

The override doesn't work for the derived tests test-fpucw-*.c because
they use #include "" instead of <> to include test-fpucw.c, so always
get the math/ version instead of the ARM sysdeps override.  This patch
changes them to use <> so the sysdeps override is effective.
(test-fpucw-ieee-static.c doesn't need a change because it includes
test-fpucw-ieee.c, which isn't itself being overridden, which in turn
includes test-fpucw.c with a #include changed by this patch.)

Tested for ARM (big-endian soft-float, non-VFP hardware).

	* math/test-fpucw-ieee.c: Use <> in #include of test-fpucw.c.
	* math/test-fpucw-static.c: Likewise.
2014-01-16 05:30:52 +00:00
Siddhesh Poyarekar 980cb5180e Don't use alloca in addgetnetgrentX (BZ #16453)
addgetnetgrentX has a buffer which is grown as per the needs of the
requested size either by using alloca or by falling back to malloc if
the size is larger than 1K.  There are two problems with the alloca
bits: firstly, it doesn't really extend the buffer since it does not
use the return value of the extend_alloca macro, which is the location
of the reallocated buffer.  Due to this the buffer does not actually
extend itself and hence a subsequent write may overwrite stuff on the
stack.

The second problem is more subtle - the buffer growth on the stack is
discontinuous due to block scope local variables.  Combine that with
the fact that unlike realloc, extend_alloca does not copy over old
content and you have a situation where the buffer just has garbage in
the space where it should have had data.

This could have been fixed by adding code to copy over old data
whenever we call extend_alloca, but it seems unnecessarily
complicated.  This code is not exactly a performance hotspot (it's
called when there is a cache miss, so factors like network lookup or
file reads will dominate over memory allocation/reallocation), so this
premature optimization is unnecessary.

Thanks Brad Hubbard <bhubbard@redhat.com> for his help with debugging
the problem.
2014-01-16 10:21:52 +05:30
Adhemerval Zanella 2393fc0119 PowerPC: sotruss-lib implementation
This patch add the missing sotruss-lib interfaces for PowerPC.
2014-01-15 12:14:06 -06:00
Ondřej Bílka d359bcc2ad Add ChangeLog entry 2014-01-15 18:43:03 +01:00
Andreas Krebbel 7beb48cbb7 [BZ #16427] Fix ldbl-128 exp overflows.
Invoke the non-IEEE handling only for numbers special also in the IEEE
case.  This aligns the exp handling with the other ldbl variants.
2014-01-15 09:50:31 +01:00
Andreas Krebbel c20d5bf509 S/390: Regenerate ULPs. 2014-01-15 09:49:54 +01:00
Carlos O'Donell e732c5f049 Add BZ #15850 to ChangeLog. 2014-01-12 12:17:33 -05:00
Allan McRae 76d0ea6990 Update Bulgarian translations 2014-01-11 15:19:59 +10:00
Allan McRae e83bd4eeba Update German translations 2014-01-11 15:02:34 +10:00
Roland McGrath bc2ba20ae8 ARM: Disable compat mcount code when unneeded. 2014-01-10 13:32:35 -08:00
Siddhesh Poyarekar 649ecea212 Correct inputs for sin and cos
The inputs for the slowest path in asin and acos were incorrect and
had some fast path inputs there too.
2014-01-10 09:57:51 +05:30
Allan McRae a46dab08ac Update Swedish translations 2014-01-10 12:25:59 +10:00
Allan McRae 421df74a00 Update Vietnamese translations 2014-01-10 12:24:43 +10:00
Allan McRae d61c51a710 Update Esperanto translations 2014-01-10 12:23:21 +10:00
Allan McRae 0339a31917 Update Czech translations 2014-01-10 12:22:12 +10:00
Allan McRae 94ad3e991a Update Dutch translations 2014-01-10 12:20:48 +10:00
Allan McRae e349ca71e5 Update Polish translations 2014-01-10 12:20:44 +10:00
Allan McRae ddf930c169 Update Russian translations 2014-01-10 12:20:38 +10:00
Allan McRae 1b19c00628 Update Ukrainian translations 2014-01-10 12:20:26 +10:00
Brooks Moses 9f236c496a Obvious comment typo fix ("openened") in elf/dl-load.c. 2014-01-08 18:46:53 -08:00
Carlos O'Donell cd6701cf9c Rename header.pot to pot.header.
The Translation Project has asked us to rename the
pot header file `header.pot' to something else. Their
scripts automatically look for pot files and the
file `header.pot' is not actually a pot file but a
header that we use when regenerating `libc.pot.'
This commit renames `header.pot' to `pot.header' to
avoid causing errors or complicating the TP project
scripts.
2014-01-08 17:17:48 -05:00
Yuriy Kaminskiy 66671c84d5 Fix a thinko/typo in i686's memmove (aka __memmove_ia32).
* sysdeps/i386/i686/memmove.S (memmove): Compare distance between
	SRC and DEST against LEN.
2014-01-09 09:49:54 +13:00
Adhemerval Zanella 38f3458175 PowerPC: remove wrong truncl implementation for PowerPC64
The truncl assembly implementation (sysdeps/powerpc/powerpc64/fpu/s_truncl.S)
returns wrong results for some inputs where first double is a exact integer
and the precision is determined by second long double.

Checking on implementation comments and history, I am very confident the
assembly implementation was based on a version before commit
5c68d40169 that fixes BZ#2423 (Errors in
long double (ldbl-128ibm) rounding functions in glibc-2.4).

By just removing the implementation and make the build select
sysdeps/ieee754/ldbl-128ibm/s_truncl.c instead it fixes tgammal
issues regarding wrong result sign.
2014-01-08 08:14:48 -06:00
Adhemerval Zanella 3ff6304ee7 Update powerpc-fpu ULPs. 2014-01-08 07:55:08 -06:00
Joseph Myers 4c327f2ad8 Fix ldbl-128ibm expm1l on large arguments (bug 16408).
This patch fixes bug 16408, ldbl-128ibm expm1l returning NaN for some
large arguments.

The basic problem is that the approach of converting the exponent to
the form n * log(2) + y, where -0.5 <= y <= 0.5, then computing 2^n *
expm1(y) + (2^n - 1) falls over when 2^n overflows (starting slightly
before the point where expm1 overflows, when y is negative and n is
the least integer for which 2^n overflows).  The ldbl-128 code, and
the x86/x86_64 code, make expm1l fall back to expl for large positive
arguments to avoid this issue.  This patch makes the ldbl-128ibm code
do the same.  (The problem appears for the particular argument in the
testsuite because the ldbl-128ibm code also uses an overflow threshold
that's for ldbl-128 and is too big for ldbl-128ibm, but the problem
described applies for large non-overflowing cases as well, although
during the freeze is not a suitable time for making the expm1 tests
cover cases close to overflow more thoroughly.)

This leaves some code for large positive arguments in expm1l that is
now dead.  To keep the code for ldbl-128 and ldbl-128ibm similar, and
to avoid unnecessary changes during the freeze, the patch doesn't
remove it; instead I propose to file a bug in Bugzilla as a reminder
that this code (for overflow, including errno setting, and for
arguments of +Inf) is no longer needed and should be removed from both
those expm1l implementations.

Tested powerpc32.

	* sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (__expm1l): Use __expl
	for large positive arguments.
2014-01-08 13:32:39 +00:00
Joseph Myers 1f0f206719 Regenerate powerpc-nofpu ulps (again). 2014-01-07 23:32:04 +00:00
Joseph Myers a5a326f660 Mark more libm tests with xfail-rounding:ldbl-128ibm.
This patch marks more libm tests as expected to fail for ldbl-128ibm
in non-default rounding modes.  Given this, my expm1l fix
<https://sourceware.org/ml/libc-alpha/2014-01/msg00135.html> and my
libgcc fix <http://gcc.gnu.org/ml/gcc-patches/2014-01/msg00157.html>
for spurious overflows, the remaining failures in test-ldouble.out
(for powerpc32 hard float) are small ulps, spurious underflow and
inexact exceptions (the former probably arising from libgcc bugs
though I haven't checked each case; the latter are barely meaningful
for this format anyway when basic arithmetic isn't correctly rounding,
though most of them are probably GCC bug 59412 which doesn't actually
involve long double), missing underflow exceptions from clog, ctan and
ctanh (probably one of the known bugs for another function), and logb
in round-downward mode (bug 887, though it's really a GCC bug that
we're not currently working around).

Tested for powerpc32 hard float.

	* math/auto-libm-test-in: Mark various tests with
	xfail-rounding:ldbl-128ibm.
	* math/auto-libm-test-out: Regenerated.
2014-01-07 22:41:58 +00:00
Joseph Myers b821f414e4 Fix ldbl-128ibm coshl spurious overflows (bug 16407).
This patch fixes bug 16407, spurious overflows from ldbl-128ibm coshl.
The implementation assumed that a high part (reinterpreted as an
integer) of the absolute value of the argument of 0x408633ce8fb9f87dLL
or more meant overflow, but the actual threshold has high part
0x408633ce8fb9f87eLL (and a negative low part).  The patch adjusts the
threshold accordingly.

sinhl probably has the same issue, but I didn't get that far in adding
tests of special cases (such as just below and above overflow) before
the freeze and during the freeze is not a suitable time to add them
(as they'd require ulps to be regenerated again), so I'm not changing
that function for now; when I add more tests of special cases, we'll
discover whether sinhl indeed has this problem.

Tested powerpc32.

	* sysdeps/ieee754/ldbl-128ibm/e_coshl.c (__ieee754_coshl):
	Increase overflow threshold.
2014-01-07 22:00:04 +00:00
Ondřej Bílka 94c8a4bc57 Fix integer overflow in vfwprintf. Fixes bug 14286. 2014-01-07 12:05:32 +01:00
Andreas Krebbel 87ded0c382 S/390: Remove __tls_get_addr argument cast. 2014-01-07 09:42:23 +01:00
Andreas Krebbel c5eebdd084 S/390: Get rid of unused variable warning in dl-machine.h 2014-01-07 09:42:23 +01:00
Andreas Krebbel 05d138ef07 S/390: Make ucontext_t extendible. 2014-01-07 09:42:23 +01:00
Andreas Krebbel 93a45ff1ca S/390: Make jmp_buf extendible. 2014-01-07 09:36:31 +01:00
Joseph Myers eb3fc44b56 Fix ldbl-128 / ldbl-128ibm lgammal spurious underflow (bug 16400).
This patch fixes bug 16400, spurious underflow exceptions for ldbl-128
/ ldbl-128ibm lgammal with small positive arguments, by just using
-__logl (x) as the result in the problem cases (similar to the
previous fix for problems with small negative arguments).

Tested powerpc32, and also tested on mips64 that this does not require
ulps regeneration for the ldbl-128 case.

	* sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgammal_r):
	Return -__logl (x) for small positive arguments without evaluating
	a polynomial.
2014-01-06 18:20:20 +00:00
Mike Frysinger 9341dde4d5 ptrace.h: add __ prefix to ptrace_peeksiginfo_args
All the other ptrace structures in this file have a __ prefix except this
new one.  This in turn causes build problems for most packages that try to
use ptrace such as strace:

gcc -DHAVE_CONFIG_H -I. -I../..  -I../../linux/x86_64 -I../../linux \
	-I./linux  -Wall -Wwrite-strings -g -O2 -MT process.o -MD -MP \
	-MF .deps/process.Tpo -c -o process.o ../../process.c
In file included from ../../process.c:63:0:
/usr/include/linux/ptrace.h:58:8: error: redefinition of 'struct ptrace_peeksiginfo_args'
 struct ptrace_peeksiginfo_args {
        ^
In file included from ../../defs.h:159:0,
                 from ../../process.c:37:
/usr/include/sys/ptrace.h:191:8: note: originally defined here
 struct ptrace_peeksiginfo_args
        ^

Since this struct was introduced in glibc-2.18, there shouldn't be any
real regressions with adding the __ prefix.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-06 08:07:33 -05:00
Allan McRae 4cff0293ef Fix typo in inet/netinet/in.h comment 2014-01-06 11:27:43 +10:00
Andreas Jaeger 75595dcf8a Update ULPs for i386
Update based on testing with GCC 4.8.1 on Intel i7
2014-01-05 21:48:54 +01:00
Allan McRae dd80481867 Regenerate libc.po 2014-01-05 17:47:49 +10:00
Allan McRae 79c1e1094e Fix gettext call formatting 2014-01-05 17:39:45 +10:00
Sami Kerola 0c813d1f3e nscd: list all tables in usage()
Usage output for option --invalidate=TABLE is not helpful without
list of tables.  The list is also missing from nscd(8) manual which
made it pretty difficult to know what are the tables.
2014-01-04 08:44:36 -05:00
Mike Frysinger 20f4a8d993 tst-fanotify: switch to AC_DEFINE
Reported-by: Joseph S. Myers <joseph@codesourcery.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-04 08:34:01 -05:00
Joseph Myers 22562bb222 Fix soft-float ldbl-128ibm atan2l signs of zero results (bug 16390).
This patch fixes bug 16390, incorrect signs of zero results from
ldbl-128ibm atan2l, soft-float only.  The problem is a longstanding
GCC bug with fabsl not being correct for signed zero for soft float,
and the fix is using -fno-builtin-fabsl as a workaround, as already
done for various other source files.  Tested powerpc-nofpu.

	* sysdeps/powerpc/nofpu/Makefile [$(subdir) = math]
	(CFLAGS-e_atan2l.c): Use -fno-builtin-fabsl.
2014-01-03 20:56:40 +00:00
Paul Pluzhnikov 0da43124a9 Fix ChangeLog entry. 2014-01-03 11:59:26 -08:00
Adhemerval Zanella d7ad2d9bad PowerPC: Fix compiler warnings
This patch fixes some compile warnings related to extra tokens at
end of #undef directive from multilib patchset.
2014-01-03 13:29:10 -06:00
Paul Pluzhnikov dc810f3778 Merge branch 'master' of ssh://sourceware.org/git/glibc 2014-01-03 11:23:16 -08:00
Andrew Hunter 7f507ee17a Async-signal safe TLS.
ChangeLog:

2014-01-03  Andrew Hunter  <ahh@google.com>

	* elf/dl-open.c (): New comment.
	* elf/dl-reloc.c (_dl_try_allocate_static_tls): Use
	atomic_compare_and_exchange_bool_acq
	(_dl_allocate_static_tls): Block signals.
	* elf/dl-tls.c (allocate_and_init): Return void.
	(_dl_update_slotinfo): Block signals, use atomic update.

nptl/ChangeLog:

2014-01-03  Andrew Hunter  <ahh@google.com>

	* nptl/Makefile (tst-tls7): New test.
	* nptl/tst-tls7.c: New file.
	* nptl/tst-tls7mod.c: New file.
	* nptl/allocatestack.c (init_one_static_tls): Use atomic barrier.
2014-01-03 11:22:26 -08:00
Joseph Myers 24db925aa7 Regenerate powerpc-nofpu ulps. 2014-01-03 18:09:05 +00:00
Joseph Myers 7dd009d865 Mark various libm tests with xfail-rounding:ldbl-128ibm.
This patch marks various libm tests with xfail-rounding:ldbl-128ibm,
where the failures appear to relate to GCC bug 59666 (bad libgcc
handling of directed rounding), so as to allow clean libm-test-ulps
regeneration without needing to edit out large ulps for various
functions manually.

Note that this only deals with the cases problematic for ulps
regeneration.  There are plenty of test failures left that do not
affect ulps regeneration - results that are infinities or NaNs but
should be finite, or vice versa, and missing and spurious exceptions -
which should also be resolved during the release testing period.

Tested for powerpc32 (hard float).

	* math/auto-libm-test-in: Mark various tests with
	xfail-rounding:ldbl-128ibm.
	* math/auto-libm-test-out: Regenerated.
2014-01-03 17:08:10 +00:00
Joseph Myers 819e5d50dd Fix ldbl-128ibm logl inaccuracy (bug 16386).
This patch fixes bug 16386, ldbl-128ibm logl inaccuracy (with
consequent inaccuracy for lgammal) for arguments where the high double
is subnormal, which showed up while attempting to regenerate ulps for
powerpc-nofpu for 2.19.  The problem here is logic failing to allow
for subnormals when calculating the exponent of the argument.  Tested
for powerpc-nofpu.

	* sysdeps/ieee754/ldbl-128ibm/e_logl.c (__ieee754_logl): Adjust
	numbers with subnormal high part when calculating exponent.
2014-01-02 16:35:46 +00:00
Joseph Myers 90b6a1e55f Fix ldbl-128ibm asinhl inaccuracy (bug 16385).
This patch fixes bug 16385, ldbl-128ibm asinhl inaccuracy, which
showed up while attempting to regenerate ulps for powerpc-nofpu for
2.19.  The problem here was use of fabs instead of fabsl meaning large
arguments were reduced to the precision of double.  Tested for
powerpc-nofpu.

	* sysdeps/ieee754/ldbl-128ibm/s_asinhl.c (__asinhl): Use fabsl not
	fabs.
2014-01-02 16:34:24 +00:00
Joseph Myers 396e3ecf3e Fix ldbl-128ibm acoshl inaccuracy (bug 16384).
This patch fixes bug 16384, ldbl-128ibm acoshl inaccuracy, which
showed up while attempting to regenerate ulps for powerpc-nofpu for
2.19.  There were two separate problems, use of __log1p instead of
__log1pl and an insufficiently accurate constant value for log 2
(which this patch replaces by use of M_LN2l), each of which could
cause substantial inaccuracy in affected cases.

Tested for powerpc-nofpu.

	* sysdeps/ieee754/ldbl-128ibm/e_acoshl.c (ln2): Initialize with
	M_LN2l.
	(__ieee754_acoshl): Use __log1pl not __log1p.
2014-01-02 16:33:06 +00:00
Ondřej Bílka 6c8dbf00f5 Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
Siddhesh Poyarekar 9a3c6a6ff6 Fix return code from getent netgroup when the netgroup is not found (bz #16366)
nscd incorrectly returns a success even when the netgroup in question
is not found and adds a positive result in the cache.  this patch
fixes this behaviour by adding a negative lookup entry to cache and
returning an error when the netgroup is not found.
2014-01-02 10:05:27 +05:30
Siddhesh Poyarekar d41242129b Fix infinite loop in nscd when netgroup is empty (bz #16365)
Currently, when a user looks up a netgroup that does not have any
members, nscd goes into an infinite loop trying to find members in the
group.  This is because it does not handle cases when getnetgrent
returns an NSS_STATUS_NOTFOUND (which is what it does on empty group).
Fixed to handle this in the same way as NSS_STATUS_RETURN, similar to
what getgrent does by itself.
2014-01-02 10:04:21 +05:30
Joseph Myers 97b9a0090e Regenerate x86 / x86_64 ulps. 2014-01-01 14:34:38 +00:00
Allan McRae ddb3687f2a scripts/update-copyrights: adjust configure input file suffix 2014-01-01 22:10:54 +10:00
Allan McRae 88726d48af Update remaining copyright dates
Update copyright years that are not handled by scripts/update-copyright.
2014-01-01 22:02:55 +10:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Mike Frysinger c8590f9d9e tst-fanotify: check for linux/fanotify.h existence
We support older kernels that lack this header, so check for it
before we try to use it.

Reported-by: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-31 03:16:42 -05:00
Siddhesh Poyarekar dd1d85e5dd Benchmark inputs for cos and sin
Add a comprehensive number of inputs for all branches in sin and cos
computation, excluding the fast paths.  This also adds a number of
inputs for the multiple precision slow paths.
2013-12-31 12:12:46 +05:30
Siddhesh Poyarekar 1acbb90f7a benchmark inputs for atan
Add a more comprehensive set of inputs for the atan function.  I have
also fixed the name on the multiple precision fallback inputs (I
couldn't find any new inputs there) to reflect the fact that the
fallback is only 144bits and not 768bits as I had earlier mentioned.
2013-12-31 12:11:13 +05:30
Siddhesh Poyarekar 4c012ed391 benchmark inputs for tanh and atanh 2013-12-31 12:06:30 +05:30
Siddhesh Poyarekar eff9832405 benchmark inputs for asinh and acosh
Like sinh and cosh, this patch has benchmark inputs for asinh and
acosh, generated using a random number generator and spread over
significant branches, ignoring the fast return paths.
2013-12-31 12:05:16 +05:30
Siddhesh Poyarekar ce641152c4 benchmark inputs for sinh and cosh
Add a full set of inputs for sinh and cosh functions generated using a
random number generator and spreading it over all branches in the
function, ignoring the fast paths (i.e. immediate return for special
values).
2013-12-31 12:03:44 +05:30
Siddhesh Poyarekar b19221b9a5 benchmark inputs for asin and acos
Add a comprehensive set of inputs for asin and acos functions,
including the multiple precision fallback path.
2013-12-31 12:01:40 +05:30
Ondřej Bílka 030a4976b8 Fix ChangeLog 2013-12-30 15:55:37 +01:00
Ville Skytta 9dcc8f116c Fix spelling in manual, as in bug 16376 2013-12-30 15:42:26 +01:00
Carlos O'Donell 11520a5796 Add Solvenian translations for glibc messages. 2013-12-27 17:36:14 -05:00
Mike Frysinger 471103ae34 ignore gdb related files
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-12-27 16:30:50 -05:00
Allan McRae 6c9642eda6 Fix typo in csloww()
An incorrect variable name was used during the refactoring done in
commit 4aafb73c.
2013-12-27 12:29:38 +10:00
Brooks Moses 3f637079f5 Define __CORRECT_ISO_CPP_STRING_H_PROTO correctly for Clang.
In the string/string.h and string/strings.h headers, we have a couple
of macros that "tell the caller that we provide correct C++
prototypes" according to the comment; they are used to determine
whether to wrap some prototypes in "extern "C++"" (and provide
multiple overloads of them, and some other magic) when __cplusplus is
defined.

The macros are set to check for sufficiently-recent GCC versions (4.4
and later), but this is not the right check for non-GCC compilers.  In
particular, these macros should also be set when using Clang -- if
they are not set, then Clang will be unable to correctly diagnose a
number of subtle bugs that will be errors in GCC compilations.

As per discussion on earlier versions of this patch, rather than
restrict the fix to Clang per se, we assume that all C++ compilers that
claim to fully support C++98 are using a standard-conforming C++
standard library, which seems pretty reasonable.  Clang has been
providing an appropriate value of __cplusplus since May 2012.
2013-12-23 15:50:54 -08:00
Maxim Kuvyrkov abc26e998f Restore accidentally deleted bug-fix entries in NEWS.
* NEWS: Restore accidentally deleted bug-fix entries.
2013-12-24 10:04:24 +13:00
Maxim Kuvyrkov 362b47fe09 Fix race in free() of fastbin chunk: BZ #15073
Perform sanity check only if we have_lock.  Due to lockless nature of fastbins
we need to be careful derefencing pointers to fastbin entries (chunksize(old)
in this case) in multithreaded environments.

The fix is to add have_lock to the if-condition checks.  The rest of the patch
only makes code more readable.

	* malloc/malloc.c (_int_free): Perform sanity check only if we
	have_lock.
2013-12-24 09:44:50 +13:00
Ondřej Bílka b9bcbbcbe7 Add Changelog and news entry. 2013-12-23 17:58:33 +01:00
Adhemerval Zanella fb55fcd21a Update powerpc-fpu ULPs. 2013-12-23 09:04:18 -05:00
Joseph Myers 4f40e4b307 Fix ldbl-128 lgammal for small negative arguments (bug 16337).
This patch fixes bug 16337, ldbl-128 lgammal spurious overflows for
small negative arguments (the arguments in question are already in the
testsuite).  The implementation uses the reflection formula to compute
lgamma of negative x from lgamma of -x, effectively resulting in a
calculation -log(x^2) + log(-x); cancellation isn't problematic in
this case (bugs for problematic cancellation in lgamma are 2542, 2543,
2558), but the x^2 calculation can underflow (in which case there is
spurious logic to return an overflowing value - lgamma can only ever
correctly overflow for large positive arguments, though tgamma can
overflow for small arguments of either sign as well as large positive
arguments).  The fix is simply to calculate the result directly with
logl when the argument is a small enough negative number.

Tested mips64.

	* sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgammal_r):
	Calculate results for small negative arguments directly rather
	than using reflection formula with special underflow handling.
2013-12-22 20:50:16 +00:00
Joseph Myers ef7344f09c Flatten sysdeps/unix/bsd/bsd4.4 into sysdeps/unix/bsd.
As discussed in
<https://sourceware.org/ml/libc-alpha/2012-04/msg00840.html> and
<https://sourceware.org/ml/libc-alpha/2012-04/msg00989.html>, it seems
appropriate to flatten sysdeps/unix/bsd/bsd4.4 into sysdeps/unix/bsd.

The bulk of the patch is just moving files.  The only other changes
are: update paths in sysdeps/mach/hurd/Implies and
sysdeps/unix/sysv/linux/wait3.c; merge the two syscalls.list files,
with the removal of syscalls that were in
sysdeps/unix/bsd/syscalls.list but overridden in the bsd4.4 directory
by .c files there.

Tested x86_64.  The installed shared libraries are identical before
and after the patch except for libc.so where the move of wait3.c
(included by sysdeps/unix/sysv/linux/wait3.c) affects debug info, but
the disassembly is unchanged.

	* sysdeps/mach/hurd/Implies: Change unix/bsd/bsd4.4 to unix/bsd.
	* sysdeps/unix/bsd/syscalls.list (chflags): Add entry from
	sysdeps/unix/bsd/bsd4.4/syscalls.list.
	(fchflags): Likewise.
	(revoke): Likewise.
	(setlogin): Likewise.
	(sigaltstack): Likewise.
	(wait4): Likewise.
	(sigblock): Remove.
	(sigsetmask): Likewise.
	(wait3): Likewise.
	(waitpid): Likewise.
	* sysdeps/unix/bsd/bsd4.4/syscalls.list: Remove file.
	* sysdeps/unix/sysv/linux/wait3.c: Update directory of included
	file.
	* sysdeps/unix/bsd/bsd4.4/Makefile: Move to ...
	* sysdeps/unix/bsd/Makefile: ... here.
	* sysdeps/unix/bsd/bsd4.4/Versions: Move to ...
	* sysdeps/unix/bsd/Versions: ... here.
	* sysdeps/unix/bsd/bsd4.4/bits/sockaddr.h: Move to ...
	* sysdeps/unix/bsd/bits/sockaddr.h: ... here.
	* sysdeps/unix/bsd/bsd4.4/cmsg_nxthdr.c: Move to ...
	* sysdeps/unix/bsd/cmsg_nxthdr.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/sigblock.c: Move to ...
	* sysdeps/unix/bsd/sigblock.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/sigsetmask.c: Move to ...
	* sysdeps/unix/bsd/sigsetmask.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/sigvec.c: Move to ...
	* sysdeps/unix/bsd/sigvec.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/tcdrain.c: Move to ...
	* sysdeps/unix/bsd/tcdrain.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/tcgetattr.c: Move to ...
	* sysdeps/unix/bsd/tcgetattr.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/tcsetattr.c: Move to ...
	* sysdeps/unix/bsd/tcsetattr.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/wait.c: Move to ...
	* sysdeps/unix/bsd/wait.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/wait3.c: Move to ...
	* sysdeps/unix/bsd/wait3.c: ... here.
	* sysdeps/unix/bsd/bsd4.4/waitpid.c: Move to ...
	* sysdeps/unix/bsd/waitpid.c: ... here.
2013-12-22 14:49:48 +00:00
Joseph Myers 5b0626b9c5 Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356).
This patch fixes bug 16356, bad results from x86 / x86_64 expl /
exp10l in directed rounding modes, the most serious of the bugs shown
up by my patch expanding libm test coverage.  When I fixed bug 16293,
I thought it was only necessary to set round-to-nearest when using
frndint in expm1 functions, because in other cases the cancellation
error from having the resulting fractional part close to 1 or -1 would
not be significant.  However, in expl and exp10l, the way the final
fractional part gets computed (something more complicated than a
simple subtraction, because more precision is needed than you'd get
that way) can result in a value outside the range [-1, 1] when the
argument to frndint was very close to an integer and was rounded the
"wrong" way because of the rounding mode - and the f2xm1 instruction
has undefined results if its argument is outside [-1, 1], so resulting
in the large errors seen.  So this patch removes the USE_AS_EXPM1L
conditionals on the round-to-nearest settings, so all of expl, expm1l
and exp10l now get round-to-nearest used for frndint (meaning the
final fractional part can at most be slightly above 0.5 in
magnitude).  Associated tests of exp and exp10 are added and testing
of exp10 in directed rounding modes enabled.

Tested x86_64 and x86 and ulps updated accordingly.

	* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL): Also set
	round-to-nearest for [!USE_AS_EXPM1L].
	* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL): Likewise.
	* math/auto-libm-test-in: Do not expect cosh tests to fail.  Add
	more tests of exp and exp10.  Expect some exp10 tests to miss
	exceptions or fail in directed rounding modes.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (exp10_tonearest_test_data): New array.
	(exp10_test_tonearest): New function.
	(exp10_towardzero_test_data): New array.
	(exp10_test_towardzero): New function.
	(exp10_downward_test_data): New array.
	(exp10_test_downward): New function.
	(exp10_upward_test_data): New array.
	(exp10_test_upward): New function.
	(main): Call the new functions.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-21 13:07:16 +00:00
Joseph Myers 31e3a40588 Add more libm-test coverage of [a-c]* real functions.
Various libm functions have inadequate test coverage in libm-test.inc
/ auto-libm-test-in - failing to cover all the usual special cases
(infinities, NaNs, zero, large and small finite values, subnormals) as
well as a reasonable range of ordinary inputs and, where appropriate,
inputs close to the thresholds for underflow and overflow.

This patch improves test coverage for real functions [a-c]* (with the
expectation of adding more coverage for other functions later).

Tested x86_64 and x86 and ulps updated accordingly (and eight glibc
bugs and one C11 DR filed for issues found in the process).

	* math/auto-libm-test-in: Add more tests of acos, acosh, asin,
	asinh, atan, atan2, atanh, cbrt, cos and cosh.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (acosh_test_data): Add more tests.
	(atanh_test_data): Likewise.
	(ceil_test_data): Likewise.
	(copysign_test_data): Likewise.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-20 21:03:39 +00:00
Joseph Myers 85bff96ad6 Update timezone code from tzcode 2013i.
Now we have Paul's support for version-3 tz files checked in, this
patch updates all the code we take (unmodified) from tzcode to version
2013i (which includes the support for generating version-3 tz files
where necessary).

Tested x86_64.

	* timezone/checktab.awk: Update from tzcode 2013i.
	* timezone/private.h: Likewise.
	* timezone/scheck.c: Likewise.
	* timezone/tzfile.h: Likewise.
	* timezone/tzselect.ksh: Likewise.
	* timezone/zdump.c: Likewise.
	* timezone/zic.c: Likewise.
2013-12-20 13:10:07 +00:00
Joseph Myers b7867a3bfb Move tests of cpow from libm-test.inc to auto-libm-test-in.
This patch moves tests of cpow to auto-libm-test-in, adding the
required support to gen-auto-libm-tests.

Tested x86_64 and x86 and ulps updated accordingly.

	* math/auto-libm-test-in: Add tests of cpow.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (cpow_test_data): Use AUTO_TESTS_cc_c.
	* * math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpc_cc_c.
	(func_calc_desc): Add mpc_cc_c union field.
	(test_functions): Add cpow.
	(special_fill_2pi): New function.
	(special_real_inputs): Add 2pi.
	(calc_generic_results): Handle mpc_cc_c.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-20 12:35:10 +00:00
Joseph Myers 7fda568229 Move various TEST_c_c tests from libm-test.inc to auto-libm-test-inc.
This patch moves tests of ccos, ccosh, cexp, clog, csqrt, ctan and
ctanh to auto-libm-test-in, adding the required support to
gen-auto-libm-tests.  Other TEST_c_c functions aren't moved for now
(although the relevant table entries are put in gen-auto-libm-tests
for it to know how to handle them): clog10 because of a known MPC bug
causing it to hang for at least some pure imaginary inputs (fixed in
SVN, but I'd rather not rely on unreleased versions of MPFR or MPC
even if relying on very recent releases); the inverse trig and
hyperbolic functions because of known slowness in special cases; and
csin / csinh because of observed slowness that I need to investigate
and report to the MPC maintainers.  Slowness can be bypassed by moving
to incremental generation (only for new / changed tests) rather than
regenerating the whole of auto-libm-test-out every time, but that
needs implementing.  (This patch takes the time for running
gen-auto-libm-tests from about one second to seven, on my system,
which I think is reasonable.  The slow functions would make it take
several minutes at least, which seems unreasonable.)

Tested x86_64 and x86 and ulps updated accordingly.

	* math/auto-libm-test-in: Add tests of ccos, ccosh, cexp, clog,
	csqrt, ctan and ctanh.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (TEST_COND_x86_64): New macro.
	(TEST_COND_x86): Likewise.
	(ccos_test_data): Use AUTO_TESTS_c_c.
	(ccosh_test_data): Likewise.
	(cexp_test_data): Likewise.
	(clog_test_data): Likewise.
	(csqrt_test_data): Likewise.
	(ctan_test_data): Likewise.
	(ctan_tonearest_test_data): Likewise.
	(ctan_towardzero_test_data): Likewise.
	(ctan_downward_test_data): Likewise.
	(ctan_upward_test_data): Likewise.
	(ctanh_test_data): Likewise.
	(ctanh_tonearest_test_data): Likewise.
	(ctanh_towardzero_test_data): Likewise.
	(ctanh_downward_test_data): Likewise.
	(ctanh_upward_test_data): Likewise.
	* math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpc_c_c.
	(func_calc_desc): Add mpc_c_c union field.
	(FUNC_mpc_c_c): New macro.
	(test_functions): Add cacos, cacosh, casin, casinh, catan, catanh,
	ccos, ccosh, cexp, clog, clog10, csin, csinh, csqrt, ctan and
	ctanh.
	(special_fill_min_subnorm_p120): New function.
	(special_real_inputs): Add min_subnorm_p120.
	(calc_generic_results): Handle mpc_c_c.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-20 12:32:44 +00:00
Siddhesh Poyarekar 392dd2de03 Consolidate code to compute sin and cos from lookup tables
This patch consolidates the multiple copies of code that looks up sin
and cos of a number from the lookup table and computes the final
value, into static functions.  This does not have a noticeable
performance impact since the functions are inlined by gcc.

There is further scope for consolidation in the functions but they
cause a more noticable impact on performance (>5%) due to which I have
held back on them.
2013-12-20 16:01:03 +05:30
Siddhesh Poyarekar 84ba214c21 Remove more redundant computations in s_sin.c
Removed more redundant computations in the slow paths of the sin and
cos functions.  The notable change is the passing of the most
significant bits of X to the slow functions to check if X is positive
so that just the absolute value of x can be passed and the repeated
ABS() operation is avoided.
2013-12-20 15:58:19 +05:30
Siddhesh Poyarekar 975195e466 Remove redundant arguments in reduce_and_compute
The A and DA arguments in reduce_and_compute are useless and hence
have been removed.
2013-12-20 15:56:21 +05:30
Siddhesh Poyarekar 5ff8d60ef3 Remove some redundant computations in s_sin.c
There are multiple points in the code where the absolute value of a
number is computed multiple times or is computed even though the value
can only be positive.  This change removes those redundant
computations.  Tested on x86_64 to verify that there were no
regressions in the testsuite.
2013-12-20 15:55:34 +05:30
Joseph Myers 64a17f1add Move tests of cabs and carg from libm-test.inc to auto-libm-test-in.
This patch moves tests of cabs and carg to auto-libm-test-in, adding
the required support to gen-auto-libm-tests.

Tested x86_64 and x86; no ulps updates needed.

	* math/auto-libm-test-in: Add tests of cabs and carg.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (cabs_test_data): Use AUTO_TESTS_c_f.
	(carg_test_data): Likewise.
	* math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpc_c_f.
	(func_calc_desc): Add mpc_c_f union field.
	(test_functions): Add cabs and carg.
	(calc_generic_results): Handle mpc_c_f.
2013-12-19 21:28:30 +00:00
Joseph Myers eb98356875 Don't make soft-fp symbols compat symbols for powerpc-nofpu.
sysdeps/powerpc/powerpc32/libgcc-compat.S makes certain symbols that
glibc once accidentally reexported from libgcc into compat symbols.

Where the exports were purely accidental, this is the right thing to
do.  However, for powerpc-nofpu the soft-fp symbols are deliberately
exported from libc, given public versions in
sysdeps/powerpc/nofpu/Versions and used by libm in preference to the
libgcc versions that do not support the software exceptions and
rounding modes.  The libc versions should also be usable by user
programs, though normally libgcc gets linked in first (meaning,
effectively, that the <fenv.h> functions are broken as regards their
expected effects on user arithmetic).

A longstanding todo item is to remove the functions in question from
libgcc (when built with recent enough glibc) - that is, remove them
from static libgcc and make them compat symbols in shared libgcc - so
that this works properly (this is one of the items mentioned at
<http://gcc.gnu.org/wiki/Software_floating_point> - parts of that page
are obviously out of date, but this item still applies).  Doing this
requires first that the functions are actually available from libc for
new links, not just as compat symbols.

This patch stops the symbols in question being compat symbols for
powerpc-nofpu.  The nofpu Versions entries for them are removed (the
symbols never were exported at GLIBC_2.3.2, only GLIBC_2.0, because
the compat symbols took precedence).

Tested powerpc-nofpu.  The symbols are no longer compat symbols and
libm.so now properly gets undefined references to them (resolved to
libc.so) instead of the libgcc copies getting linked into libm as
before.

	* sysdeps/powerpc/powerpc32/libgcc-compat.S
	[_SOFT_FLOAT || __NO_FPRS__] (__fixdfdi_v_glibc20): Do not define
	as a macro and a compat symbol.
	[_SOFT_FLOAT || __NO_FPRS__] (__fixsfdi_v_glibc20): Likewise.
	[_SOFT_FLOAT || __NO_FPRS__] (__fixunsdfdi_v_glibc20): Likewise.
	[_SOFT_FLOAT || __NO_FPRS__] (__fixunssfdi_v_glibc20): Likewise.
	[_SOFT_FLOAT || __NO_FPRS__] (__floatdidf_v_glibc20): Likewise.
	[_SOFT_FLOAT || __NO_FPRS__] (__floaddisf_v_glibc20): Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixdfdi): Do
	not use .hidden.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixsfdi):
	Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixunsdfdi):
	Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__fixunssfdi):
	Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__floaddidf):
	Likewise.
	[HAVE_DOT_HIDDEN && (_SOFT_FLOAT || __NO_FPRS__)] (__floaddisf):
	Likewise.
	* sysdeps/powerpc/nofpu/Versions (libc): Remove __fixdfdi,
	__fixsfdi, __fixunsdfdi, __fixunssfdi, __floatdidf and __floatdisf
	from GLIBC_2.3.2.
2013-12-19 21:26:36 +00:00
Adhemerval Zanella 6eeb678ac0 Update powerpc-fpu ULPs. 2013-12-19 13:44:16 -06:00
Paul Pluzhnikov 063b2acbce Cleanup compile warnings.
2013-12-19  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* elf/dl-misc.c (ptr_to_signal_safe_allocator_header): New function.
	(__signal_safe_memalign, __signal_safe_free): Use it.
	(__signal_safe_realloc): Likewise.
2013-12-19 10:25:23 -08:00
Joseph Myers 21fea2e228 Update texinfo.tex, config.guess, config.sub from upstream.
This patch updates various miscellaneous files we take from upstream
GNU sources (texinfo.texi, config.guess, config.sub - various others
haven't changed upstream since we last updated them) to their current
upstream versions.

Tested x86_64.

	* manual/texinfo.tex: Update to version 2013-11-26.10 with
	trailing whitespace removed.
	* scripts/config.guess: Update to version 2013-11-29.
	* scripts/config.sub: Update to version 2013-10-01.
2013-12-19 17:36:10 +00:00
Joseph Myers 6f6fc48226 Move tests of sincos from libm-test.inc to auto-libm-test-in.
This patch moves tests of sincos to auto-libm-test-in, adding the
required support to gen-auto-libm-tests.

Tested x86_64 and x86 and ulps updated accordingly.

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

	* math/auto-libm-test-in: Add tests of sincos.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (sincos_test_data): Use AUTO_TESTS_fFF_11.
	* math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpfr_f_11.
	(func_calc_desc): Add mpfr_f_11 union field.
	(test_functions): Add sincos.
	(calc_generic_results): Handle mpfr_f_11.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-19 17:21:01 +00:00
Andreas Schwab 83f5c32d21 Fix uses of CALL_MCOUNT in ppc64 assembler sources 2013-12-19 17:06:48 +01:00
Joseph Myers 335ee09231 Disable libm-test test name beautification for M_* constants.
math/gen-libm-test.pl has code to beautify names of various constants,
transforming the source form in libm-test.inc into the version
appearing in test names in libm-test-ulps files.

This has become decreasingly relevant over time for the M_* constants,
first as I changed the test names so only the arguments and not the
expected results appeared in them, then as tests have moved to
auto-libm-test-* so that automatically generated hex float constants
get used instead of M_* in test inputs.

This patch removes the beautification for all M_* constants.  Tested
x86_64 and x86 and ulps updated accordingly.  Even the one case where
this affected the name in the ulps files will disappear once complex
function tests are moved to auto-libm-test-*.

	* math/gen-libm-test.pl (%beautify): Remove M_* constants.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-19 14:59:22 +00:00
Joseph Myers f88acd39da Fix x86/x86_64 expm1 inaccuracy near 0 in directed rounding modes (bug 16293).
Bug 16293 is inaccuracy of x86/x86_64 versions of expm1, near 0 in
directed rounding modes, that arises from frndint rounding the
exponent to 1 or -1 instead of 0, resulting in large cancellation
error.  This inaccuracy in turn affects other functions such as sinh
that use expm1.  This patch fixes the problem by setting
round-to-nearest mode temporarily around the affected calls to
frndint.  I don't think this is needed for other uses of frndint, such
as in exp itself, as only for expm1 is the cancellation error
significant.

Tested x86_64 and x86 and ulps updated accordingly.

	* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]: Set
	round-to-nearest mode when using frndint.
	* sysdeps/i386/fpu/s_expm1.S (__expm1): Likewise.
	* sysdeps/i386/fpu/s_expm1f.S (__expm1f): Likewise.
	* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL) [USE_AS_EXPM1L]:
	Likewise.
	* math/auto-libm-test-in: Add more tests of expm1.  Do not expect
	sinh test to fail.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (TEST_COND_x86_64): Remove macro.
	(TEST_COND_x86): Likewise.
	(expm1_tonearest_test_data): New array.
	(expm1_test_tonearest): New function.
	(expm1_towardzero_test_data): New array.
	(expm1_test_towardzero): New function.
	(expm1_downward_test_data): New array.
	(expm1_test_downward): New function.
	(expm1_upward_test_data): New array.
	(expm1_test_upward): New function.
	(main): Run the new test functions.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-19 13:36:10 +00:00
Joseph Myers c688b41960 Add _DEFAULT_SOURCE feature test macro.
This patch adds a feature test macro _DEFAULT_SOURCE to enable the
default set of header declarations.

The intention is: if _DEFAULT_SOURCE is not used there is no change to
the set of __USE_* macros glibc defines; if it's used on its own, and
without compiler options such as -std=c99 that define __STRICT_ANSI__,
again, there is no change; if it's used together with the macros it
approximately (i.e., apart from __USE_POSIX_IMPLICITLY) implies
(-D_BSD_SOURCE -D_SVID_SOURCE -D_POSIX_C_SOURCE=200809L), again, there
is no change.  Otherwise, it causes the relevant features to be
enabled, even if __STRICT_ANSI__, or another feature test macro, would
cause them to be disabled.

This macro deliberately bundles the POSIX.1-2008 (non-X/Open)
functionality with the BSD/SVID/"misc" functionality, rather than
defining a macro that gives just the latter, as many of the header
cleanups resulting from removing _BSD_SOURCE and _SVID_SOURCE support
are only possible when BSD/SVID/"misc" is always bundled with
POSIX.1-2008.

Tested x86_64.

	* include/features.h: Update comment documenting feature test
	macros.  Mention _DEFAULT_SOURCE in comment.
	[_GNU_SOURCE] (_DEFAULT_SOURCE): Undefine and redefine.
	[_DEFAULT_SOURCE]: Undefine and redefine _DEFAULT_SOURCE,
	_BSD_SOURCE and _SVID_SOURCE.
	[!__STRICT_ANSI__ && !_ISOC99_SOURCE && !_POSIX_SOURCE &&
	!_POSIX_C_SOURCE && !_XOPEN_SOURCE && !_BSD_SOURCE &&
	!_SVID_SOURCE]: Likewise.
	[_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE]
	(__USE_POSIX_IMPLICITLY): Define.
	[_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE]
	(_POSIX_SOURCE): Undefine and redefine.
	[_DEFAULT_SOURCE && !_POSIX_SOURCE && !_POSIX_C_SOURCE]
	(_POSIX_C_SOURCE): Likewise.
	* manual/creature.texi (_DEFAULT_SOURCE): Document.
	(Feature Test Macros): Update documentation of default features.
2013-12-19 13:32:42 +00:00
Rajalakshmi Srinivasaraghavan 9f6e964c3a benchtests: Add strtok benchmark 2013-12-19 06:45:54 -05:00
Allan McRae ee0a148a56 Stop partial menu generation in INSTALL file
The commit d136c6dc resulted in menu text for the "Top" node being added
to the INSTALL file on regeneration.  As the full menu is not displayed
in the plain text file anyway, suppress the menu section completely to
avoid the additional text.

Also regenerate the INSTALL file to commit a small formatting change
introduced in the same commit.
2013-12-19 11:54:06 +10:00
Paul Pluzhnikov 1f33d36a8a Patch 2/4 of the effort to make TLS access async-signal-safe.
Add a signal-safe malloc replacement.

2013-12-18  Andrew Hunter  <ahh@google.com>

	* sysdeps/generic/ldsodefs.h (__signal_safe_memalign): New prototype.
	(__signal_safe_malloc, __signal_safe_free): Likewise.
	(__signal_safe_realloc, __signal_safe_calloc): Likewise.
	* elf/dl-misc.c (__signal_safe_allocator_header): New struct.
	(__signal_safe_memalign, __signal_safe_malloc): New function.
	(__signal_safe_free, __signal_safe_realloc): Likewise.
	(__signal_safe_calloc): Likewise.
	* elf/dl-tls.c (allocate_dtv, _dl_clear_dtv): Call signal-safe
	functions.
	(_dl_deallocate_tls, _dl_update_slotinfo): Likewise.
2013-12-18 16:46:18 -08:00
Paul Pluzhnikov 35e8f7ab94 Patch 3/4 of the effort to make TLS access async-signal-safe.
Factor out _dl_clear_dtv.

2013-12-18  Andrew Hunter  <ahh@google.com>

	* elf/Versions (ld): Add _dl_clear_dtv.
	* sysdeps/generic/ldsodefs.h (_dl_clear_dtv): New prototype.
	* elf/dl-tls.c (_dl_clear_dtv): New function.
	* nptl/allocatestack.c (get_cached_stack): Call _dl_clear_dtv.
2013-12-18 16:24:19 -08:00
Paul Pluzhnikov 69a17d9d24 Patch [1/4] async-signal safe TLS.
2013-12-18  Andrew Hunter  <ahh@google.com>

	* sysdeps/generic/ldsodefs.h (_dl_mask_all_signals): New prototype.
	(_dl_unmask_signals): Likewise.
	* sysdeps/mach/hurd/dl-sysdep.h (_dl_mask_all_signals): New stub.
	(_dl_unmask_all_signals): Likewise.
	* sysdeps/unix/sysv/linux/dl-sysdep.h (_dl_mask_all_signals): New prototype.
	(_dl_unmask_all_signals): Likewise.
	* sysdeps/unix/sysv/linux/dl-sysdep.c (_dl_mask_all_signals): New function.
	(_dl_unmask_signals): Likewise.
2013-12-18 15:07:11 -08:00
Brooks Moses b9ab448f98 Add error reporting (via errno) to getauxval().
[BZ 15846] As discussed in the recent thread on my $EXEC_ORIGIN patch
and in BZ 15846, getauxval() presently has no unambiguous way of
reporting an error condition.  It currently returns zero on error, but
this may also be a valid result for some auxv entries.  As there is no
clear invalid result for all current and future auxv entries, this patch
sets errno (following a suggestion in the BZ entry).

This version of the patch also adds documentation and tests for the
value-not-found conditions in getauxval().
2013-12-18 10:52:37 -08:00
Joseph Myers f889953b44 Move tests of jn and yn from libm-test.inc to auto-libm-test-in.
This patch moves tests of jn and yn to auto-libm-test-in, adding the
required support for gen-auto-libm-tests (and adding a missing
assertion there and fixing logic that was broken for functions with
integer arguments).

Tested x86_64 and x86 and ulps updated accordingly.

	* math/auto-libm-test-in: Add tests of jn and yn.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (jn_test_data): Use AUTO_TESTS_if_f.
	(yn_test_data): Likewise.
	* math/gen-auto-libm-tests.c (func_calc_method): Add value
	mpfr_if_f.
	(func_calc_desc): Add mpfr_if_f union field.
	(FUNC_mpfr_if_f): New macro.
	(test_functions): Add jn and yn.
	(calc_generic_results): Assert type of second input for
	mpfr_ff_f.  Handle mpfr_if_f.
	(output_for_one_input_case): Disable all checking for arguments
	fitting floating-point types in case of an integer argument.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-18 17:59:29 +00:00
Joseph Myers 2377648767 Update powerpc-nofpu localplt.data for fegetround hidden_proto / hidden_def.
My recent changes that added libm_hidden_proto / libm_hidden_def for
fegetround had the side effect of removing the need for a
localplt.data entry for fegetround for powerpc-nofpu.  This patch
removes that entry.  Tested powerpc-nofpu.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/localplt.data:
	Don't expect fegetround reference in libm.so.
2013-12-18 15:17:39 +00:00
Marcus Shawcroft cb756c6d68 Compile e_sqrt.c with -ffp-contract=off. 2013-12-18 12:07:06 +00:00
Joseph Myers 5953eb3ad7 Mark some hypot tests no-test-inline.
As needed on x86.

	* math/auto-libm-test-in: Mark some hypot tests no-test-inline.
	* math/auto-libm-test-out: Regenerated.
2013-12-18 11:46:16 +00:00
Joseph Myers 2dec468fd8 Fix ldbl-128 logl for subnormals (bug 16338).
This patch fixes bug 16338, ldbl-128 logl not handling subnormals
(with consequent inaccuracy for lgammal as well).  The fix is simply
to use __frexpl when determining the exponent, as done already in
log2l and log10l.  Given the lack of testing of small arguments to any
of the log* functions, appropriate tests are added for all of them.

Tested x86_64 and x86 and ulps updated accordingly, and spot tests
also run for mips64 to confirm the ldbl-128 fix.

Note that while this fixes lgammal inaccuracy for small positive
arguments, I suspect that there will still be problems with spurious
underflows in that case.

	* sysdeps/ieee754/ldbl-128/e_logl.c (__ieee754_logl): Use __frexpl
	to determine exponent and adjust argument to have exponent of -1.
	* math/auto-libm-test-in: Add more tests of log, log10, log1p and
	log2.
	* math/auto-libm-test-out: Regenerated.
	* sysdeps/x86_64/fpu/libm-test-ulps: Update.
2013-12-18 11:38:27 +00:00
Ondřej Bílka 4d84e6addd Update documentation after dropping PER_THREAD conditional.
In probes documentation we described what happens when PER_THREAD is
disabled which is now not relevant.
2013-12-18 11:18:19 +01:00
Andreas Schwab 1818483b15 Remove use of SSE4.2 functions for strstr on i686
The SSE4.2 have been removed from x86_64 by commit 584b18eb.  This patch
fixes the build on i686, which attempts to use the removed files.
2013-12-18 14:28:30 +10:00
Joseph Myers 25de95bfd1 Remove unused files from sysdeps/unix/bsd/bsd4.4/bits/. 2013-12-17 18:53:32 +00:00
Paul Eggert 0748546f66 Support TZ transition times < 00:00:00.
This is needed for version-3 tz-format files; it supports time
stamps past 2037 for America/Godthab (the only entry in the tz
database for which this change is relevant).
* manual/time.texi (TZ Variable): Document transition times
from -167:59:59 through -00:00:01.
* time/tzset.c (tz_rule): Time of day is now signed.
(__tzset_parse_tz): Parse negative time of day.
2013-12-17 10:18:10 -08:00
Paul Eggert 4480e934cc Document TZ transition times >= 25:00:00.
* manual/time.texi (TZ Variable): Document transition times from
25:00:00 through 167:59:59.  These are already supported, and this
support will help with version-3 tz-format files.
2013-12-17 10:18:09 -08:00
Paul Eggert 69947401b9 * manual/time.texi (TZ Variable): Modernize North America example
to reflect current (i.e., 2007-and-later) daylight saving rules.
2013-12-17 10:18:09 -08:00
Paul Eggert 674762d904 * manual/time.texi (TZ Variable): POSIX.1 hour can be 24. 2013-12-17 10:18:09 -08:00
Joseph Myers 2fc6557eb8 Remove various unused files from sysdeps/unix/bsd/. 2013-12-17 18:12:52 +00:00
Joseph Myers 029c7b2599 Remove libbsd-compat dummy library. 2013-12-17 18:11:48 +00:00
Joseph Myers 7011c2622f Remove __FAVOR_BSD. 2013-12-17 18:05:57 +00:00
Adhemerval Zanella affb6f7836 Update powerpc-fpu ULPs. 2013-12-17 10:23:00 -06:00
Joseph Myers 6432a5409c Fix dbl-64 hypot spurious underflows (bug 16314). 2013-12-17 13:43:40 +00:00
Joseph Myers c88769dda4 Fix hypot handling of subnormals (bug 16316, bug 16330). 2013-12-17 13:42:13 +00:00
Kaz Kojima 29618f6b74 Make soft-float sh use soft-fp fma/fmaf. 2013-12-17 09:00:05 +09:00
Roland McGrath eacfdfbfad Clean up setjmp use in dl-error.c. 2013-12-16 14:09:52 -08:00
Joseph Myers ff362e5b93 Move tests of atan2, hypot and pow from libm-test.inc to auto-libm-test-in. 2013-12-16 21:18:07 +00:00
Will Newton 5764c27f8b manual/memory.texi: Document aligned_alloc.
ChangeLog:

2013-12-16  Will Newton  <will.newton@linaro.org>

	* manual/memory.texi (Malloc Examples): Mention aligned_alloc.
	(Aligned Memory Blocks): Add documentation for aligned_alloc
	and suggest it as an alternative to posix_memalign.
	(Hooks for Malloc): Document __memalign_hook is also called
	for aligned_alloc.  (Summary of Malloc): Add summary for
	aligned alloc.  Document __memalign_hook is also called
	for aligned_alloc.
2013-12-16 14:51:39 +00:00
Will Newton 0a096e4487 manual/memory.texi: Bring aligned allocation docs up to date.
The current documentation suggests using memalign and valloc which
are now considered obsolete, so suggest using posix_memalign instead.
Also document the possible error return and errno values for memalign
and posix_memalign and improve documentation of __memalign_hook.

ChangeLog:

2013-12-16  Will Newton  <will.newton@linaro.org>

	* manual/memory.texi (Malloc Examples): Clarify default
	alignment documentation.  Suggest posix_memalign rather
	than memalign or valloc.
	(Aligned Memory Blocks): Remove suggestion to use memalign
	or valloc.  Remove obsolete comment about BSD.
	Document memalign errno values and mark the function obsolete.
	Document posix_memalign returned error codes.  Mark valloc
	as obsolete.  (Hooks for Malloc): __memalign_hook is also
	called for posix_memalign and valloc.
	(Summary of Malloc): Add posix_memalign to function summary.
	__memalign_hook is also called for posix_memalign and valloc.
2013-12-16 14:51:29 +00:00