platform/upstream/glibc.git
10 years agobenchtests: Link against objects in build directory
Siddhesh Poyarekar [Tue, 15 Apr 2014 09:03:06 +0000 (14:33 +0530)]
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.

10 years agoSupport _r_debug for static binaries.
Carlos O'Donell [Fri, 11 Apr 2014 16:43:58 +0000 (12:43 -0400)]
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.

10 years agonscd: Make SELinux checks dynamic.
Carlos O'Donell [Thu, 10 Apr 2014 22:31:53 +0000 (18:31 -0400)]
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

10 years agoRegenerate sparc ULPs.
David S. Miller [Mon, 14 Apr 2014 01:27:19 +0000 (18:27 -0700)]
Regenerate sparc ULPs.

* sysdeps/sparc/fpu/libm-test-ulps: Update.

10 years agoFix qsort argument order in collation example
Allan McRae [Sat, 12 Apr 2014 04:26:29 +0000 (14:26 +1000)]
Fix qsort argument order in collation example

10 years agoFix typo on ChangeLog.
Paul Pluzhnikov [Fri, 11 Apr 2014 19:16:38 +0000 (12:16 -0700)]
Fix typo on ChangeLog.

10 years agomath: make test-fenv-preserve.c a no-op if FE_ALL_EXCEPT == 0.
Chris Metcalf [Fri, 11 Apr 2014 19:13:42 +0000 (15:13 -0400)]
math: make test-fenv-preserve.c a no-op if FE_ALL_EXCEPT == 0.

This fixes a testsuite failure for tile (and possibly microblaze).

10 years ago2014-04-11 Paul Pluzhnikov <ppluzhnikov@google.com>
Paul Pluzhnikov [Fri, 11 Apr 2014 18:25:53 +0000 (11:25 -0700)]
2014-04-11  Paul Pluzhnikov  <ppluzhnikov@google.com>

* elf/Makefile (tests): make tst-dlopen-aout conditional on
enable-hardcoded-path-in-tests

10 years agobenchtests: Improve readability of JSON output
Will Newton [Tue, 8 Apr 2014 09:18:16 +0000 (10:18 +0100)]
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.

10 years agoFixed and unified pthread_once.
Torvald Riegel [Wed, 8 May 2013 14:35:10 +0000 (16:35 +0200)]
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.

10 years agoS/390: Unify 31 and 64 bit configure.ac
Stefan Liebler [Fri, 11 Apr 2014 11:11:50 +0000 (13:11 +0200)]
S/390: Unify 31 and 64 bit configure.ac

10 years agoNEWS: Add comment about changed ABI on s390 and s390x.
Andreas Krebbel [Tue, 8 Apr 2014 14:30:07 +0000 (16:30 +0200)]
NEWS: Add comment about changed ABI on s390 and s390x.

10 years agoFix typo in comment in res_query.c
Joseph Anthony Pasquale Holsten [Fri, 11 Apr 2014 09:46:13 +0000 (15:16 +0530)]
Fix typo in comment in res_query.c

10 years agomalloc: Fix MALLOC_DEBUG -Wundef warning
Will Newton [Mon, 31 Mar 2014 14:00:32 +0000 (15:00 +0100)]
malloc: Fix MALLOC_DEBUG -Wundef warning

MALLOC_DEBUG is set optionally on the command line. Default the value
to zero if it is not set on the command line, and test its value
with #if rather than #ifdef. Verified the code is identical before
and after this change apart from line numbers.

ChangeLog:

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

* malloc/malloc.c [!MALLOC_DEBUG]: #define MALLOC_DEBUG
to zero if it is not defined elsewhere.  (mtrim): Test
the value of MALLOC_DEBUG with #if rather than #ifdef.

10 years agobenchtests: Add pthread_once common-case test.
Torvald Riegel [Tue, 8 Oct 2013 11:17:01 +0000 (14:17 +0300)]
benchtests: Add pthread_once common-case test.

We have a single thread that runs a no-op initialization once and then
repeatedly runs checks of the initialization (i.e., an acquire load and
conditional jump) in a tight loop.  This gives us, on average, the
best-case latency of pthread_once (the initialization is the
exactly-once slow path, and we're not looking at initialization-related
synchronization overheads in this case).

10 years agoSave/restore bound registers in _dl_runtime_resolve
Igor Zamyatin [Tue, 1 Apr 2014 17:16:04 +0000 (10:16 -0700)]
Save/restore bound registers in _dl_runtime_resolve

This patch saves and restores bound registers in symbol lookup for x86-64:

1. Branches without BND prefix clear bound registers.
2. x86-64 pass bounds in bound registers as specified in MPX psABI
extension on hjl/mpx/master branch at

https://github.com/hjl-tools/x86-64-psABI
https://groups.google.com/forum/#!topic/x86-64-abi/KFsB0XTgWYc

Binutils has been updated to create an alternate PLT to add BND prefix
when branching to ld.so.

* config.h.in (HAVE_MPX_SUPPORT): New #undef.
* sysdeps/x86_64/configure.ac: Set HAVE_MPX_SUPPORT.
* sysdeps/x86_64/configure: Regenerated.
* sysdeps/x86_64/dl-trampoline.S (REGISTER_SAVE_AREA): New
macro.
(REGISTER_SAVE_RAX): Likewise.
(REGISTER_SAVE_RCX): Likewise.
(REGISTER_SAVE_RDX): Likewise.
(REGISTER_SAVE_RSI): Likewise.
(REGISTER_SAVE_RDI): Likewise.
(REGISTER_SAVE_R8): Likewise.
(REGISTER_SAVE_R9): Likewise.
(REGISTER_SAVE_BND0): Likewise.
(REGISTER_SAVE_BND1): Likewise.
(REGISTER_SAVE_BND2): Likewise.
(_dl_runtime_resolve): Use them.  Save and restore Intel MPX
bound registers when calling _dl_fixup.

10 years agoDefine _STRING_ARCH_unaligned unconditionally
Adhemerval Zanella [Wed, 26 Mar 2014 20:37:35 +0000 (15:37 -0500)]
Define _STRING_ARCH_unaligned unconditionally

This patch defines _STRING_ARCH_unaligned to 0 on default bits/string.h
header to avoid undefined compiler warnings on platforms that do not
define it.  It also make adjustments in code where tests checked if macro
existed or not.

10 years agoUse statvfs64() for pathconf(_PC_NAME_MAX).
Peter TB Brett [Mon, 7 Apr 2014 20:56:12 +0000 (21:56 +0100)]
Use statvfs64() for pathconf(_PC_NAME_MAX).

pathconf(_PC_NAME_MAX) was implemented on top of statfs().  The 32bit
version therefore fails EOVERFLOW if the filesystem blockcount is
sufficiently large.

Most pathconf() queries use statvfs64(), which avoids this issue.  This
patch modifies pathconf(_PC_NAME_MAX) to do likewise.

10 years agoMove __PTHREAD_SPINS definition to architecture specific header
Adhemerval Zanella [Wed, 26 Mar 2014 18:48:00 +0000 (13:48 -0500)]
Move __PTHREAD_SPINS definition to architecture specific header

This patch moves the __PTHREAD_SPINS definition to arch specific header
since pthread_mutex_t layout is also arch specific.  This leads to no
need to defining __PTHREAD_MUTEX_HAVE_ELISION and thus removing of the
undefined compiler warning.

10 years agoPowerPC: Fix --disable-multi-arch builds
Adhemerval Zanella [Tue, 8 Apr 2014 22:25:14 +0000 (17:25 -0500)]
PowerPC: Fix --disable-multi-arch builds

This patch fixes some powerpc32 and powerpc64 builds with
--disable-multi-arch option along with different --with-cpu=powerN.
It cleanups the Implies directories by removing the multiarch
folder for non multiarch config and also fixing two assembly
implementations: powerpc64/power7/strncat.S that is calling the
wrong strlen; and power8/fpu/s_isnan.S that misses the hidden_def and
weak_alias directives.

10 years agomanual/ipc.texi: Fix AC-safety notes.
Carlos O'Donell [Tue, 8 Apr 2014 21:12:15 +0000 (17:12 -0400)]
manual/ipc.texi: Fix AC-safety notes.

The function sem_close is AC-unsafe because lll_lock*
leaks a lock (aculock) and not because of twalk.

10 years agostring: Cosmetic cleanup of string functions
Will Newton [Mon, 31 Mar 2014 12:47:56 +0000 (13:47 +0100)]
string: Cosmetic cleanup of string functions

Clean up string functions that do not have a version in gnulib on
the assumption that glibc is the canonical upstream copy of this
code. basename has a copy in gnulib but it is largely written to
handle Windows paths so merging it is not really viable. The changes
mostly consist of switching to ANSI function prototypes and removing
unused includes.

As many of these functions do not get built in a typical build due
to architecture optimized versions being used instead I built these
by hand to verify there were no build warnings and the code was
identical.

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

* string/basename.c [HAVE_CONFIG_H]: Remove #ifdef and
and contents.  [!_LIBC] Remove #ifndef and contents.
(basename): Use ANSI prototype.  [_LIBC] Remove #idef.
* string/memccpy.c (__memccpy): Use ANSI prototype.
* string/memfrob.c (memfrob): Likewise.
* string/strcoll.c (STRCOLL): Likewise.
* string/strlen.c (strlen): Likewise.
* string/strtok.c (STRTOK): Likewise.
* string/strcat.c: Remove unused #include of memcopy.h.
(strcat): Use ANSI prototype.
* string/strchr.c: Remove unused #include of memcopy.h.
(strchr): Use ANSI prototype.
* string/strcmp.c: Remove unused #include of memcopy.h.
(strcmp): Use ANSI prototype.
* string/strcpy.c: Remove unused #include of memcopy.h.
(strcpy): Use ANSI prototype.

10 years agoPowerPC: define _CALL_ELF if compiler does not
Adhemerval Zanella [Sun, 6 Apr 2014 21:26:32 +0000 (16:26 -0500)]
PowerPC: define _CALL_ELF if compiler does not

This patch makes the configure adds -D_CALL_ELF=1 when compiler does
not define _CALL_ELF (versions before powerpc64le support).  It cleans
up compiler warnings on old compiler where _CALL_ELF is not defined
on powerpc64(be) builds.

It does by add a new config.make variable for configure-deduced
CPPFLAGS and accumulate into that (confix-extra-cppflags).  It also
generalizes libc_extra_cflags so it accumulates in sysdeps configure
fragmenets.

10 years agoPowerPC: Fix nearbyint/nearbyintf result for FE_DOWNWARD
Adhemerval Zanella [Sun, 6 Apr 2014 19:50:11 +0000 (14:50 -0500)]
PowerPC: Fix nearbyint/nearbyintf result for FE_DOWNWARD

This patch fixes the powerpc32 optimized nearbyint/nearbyintf bogus
results for FE_DOWNWARD rounding mode.  This is due wrong instructions
sequence used in the rounding calculation (two subtractions instead of
adition and a subtraction).

Fixes BZ#16815.

10 years agotile: Fix cut-and-paste bug in commit fcccd5128.
Chris Metcalf [Fri, 4 Apr 2014 19:03:47 +0000 (15:03 -0400)]
tile: Fix cut-and-paste bug in commit fcccd5128.

10 years agomanual: clarify buffer behavior in getline [BZ #5666]
David Svoboda [Wed, 2 Apr 2014 09:13:02 +0000 (05:13 -0400)]
manual: clarify buffer behavior in getline [BZ #5666]

If the user has requested automatic buffer creation, getline may create
it and not free things when an error occurs.  That means the user is
always responsible for calling free() regardless of the return value.

The current documentation does not explicitly cover this which leaves it
slightly ambiguous to the reader.  So clarify things.

URL: https://sourceware.org/bugzilla/show_bug.cgi?id=5666

10 years agoFactor mmap/munmap of PT_LOAD segments out of _dl_map_object_from_fd et al.
Roland McGrath [Thu, 3 Apr 2014 17:47:14 +0000 (10:47 -0700)]
Factor mmap/munmap of PT_LOAD segments out of _dl_map_object_from_fd et al.

10 years agoelf/dl-lookup.c: Remove obsolete comment about nested function
Will Newton [Wed, 2 Apr 2014 14:23:16 +0000 (15:23 +0100)]
elf/dl-lookup.c: Remove obsolete comment about nested function

The nested function referred to has gone away so remove the
comment. Also move the variable declaration down to where other
variables of a similar lifetime are declared for clarity.

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

* elf/dl-lookup.c (do_lookup_x): Remove comment
referring to nested function and move variable
declarations down to before first use.

10 years agoFix catan, catanh, __ieee754_logf in round-downward mode (bug 16799, bug 16800).
Joseph Myers [Wed, 2 Apr 2014 17:41:02 +0000 (17:41 +0000)]
Fix catan, catanh, __ieee754_logf in round-downward mode (bug 16799, bug 16800).

This patch fixes incorrect results from catan and catanh of certain
special inputs in round-downward mode (bug 16799), and incorrect
results of __ieee754_logf (+/-0) in round-downward mode (bug 16800)
that show up through catan/catanh when tested in all rounding modes,
but not directly in the testing for logf because the bug gets hidden
by the wrappers.

Both bugs involve a zero that should be +0 being -0 instead: one
computed as (1-x)*(1+x) in the catan/catanh case, and one as (x-x) in
the logf case.  The fixes ensure positive zero is used.  Testing of
catan and catanh in all rounding modes is duly enabled.

I expect there are various other bugs in special cases in __ieee754_*
functions that are normally hidden by the wrappers but would show up
for testing with -lieee (or in future with -fno-math-errno if we
replace -lieee and _LIB_VERSION with compile-time redirection to new
*_noerrno symbol names).

Tested x86_64 and x86 and ulps updated accordingly.

[BZ #16799]
[BZ #16800]
* math/s_catan.c (__catan): Avoid passing -0 denominator to atan2
with 0 numerator.
* math/s_catanf.c (__catanf): Likewise.
* math/s_catanh.c (__catanh): Likewise.
* math/s_catanhf.c (__catanhf): Likewise.
* math/s_catanhl.c (__catanhl): Likewise.
* math/s_catanl.c (__catanl): Likewise.
* sysdeps/ieee754/flt-32/e_logf.c (__ieee754_logf): Always divide
by positive zero when computing -Inf result.
* math/libm-test.inc (catan_test): Use ALL_RM_TEST.
(catanh_test): Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoFix clog / clog10 sign of zero result in round-downward mode (bug 16789).
Joseph Myers [Wed, 2 Apr 2014 13:10:19 +0000 (13:10 +0000)]
Fix clog / clog10 sign of zero result in round-downward mode (bug 16789).

This patch fixes bug 16789, incorrect sign of (real part) zero result
from clog and clog10 in round-downward mode, arising from that real
part being computed as 0 - 0.  To ensure that an underflow exception
occurred, the code used an underflowing value (the next term in the
series for log1p) in arithmetic computing the real part of the result,
yielding the problematic 0 - 0 computation in some cases even when the
mathematical result would be small but positive.  The patch changes
this code to use the math_force_eval approach to ensuring that an
underflowing computation actually occurs.  Tests of clog and clog10
are enabled in all rounding modes.

Tested x86_64 and x86 and ulps updated accordingly.

[BZ #16789]
* math/s_clog.c (__clog): Use math_force_eval to ensure underflow
instead of using underflowing value in computing result.
* math/s_clog10.c (__clog10): Likewise.
* math/s_clog10f.c (__clog10f): Likewise.
* math/s_clog10l.c (__clog10l): Likewise.
* math/s_clogf.c (__clogf): Likewise.
* math/s_clogl.c (__clogl): Likewise.
* math/libm-test.inc (clog_test): Use ALL_RM_TEST.
(clog10_test): Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoCorrect IBM long double nextafterl.
Alan Modra [Wed, 2 Apr 2014 03:16:19 +0000 (13:46 +1030)]
Correct IBM long double nextafterl.

Fix for values near a power of two, and some tidies.

[BZ #16739]
* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Correct
output when value is near a power of two.  Use int64_t for lx and
remove casts.  Use decimal rather than hex exponent constants.
Don't use long double multiplication when double will suffice.
* math/libm-test.inc (nextafter_test_data): Add tests.
* NEWS: Add 16739 and 16786 to bug list.

10 years agoCorrect prefetch hint in power7 memrchr.
Alan Modra [Wed, 2 Apr 2014 03:12:27 +0000 (13:42 +1030)]
Correct prefetch hint in power7 memrchr.

Typo fix.

* sysdeps/powerpc/powerpc64/power7/memrchr.S: Correct stream hint.

10 years agoFix reference to toc symbol.
Alan Modra [Wed, 2 Apr 2014 03:10:21 +0000 (13:40 +1030)]
Fix reference to toc symbol.

https://sourceware.org/ml/binutils/2014-03/msg00033.html removes the
"magic" treatment of symbols defined in a .toc section.

* sysdeps/powerpc/powerpc64/start.S: Add @toc to toc symbol reference.

10 years agoUpdate NEWS for fixed bug 13347
Florian Weimer [Tue, 1 Apr 2014 12:20:01 +0000 (14:20 +0200)]
Update NEWS for fixed bug 13347

10 years agobenchtests: Build ffs and ffsl benchtests with -fno-builtin
Will Newton [Mon, 31 Mar 2014 14:58:19 +0000 (15:58 +0100)]
benchtests: Build ffs and ffsl benchtests with -fno-builtin

Without this flag it is possible that the compiler will optimize
away the calls to ffs/ffsll.

ChangeLog:

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

* benchtests/Makefile (CFLAGS-bench-ffs.c): Add
-fno-builtin.  (CFLAGS-bench-ffsll.c): Likewise.

10 years agoCheck for syscall error in the SETXID implementation in NPTL (bug 13347).
Florian Weimer [Mon, 24 Mar 2014 14:24:02 +0000 (15:24 +0100)]
Check for syscall error in the SETXID implementation in NPTL (bug 13347).

At this point, we can only abort the process because we have already
switched credentials on other threads.  Returning an error would still
leave the process in an inconsistent state.

The new xtest needs root privileges to run.

10 years agoFix s_copysign stack temp for PowerPC64 ELFv2
Alan Modra [Tue, 1 Apr 2014 03:37:42 +0000 (14:07 +1030)]
Fix s_copysign stack temp for PowerPC64 ELFv2

[BZ #16786]
* sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Don't trash stack.

10 years agoSet errno for scalb errors (bug 6803, bug 6804).
Joseph Myers [Mon, 31 Mar 2014 14:57:53 +0000 (14:57 +0000)]
Set errno for scalb errors (bug 6803, bug 6804).

This patch fixes the default mode of scalb to set errno (bugs 6803 and
6804).

Previously, the _LIB_VERSION == _SVID_ mode would set errno but only
in some relevant cases, and with various peculiarities (such as errno
setting when an exact infinity or zero result arises with an argument
to scalb being an infinity).  This patch leaves this mode
bug-compatible, while making the default mode set errno in accordance
with normal practice (so an exact infinity from an infinite argument
is not an error, and nor is an exact zero result).  gen-libm-test.pl
is taught new notation such as ERRNO_PLUS_OFLOW to facilitate writing
the tests of errno setting for underflow / overflow in libm-test.inc.

Note that bug 6803 also covers scalbn and scalbln, but this patch only
addresses the scalb parts of that bug (along with the whole of bug
6804).

Tested x86_64 and x86.

[BZ #6803]
[BZ #6804]
* math/w_scalb.c (__scalb): For non-SVID mode, check result and
set errno as appropriate.
* math/w_scalbf.c (__scalbf): Likewise.
* math/w_scalbl.c (__scalbl): Likewise.
* math/gen-libm-test.pl (parse_args): Handle ERRNO_PLUS_OFLOW,
ERRNO_MINUS_OFLOW, ERRNO_PLUS_UFLOW and ERRNO_MINUS_UFLOW.
* math/libm-test.inc (scalb_test_data): Add errno expectations.
Add more NaN tests.

10 years agoSet errno for atan2 underflow (bug 16349).
Joseph Myers [Mon, 31 Mar 2014 14:56:37 +0000 (14:56 +0000)]
Set errno for atan2 underflow (bug 16349).

This patch fixes bug 16349, missing errno setting for atan2 underflow,
by adding appropriate checks to the existing wrappers.  (As in other
cases, the __kernel_standard support for calling matherr is considered
to be for existing code expecting existing rules for what's considered
an error, even if those don't correspond to a general logical scheme
for what counts as what kind of error, so __set_errno calls are added
directly without any changes to __kernel_standard.)

Tested x86_64 and x86.

[BZ #16349]
* math/w_atan2.c: Include <errno.h>.
(__atan2): Set errno for result underflowing to zero.
* math/w_atan2f.c: Include <errno.h>.
(__atan2f): Set errno for result underflowing to zero.
* math/w_atan2l.c: Include <errno.h>.
(__atan2l): Set errno for result underflowing to zero.
* math/auto-libm-test-in: Don't allow missing errno for some atan2
tests.
* math/auto-libm-test-out: Regenerated.

10 years agoPowerPC: Fix little endian enconding for mfvsrd
Adhemerval Zanella [Mon, 31 Mar 2014 13:00:38 +0000 (08:00 -0500)]
PowerPC: Fix little endian enconding for mfvsrd

This patch fixes the MFVSRD_R3_V1 macro that encodes 'mfvsrd  r3,vs1'
(to support old binutils) for little endian.

10 years agoCorrect robust mutex / PI futex kernel assumptions (bug 9894).
Joseph Myers [Mon, 31 Mar 2014 12:55:18 +0000 (12:55 +0000)]
Correct robust mutex / PI futex kernel assumptions (bug 9894).

This patch continues fixing __ASSUME_* issues in preparation for
moving to a 2.6.32 minimum kernel version by addressing assumptions on
robust mutex and PI futex support availability.  Those assumptions are
bug 9894, but to be clear this patch does not address all the issues
from that bug about wrong version assumptions, only those still
applicable for --enable-kernel=2.6.32 or later (with the expectation
that the move to that minimum kernel will obsolete the other parts of
the bug).  The patch is independent of
<https://sourceware.org/ml/libc-alpha/2014-03/msg00585.html>, my other
pending-review patch preparing for the kernel version change; the two
together complete all the changes I believe are needed in preparation
regarding any macro in sysdeps/unix/sysv/linux/kernel-features.h that
would be affected by such a change.  (I have not checked the
correctness of macros whose conditions are unaffected by such a
change, or macros only defined in other kernel-features.h files.)

As discussed in that bug, robust mutexes and PI futexes need
futex_atomic_cmpxchg_inatomic to be implemented, in addition to
certain syscalls needed for robust mutexes (and
architecture-independent kernel pieces for all the features in
question).  That is, as I understand it, they need
futex_atomic_cmpxchg_inatomic to *work* (not return an ENOSYS error).

The issues identified in my analysis relate to ARM, M68K, MicroBlaze,
MIPS and SPARC.

On ARM, whether futex_atomic_cmpxchg_inatomic works depends on the
kernel configuration.  As of 3.13, the condition for *not* working is
CONFIG_CPU_USE_DOMAINS && CONFIG_SMP.  As of 2.6.32 it was simply
CONFIG_SMP that meant the feature was not implemented.  I don't know
if there are any circumstances in which we can say "we can assume a
userspace glibc binary built with these options will never run on a
kernel with the problematic configuration", but at least for now I'm
just undefining the relevant __ASSUME_* macros for ARM.

On M68K, two of the three macros are undefined for kernels before
3.10, but as far as I can see __ASSUME_FUTEX_LOCK_PI is in the same
group needing futex_atomic_cmpxchg_inatomic support and so should be
undefined as well.

On MicroBlaze the required support was added in 2.6.33.

On MIPS, the support depends on cpu_has_llsc in the kernel - that is,
actual hardware LL/SC support (GCC and glibc for MIPS GNU/Linux rely
on the instructions being supported in some way, but it may be kernel
emulation; futex_atomic_cmpxchg_inatomic doesn't work with that
emulation).  The same condition as in GCC for indicating LL/SC support
may not be available is used for undefining the macros in glibc,
__mips == 1 || defined _MIPS_ARCH_R5900.  (Maybe we could in fact
desupport MIPS processors without the hardware support in glibc.)

On SPARC, 32-bit kernels don't support futex_atomic_cmpxchg_inatomic;
__arch64__ || __sparc_v9__ is used as the condition for binaries that
won't run on 32-bit kernels.

This patch is not tested beyond the sanity check of an x86_64 build.

[BZ #9894]
* sysdeps/unix/sysv/linux/kernel-features.h
[__sparc__ && !__arch64__ && !__sparc_v9__]
(__ASSUME_SET_ROBUST_LIST): Do not define.
[__sparc__ && !__arch64__ && !__sparc_v9__]
(__ASSUME_FUTEX_LOCK_PI): Likewise.
[__sparc__ && !__arch64__ && !__sparc_v9__] (__ASSUME_REQUEUE_PI):
Likewise.
* sysdeps/unix/sysv/linux/arm/kernel-features.h
(__ASSUME_FUTEX_LOCK_PI): Undefine.
(__ASSUME_REQUEUE_PI): Likewise.
(__ASSUME_SET_ROBUST_LIST): Likewise.
* sysdeps/unix/sysv/linux/m68k/kernel-features.h
[__LINUX_KERNEL_VERSION < 0x030a00] (__ASSUME_FUTEX_LOCK_PI):
Undefine.
* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_FUTEX_LOCK_PI):
Likewise.
[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_REQUEUE_PI):
Likewise.
[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_SET_ROBUST_LIST):
Likewise.
* sysdeps/unix/sysv/linux/mips/kernel-features.h
[__mips == 1 || _MIPS_ARCH_R5900] (__ASSUME_FUTEX_LOCK_PI):
Undefine.
[__mips == 1 || _MIPS_ARCH_R5900] (__ASSUME_REQUEUE_PI): Likewise.
[__mips == 1 || _MIPS_ARCH_R5900] (__ASSUME_SET_ROBUST_LIST):
Likewise.

10 years agoFix futimesat for older MicroBlaze kernels (bug 16648).
Joseph Myers [Mon, 31 Mar 2014 12:51:45 +0000 (12:51 +0000)]
Fix futimesat for older MicroBlaze kernels (bug 16648).

Continuing the fixes for __ASSUME_* issues in preparation for moving
to a 2.6.32 minimum kernel version, this *untested* patch fixes bug
16648, the definition of __ASSUME_ATFCTS meaning that the futimesat
syscall is assumed for all MicroBlaze kernels despite not being
present until 2.6.33.

__ASSUME_ATFCTS controls conditionals relating to a lot of different
syscalls in Linux-specific code (fstatat64 faccessat fchmodat fchownat
futimesat newfstatat linkat mkdirat openat readlinkat renameat
symlinkat unlinkat mknodat), where whether newfstatat fstatat64
futimesat are used depends on the architecture, as well as controlling
whether openat64_not_cancel_3 is expected to work in
sysdeps/posix/getcwd.c.  The assumptions are all OK as of 2.6.32
except for this MicroBlaze case, and it's generally desirable to get
rid of as many of the __ASSUME_ATFCTS conditionals as possible, to
simplify the code (the fallbacks include potential unbounded dynamic
stack allocations).  Thus, rather than the simplest approach of
undefining __ASSUME_ATFCTS for older kernels on MicroBlaze, this patch
takes the approach of using the linux-generic implementation of
futimesat for MicroBlaze kernels before 2.6.33 (all such kernels have
the utimensat syscall).

[BZ #16648]
* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
[__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_FUTIMESAT): Define.
* sysdeps/unix/sysv/linux/microblaze/futimesat.c: New file.

10 years agobenchtests: Add benchtests for ffs and ffsll
Will Newton [Fri, 28 Mar 2014 17:30:44 +0000 (17:30 +0000)]
benchtests: Add benchtests for ffs and ffsll

Add benchtests for ffs and ffsll. There is no benchtest for ffsl as
it is identical to one of the other functions.

2014-03-31  Will Newton  <will.newton@linaro.org>

* benchtests/Makefile (bench): Add ffs and ffsll to list
of tests.
* benchtests/ffs-inputs: New file.
* benchtests/ffsll-inputs: Likewise.

10 years agoFix ChangeLog formatting.
Carlos O'Donell [Sun, 30 Mar 2014 23:03:19 +0000 (19:03 -0400)]
Fix ChangeLog formatting.

10 years agoFix scalb spurious "invalid" exceptions (bug 16770).
Joseph Myers [Sat, 29 Mar 2014 17:22:14 +0000 (17:22 +0000)]
Fix scalb spurious "invalid" exceptions (bug 16770).

This patch fixes bug 16770, spurious "invalid" exceptions from scalb
when testing whether the second argument is an integer, by inserting
appropriate range checks to determine whether a cast to int is safe.
(Note that invalid_fn is a function that handles both nonintegers and
large integers, distinguishing them reliably using functions such as
__rint; note also that there are no issues with scalb needing to avoid
spurious "inexact" exceptions - it's an old-POSIX XSI function, not a
standard C function bound to an IEEE 754 operation - although the
return value is still fully determined.)

Tested x86_64 and x86.

[BZ #16770]
* math/e_scalb.c (__ieee754_scalb): Check second argument is not
too large before casting to int.
* math/e_scalbf.c (__ieee754_scalbf): Likewise.
* math/e_scalbl.c (__ieee754_scalbl): Likewise.
* math/libm-test.inc (scalb_test_data): Add more tests.

10 years agoDetailed benchmark outputs for functions
Siddhesh Poyarekar [Sat, 29 Mar 2014 04:10:19 +0000 (09:40 +0530)]
Detailed benchmark outputs for functions

This patch adds an option to get detailed benchmark output for
functions.  Invoking the benchmark with 'make DETAILED=1 bench' causes
each benchmark program to store a mean execution time for each input
it works on.  This is useful to give a more comprehensive picture of
performance of functions compared to just the single mean figure.

10 years agoMake bench.out in json format
Siddhesh Poyarekar [Sat, 29 Mar 2014 04:07:44 +0000 (09:37 +0530)]
Make bench.out in json format

This patch changes the output format of the main benchmark output file
(bench.out) to an extensible format.  I chose JSON over XML because in
addition to being extensible, it is also not too verbose.
Additionally it has good support in python.

The significant change I have made in terms of functionality is to put
timing information as an attribute in JSON instead of a string and to
do that, there is a separate program that prints out a JSON snippet
mentioning the type of timing (hp_timing or clock_gettime).  The mean
timing has now changed from iterations per unit to actual timing per
iteration.

10 years ago[benchtests] Use inputs file for modf
Siddhesh Poyarekar [Sat, 29 Mar 2014 04:05:50 +0000 (09:35 +0530)]
[benchtests] Use inputs file for modf

The modf benchmark can now use the framework since the introduction of
output arguments.

10 years agoFix clog10 (-0 +/- 0i) (bug 16362).
Joseph Myers [Fri, 28 Mar 2014 20:53:32 +0000 (20:53 +0000)]
Fix clog10 (-0 +/- 0i) (bug 16362).

This patch fixes the imaginary part of clog10 (-0 +/- 0i), which
should be +/-pi / log(10) by analogy with clog (the functions were
wrongly returning a result with imaginary part +/-pi, same as for
clog, and the tests matched the incorrect result, though both
functions and tests were correct for the similar case of clog10 (-inf
+/- 0i)).  Tested x86_64 and x86.

[BZ #16362]
* math/s_clog10.c (M_PI_LOG10E): New macro.
(__clog10): Use M_PI_LOG10E instead of M_PI when real and
imaginary parts are 0.
* math/s_clog10f.c (M_PI_LOG10Ef): New macro.
(__clog10f): Use M_PI_LOG10Ef instead of M_PI when real and
imaginary parts are 0.
* math/s_clog10l.c (M_PI_LOG10El): New macro.
(__clog10l): Use M_PI_LOG10El instead of M_PIl when real and
imaginary parts are 0.
* math/libm-test.inc (clog10_test_data): Update expected results
for when real and imaginary parts are 0.

10 years ago2014-03-27 Paul Pluzhnikov <ppluzhnikov@google.com>
Paul Pluzhnikov [Thu, 27 Mar 2014 18:50:42 +0000 (11:50 -0700)]
2014-03-27  Paul Pluzhnikov  <ppluzhnikov@google.com>

* elf/dl-load.c: Finish conversion of __builtin_expect into
__glibc_{un}likely.

10 years agoFix x86/x86_64 expl/exp10l spurious underflows (bug 16348).
Joseph Myers [Thu, 27 Mar 2014 18:41:14 +0000 (18:41 +0000)]
Fix x86/x86_64 expl/exp10l spurious underflows (bug 16348).

This patch fixes bug 16348, spurious underflows from x86/x86_64 expl
on arguments close to 0.  These implementations effectively use expm1
(on the fractional part of the argument) internally, so resulting in
spurious underflows when the result is very close to 1.  For arguments
small enough that the round-to-nearest correct result is 1, this patch
uses 1+x instead.

These implementations are also used for exp10l and so the patch fixes
similar issues there (the 0x1p-67 threshold being small enough to be
correct for exp10l as well as expl).  But because of spurious
underflows in other exp10 implementations (bug 16560), the tests
aren't added for exp10 at this point - they can be added when the
other exp10 parts of that bug are fixed.

Tested x86_64 and x86; no ulps updates needed.

[BZ #16348]
* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL) [!USE_AS_EXPM1L]: Use
1+x for argument with exponent below -67.
* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL) [!USE_AS_EXPM1L]:
Likewise.
* math/auto-libm-test-in: Add more tests of exp.
* math/auto-libm-test-out: Regenerated.

10 years agoReturn NULL for wildcard values in getnetgrent from nscd (BZ #16759)
Siddhesh Poyarekar [Thu, 27 Mar 2014 14:19:51 +0000 (19:49 +0530)]
Return NULL for wildcard values in getnetgrent from nscd (BZ #16759)

getnetgrent is supposed to return NULL for values that are wildcards
in the (host, user, domain) triplet.  This works correctly with nscd
disabled, but with it enabled, it returns a blank ("") instead of a
NULL.  This is easily seen with the output of `getent netgroup foonet`
for a netgroup foonet defined as follows in /etc/netgroup:

    foonet (,foo,)

The output with nscd disabled is:

    foonet ( ,foo,)

while with nscd enabled, it is:

    foonet (,foo,)

The extra space with nscd disabled is due to the fact that `getent
netgroup` adds it if the return value from getnetgrent is NULL for
either host or user.

10 years agoAvoid overlapping addresses to stpcpy calls in nscd (BZ #16760)
Siddhesh Poyarekar [Thu, 27 Mar 2014 14:18:15 +0000 (19:48 +0530)]
Avoid overlapping addresses to stpcpy calls in nscd (BZ #16760)

Calls to stpcpy from nscd netgroups code will have overlapping source
and destination when all three values in the returned triplet are
non-NULL and in the expected (host,user,domain) order.  This is seen
in valgrind as:

==3181== Source and destination overlap in stpcpy(0x19973b48, 0x19973b48)
==3181==    at 0x4C2F30A: stpcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3181==    by 0x12567A: addgetnetgrentX (string3.h:111)
==3181==    by 0x12722D: addgetnetgrent (netgroupcache.c:665)
==3181==    by 0x11114C: nscd_run_worker (connections.c:1338)
==3181==    by 0x4E3C102: start_thread (pthread_create.c:309)
==3181==    by 0x59B81AC: clone (clone.S:111)
==3181==

Fix this by using memmove instead of stpcpy.

10 years agoFix dwarf2 unwinding through futex functions.
Andi Kleen [Wed, 26 Mar 2014 22:45:37 +0000 (18:45 -0400)]
Fix dwarf2 unwinding through futex functions.

When profiling programs with lock problems with perf record -g dwarf,
libunwind can currently not backtrace through the futex and unlock
functions in pthread. This is because they use out of line sections,
and those are not correctly described in dwarf2 (I believe needs
dwarf3 or 4).

This patch first removes the out of line sections. They only save a
single jump, but cause a lot of pain. Then it converts the now inline
lock code to use the now standard gas .cfi_* commands.

With these changes libunwind/perf can backtrace through the futex
functions now.

Longer term it would be likely better to just use C futex() functions
on x86 like all the other architectures. This would clean the code up
even more.

10 years agoFix nscd lookup for innetgr when netgroup has wildcards (BZ #16758)
Siddhesh Poyarekar [Thu, 27 Mar 2014 01:45:22 +0000 (07:15 +0530)]
Fix nscd lookup for innetgr when netgroup has wildcards (BZ #16758)

nscd works correctly when the request in innetgr is a wildcard,
i.e. when one or more of host, user or domain parameters is NULL.
However, it does not work when the the triplet in the netgroup
definition has a wildcard.  This is easy to reproduce for a triplet
defined as follows:

    foonet (,foo,)

Here, an innetgr call that looks like this:

    innetgr ("foonet", "foohost", "foo", NULL);

should succeed and so should:

    innetgr ("foonet", NULL, "foo", "foodomain");

It does succeed with nscd disabled, but not with nscd enabled.  This
fix adds this additional check for all three parts of the triplet so
that it gives the correct result.

[BZ #16758]
* nscd/netgroupcache.c (addinnetgrX): Succeed if triplet has
blank values.

10 years ago2014-03-26 Paul Pluzhnikov <ppluzhnikov@google.com>
Paul Pluzhnikov [Wed, 26 Mar 2014 22:37:07 +0000 (15:37 -0700)]
2014-03-26  Paul Pluzhnikov  <ppluzhnikov@google.com>

* elf/dl-load.c: Convert __builtin_expect into __glibc_{un}likely.

10 years agoMake x86_64 fegetenv preserve exception mask (bug 16198).
Joseph Myers [Wed, 26 Mar 2014 18:59:08 +0000 (18:59 +0000)]
Make x86_64 fegetenv preserve exception mask (bug 16198).

Bug 16198 is x86_64 fegetenv wrongly masking exceptions for which
traps are enabled, because that's a side-effect of the fnstenv
instruction.  This patch fixes it to use fldenv immediately after
fnstenv, like the i386 version.  Tested x86_64 and x86.

[BZ #16198]
* sysdeps/x86_64/fpu/fegetenv.c (fegetenv): Use fldenv after
fnstenv.
* math/test-fenv-preserve.c: New file.
* math/Makefile (tests): Add test-fenv-preserve.

10 years agobenchtests/bench-strtod.c: Increase timeout value
Will Newton [Tue, 25 Mar 2014 15:27:22 +0000 (15:27 +0000)]
benchtests/bench-strtod.c: Increase timeout value

This benchmark can take longer than the default 2 seconds on slower
platforms, so increase it to 10 seconds.

ChangeLog:

2014-03-26  Will Newton <will.newton@linaro.org>

* benchtests/bench-strtod.c (TIMEOUT): Define to 10.

10 years agoKludge fix for Versions.def regression
Roland McGrath [Tue, 25 Mar 2014 18:16:51 +0000 (11:16 -0700)]
Kludge fix for Versions.def regression

10 years agoAdd empty GLIBC_2.2.5 version to elf/Versions.
Joseph Myers [Tue, 25 Mar 2014 21:54:09 +0000 (21:54 +0000)]
Add empty GLIBC_2.2.5 version to elf/Versions.

As needed for SHLIB_COMPAT calls using this version.

* elf/Versions (libc) [EXPORT_UNWIND_FIND_FDE]: Add empty
GLIBC_2.2.5 version.

10 years agoFix localplt check for GNU_IFUNC
Adhemerval Zanella [Wed, 19 Mar 2014 20:30:18 +0000 (15:30 -0500)]
Fix localplt check for GNU_IFUNC

GNU_IFUNC are shown by readelf in 'Relocation section' value as
"symbol()" instead of expected hexadecimal value. This causes the
check-localplt script to ignore potential PLT stub begin generated
by wrong IFUNC usage.  This patch changes the localplt script to
emit such PLT cases.

10 years agoPowerPC: Revert __PTHREAD_MUTEX_HAVE_ELISION change
Adhemerval Zanella [Tue, 25 Mar 2014 16:36:28 +0000 (11:36 -0500)]
PowerPC: Revert __PTHREAD_MUTEX_HAVE_ELISION change

This patch revert 449282f2e0e850c29f6a9666058503d4734964f0.

10 years agoUpdate powerpc-fpu ULPs.
Adhemerval Zanella [Tue, 25 Mar 2014 15:13:53 +0000 (10:13 -0500)]
Update powerpc-fpu ULPs.

10 years agoFix use of uninitialized variable
Andreas Schwab [Tue, 25 Mar 2014 07:51:59 +0000 (08:51 +0100)]
Fix use of uninitialized variable

10 years agoPowerPC: Fix -Wundef warning for __PTHREAD_MUTEX_HAVE_ELISION.
Adhemerval Zanella [Tue, 25 Mar 2014 13:21:24 +0000 (08:21 -0500)]
PowerPC: Fix -Wundef warning for __PTHREAD_MUTEX_HAVE_ELISION.

10 years agoRelax gen-auto-libm-tests may-underflow rules, test log1p in all rounding modes.
Joseph Myers [Tue, 25 Mar 2014 12:26:06 +0000 (12:26 +0000)]
Relax gen-auto-libm-tests may-underflow rules, test log1p in all rounding modes.

gen-auto-libm-tests presently allows but does not require underflow
exceptions for results with magnitude in the range (greatest
subnormal, least normal].

In some cases, the magnitude of the exact result is very slightly
above the least normal, but rounding in the implementation results in
it effectively computing an infinite-precision result that is slightly
below the least normal, so raising an underflow exception.  This is in
accordance with the documented accuracy goals, but results in
testsuite failures.

This patch changes the logic to allow underflows when the mathematical
result is up to 0.5ulp above the least normal (so in any case where
the round-to-nearest result is the least normal).  Ideally underflows
in all these cases would be accepted only when an underflow with the
actual result is consistent with the rounding mode (in FE_TOWARDZERO
mode, a return value of the least normal implies that the
infinite-precision result did not underflow so there should be no
underflow exception, for example), so as to match the documented goals
more precisely - whereas at present the tests for exceptions are
completely independent of the tests of the returned values.  (The same
applies to overflow exceptions as well - they too should be checked
for consistency with the result, as in FE_TOWARDZERO mode a result
1ulp below the largest finite value should be inconsistent with an
overflow exception and cause a failure with overflow rather than
simply being considered a 1ulp error when overflow is expected.)  But
the present patch at least deals with the cases causing spurious
failures so that (a) certain existing tests no longer need to be
marked as having spurious exceptions (such markings in
auto-libm-test-in end up applying to more cases than just those they
are needed for) and (b) log1p can be tested in all rounding modes
without introducing more such failures.  This patch duly moves tests
of log1p to ALL_RM_TEST.

Tested x86_64 and x86 and ulps updated accordingly.

[BZ #16357]
[BZ #16599]
* math/gen-auto-libm-tests.c (fp_format_desc): Add field
min_plus_half.
(fp_formats): Update initializers.
(init_fp_formats): Initialize new field.
(output_for_one_input_case): Allow underflow for results up to
min_plus_half.
* math/libm-test.inc (log1p_test): Use ALL_RM_TEST.
* math/auto-libm-test-in: Don't mark some underflows from asin and
atanh as spurious.
* math/auto-libm-test-out: Regenerated.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoSetup LOCPATH for tst-ftell-active-handler and tst-ftell-partial-wide in libio
Andreas Schwab [Tue, 25 Mar 2014 11:40:06 +0000 (12:40 +0100)]
Setup LOCPATH for tst-ftell-active-handler and tst-ftell-partial-wide in libio

10 years agoNEWS: Add 16712, 16713, 16714 to fixed bug list.
Stefan Liebler [Tue, 25 Mar 2014 09:16:08 +0000 (10:16 +0100)]
NEWS: Add 16712, 16713, 16714 to fixed bug list.

10 years agoAddress post-commit patch comments.
Paul Pluzhnikov [Tue, 25 Mar 2014 01:22:32 +0000 (18:22 -0700)]
Address post-commit patch comments.

2014-03-24  Paul Pluzhnikov  <ppluzhnikov@google.com>

* elf/tst-dlopen-aout.c: Adjust comments. Use test-skeleton.c

10 years agoFix implicit __isinf declarations in exp.
Joseph Myers [Mon, 24 Mar 2014 22:00:32 +0000 (22:00 +0000)]
Fix implicit __isinf declarations in exp.

My recent exp patch introduced warnings about implicit __isinf
declarations in exp because e_exp.c didn't include <math.h>.  This
patch fixes this.  Because <math.h> can't be included after
<math_private.h> (because of macro definitions of __nan*), it was
necessary to put an include in sysdeps/x86_64/fpu/multiarch/e_exp.c as
well.

Tested x86_64.

* sysdeps/ieee754/dbl-64/e_exp.c: Include <math.h>.
* sysdeps/x86_64/fpu/multiarch/e_exp.c
[HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise.

10 years agoFix BZ #16634.
Paul Pluzhnikov [Mon, 24 Mar 2014 17:58:26 +0000 (10:58 -0700)]
Fix BZ #16634.

An application that erroneously tries to repeatedly dlopen("a.out", ...)
may hit assertion failure:

  Inconsistency detected by ld.so: dl-tls.c: 474: _dl_allocate_tls_init:
  Assertion `listp != ((void *)0)' failed!

dlopen() actually fails with  "./a.out: cannot dynamically load executable",
but it does so after incrementing dl_tls_max_dtv_idx.

Once we run out of TLS_SLOTINFO_SURPLUS (62), we exit with above assertion
failure.

2014-03-24  Paul Pluzhnikov  <ppluzhnikov@google.com>

[BZ #16634]

* elf/dl-load.c (open_verify): Add mode parameter.
        Error early when ET_EXEC and mode does not have __RTLD_OPENEXEC.
        (open_path): Change from boolean 'secure' to complete flag 'mode'
        (_dl_map_object): Adjust.
* elf/Makefile (tests): Add tst-dlopen-aout.
* elf/tst-dlopen-aout.c: New test.

10 years agoS390: Fix namespace violation in struct stat (BZ #16714).
Stefan Liebler [Mon, 24 Mar 2014 15:49:13 +0000 (16:49 +0100)]
S390: Fix namespace violation in struct stat (BZ #16714).

10 years agoS390: Define SIZE_MAX as unsigned long (BZ #16712).
Stefan Liebler [Mon, 24 Mar 2014 15:46:51 +0000 (16:46 +0100)]
S390: Define SIZE_MAX as unsigned long (BZ #16712).

10 years agoS390: Correct type of sa_flags in struct sigaction for POSIX conformance
Stefan Liebler [Mon, 24 Mar 2014 15:34:49 +0000 (16:34 +0100)]
S390: Correct type of sa_flags in struct sigaction for POSIX conformance
(BZ #16713).

10 years agoUse += before-compile instead of a :=.
Stefan Liebler [Mon, 24 Mar 2014 15:32:47 +0000 (16:32 +0100)]
Use += before-compile instead of a :=.

10 years agoS390: Fix -Wundef warning for __PTHREAD_MUTEX_HAVE_ELISION.
Stefan Liebler [Mon, 24 Mar 2014 15:31:13 +0000 (16:31 +0100)]
S390: Fix -Wundef warning for __PTHREAD_MUTEX_HAVE_ELISION.

10 years agoFix use of half-initialized result in getaddrinfo when using nscd (bug 16743)
Andreas Schwab [Thu, 20 Mar 2014 14:05:25 +0000 (15:05 +0100)]
Fix use of half-initialized result in getaddrinfo when using nscd (bug 16743)

This fixes a bug in the way the results from __nscd_getai are collected:
for every returned result a new entry is first added to the
gaih_addrtuple list, but if that result doesn't match the request this
entry remains uninitialized.  So for this non-matching result an extra
result with uninitialized content is returned.

To reproduce (with nscd running):

$ getent ahostsv4 localhost
127.0.0.1       STREAM localhost
127.0.0.1       DGRAM
127.0.0.1       RAW
(null)          STREAM
(null)          DGRAM
(null)          RAW

10 years agobenchtests: Move bench.py to benchtests/scripts/
Siddhesh Poyarekar [Mon, 24 Mar 2014 15:46:36 +0000 (21:16 +0530)]
benchtests: Move bench.py to benchtests/scripts/

It makes much more sense to have all benchmarking-related scripts in a
single place away from everything else.

10 years agoAccount for alloca use when collecting interface addresses (bug 16002)
Andreas Schwab [Mon, 24 Mar 2014 10:06:30 +0000 (11:06 +0100)]
Account for alloca use when collecting interface addresses (bug 16002)

To reproduce:

# ip li add name dummy0 type dummy
# site_id=$(head -c6 /dev/urandom | od -tx2 -An | tr ' ' ':')
# for ((i = 0; i < 65536; i++)) do
> ip ad ad $(printf fd80$site_id::%04x $i)/128 dev dummy0
> done
# (ulimit -s 900; getent ahosts localhost)
# ip li de dummy0

10 years agoFix dbl-64 exp overflow/underflow in non-default rounding modes (bug 16284).
Joseph Myers [Mon, 24 Mar 2014 12:18:45 +0000 (12:18 +0000)]
Fix dbl-64 exp overflow/underflow in non-default rounding modes (bug 16284).

The dbl-64 version of exp needs round-to-nearest mode for its internal
computations, but that has the consequence of inappropriate
overflowing and underflowing results in other rounding modes.  This
patch fixes this by recomputing the relevant results in cases where
the round-to-nearest result overflows to infinity or underflows to
zero (most of the diffs are actually just consequent reindentation).
Tests are enabled in all rounding modes for complex functions using
exp - but not for cexp because it turns out there are bugs causing
spurious underflows for cexp for some tests, which will need to be
fixed separately (I suspect ccos ccosh csin csinh ctan ctanh have
similar bugs, just not shown by the present set of test inputs).

Tested x86_64 and x86 and ulps updated accordingly.

[BZ #16284]
* sysdeps/ieee754/dbl-64/e_exp.c (__ieee754_exp): Use original
rounding mode to recompute results that overflow to infinity or
underflow to zero.
* math/auto-libm-test-in: Don't mark tests as expected to fail for
bug 16284.
* math/auto-libm-test-out: Regenerated.
* math/libm-test.inc (ccos_test): Use ALL_RM_TEST.
(ccosh_test): Likewise.
(csin_test_data): Use plus_oflow.
(csin_test): Use ALL_RM_TEST.
(csinh_test_data): Use plus_oflow.
(csinh_test): Use ALL_RM_TEST.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoFix -Wundef warnings for _ABI* on MIPS.
Joseph Myers [Fri, 21 Mar 2014 18:21:13 +0000 (18:21 +0000)]
Fix -Wundef warnings for _ABI* on MIPS.

This patch fixes -Wundef warnings related to the _ABI* macros on MIPS.
GCC predefines only the _ABI* macro related to the ABI actually in
use, meaning that a conditional such as "#if _MIPS_SIM == _ABI64" is
true only for the ABI in question (all the macros are nonzero), but
produces a -Wundef warning for the other ABIs.  The normal approach to
using these macros is to include <sgidefs.h>, which ensures that all
three _ABI* macros are defined rather than just one; this patch does
so in the places that caused warnings (the bulk of the warnings
arising from <bits/wordsize.h>).  Tested that the warnings are fixed.

* sysdeps/mips/bits/wordsize.h: Include <sgidefs.h>.
* sysdeps/unix/sysv/linux/mips/getrlimit64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/setrlimit64.c: Likewise.

10 years agoFix log (1) in round-downward mode (bug 16731).
Joseph Myers [Fri, 21 Mar 2014 18:13:58 +0000 (18:13 +0000)]
Fix log (1) in round-downward mode (bug 16731).

According to ISO C Annex F, log (1) should be +0 in all rounding
modes, but some implementations in glibc wrongly return -0 in
round-downward mode (mapping to log1p (x - 1) is problematic because 1
- 1 is -0 in round-downward mode, and log1p (-0) is -0).  This patch
fixes this.  (It helps with some implementations of other functions
such as acosh, log2 and log10 that call out to log, but not enough to
enable all-rounding-modes testing for those functions without further
fixes to other implementations of them.)

Tested x86_64 and x86 and ulps updated accordingly, and did spot tests
for mips64 for the ldbl-128 fix, and i586 for the sysdeps/i386/fpu
implementations shadowed by those in sysdeps/i386/i686/fpu.

[BZ #16731]
* sysdeps/i386/fpu/e_log.S (__ieee754_log): Take absolute value
when x - 1 is zero.
* sysdeps/i386/fpu/e_logf.S (__ieee754_logf): Likewise.
* sysdeps/i386/fpu/e_logl.S (__ieee754_logl): Likewise.
* sysdeps/i386/i686/fpu/e_logl.S (__ieee754_logl): Likewise.
* sysdeps/ieee754/dbl-64/e_log.c (__ieee754_log): Return +0 when
argument is 1.
* sysdeps/ieee754/ldbl-128/e_logl.c (__ieee754_logl): Likewise.
* sysdeps/x86_64/fpu/e_logl.S: Take absolute value when x - 1 is
zero.
* math/libm-test.inc (log_test): Use ALL_RM_TEST.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoChangeLog formatting fix
Siddhesh Poyarekar [Fri, 21 Mar 2014 12:41:52 +0000 (18:11 +0530)]
ChangeLog formatting fix

10 years agoImplement benchmarking script in python
Siddhesh Poyarekar [Fri, 6 Dec 2013 08:21:09 +0000 (13:51 +0530)]
Implement benchmarking script in python

Implemented the benchmark script in python since it is much cleaner
and simpler to maintain.

10 years agoFix -Wundef warnins for __FP_FAST_FMA*
Siddhesh Poyarekar [Tue, 18 Mar 2014 01:52:36 +0000 (07:22 +0530)]
Fix -Wundef warnins for __FP_FAST_FMA*

The macros are defined by the compiler, so we can only verify whether
they are defined or not.

10 years agoPowerPC: optimized strpbrk for POWER7
Adhemerval Zanella [Thu, 20 Mar 2014 20:28:07 +0000 (15:28 -0500)]
PowerPC: optimized strpbrk for POWER7

This patch add an optimized strpbrk for POWER7 by using a different
algorithm than default implementation: it constructs a table based on
the 'accept' argument and use this table to check for any occurance on
the input string. The idea is similar as x86_64 uses.
For PowerPC some tunings were added, such as unroll loops and memory
clear using VSX instructions.

10 years agoTest most libm functions in all rounding modes.
Joseph Myers [Fri, 21 Mar 2014 00:03:38 +0000 (00:03 +0000)]
Test most libm functions in all rounding modes.

This patch makes libm-test.inc tests of most functions use ALL_RM_TEST
unless there was some reason to defer that change for a particular
function.

I started out planning to defer the change for pow (bug 16315), cexp /
ccos / ccosh / csin / csinh (likely fallout from exp, bug 16284) and
cpow (exact expectations for signs of exact zero results not wanted).
Testing on x86_64 and x86 showed additional failures for acosh, cacos,
catan, catanh, clog, clog10, jn, log, log10, log1p, log2, tgamma, yn,
so making the change for those functions was deferred as well, pending
investigation to show which of these represent distinct bugs (some
such bugs may already be filed) and appropriate fixing / XFAILing.
Failures include wrong signs of zero results, errors slightly above
the 9ulp bound (in such cases it may make sense for functions to set
round-to-nearest internally to reduce error accumulation), large
errors and incorrect overflow/underflow for the rounding mode (with
consequent missing errno settings in some cases).  It's possible some
could be issues with test expectations, though I didn't notice any
that were obviously like that (I added NO_TEST_INLINE for cases that
were failing for ildoubl on x86 and where it seemed reasonable for
them to fail for the fast-math inlines).

There may of course be failures on other architectures for functions
that didn't fail on x86_64 or x86, in which case the usual rule
applies: file a bug (preferably identifying the underlying problem
function, in cases where function A calls function B and a problem
with function B may present in the test results for function A) if not
already in Bugzilla then fix or XFAIL.

Tested x86_64 and x86 and ulps updated accordingly.

* math/libm-test.inc (asinh_test): Use ALL_RM_TEST.
(atan_test): Likewise.
(atanh_test_data): Use NO_TEST_INLINE for two tests.
(atanh_test): Use ALL_RM_TEST.
(atan2_test_data): Likewise.
(cabs_test): Likewise.
(cacosh_test): Likewise.
(carg_test): Likewise.
(casin_test): Likewise.
(casinh_test): Likewise.
(cbrt_test): Likewise.
(csqrt_test): Likewise.
(erf_test): Likewise.
(erfc_test): Likewise.
(pow10_test): Likewise.
(exp2_test): Likewise.
(hypot_test): Likewise.
(j0_test): Likewise.
(j1_test): Likewise.
(lgamma_test): Likewise.
(gamma_test): Likewise.
(sincos_test): Likewise.
(tanh_test): Likewise.
(y0_test): Likewise.
(y1_test): Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Update.
* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

10 years agoPowerPC: optimized strcspn for PPC64/POWER7
Adhemerval Zanella [Thu, 20 Mar 2014 16:24:52 +0000 (11:24 -0500)]
PowerPC: optimized strcspn for PPC64/POWER7

This patch add a optimized strcspn for POWER7 by using a different
algorithm than default implementation: it constructs a table based on
the 'accept' argument and use this table to check for any occurance
on the input string. The idea is similar as x86_64 uses.
For PowerPC some tunings were added, such as unroll loops and align
stack memory to table to 16 bytes (so VSX clean can ran without
alignment issues).

10 years agoMake libm-test support ALL_RM_TEST with AUTO_TESTS_*.
Joseph Myers [Thu, 20 Mar 2014 11:48:07 +0000 (11:48 +0000)]
Make libm-test support ALL_RM_TEST with AUTO_TESTS_*.

This patch continues improvements to all-rounding-mode libm testing by
making testing with ALL_RM_TEST support test results from
auto-libm-test-out.  gen-libm-test.pl is adapted to generate
appropriate output with results for each rounding mode, with
AUTO_TESTS_* calls no longer specifying a rounding mode.  Where there
were separate functions in libm-test.inc to test a function in each
rounding mode, using AUTO_TESTS_* to list the tests for each rounding
mode, those are converted to using ALL_RM_TEST (so generally this
patch doesn't change the sets of tests run in each rounding mode,
except that in various cases special-case tests given directly in
libm-test.inc were previously run only for round-to-nearest, and now
are run for all rounding modes).

Tested x86_64 and x86.

* math/gen-libm-test.pl (generate_testfile): Expect only function
name as argument to AUTO_TESTS_* and pass results for all rounding
modes to parse_args.
(parse_auto_input): Separate inputs of automatic tests from
outputs before storing in %auto_tests.
* math/libm-test.inc (acos_test_data): Update call to
AUTO_TESTS_f_f.
(acos_test): Use ALL_RM_TEST.
(acos_tonearest_test_data): Remove.
(acos_test_tonearest): Likewise.
(acos_towardzero_test_data): Likewise.
(acos_test_towardzero): Likewise.
(acos_downward_test_data): Likewise.
(acos_test_downward): Likewise.
(acos_upward_test_data): Likewise.
(acos_test_upward): Likewise.
(acosh_test_data): Update call to AUTO_TESTS_f_f.
(asin_test_data): Likewise.
(asin_test): Use ALL_RM_TEST.
(asin_tonearest_test_data): Remove.
(asin_test_tonearest): Likewise.
(asin_towardzero_test_data): Likewise.
(asin_test_towardzero): Likewise.
(asin_downward_test_data): Likewise.
(asin_test_downward): Likewise.
(asin_upward_test_data): Likewise.
(asin_test_upward): Likewise.
(asinh_test_data): Update call to AUTO_TESTS_f_f.
(atan_test_data): Likewise.
(atanh_test_data): Likewise.
(atan2_test_data): Update call to AUTO_TESTS_ff_f.
(cabs_test_data): Update call to AUTO_TESTS_c_f.
(carg_test_data): Likewise.
(cbrt_test_data): Update call to AUTO_TESTS_f_f.
(ccos_test_data): Update call to AUTO_TESTS_c_c.
(ccosh_test_data): Likewise.
(cexp_test_data): Likewise.
(clog_test_data): Likewise.
(clog10_test_data): Likewise.
(cos_test_data): Update call to AUTO_TESTS_f_f.
(cos_test): Use ALL_RM_TEST.
(cos_tonearest_test_data): Remove.
(cos_test_tonearest): Likewise.
(cos_towardzero_test_data): Likewise.
(cos_test_towardzero): Likewise.
(cos_downward_test_data): Likewise.
(cos_test_downward): Likewise.
(cos_upward_test_data): Likewise.
(cos_test_upward): Likewise.
(cosh_test_data): Update call to AUTO_TESTS_f_f.
(cosh_test): Use ALL_RM_TEST.
(cosh_tonearest_test_data): Remove.
(cosh_test_tonearest): Likewise.
(cosh_towardzero_test_data): Likewise.
(cosh_test_towardzero): Likewise.
(cosh_downward_test_data): Likewise.
(cosh_test_downward): Likewise.
(cosh_upward_test_data): Likewise.
(cosh_test_upward): Likewise.
(cpow_test_data): Update call to AUTO_TESTS_cc_c.
(csqrt_test_data): Update call to AUTO_TESTS_c_c.
(ctan_test_data): Likewise.
(ctan_test): Use ALL_RM_TEST.
(ctan_tonearest_test_data): Remove.
(ctan_test_tonearest): Likewise.
(ctan_towardzero_test_data): Likewise.
(ctan_test_towardzero): Likewise.
(ctan_downward_test_data): Likewise.
(ctan_test_downward): Likewise.
(ctan_upward_test_data): Likewise.
(ctan_test_upward): Likewise.
(ctanh_test_data): Update call to AUTO_TESTS_c_c.
(ctanh_test): Use ALL_RM_TEST.
(ctanh_tonearest_test_data): Remove.
(ctanh_test_tonearest): Likewise.
(ctanh_towardzero_test_data): Likewise.
(ctanh_test_towardzero): Likewise.
(ctanh_downward_test_data): Likewise.
(ctanh_test_downward): Likewise.
(ctanh_upward_test_data): Likewise.
(ctanh_test_upward): Likewise.
(erf_test_data): Update call to AUTO_TESTS_f_f.
(erfc_test_data): Likewise.
(exp_test_data): Likewise.
(exp_test): Use ALL_RM_TEST.
(exp_tonearest_test_data): Remove.
(exp_test_tonearest): Likewise.
(exp_towardzero_test_data): Likewise.
(exp_test_towardzero): Likewise.
(exp_downward_test_data): Likewise.
(exp_test_downward): Likewise.
(exp_upward_test_data): Likewise.
(exp_test_upward): Likewise.
(exp10_test_data): Update call to AUTO_TESTS_f_f.
(exp10_test): Use ALL_RM_TEST.
(exp10_tonearest_test_data): Remove.
(exp10_test_tonearest): Likewise.
(exp10_towardzero_test_data): Likewise.
(exp10_test_towardzero): Likewise.
(exp10_downward_test_data): Likewise.
(exp10_test_downward): Likewise.
(exp10_upward_test_data): Likewise.
(exp10_test_upward): Likewise.
(exp2_test_data): Update call to AUTO_TESTS_f_f.
(expm1_test_data): Likewise.
(expm1_test): Use ALL_RM_TEST.
(expm1_tonearest_test_data): Remove.
(expm1_test_tonearest): Likewise.
(expm1_towardzero_test_data): Likewise.
(expm1_test_towardzero): Likewise.
(expm1_downward_test_data): Likewise.
(expm1_test_downward): Likewise.
(expm1_upward_test_data): Likewise.
(expm1_test_upward): Likewise.
(fma_test_data): Update call to AUTO_TESTS_fff_f.
(fma_test): Use ALL_RM_TEST.
(fma_towardzero_test_data): Remove.
(fma_test_towardzero): Likewise.
(fma_downward_test_data): Likewise.
(fma_test_downward): Likewise.
(fma_upward_test_data): Likewise.
(fma_test_upward): Likewise.
(hypot_test_data): Update call to AUTO_TESTS_ff_f.
(j0_test_data): Update call to AUTO_TESTS_f_f.
(j1_test_data): Likewise.
(jn_test_data): Update call to AUTO_TESTS_if_f.
(lgamma_test_data): Update call to AUTO_TESTS_f_f1.
(log_test_data): Update call to AUTO_TESTS_f_f.
(log10_test_data): Likewise.
(log1p_test_data): Likewise.
(log2_test_data): Likewise.
(pow_test_data): Update call to AUTO_TESTS_ff_f.
(pow_tonearest_test_data): Likewise.
(sin_test_data): Update call to AUTO_TESTS_f_f.
(sin_test): Use ALL_RM_TEST.
(sin_tonearest_test_data): Remove.
(sin_test_tonearest): Likewise.
(sin_towardzero_test_data): Likewise.
(sin_test_towardzero): Likewise.
(sin_downward_test_data): Likewise.
(sin_test_downward): Likewise.
(sin_upward_test_data): Likewise.
(sin_test_upward): Likewise.
(sincos_test_data): Update call to AUTO_TESTS_fFF_11.
(sinh_test_data): Update call to AUTO_TESTS_f_f.
(sinh_test): Use ALL_RM_TEST.
(sinh_tonearest_test_data): Remove.
(sinh_test_tonearest): Likewise.
(sinh_towardzero_test_data): Likewise.
(sinh_test_towardzero): Likewise.
(sinh_downward_test_data): Likewise.
(sinh_test_downward): Likewise.
(sinh_upward_test_data): Likewise.
(sinh_test_upward): Likewise.
(sqrt_test_data): Update call to AUTO_TESTS_f_f.
(sqrt_test): Use ALL_RM_TEST.
(sqrt_tonearest_test_data): Remove.
(sqrt_test_tonearest): Likewise.
(sqrt_towardzero_test_data): Likewise.
(sqrt_test_towardzero): Likewise.
(sqrt_downward_test_data): Likewise.
(sqrt_test_downward): Likewise.
(sqrt_upward_test_data): Likewise.
(sqrt_test_upward): Likewise.
(tan_test_data): Update call to AUTO_TESTS_f_f.
(tan_test): Use ALL_RM_TEST.
(tan_tonearest_test_data): Remove.
(tan_test_tonearest): Likewise.
(tan_towardzero_test_data): Likewise.
(tan_test_towardzero): Likewise.
(tan_downward_test_data): Likewise.
(tan_test_downward): Likewise.
(tan_upward_test_data): Likewise.
(tan_test_upward): Likewise.
(tanh_test_data): Update call to AUTO_TESTS_f_f.
(tgamma_test_data): Likewise.
(y0_test_data): Likewise.
(y1_test_data): Likewise.
(yn_test_data): Update call to AUTO_TESTS_if_f.
(main): Do not call removed functions.

10 years agoUse ALL_RM_TEST for more libm tests.
Joseph Myers [Wed, 19 Mar 2014 16:17:22 +0000 (16:17 +0000)]
Use ALL_RM_TEST for more libm tests.

Continuing the move to using ALL_RM_TEST for tests in libm-test.inc,
this patch converts the tests of fdim, ldexp and scalb.  fdim and
scalb are cases where tests could depend on the rounding mode though
none of the present test inputs do; ldexp is such a case where the
function is equivalent to scalbn (for binary floating point) and the
tests used were a subset of those for scalbn, so this patch makes
ldexp testing use the scalbn tests, as done for other cases of libm
function aliases.

Tested x86_64 and x86.

* math/libm-test.inc (fdim_test): Use ALL_RM_TEST.
(ldexp_test_data): Remove.
(ldexp_test): Move to after scalbn_test.  Use ALL_RM_TEST with
scalbn_test_data.
(scalb_test): Use ALL_RM_TEST.

10 years agonscd: also invalidate netgroup cache on reload
Andreas Schwab [Wed, 19 Mar 2014 08:42:29 +0000 (09:42 +0100)]
nscd: also invalidate netgroup cache on reload

10 years agoFix __ASSUME_PREADV and __ASSUME_PWRITEV for Alpha and MicroBlaze (bug 16649).
Joseph Myers [Wed, 19 Mar 2014 13:10:52 +0000 (13:10 +0000)]
Fix __ASSUME_PREADV and __ASSUME_PWRITEV for Alpha and MicroBlaze (bug 16649).

Reviewing (for all architectures, with a baseline kernel version of
2.6.32) the kernel support for features for which __ASSUME_* macros
would be affected by a move to 2.6.32 as minimum kernel version showed
up that __ASSUME_PREADV and __ASSUME_PWRITEV were wrongly defined for
MicroBlaze (despite the corresponding syscall table entries not being
wired up in the kernel) and Alpha for 2.6.30 and above (although the
support on Alpha was added in 2.6.33).  This patch makes the
kernel-features.h files undefine those macros for appropriate
versions.

[BZ #16649]
* sysdeps/unix/sysv/linux/alpha/kernel-features.h
[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_PREADV): Undefine.
[__LINUX_KERNEL_VERSION < 0x020621] (__ASSUME_PWRITEV): Likewise.
* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
(__ASSUME_PREADV): Undefine.
(__ASSUME_PWRITEV): Likewise.

10 years agoAdd comments about non-Linux use of bits/mman-linux.h.
Roland McGrath [Tue, 18 Mar 2014 21:58:15 +0000 (14:58 -0700)]
Add comments about non-Linux use of bits/mman-linux.h.

10 years agoMove bits/mman-linux.h out of sysdeps/unix/sysv/linux/.
Roland McGrath [Tue, 18 Mar 2014 21:48:09 +0000 (14:48 -0700)]
Move bits/mman-linux.h out of sysdeps/unix/sysv/linux/.

This way, non-Linux ports using the Linux values for bits/mman.h
constants need not duplicate the header.

10 years agoAdd stardard definition on conform processing
Adhemerval Zanella [Tue, 18 Mar 2014 13:54:04 +0000 (08:54 -0500)]
Add stardard definition on conform processing

This patch adds the -std=c99 option when preprocessing the data files
from the conform testcases. It fixes an issue where the compiler may
split the 'macro bool' defition from stdbool.h-data in two lines and
thus breaking the conform script.

10 years agoTest scalbn and scalbln in all rounding modes, add more tests of negative arguments.
Joseph Myers [Tue, 18 Mar 2014 18:47:46 +0000 (18:47 +0000)]
Test scalbn and scalbln in all rounding modes, add more tests of negative arguments.

Continuing the move to systematically testing libm functions in all
rounding modes with ALL_RM_TEST, this patch converts the tests of
scalbn and scalbln to use that macro.

Those tests include cases of underflow and overflow, meaning the
expected results depend on the rounding mode.  For convenience in
writing such tests manually, the patch adds the notation plus_oflow,
minus_oflow, plus_uflow and minus_uflow for overflowing / underflowing
results of each sign appropriate to the rounding mode being used, and
gen-libm-test.pl is made to substitute in the appropriate values.  The
tests of underflow and overflow are extended to include negative
arguments to provide better coverage (otherwise minus_oflow and
minus_uflow wouldn't have been used at all).

(A subsequent patch will make ldexp use the scalbn tests, as those
functions are equivalent for binary floating point.)

Tested x86_64 and x86.

* math/gen-libm-test.pl (parse_args): Handle plus_oflow,
minus_oflow, plus_uflow and minus_uflow in expected results.
* math/libm-test.inc (scalbn_test_data): Add more tests of
negative arguments.  Use plus_oflow, minus_oflow, plus_uflow and
minus_uflow.
(scalbn_test): Use ALL_RM_TEST.
(scalbln_test_data): Add more tests of negative arguments.  Use
plus_oflow, minus_oflow, plus_uflow and minus_uflow.
(scalbln_test): Use ALL_RM_TEST.

10 years agoWork around binutils bugs in 2.23 and older
Roland McGrath [Tue, 18 Mar 2014 02:14:00 +0000 (07:44 +0530)]
Work around binutils bugs in 2.23 and older

binutils versions up through at least 2.23 have some bugs that cause
STV_HIDDEN symbols to appear in .dynsyms.

10 years agomisc/sys/xattr.h: guard against linux uapi header inclusion
Serge Hallyn [Tue, 11 Mar 2014 04:17:07 +0000 (23:17 -0500)]
misc/sys/xattr.h: guard against linux uapi header inclusion

If the glibc xattr.h header is included after the uapi header,
compilation fails due to an enum re-using a #define from the
uapi header.  Protect against this by guarding the define and
enum inclusions against each other.

(A corresponding kernel patch has been sent here:
http://lkml.org/lkml/2014/3/7/331 )

(See https://lists.debian.org/debian-glibc/2014/03/msg00029.html
and https://sourceware.org/glibc/wiki/Synchronizing_Headers
for more information.)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoaarch64: Remove inaccurate comment from sysdep.h
Will Newton [Tue, 11 Mar 2014 14:14:32 +0000 (14:14 +0000)]
aarch64: Remove inaccurate comment from sysdep.h

This comment appears to have been copied from the ARM port where it
makes more sense.

2014-03-18  Will Newton  <will.newton@linaro.org>

* sysdeps/unix/sysv/linux/aarch64/sysdep.h: Remove
inaccurate comment.

10 years agoExit with error status on check-abi failure.
Joseph Myers [Tue, 18 Mar 2014 00:05:28 +0000 (00:05 +0000)]
Exit with error status on check-abi failure.

* Makerules [!subdir] (check-abi): Exit with error status if a
test failed.