]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
8 years agoImprove check against integer wraparound in hcreate_r [BZ #18240]
Florian Weimer [Thu, 28 Jan 2016 12:59:11 +0000 (13:59 +0100)] 
Improve check against integer wraparound in hcreate_r [BZ #18240]

8 years agoFix MIPS64 memcpy regression.
Steve Ellcey [Thu, 28 Jan 2016 01:52:05 +0000 (01:52 +0000)] 
Fix MIPS64 memcpy regression.

The MIPS memcpy optimizations at
<https://sourceware.org/ml/libc-alpha/2015-10/msg00597.html>
introduced a bug causing many string function tests to fail with
segfaults for n32 and n64:

FAIL: string/stratcliff
FAIL: string/test-bcopy
FAIL: string/test-memccpy
FAIL: string/test-memcmp
FAIL: string/test-memcpy
FAIL: string/test-memmove
FAIL: string/test-mempcpy
FAIL: string/test-stpncpy
FAIL: string/test-strncmp
FAIL: string/test-strncpy

(Some failures in other directories could also be caused by this bug.)

The problem is that after the check for whether a word of input is
left that can be copied as a word before moving to byte copies, a load
can occur in the branch delay slot, resulting in a segfault if we are
at the end of a page and the following page is unmapped.  I don't see
how this would have passed the tests as reported in the original patch
posting (different kernel configurations affecting the code setting up
unmapped pages, maybe?), since the tests in question don't appear to
have changed recently.

This patch moves a later instruction into the delay slot, as suggested
at <https://sourceware.org/ml/libc-alpha/2016-01/msg00584.html>.

Tested for n32 and n64.

2016-01-28  Steve Ellcey  <sellcey@imgtec.com>
            Joseph Myers  <joseph@codesourcery.com>

* sysdeps/mips/memcpy.S (MEMCPY_NAME) [USE_DOUBLE]: Avoid word
load in branch delay slot when less than a word of input left.

8 years agoRemove unused variables
Andreas Schwab [Mon, 25 Jan 2016 16:07:07 +0000 (17:07 +0100)] 
Remove unused variables

They are flagged by -Wunused-const-variable.

8 years agoUpdate localplt.data for 32-bit sparc.
David S. Miller [Wed, 27 Jan 2016 00:16:38 +0000 (16:16 -0800)] 
Update localplt.data for 32-bit sparc.

* sysdeps/unix/sysv/linux/sparc/sparc32/localplt.data: Add _Q_cmp.

8 years agoDefine __sqrtl_finite on sparc 32-bit with correct symbol version.
David S. Miller [Tue, 26 Jan 2016 00:07:15 +0000 (16:07 -0800)] 
Define __sqrtl_finite on sparc 32-bit with correct symbol version.

* sysdeps/sparc/sparc32/Versions (GLIBC_2.23): Add entry for __sqrtl_finite.
* sysdeps/sparc/sparc32/fpu/e_sqrtl.c (__sqrtl_finite): Define instead using
versioned_symbol.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Fix ordering of entries.

8 years agoAdjust sparc 32-bit __sqrtl_finite version tag.
David S. Miller [Mon, 25 Jan 2016 18:41:05 +0000 (10:41 -0800)] 
Adjust sparc 32-bit __sqrtl_finite version tag.

* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Move
__sqrtl_finite to GLIBC_2.23

8 years agoUpdate Alpha libm-test-ulps
Richard Henderson [Mon, 25 Jan 2016 18:43:41 +0000 (10:43 -0800)] 
Update Alpha libm-test-ulps

8 years agoDon't do lock elision on an error checking mutex (bug 17514)
Andreas Schwab [Wed, 13 Jan 2016 15:04:42 +0000 (16:04 +0100)] 
Don't do lock elision on an error checking mutex (bug 17514)

Error checking mutexes are not supposed to be subject to lock elision.
That would defeat the error checking nature of the mutex because lock
elision doesn't record ownership.

8 years agoCleanup ppc bits/ipc.h
Paul E. Murphy [Tue, 19 Jan 2016 17:05:41 +0000 (11:05 -0600)] 
Cleanup ppc bits/ipc.h

Ages ago (commit e9dcb08) the ipc syscalls were inlined and
eventually abstracted away any need for direct __ipc calls.

8 years agoS390: Fix build failure in test string/tst-endian.c with gcc 6.
Stefan Liebler [Mon, 25 Jan 2016 11:44:46 +0000 (12:44 +0100)] 
S390: Fix build failure in test string/tst-endian.c with gcc 6.

Building string/tst-endian.c with gcc 6 produces an build warning/error on s390 (big endian machine):
gcc tst-endian.c -c -std=gnu11 -fgnu89-inline  -O2 or -O3 ...
tst-endian.c: In function ‘do_test’:
tst-endian.c:16:30: error: self-comparison always evaluates to false [-Werror=tautological-compare]
    if (htobe16 (be16toh (i)) != i)
                              ^~
...

See definitions of htobexx, bexxtoh in string/endian.h:
...

This patch silences these warnings with DIAG_* macros if build with gcc 6
and newer.

The same warnings occur on little endian machines with the
"htoleXX (leXXtoh (i)) != i" if-statements.

ChangeLog:

* string/tst-endian.c: Include <libc-internal.h>.
(do_test): Ignore tautological-compare warnings around
"htobeXX (beXXtoh (i)) != i" and
"htoleXX (leXXtoh (i)) != i" if-statements.

8 years agoFix missing __sqrtl_finite symbol in libm on sparc 32-bit.
David S. Miller [Mon, 25 Jan 2016 05:14:12 +0000 (21:14 -0800)] 
Fix missing __sqrtl_finite symbol in libm on sparc 32-bit.

* sysdeps/sparc/sparc32/fpu/e_sqrtl.c: New file.
* sysdeps/sparc/sparc32/soft-fp/q_sqrt.c (__ieee754_sqrtl): Remove alias.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Add __sqrtl_finite.

8 years agoUpdate sparc ULPS.
David S. Miller [Mon, 25 Jan 2016 05:12:58 +0000 (21:12 -0800)] 
Update sparc ULPS.

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

8 years agoMIPS: Set the required Linux kernel version to 4.5.0 for 2008 NaN
Maciej W. Rozycki [Mon, 25 Jan 2016 00:19:27 +0000 (00:19 +0000)] 
MIPS: Set the required Linux kernel version to 4.5.0 for 2008 NaN

Complement the addition of the required kernel support, present upstream
as from commit 2b5e869ecfcb3112f7e1267cb0328f3ff6d49b18 ("MIPS: ELF:
Interpret the NAN2008 file header flag") and released with Linux 4.5-rc1
on Jan 24th, 2016.

* sysdeps/unix/sysv/linux/mips/configure.ac: Set
`arch_minimum_kernel' to 4.5.0 if 2008 NaN encoding is used.
* sysdeps/unix/sysv/linux/mips/configure: Regenerate.

8 years agoFix nptl/tst-setuid3.c
Paul E. Murphy [Tue, 19 Jan 2016 19:42:44 +0000 (13:42 -0600)] 
Fix nptl/tst-setuid3.c

pthread_barrier_wait can return either PTHREAD_BARRIER_SERIAL_THREAD
or 0.  Posix makes no guarantees about which thread return the unique
value.

Additionally, pthread_join was not called despite seemingly checking
for the error.

8 years agopowerpc: Fix macro usage of htm builtins
Paul E. Murphy [Wed, 20 Jan 2016 16:33:19 +0000 (10:33 -0600)] 
powerpc: Fix macro usage of htm builtins

Some extraneous semicolons were included in a
recent patch which causes a build failure with
newer compilers.

8 years agoMaintainence patch for nios2: update ULPS file and localplt.data changes.
Chung-Lin Tang [Fri, 22 Jan 2016 06:58:03 +0000 (22:58 -0800)] 
Maintainence patch for nios2: update ULPS file and localplt.data changes.

8 years agoSilence some false positive warnings for gcc 4.7
Chris Metcalf [Wed, 20 Jan 2016 22:07:51 +0000 (17:07 -0500)] 
Silence some false positive warnings for gcc 4.7

8 years agoNaCl: Fix unused variable errors in lowlevellock-futex.h macros.
Roland McGrath [Wed, 20 Jan 2016 21:57:14 +0000 (13:57 -0800)] 
NaCl: Fix unused variable errors in lowlevellock-futex.h macros.

8 years ago2016-01-20 Paul Pluzhnikov <ppluzhnikov@google.com>
Paul Pluzhnikov [Wed, 20 Jan 2016 21:39:20 +0000 (13:39 -0800)] 
2016-01-20  Paul Pluzhnikov  <ppluzhnikov@google.com>

[BZ #19490]
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S (pthread_cond_broadcast): Use ENTRY/END
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S (pthread_cond_signal): Likewise
* sysdeps/x86_64/nptl/pthread_spin_lock.S (pthread_spin_lock): Likewise
* sysdeps/x86_64/nptl/pthread_spin_trylock.S (pthread_spin_trylock): Likewise
* sysdeps/x86_64/nptl/pthread_spin_unlock.S (pthread_spin_unlock): Likewise

8 years agoFix __finitel libm compat symbol version.
Joseph Myers [Wed, 20 Jan 2016 19:04:43 +0000 (19:04 +0000)] 
Fix __finitel libm compat symbol version.

The changes to restrict implementation-namespace symbol aliases such
as __finitel to compat symbols used code for __finitel in libm
analogous to that for __finitel in libc.  However, the versions for
the two symbols are actually different, GLIBC_2.0 in libc and
GLIBC_2.1 in libm.  This patch fixes the handling of the libm compat
symbol.

Tested for mips (o32), where it fixes an ABI test failure.

* sysdeps/ieee754/dbl-64/s_finite.c
[NO_LONG_DOUBLE && LDBL_CLASSIFY_COMPAT] (__finitel): Define
compat symbol at version GLIBC_2_1 and use GLIBC_2_1 in
SHLIB_COMPAT condition for libm, not GLIBC_2_0.
* sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
[NO_LONG_DOUBLE && LDBL_CLASSIFY_COMPAT] (__finitel): Likewise.

8 years agoUpdate localplt.data for powerpc-nofpu.
Joseph Myers [Wed, 20 Jan 2016 18:19:10 +0000 (18:19 +0000)] 
Update localplt.data for powerpc-nofpu.

Testing for powerpc-nofpu showed that localplt.data was out of date.
Two new soft-fp functions showed up in the list: __gtsf2 and
__unordsf2; this patch adds these as optional.  __signbit and
__signbitl no longer appear as local PLT entries; given the move to
__builtin_signbit* for all GCC versions supported for building glibc
(and given the use of the type-generic signbit macro within glibc),
those can safely be removed from the list, which this patch does.

Tested for powerpc-nofpu.

* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/localplt.data
(__gtsf2): Add as optional for libc.so.
(__unordsf2): Likewise.
(__signbit): Remove for libc.so.
(__signbitl): Likewise.

8 years agoS390: Fix build error in iconvdata/bug-iconv11.c.
Stefan Liebler [Wed, 20 Jan 2016 07:32:37 +0000 (08:32 +0100)] 
S390: Fix build error in iconvdata/bug-iconv11.c.

This fixes the following build error on S390 31bit while building the test
iconvdata/bug-iconv11.c with gcc 5.3:
bug-iconv11.c: In function ‘test_ibm93x’:
bug-iconv11.c:59:11: error: format ‘%td’ expects argument of type ‘ptrdiff_t’, but argument 2 has type ‘size_t {aka long unsigned int}’ [-Werror=format=]
   printf ("  ==> %td: %s\n"
           ^
cc1: all warnings being treated as errors

This patch uses %zu format specifier for argument size_t ret instead of %td.

ChangeLog:

* iconvdata/bug-iconv11.c (test_ibm93x):
Use %zu printf format specifier for size_t argument.

8 years agoFix ulps regeneration for *-finite tests.
Joseph Myers [Tue, 19 Jan 2016 21:42:58 +0000 (21:42 +0000)] 
Fix ulps regeneration for *-finite tests.

On running tests after from-scratch ulps regeneration, I found that
some libm tests failed with ulps in excess of those recorded in the
from-scratch regeneration, which should never happen unless those ulps
exceed the limit on ulps that can go in libm-test-ulps files.

Failure: Test: atan2_upward (inf, -inf)
Result:
 is:          2.35619498e+00   0x1.2d97ccp+1
 should be:   2.35619450e+00   0x1.2d97c8p+1
 difference:  4.76837159e-07   0x1.000000p-21
 ulp       :  2.0000
 max.ulp   :  1.0000
Maximal error of `atan2_upward'
 is      : 2 ulp
 accepted: 1 ulp
Failure: Test: carg_upward (-inf + inf i)
Result:
 is:          2.35619498e+00   0x1.2d97ccp+1
 should be:   2.35619450e+00   0x1.2d97c8p+1
 difference:  4.76837159e-07   0x1.000000p-21
 ulp       :  2.0000
 max.ulp   :  1.0000
Maximal error of `carg_upward'
 is      : 2 ulp
 accepted: 1 ulp

The problem comes from the addition of tests for the finite-math-only
versions of libm functions.  Those tests share ulps with the default
function variants.  make regen-ulps runs the default tests before the
finite-math-only tests, concatenating the resulting ulps before
feeding them to gen-libm-test.pl to generate a new libm-test-ulps
file.  But gen-libm-test.pl always takes the last ulps value given for
any (function, type) pair.  So, if the largest ulps for a function
come from non-finite inputs, a from-scratch regeneration loses those
ulps.

This patch fixes gen-libm-test.pl, in the case where there are
multiple ulps values for a (function, type) pair - which can only
happen as part of a regeneration - to take the largest ulps value
rather than the last one.

Tested for ARM / MIPS / powerpc-nofpu.

* math/gen-libm-test.pl (parse_ulps): Do not reduce
already-recorded ulps.
* sysdeps/arm/libm-test-ulps: Regenerated.
* sysdeps/mips/mips32/libm-test-ulps: Likewise.
* sysdeps/mips/mips64/libm-test-ulps: Likewise.
* sysdeps/powerpc/nofpu/libm-test-ulps: Likewise.

8 years agoFixed build with assembler w/o AVX-512 support.
Andrew Senkevich [Tue, 19 Jan 2016 11:34:53 +0000 (14:34 +0300)] 
Fixed build with assembler w/o AVX-512 support.

    * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Fixed build with
    assembler not supporting AVX-512.

8 years agoS390: Regenerate ULPs
Stefan Liebler [Tue, 19 Jan 2016 09:00:52 +0000 (10:00 +0100)] 
S390: Regenerate ULPs

I've regenerated ulps from scratch for s390/s390x.
All math testcases are passing afterwards.

ChangeLog:

* sysdeps/s390/fpu/libm-test-ulps: Regenerated.

8 years agoRegenerate MIPS libm-test-ulps.
Joseph Myers [Mon, 18 Jan 2016 23:32:40 +0000 (23:32 +0000)] 
Regenerate MIPS libm-test-ulps.

* sysdeps/mips/mips32/libm-test-ulps: Regenerated.
* sysdeps/mips/mips64/libm-test-ulps: Likewise.

8 years agoRegenerate powerpc-nofpu libm-test-ulps.
Joseph Myers [Mon, 18 Jan 2016 23:02:03 +0000 (23:02 +0000)] 
Regenerate powerpc-nofpu libm-test-ulps.

* sysdeps/powerpc/nofpu/libm-test-ulps: Regenerated.

8 years agoRegenerate ARM libm-test-ulps.
Joseph Myers [Mon, 18 Jan 2016 22:55:47 +0000 (22:55 +0000)] 
Regenerate ARM libm-test-ulps.

* sysdeps/arm/libm-test-ulps: Regenerated.

8 years ago[BZ #19451]
Paul Pluzhnikov [Mon, 18 Jan 2016 22:36:28 +0000 (14:36 -0800)] 
[BZ #19451]
* math/Makefile (libm-vec-tests): Move libraries after wrappers.o to fix
"make check" link failure on Ubuntu.

8 years agoS/390: Do not raise inexact exception in lrint/lround. [BZ #19486]
Stefan Liebler [Mon, 18 Jan 2016 11:48:06 +0000 (12:48 +0100)] 
S/390: Do not raise inexact exception in lrint/lround. [BZ #19486]

I get some math test-failures on s390 for float/double/ldouble for
various lrint/lround functions like:
lrint (0x1p64): Exception "Inexact" set
lrint (-0x1p64): Exception "Inexact" set
lround (0x1p64): Exception "Inexact" set
lround (-0x1p64): Exception "Inexact" set
...

GCC emits "convert to fixed" instructions for casting floating point
values to integer values. These instructions raise invalid and inexact
exceptions if the floating point value exceeds the integer type ranges.

This patch enables the various FIX_DBL_LONG_CONVERT_OVERFLOW macros in
order to avoid a cast from floating point to integer type and raise the
invalid exception with feraiseexcept.
The ldbl-128 rint/round functions are now using the same logic.

ChangeLog:

[BZ #19486]
* sysdeps/s390/fix-fp-int-convert-overflow.h: New File.
* sysdeps/generic/fix-fp-int-convert-overflow.h
(FIX_LDBL_LONG_CONVERT_OVERFLOW,
FIX_LDBL_LLONG_CONVERT_OVERFLOW): New define.
* sysdeps/arm/fix-fp-int-convert-overflow.h: Likewise.
* sysdeps/mips/mips32/fpu/fix-fp-int-convert-overflow.h:
Likewise.
* sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl):
Avoid conversions to long int where inexact exceptions
could be raised.
* sysdeps/ieee754/ldbl-128/s_lroundl.c (__lroundl):
Likewise.
* sysdeps/ieee754/ldbl-128/s_llrintl.c (__llrintl):
Avoid conversions to long long int where inexact exceptions
could be raised.
* sysdeps/ieee754/ldbl-128/s_llroundl.c (__llroundl):
Likewise.

8 years agoconfigure: make the unsupported error message less hostile
Mike Frysinger [Sat, 16 Jan 2016 00:57:36 +0000 (19:57 -0500)] 
configure: make the unsupported error message less hostile

8 years agoFixed typos in __memcpy_chk.
Andrew Senkevich [Sat, 16 Jan 2016 11:42:26 +0000 (14:42 +0300)] 
Fixed typos in __memcpy_chk.

    * sysdeps/x86_64/multiarch/memcpy_chk.S: Fixed typos.

8 years agosparc: mman.h: fix bad comment insertion
Mike Frysinger [Sat, 16 Jan 2016 07:31:25 +0000 (02:31 -0500)] 
sparc: mman.h: fix bad comment insertion

The MCL_ONFAULT define was inserted into the middle of a comment which
breaks the build.

8 years agonptl: Add first-line description for barrier tests.
Torvald Riegel [Fri, 15 Jan 2016 22:16:49 +0000 (23:16 +0100)] 
nptl: Add first-line description for barrier tests.

8 years agoFix pthread_barrier_init typo.
Torvald Riegel [Fri, 15 Jan 2016 21:40:50 +0000 (22:40 +0100)] 
Fix pthread_barrier_init typo.

Applies Paul Eggert's fix for BZ 18868.

8 years agoAdded memcpy/memmove family optimized with AVX512 for KNL hardware.
Andrew Senkevich [Fri, 15 Jan 2016 21:49:45 +0000 (00:49 +0300)] 
Added memcpy/memmove family optimized with AVX512 for KNL hardware.

Added AVX512 implementations of memcpy, mempcpy, memmove, memcpy_chk,
mempcpy_chk, memmove_chk.
It shows average improvement more than 30% over AVX versions on KNL
hardware (performance results in the thread
<https://sourceware.org/ml/libc-alpha/2016-01/msg00258.html>).

    * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Added new files.
    * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Added new tests.
    * sysdeps/x86_64/multiarch/memcpy-avx512-no-vzeroupper.S: New file.
    * sysdeps/x86_64/multiarch/mempcpy-avx512-no-vzeroupper.S: Likewise.
    * sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S: Likewise.
    * sysdeps/x86_64/multiarch/memcpy.S: Added new IFUNC branch.
    * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise.
    * sysdeps/x86_64/multiarch/memmove.c: Likewise.
    * sysdeps/x86_64/multiarch/memmove_chk.c: Likewise.
    * sysdeps/x86_64/multiarch/mempcpy.S: Likewise.
    * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise.

8 years agoNew pthread_barrier algorithm to fulfill barrier destruction requirements.
Torvald Riegel [Wed, 24 Jun 2015 12:37:32 +0000 (14:37 +0200)] 
New pthread_barrier algorithm to fulfill barrier destruction requirements.

The previous barrier implementation did not fulfill the POSIX requirements
for when a barrier can be destroyed.  Specifically, it was possible that
threads that haven't noticed yet that their round is complete still access
the barrier's memory, and that those accesses can happen after the barrier
has been legally destroyed.
The new algorithm does not have this issue, and it avoids using a lock
internally.

8 years agoFix race in tst-mqueue5
Paul E. Murphy [Mon, 11 Jan 2016 22:24:04 +0000 (17:24 -0500)] 
Fix race in tst-mqueue5

The check is done on line 117 by a thread spawned
from do_child(), forked from do_test().  This test
generates a signal in the forked process.

Either thread may handle the signal, and on ppc,
it happens to be done on do_child, on the thread
which is not doing the check on line 117.

This exposes a race condition whereby the test
incorrectly fails as the signal is caught during
or after the check.

This is mitigated by ensuring the signal is blocked
in the child thread while thread is running.

8 years agoHave iconv accept redundant escape sequences in IBM900, IBM903, IBM905,
Martin Sebor [Fri, 15 Jan 2016 18:25:13 +0000 (11:25 -0700)] 
Have iconv accept redundant escape sequences in IBM900, IBM903, IBM905,
IBM907, and IBM909.

Patch for bug #17197 changes the encoder to avoid generating redundant
shift sequences.  However, those sequences may already be present in
data encododed by prior versions of the encoder.  This change modifies
the decoder to also avoid rejecting redundant shift sequences.

        [BZ #19432]
        * iconvdata/Makefile: Add bug-iconv11.
        * iconvdata/bug-iconv11.c: New test.
        * iconvdata/ibm930.c: Do not reject redundant shift sequences.
        * iconvdata/ibm933.c: Same.
        * iconvdata/ibm935.c: Same.
        * iconvdata/ibm937.c: Same.
        * iconvdata/ibm939.c: Same.

8 years agoFix build failures with -DDEBUG.
Martin Sebor [Fri, 15 Jan 2016 18:07:41 +0000 (11:07 -0700)] 
Fix build failures with -DDEBUG.

        [BZ #19443]
        * crypt/crypt_util.c [DEBUG] (_ufc_prbits): Correct format string.
        [DEBUG] (_ufc_set_bits): Declare used.
        * iconv/gconv_dl.c [DEBUG]: Add a missing include directive.
        [DEBUG] (print_all): Declare used.
        * resolv/res_send.c [DEBUG] (__libc_res_nsend): Explicitly convert
        operands of the ternary ?: expression to target type.
        * stdlib/rshift.c [DEBUG] (mpn_rshift): Use assert() instead of
        calling the undeclared abort.
        * time/mktime.c [DEBUG] (DEBUG): Rename to DEBUG_MKTIME.

8 years agoFix build errors with -DNDEBUG.
Martin Sebor [Fri, 15 Jan 2016 17:44:07 +0000 (10:44 -0700)] 
Fix build errors with -DNDEBUG.

        [BZ #18755]
        * iconv/skeleton.c (FUNCTION_NAME): Suppress -Wunused-but-set-variable
        warnings.
        * sysdeps/nptl/gai_misc.h (__gai_start_notify_thread): Same.
        (__gai_create_helper_thread): Same.
        * nscd/nscd.c (do_exit): Suppress -Wunused-variable.
        * iconvdata/iso-2022-cn-ext.c (BODY): Initialize local variable
        to suppress -Wmaybe-uninitialized warnings.

8 years agoCall math_opt_barrier inside if
H.J. Lu [Fri, 15 Jan 2016 13:22:59 +0000 (05:22 -0800)] 
Call math_opt_barrier inside if

Since floating-point operation may trigger floating-point exceptions,
we call math_opt_barrier inside if to prevent code motion.

[BZ #19465]
* sysdeps/ieee754/dbl-64/s_fma.c (__fma): Call math_opt_barrier
inside if.
* sysdeps/ieee754/ldbl-128/s_fmal.c (__fmal): Likewise.
* sysdeps/ieee754/ldbl-96/s_fma.c (__fma): Likewise.
* sysdeps/ieee754/ldbl-96/s_fmal.c (__fmal): Likewise.

8 years agoUse TIME_T_MAX and TIME_T_MIN in tst-mktime2.c
H.J. Lu [Fri, 15 Jan 2016 00:35:24 +0000 (16:35 -0800)] 
Use TIME_T_MAX and TIME_T_MIN in tst-mktime2.c

GCC 5.3 compiles

for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
    continue;

into an infinite loop with -Os.  We can copy TIME_T_MAX and TIME_T_MIN
from time/mktime.c.

[BZ #19466]
* time/tst-mktime2.c (time_t_max): Removed.
(time_t_min): Likewise.
(TYPE_SIGNED): New.
(TYPE_MINIMUM): Likewise.
(TYPE_MAXIMUM): Likewise.
(TIME_T_MIN): Likewise.
(TIME_T_MAX): Likewise.
(mktime_test): Replace time_t_max and time_t_min with TIME_T_MAX
and TIME_T_MIN.
(do_test): Likewise.

8 years agoSet index_Fast_Unaligned_Load for Excavator family CPUs
Amit Pawar [Thu, 14 Jan 2016 14:36:02 +0000 (20:06 +0530)] 
Set index_Fast_Unaligned_Load for Excavator family CPUs

GLIBC benchtest testcases shows SSE2_Unaligned based implementations
are performing faster compare to SSE2 based implementations for
routines: strcmp, strcat, strncat, stpcpy, stpncpy, strcpy, strncpy
and strstr. Flag index_Fast_Unaligned_Load is set for Excavator family
0x15h CPU's. This makes SSE2_Unaligned based implementations as
default for these routines.

[BZ #19467]
* sysdeps/x86/cpu-features.c (init_cpu_features): Set
index_Fast_Unaligned_Load flag for Excavator family CPUs.

8 years agoAdd __private_ss to s390 struct tcbhead.
Marcin Kościelnicki [Thu, 14 Jan 2016 15:48:55 +0000 (16:48 +0100)] 
Add __private_ss to s390 struct tcbhead.

Preparation for gcc -fsplit-stack support (gcc bug #68191).  The new
field is basically identical to the one on x86.  Its TCB offset needs
to be constant, as it'll be hardcoded in gcc.

ChangeLog:

* sysdeps/s390/nptl/tls.h (struct tcbhead_t): Add __private_ss field.

8 years agoUse $(PYTHON) to run benchtests python files.
Carlos O'Donell [Wed, 13 Jan 2016 16:00:57 +0000 (11:00 -0500)] 
Use $(PYTHON) to run benchtests python files.

8 years agoFix O_DIRECTORY lookup on trivial translators
Flavio Cruz [Tue, 12 Jan 2016 23:48:30 +0000 (00:48 +0100)] 
Fix O_DIRECTORY lookup on trivial translators

* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Do not remove
leading slash when `file_name' is "/".

8 years agoAdd new header definitions from Linux 4.4 (plus older ptrace definitions).
Joseph Myers [Tue, 12 Jan 2016 12:42:55 +0000 (12:42 +0000)] 
Add new header definitions from Linux 4.4 (plus older ptrace definitions).

This patch adds some new header definitions from Linux 4.4:

* MCL_ONFAULT is added to bits/mman.h / bits/mman-linux.h (this was
  already done for hppa).

* PTRACE_SECCOMP_GET_FILTER is added to sys/ptrace.h.  Along with it,
  the older PTRACE_GETSIGMASK and PTRACE_SETSIGMASK, added in Linux
  3.11 but missed at the time, are also added.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

* bits/mman-linux.h [!MCL_CURRENT] (MCL_ONFAULT): New macro.
* sysdeps/unix/sysv/linux/alpha/bits/mman.h (MCL_ONFAULT):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/mman.h (MCL_ONFAULT):
Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/mman.h (MCL_ONFAULT):
Likewise.
* sysdeps/unix/sysv/linux/sys/ptrace.h (PTRACE_GETSIGMASK): New
enum constant and macro.
(PTRACE_SETSIGMASK): Likewise.
(PTRACE_SECCOMP_GET_FILTER): Likewise.
* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
(PTRACE_GETSIGMASK): Likewise.
(PTRACE_SETSIGMASK): Likewise.
(PTRACE_SECCOMP_GET_FILTER): Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h (PTRACE_GETSIGMASK):
Likewise.
(PTRACE_SETSIGMASK): Likewise.
(PTRACE_SECCOMP_GET_FILTER): Likewise.
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
(PTRACE_GETSIGMASK): Likewise.
(PTRACE_SETSIGMASK): Likewise.
(PTRACE_SECCOMP_GET_FILTER): Likewise.
* sysdeps/unix/sysv/linux/s390/sys/ptrace.h (PTRACE_GETSIGMASK):
Likewise.
(PTRACE_SETSIGMASK): Likewise.
(PTRACE_SECCOMP_GET_FILTER): Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h (PTRACE_GETSIGMASK):
Likewise.
(PTRACE_SETSIGMASK): Likewise.
(PTRACE_SECCOMP_GET_FILTER): Likewise.
* sysdeps/unix/sysv/linux/tile/sys/ptrace.h (PTRACE_GETSIGMASK):
Likewise.
(PTRACE_SETSIGMASK): Likewise.
(PTRACE_SECCOMP_GET_FILTER): Likewise.

8 years agoFix isinf/isnan declaration conflict with C++11
Adhemerval Zanella [Mon, 11 Jan 2016 15:34:52 +0000 (13:34 -0200)] 
Fix isinf/isnan declaration conflict with C++11

GLIBC declares isinf and isnan as expected by Unix98 and for C99 programs
these functions are hidden by the generics inf and isnan macros.
However C++11 defines isinf and isnan with the same semantics as C99
but requires that they are functions not macros (C++11 26.8 [c.math]
paragraph 10).

This then results in a conflict for perfectly valid C++11 programs:

--
using std::isinf;
using std::isnan;

double d1 = isinf(1.0);
double d2 = isnan(1.0);

d.cc:3:12: error: ‘constexpr bool std::isinf(double)’ conflicts with a previous declaration
 using std::isinf;
[...]
/usr/include/bits/mathcalls.h:201:1: note: previous declaration ‘int isinf(double)’
 __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
[...]
--

This patch fixes the prototypes by leaving the obsolete functions
defined for C++98 code (since they do not conflict with any standard
function in C++98), however preventing them on C++11.

No issues found in libstdc++ tests and check on x86_64 and i686 with
glibc testsuite.

Patch from Jonathan Wakely  <jwakely.gcc@gmail.com>.

[BZ #19439]
* math/bits/mathcalls.h
[!__cplusplus || __cplusplus < 201103L] (isinf): Do not declare
prototype.
[!__cplusplus || __cplusplus < 201103L] (isnan): Likewise.

8 years agoForce rereading TZDEFRULES after it was used to set DST rules only (bug #19253)
Andreas Schwab [Tue, 17 Nov 2015 10:43:49 +0000 (11:43 +0100)] 
Force rereading TZDEFRULES after it was used to set DST rules only (bug #19253)

If the TZDEFRULES file was used to set the DST rules when $TZ didn't
provide any we need to make sure that the next time it is used we
recompute everything as __tzfile_default changes some setting from what is
provided by TZDEFRULES.

8 years agoFix doc quoting problems with Texinfo 5
Paul Eggert [Sun, 10 Jan 2016 08:20:03 +0000 (00:20 -0800)] 
Fix doc quoting problems with Texinfo 5

Without this change, in the info file output, Texinfo 5 quotes code
in text with undirected single quotes 'like this' and generates
code examples that with many PDF readers cannot be cut out of PDFs
and pasted into code.
* manual/libc.texinfo: Configure the libc manual like the GNU
Emacs manual, by using @documentencoding and setting
txicodequoteundirected and txicodequotebacktick.  This way,
Texinfo 5 quotes code in text with directed single quotes ‘like
this’ and produces examples that can be cut out of PDFs.  This
change causes Texinfo 5 to generate info files that contain UTF-8
characters in the set {'‘', '’', '“', '”', 'Ä', 'ä', 'ö', '−',
'–', '—', '©', '⇒', '•', '…'}, which is OK nowadays.

8 years agolocaledata: nl_NL: date_fmt: rewrite to match standards [BZ #16495]
Evert [Mon, 4 Jan 2016 22:20:58 +0000 (17:20 -0500)] 
localedata: nl_NL: date_fmt: rewrite to match standards [BZ #16495]

Add some references to public Dutch standards.

8 years agopowerpc: Enforce compiler barriers on hardware transactions
Tulio Magno Quites Machado Filho [Mon, 28 Dec 2015 14:24:43 +0000 (12:24 -0200)] 
powerpc: Enforce compiler barriers on hardware transactions

Work around a GCC behavior with hardware transactional memory built-ins.
GCC doesn't treat the PowerPC transactional built-ins as compiler
barriers, moving instructions past the transaction boundaries and
altering their atomicity.

8 years agoMake shebang interpreter directives consistent
Marko Myllynen [Fri, 8 Jan 2016 13:11:15 +0000 (15:11 +0200)] 
Make shebang interpreter directives consistent

Undo changes in files maintained elsewhere.

8 years agopowerpc: Add hwcap2 bits for POWER9.
Carlos Eduardo Seo [Tue, 5 Jan 2016 17:13:18 +0000 (15:13 -0200)] 
powerpc: Add hwcap2 bits for POWER9.

Added hwcap2 bit masks for Power ISA 3.0 and VSX IEEE binary float 128-bit
features.

8 years agohppa: fix dladdr [BZ #19415]
John David Anglin [Sat, 2 Jan 2016 14:48:18 +0000 (09:48 -0500)] 
hppa: fix dladdr [BZ #19415]

The attached patch fixes dladdr on hppa.

Instead of using the generic version of _dl_lookup_address, we use an
implementation more or less modeled after __canonicalize_funcptr_for_compare()
in gcc.  The function pointer is analyzed and if it points to the
trampoline used to call _dl_runtime_resolve just before the global
offset table, then we call _dl_fixup to resolve the function pointer.
Then, we return the instruction pointer from the first word of the
descriptor.

The change fixes the testcase provided in [BZ #19415] and the Debian
nss package now builds successfully.

8 years agolonglong: fix sh -Wundef builds
Mike Frysinger [Thu, 7 Jan 2016 22:18:09 +0000 (17:18 -0500)] 
longlong: fix sh -Wundef builds

This file fails when building for SuperH as it assumes __SHMEDIA__
is always defined.  Update the code to check if it's defined.

8 years agolonglong: add SH FDPIC support
Andrew Stubbs [Tue, 27 Oct 2015 13:36:47 +0000 (13:36 +0000)] 
longlong: add SH FDPIC support

8 years agolonglong.h: Disable alpha umul_ppmm for old g++
Richard Henderson [Tue, 28 Oct 2014 20:26:24 +0000 (13:26 -0700)] 
longlong.h: Disable alpha umul_ppmm for old g++

Causes "unexpected AST of kind MULT_HIGHPART" error with bootstrap from gcc 4.8.

8 years agoxstat: only check to see if __ASSUME_ST_INO_64_BIT is defined
Mike Frysinger [Thu, 7 Jan 2016 00:51:28 +0000 (19:51 -0500)] 
xstat: only check to see if __ASSUME_ST_INO_64_BIT is defined

We define __ASSUME_ST_INO_64_BIT by default for Linux targets, and then
undef it for alpha/sh targets.  But the code that uses it looks at its
value (as 0/1) rather than whether it's defined (like all other assume
knobs).  Change the code to see if it's defined to fix build Wundef build
errors for alpha/sh.

8 years agoUpdate timezone code from tzcode 2015g.
Paul Eggert [Thu, 7 Jan 2016 11:45:07 +0000 (11:45 +0000)] 
Update timezone code from tzcode 2015g.

This patch updates the timezone code from tzcode 2015g.  The Makefile
and README changes are based on those in Paul's patch
<https://sourceware.org/ml/libc-alpha/2015-05/msg00553.html>.

Tested for x86_64 and x86.

2016-01-06  Paul Eggert  <eggert@cs.ucla.edu>
    Joseph Myers  <joseph@codesourcery.com>

* timezone/private.h: Update from tzcode 2015g.
* timezone/tzfile.h: Likewise.
* timezone/tzselect.ksh: Likewise.
* timezone/zdump.c: Likewise.
* timezone/zic.c: Likewise.
* timezone/ialloc.c: Remove file.
* timezone/scheck.c: Likewise.
* timezone/Makefile (extra-objs): Remove variable.
($(objpfx)zic): Do not depend on scheck.o and ialloc.o.
(tz-cflags): Add -DHAVE_GETTEXT -DUSE_LTZ=0
-Wno-maybe-uninitialized.
(CFLAGS-zdump.c): Remove -fwrapv -DNOID -DHAVE_GETTEXT.
(CFLAGS-zic.c): Remove -DNOID -DHAVE_GETTEXT.
(CFLAGS-ialloc.c): Remove variable.
(CFLAGS-scheck.c): Likewise.
* timezone/README: Update list of files from tzcode.

8 years agoargp: Use fwrite_unlocked instead of __fxprintf when !_LIBC
Khem Raj [Fri, 1 Jan 2016 20:20:26 +0000 (20:20 +0000)] 
argp: Use fwrite_unlocked instead of __fxprintf when !_LIBC

__fxprintf is not available when argp is built outside libc.
gnulib has the same logic already.

8 years agoMake shebang interpreter directives consistent
Marko Myllynen [Thu, 7 Jan 2016 08:51:53 +0000 (10:51 +0200)] 
Make shebang interpreter directives consistent

8 years agohppa: fix pthread spinlock
John David Anglin [Sun, 4 May 2014 18:02:30 +0000 (14:02 -0400)] 
hppa: fix pthread spinlock

URL: https://bugs.debian.org/725508

8 years agoUpdate copyright dates committed in 2016
H.J. Lu [Wed, 6 Jan 2016 22:03:10 +0000 (14:03 -0800)] 
Update copyright dates committed in 2016

8 years agoMark internal unistd functions hidden in ld.so
H.J. Lu [Wed, 6 Jan 2016 20:37:04 +0000 (12:37 -0800)] 
Mark internal unistd functions hidden in ld.so

Since internal unistd functions are only used internally in ld.so and
libc.so, they can be made hidden.  __close, __getcwd, __getpid,
__libc_read and __libc_write can't be hidden in ld.so on Hurd since they
will be preempted by the ones in libc.so after bootstrap.

[BZ #19122]
* include/unistd.h [IS_IN (rtld)]: Include <dl-unistd.h>.
* sysdeps/generic/dl-unistd.h: New file.
* sysdeps/mach/hurd/dl-unistd.h: Likewise.

8 years agoMark ld.so internal mmap functions hidden in ld.so
H.J. Lu [Wed, 6 Jan 2016 19:28:04 +0000 (11:28 -0800)] 
Mark ld.so internal mmap functions hidden in ld.so

Since ld.so internal mmap functions are only used internally in ld.so,
they can be made hidden.  Don't hide __mmap on Hurd, since __mmap in
ld.so will be preempted by the one in libc.so after bootstrap.

 [BZ #19122]
 * include/sys/mman.h [IS_IN (rtld)]: Include <dl-mman.h>.
 * sysdeps/generic/dl-mman.h: New file.
 * sysdeps/mach/hurd/dl-mman.h: Likewise.

8 years agoUpdate miscellaneous files from upstream sources.
Joseph Myers [Tue, 5 Jan 2016 18:04:06 +0000 (18:04 +0000)] 
Update miscellaneous files from upstream sources.

This patch updates texinfo.tex, config.guess, config.sub and
move-if-change from their respective upstream sources.

* manual/texinfo.tex: Update to version 2016-01-04.21 with
trailing whitespace removed.
* scripts/config.guess: Update to version 2016-01-01.
* scripts/config.sub: Update to version 2016-01-01.
* scripts/move-if-change: Update from gnulib.

8 years agoEliminate redundant sign extensions in pow()
Anton Blanchard [Mon, 4 Jan 2016 15:28:52 +0000 (13:28 -0200)] 
Eliminate redundant sign extensions in pow()

When looking at the code generated for pow() on ppc64 I noticed quite
a few sign extensions. Making the array indices unsigned reduces the
number of sign extensions from 24 to 7.

Tested for powerpc64le and x86_64.

8 years agoUpdate copyright dates not handled by scripts/update-copyrights.
Joseph Myers [Mon, 4 Jan 2016 16:26:30 +0000 (16:26 +0000)] 
Update copyright dates not handled by scripts/update-copyrights.

I've updated copyright dates in glibc for 2016.  This is the patch for
the changes not generated by scripts/update-copyrights and subsequent
build / regeneration of generated files.

* NEWS: Update copyright dates.
* catgets/gencat.c (print_version): Likewise.
* csu/version.c (banner): Likewise.
* debug/catchsegv.sh: Likewise.
* debug/pcprofiledump.c (print_version): Likewise.
* debug/xtrace.sh (do_version): Likewise.
* elf/ldconfig.c (print_version): Likewise.
* elf/ldd.bash.in: Likewise.
* elf/pldd.c (print_version): Likewise.
* elf/sotruss.sh: Likewise.
* elf/sprof.c (print_version): Likewise.
* iconv/iconv_prog.c (print_version): Likewise.
* iconv/iconvconfig.c (print_version): Likewise.
* locale/programs/locale.c (print_version): Likewise.
* locale/programs/localedef.c (print_version): Likewise.
* login/programs/pt_chown.c (print_version): Likewise.
* malloc/memusage.sh (do_version): Likewise.
* malloc/memusagestat.c (print_version): Likewise.
* malloc/mtrace.pl: Likewise.
* manual/libc.texinfo: Likewise.
* nptl/version.c (banner): Likewise.
* nscd/nscd.c (print_version): Likewise.
* nss/getent.c (print_version): Likewise.
* nss/makedb.c (print_version): Likewise.
* posix/getconf.c (main): Likewise.
* scripts/test-installation.pl: Likewise.
* sysdeps/unix/sysv/linux/lddlibc4.c (main): Likewise.

8 years agoUpdate copyright dates with scripts/update-copyrights.
Joseph Myers [Mon, 4 Jan 2016 16:05:18 +0000 (16:05 +0000)] 
Update copyright dates with scripts/update-copyrights.

8 years agohppa: Add MAP_HUGETLB and MAP_STACK defines [BZ #19285]
Helge Deller [Sat, 2 Jan 2016 22:31:12 +0000 (23:31 +0100)] 
hppa: Add MAP_HUGETLB and MAP_STACK defines [BZ #19285]

The attached patch adds some upstream defines like MAP_HUGETLB and MAP_STACK
in mman.h for the hppa architecture.

The existing MADV_xxK_PAGES defines were dropped upstream, because they were
originally added many years ago based on a proposed patch for the Linux kernel
which was never applied. So, this patch drops those unneeded defines.

8 years agoia64: fpu: fix gamma definition handling [BZ #15421]
Mike Frysinger [Tue, 29 Dec 2015 06:06:30 +0000 (01:06 -0500)] 
ia64: fpu: fix gamma definition handling [BZ #15421]

The rework in commit d709042a6e5ab3c360280faad6f9538a34dc8eea broke
buiding on ia64 due to compat_symbol expanding into ... in some cases.
The common files were wrapped in a BUILD_LGAMMA check, but the ia64
ones were not.  Add that logic to the ia64 files too.

8 years agoFix linux personality syscall wrapper
Dmitry V. Levin [Sun, 27 Dec 2015 16:30:02 +0000 (16:30 +0000)] 
Fix linux personality syscall wrapper

The personality system call, starting with linux kernel commit
v2.6.29-6609-g11d06b2a1e5658f448a308aa3beb97bacd64a940, always
successfully changes the personality if requested.  The syscall
wrapper, however, still can return an error in the following cases:
- the value returned by the system call looks like an error
due to architecture limitations of 32-bit kernels;
- a personality greater than 0xffffffff is passed to the system call,
and the 64-bit kernel does not have commit
v2.6.35-rc1-372-g485d527686850d68a0e9006dd9904f19f122485e
that would truncate this value to unsigned int;
- on sparc64, the value returned by the system call looks like an error
due to sparc64 kernel sign extension bug.

The solution is three-fold:
- move generic syscalls.list personality entry to generic 64-bit
syscalls.list file;
- for each 32-bit architecture that use negated errno semantics,
add a NOERRNO personality entry to their syscalls.list file;
- for sparc64 and 32-bit architectures that use dedicated registers
to flag syscall errors, add a wrapper around personality syscall;
if the system call return value is flagged as an error, this wrapper
returns the negated "would be errno" value, otherwise it returns
the system call return value; on sparc64, it also truncates the
personality argument to unsigned int before passing it to the kernel.

[BZ #19408]
* sysdeps/unix/sysv/linux/personality.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/personality.c: Likewise.
* sysdeps/unix/sysv/linux/tst-personality.c: Likewise.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add personality.
(tests): Add tst-personality.
* sysdeps/unix/sysv/linux/syscalls.list (personality): Move ...
* sysdeps/unix/sysv/linux/wordsize-64/syscalls.list: ... here.
* sysdeps/unix/sysv/linux/arm/syscalls.list (personality): New entry.
* sysdeps/unix/sysv/linux/hppa/syscalls.list (personality): Likewise.
* sysdeps/unix/sysv/linux/i386/syscalls.list (personality): Likewise.
* sysdeps/unix/sysv/linux/m68k/syscalls.list (personality): Likewise.
* sysdeps/unix/sysv/linux/microblaze/syscalls.list (personality):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list (personality):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list (personality):
Likewise.
* sysdeps/unix/sysv/linux/sh/syscalls.list (personality): Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list (personality):
Likewise.

8 years agoCleanup ARM ioperm implementation (step 2)
Aurelien Jarno [Tue, 29 Dec 2015 14:27:56 +0000 (15:27 +0100)] 
Cleanup ARM ioperm implementation (step 2)

Since GLIBC requires a minimum 2.6.32 kernel, the sysctl (CTL_BUS,
CTL_BUS_ISA, ISA_*) is always available.  We can therefore remove the
fallback code reading /etc/arm_systype or parsing /proc/cpuinfo.

Remove fscanf from localplt.data as it is no longer called from within
GLIBC.

* sysdeps/unix/sysv/linux/arm/ioperm.c: Do not include <string.h>.
(PATH_ARM_SYSTYPE): Remove.
(PATH_CPUINFO): Likewise.
(IO_BASE_FOOTBRIDGE): Likewise.
(IO_SHIFT_FOOTBRIDGE): Likewise.
(struct platform): Likewise.
(init_iosys): Remove compatibility code for 2.4 kernels.
* sysdeps/unix/sysv/linux/arm/localplt.data: Remove fscanf.

8 years agolocaledata: nl_NL@euro: copy measurement from nl_NL [BZ #19198]
Mike Frysinger [Wed, 30 Dec 2015 04:19:54 +0000 (23:19 -0500)] 
localedata: nl_NL@euro: copy measurement from nl_NL [BZ #19198]

No real changes here as the output is the same.  Just making the input
a little bit nicer.

8 years agomalloc: Test various special cases related to allocation failures
Florian Weimer [Tue, 29 Dec 2015 19:32:35 +0000 (20:32 +0100)] 
malloc: Test various special cases related to allocation failures

This test case exercises unusual code paths in allocation functions,
related to allocation failures.  Specifically, the test can reveal
the following bugs:

(a) calloc returns non-zero memory on fallback to sysmalloc.
(b) calloc can self-deadlock because it fails to release
    the arena lock on certain allocation failures.
(c) pvalloc can dereference a NULL arena pointer.

(a) and (b) appear specific to a faulty downstream backport.
(c) was fixed as part of commit 10ad46bc6526edc5c7afcc57112da96917ff3629.

The test for (a) was inspired by a reproducer supplied by Jeff Layton.

8 years agolocaledata: bg_BG: use colon as time separator [BZ #19385]
Damyan Ivanov [Tue, 29 Dec 2015 18:45:25 +0000 (13:45 -0500)] 
localedata: bg_BG: use colon as time separator [BZ #19385]

The only official source is the "Official spelling dictionary of the
Bulgarian language, Prosveta 2012", which states there are three ways
to separate time components: comma, colon and dot. That same dictionary
doesn't say which one is preferred.

So I turned to the mailing list of the translators of free software in
Bulgarian. The consensus is that colon is the only separator that is
widely used in Bulgarian texts and everything else will just be confusing.

URL: http://lists.ludost.net/pipermail/dict/2015-December/000538.html

8 years agolist-fixed-bugs: use argparse for the commandline
Mike Frysinger [Tue, 10 Nov 2015 05:41:33 +0000 (00:41 -0500)] 
list-fixed-bugs: use argparse for the commandline

This makes the interface more friendly to users.

8 years agoresolv: Reset defdname before use in __res_vinit [BZ #19369]
Rob Wu [Wed, 16 Dec 2015 11:53:27 +0000 (12:53 +0100)] 
resolv: Reset defdname before use in __res_vinit [BZ #19369]

Resetting defdname (default domain name) before use in __res_vinit
ensures that the default domain name is correctly set to a default
value when it is not set by the LOCALDOMAIN environment variable or
the "domain" or "search" parameters in resolv.conf

Tested using the steps from:
https://sourceware.org/bugzilla/show_bug.cgi?id=19369

8 years agohppa: Define __NO_LONG_DOUBLE_MATH so headers are consistent with libm build [BZ...
John David Anglin [Sun, 22 Nov 2015 22:15:04 +0000 (17:15 -0500)] 
hppa: Define __NO_LONG_DOUBLE_MATH so headers are consistent with libm build [BZ #19270]

The attached patch fixes BZ #19270 and the Debian gmt package now builds
successfully.  Aside from the comment, the define of __NO_LONG_DOUBLE_MATH
is similar to that in the generic version of glibc.

Build tested on hppa-unknown-linux-gnu with no observed regressions.

8 years agoia64: fpu: fix gammaf typo [BZ #15421]
Mike Frysinger [Tue, 29 Dec 2015 03:18:22 +0000 (22:18 -0500)] 
ia64: fpu: fix gammaf typo [BZ #15421]

The lgamma rewrite in commit d709042a6e5ab3c360280faad6f9538a34dc8eea
used "gammaf" in this function when it should have used "gamma".

8 years agoFix getaddrinfo bug number in ChangeLog and NEWS files
Dmitry V. Levin [Wed, 23 Dec 2015 20:39:42 +0000 (20:39 +0000)] 
Fix getaddrinfo bug number in ChangeLog and NEWS files

This amends commit 34a9094f49241ebb72084c536cf468fd51ebe3ec
that erroneously mentions number 11869 instead of 11884.

8 years agoDo not violate mutex destruction requirements.
Torvald Riegel [Tue, 14 Jul 2015 19:58:34 +0000 (21:58 +0200)] 
Do not violate mutex destruction requirements.

POSIX and C++11 require that a thread can destroy a mutex if no other
thread owns the mutex, is blocked on the mutex, or will try to acquire
it in the future.  After destroying the mutex, it can reuse or unmap the
underlying memory.  Thus, we must not access a mutex' memory after
releasing it.  Currently, we can load the private flag after releasing
the mutex, which is fixed by this patch.
See https://sourceware.org/bugzilla/show_bug.cgi?id=13690 for more
background.

We need to call futex_wake on the lock after releasing it, however.  This
is by design, and can lead to spurious wake-ups on unrelated futex words
(e.g., when the mutex memory is reused for another mutex).  This behavior
is documented in the glibc-internal futex API and in recent drafts of the
Linux kernel's futex documentation (see the draft_futex branch of
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git).

8 years agomalloc: Update comment for list_lock
Florian Weimer [Wed, 23 Dec 2015 16:23:33 +0000 (17:23 +0100)] 
malloc: Update comment for list_lock

8 years agopowerpc: Export __parse_hwcap_and_convert_at_platform to libc.a.
Carlos Eduardo Seo [Wed, 9 Dec 2015 20:48:04 +0000 (18:48 -0200)] 
powerpc: Export __parse_hwcap_and_convert_at_platform to libc.a.

Commit 67385a01d229751569b6aac067ffdcd813a15d7a added a new feature for
powerpc, where we store HWCAP/Platform bits in the TCB.  In the dynamic
linking case, we use the versioned symbol
'__parse_hwcap_and_convert_at_platform' to verify if this feature is
available.  However, the same symbol was not exported to libc.a, making
it not possible for GCC to check for it prior to link time.

8 years agopowerpc: Add basic support for POWER9 sans hwcap.
Carlos Eduardo Seo [Wed, 4 Nov 2015 21:30:49 +0000 (19:30 -0200)] 
powerpc: Add basic support for POWER9 sans hwcap.

This patch adds the minimum changes for supporting the POWER9 processor.

8 years agoHarmonize generic stdio-lock support with nptl
Samuel Thibault [Tue, 22 Dec 2015 13:39:19 +0000 (14:39 +0100)] 
Harmonize generic stdio-lock support with nptl

This fixes build when _IO_funlockfile is a macro, fixes build where
_IO_acquire_lock_clear_flags2 is used, and fixes unlocking on unexpected
stack unwind.

* sysdeps/generic/stdio-lock.h [__EXCEPTIONS] (_IO_acquire_lock,
_IO_release_lock ): Use cleanup attribute on new
_IO_acquire_lock_file variable instead of assuming that
_IO_release_lock will be called.
[!__EXCEPTIONS] (_IO_acquire_lock): Define to non-existing
_IO_acquire_lock_needs_exceptions_enabled.
(_IO_acquire_lock_clear_flags2): New macro.

8 years agopowerpc: Regenerate libm-test-ulps
Adhemerval Zanella [Tue, 22 Dec 2015 13:06:36 +0000 (11:06 -0200)] 
powerpc: Regenerate libm-test-ulps

* sysdeps/powerpc/fpu/libm-test-ulps: Regenerated.

8 years agomalloc: Fix list_lock/arena lock deadlock [BZ #19182]
Florian Weimer [Mon, 21 Dec 2015 15:42:46 +0000 (16:42 +0100)] 
malloc: Fix list_lock/arena lock deadlock [BZ #19182]

* malloc/arena.c (list_lock): Document lock ordering requirements.
(free_list_lock): New lock.
(ptmalloc_lock_all): Comment on free_list_lock.
(ptmalloc_unlock_all2): Reinitialize free_list_lock.
(detach_arena): Update comment.  free_list_lock is now needed.
(_int_new_arena): Use free_list_lock around detach_arena call.
Acquire arena lock after list_lock.  Add comment, including FIXME
about incorrect synchronization.
(get_free_list): Switch to free_list_lock.
(reused_arena): Acquire free_list_lock around detach_arena call
and attached threads counter update.  Add two FIXMEs about
incorrect synchronization.
(arena_thread_freeres): Switch to free_list_lock.
* malloc/malloc.c (struct malloc_state): Update comments to
mention free_list_lock.

8 years agoConsolidate sincos computation for 2.426265 < |x| < 105414350
Siddhesh Poyarekar [Mon, 21 Dec 2015 05:13:04 +0000 (10:43 +0530)] 
Consolidate sincos computation for 2.426265 < |x| < 105414350

Like the previous change, exploit the fact that computation for sin
and cos is identical except that it is apart by a quadrant.  Also
remove csloww, csloww1 and csloww2 since they can easily be expressed
in terms of sloww, sloww1 and sloww2.

8 years agoConsolidate sin and cos code for 105414350 <|x|< 281474976710656
Siddhesh Poyarekar [Mon, 21 Dec 2015 05:11:46 +0000 (10:41 +0530)] 
Consolidate sin and cos code for 105414350 <|x|< 281474976710656

The sin and cos computation for this range of input is identical
except for a difference in quadrants by 1.  Exploit that fact and the
common argument reduction to reduce computations for sincos.

8 years agoConsolidate range reduction in sincos for x > 281474976710656
Siddhesh Poyarekar [Mon, 21 Dec 2015 05:10:32 +0000 (10:40 +0530)] 
Consolidate range reduction in sincos for x > 281474976710656

Range reduction needs to be done only once for sin and cos, so copy
over all of the relevant functions (__sin, __cos, reduce_and_compute)
and consolidate common code.

8 years agoFix up ChangeLog
Siddhesh Poyarekar [Mon, 21 Dec 2015 05:08:38 +0000 (10:38 +0530)] 
Fix up ChangeLog

8 years agoi386: move ULPs to i686/multiarch and regenerate new ones for i386
Aurelien Jarno [Sun, 13 Dec 2015 21:55:34 +0000 (22:55 +0100)] 
i386: move ULPs to i686/multiarch and regenerate new ones for i386

The i386 ULPs are actually the i686/multiarch ones. The i686/multiarch
float ULPs are more precise as the SSE2 version (when available) uses
double for the cosf and sinf functions.

On the other hand the higher precision of the x86 FPU improves the
precision for a few other math functions.

* sysdeps/i386/fpu/libm-test-ulps: Move to ....
* sysdeps/i386/i686/multiarch/fpu/libm-test-ulps: ...here.
* sysdeps/i386/fpu/libm-test-ulps: Regenerate.

8 years agoAdded memset optimized with AVX512 for KNL hardware.
Andrew Senkevich [Fri, 18 Dec 2015 23:47:28 +0000 (02:47 +0300)] 
Added memset optimized with AVX512 for KNL hardware.

It shows improvement up to 28% over AVX2 memset (performance results
attached at <https://sourceware.org/ml/libc-alpha/2015-12/msg00052.html>).

    * sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S: New file.
    * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Added new file.
    * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Added new tests.
    * sysdeps/x86_64/multiarch/memset.S: Added new IFUNC branch.
    * sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
    * sysdeps/x86/cpu-features.h (bit_Prefer_No_VZEROUPPER,
    index_Prefer_No_VZEROUPPER): New.
    * sysdeps/x86/cpu-features.c (init_cpu_features): Set the
    Prefer_No_VZEROUPPER for Knights Landing.

8 years agoRemove unused variable in math/atest-exp2.c.
Torvald Riegel [Thu, 17 Dec 2015 22:30:03 +0000 (23:30 +0100)] 
Remove unused variable in math/atest-exp2.c.

8 years agoFix SYSCALL_CANCEL for empty argumetns
Adhemerval Zanella [Sat, 17 Oct 2015 19:56:27 +0000 (16:56 -0300)] 
Fix SYSCALL_CANCEL for empty argumetns

This patch fixes the SYSCALL_CANCEL macro for usage with zero argument
number (for instance SYSCALL_CANCEL (pause)) using a similar approach
used for SOCKETCALL_CANCEL.

GLIBC build still does not hit this issue still since SYSCALL_CANCEL
is not currently being used for zero arguments calls.

Tested on i386, x86_64, powerpc64le, aarch64.

* sysdeps/unix/sysdep.h (SYSCALL_CANCEL): Fix macro for zero argument
syscalls.
(__SYSCALL0): New macro.
(__SYSCALL1): Likewise.
(__SYSCALL2): Likewise.
(__SYSCALL3): Likewise.
(__SYSCALL4): Likewise.
(__SYSCALL5): Likewise.
(__SYSCALL6): Likewise.
(__SYSCALL7): Likewise.
(__SYSCALL_CONCAT_X): Likewise.
(__SYSCALL_CONCAT): Likewise.
(__SYSCALL_DIST): Likewise.
(__SYSCALL_CALL): Likewise.

8 years agoProvide x32 times
H.J. Lu [Thu, 17 Dec 2015 19:46:49 +0000 (11:46 -0800)] 
Provide x32 times

Since times returns 64-bit clock_t on x32, we need to provide x32 times
by redefining INTERNAL_SYSCALL_NCS and INTERNAL_SYSCALL_ERROR_P with
64-bit return type for syscall.  All system calls returning 64-bit
integer, which are lseek, time and times, must be handled specially for
x32.  lseek is handled by x32 lseek.S and time doesn't check syscall
return.  times is the only missed one.  Before this patch, there are

0000000 <__times>:
   0: b8 64 00 00 40        mov    $0x40000064,%eax
   5: 0f 05                 syscall
   7: 48 63 d0              movslq %eax,%rdx
                                ^^^^^^^^^^ Incorrect signed extension
   a: 48 83 fa f2           cmp    $0xfffffffffffffff2,%rdx
   e: 75 07                 jne    17 <__times+0x17>
  10: 3d 00 f0 ff ff        cmp    $0xfffff000,%eax
                                ^^^^^^^^^^^^^^^^^^^^^ 32-bit compare
  15: 77 11                 ja     28 <__times+0x28>
  17: 48 83 fa ff           cmp    $0xffffffffffffffff,%rdx
  1b: b8 00 00 00 00        mov    $0x0,%eax
  20: 48 0f 45 c2           cmovne %rdx,%rax
  24: c3                    retq

After this patch, there are

00000000 <__times>:
   0: b8 64 00 00 40        mov    $0x40000064,%eax
   5: 0f 05                 syscall
   7: 48 83 f8 f2           cmp    $0xfffffffffffffff2,%rax
   b: 75 08                 jne    15 <__times+0x15>
   d: 48 3d 00 f0 ff ff     cmp    $0xfffffffffffff000,%rax
  13: 77 13                 ja     28 <__times+0x28>
  15: 48 83 f8 ff           cmp    $0xffffffffffffffff,%rax
  19: ba 00 00 00 00        mov    $0x0,%edx
  1e: 48 0f 44 c2           cmove  %rdx,%rax
  22: c3                    retq

The incorrect signed extension and 32-bit compare are gone.

[BZ #19363]
* sysdeps/unix/sysv/linux/x86_64/x32/times.c: New file.

8 years agoFix POWER7 logb results for negative subnormals (bug 19375)
Adhemerval Zanella [Thu, 17 Dec 2015 14:34:57 +0000 (12:34 -0200)] 
Fix POWER7 logb results for negative subnormals (bug 19375)

The optimized POWER7 logb implementation does not use the absolute
value of the word extracted from the input to apply the leading 0-bits
builtin (to ignore the float sign).  This patch fixes it by
clearing the signal bit in the resulting word.

It fixes the subnormal tests failures when running on POWER7 ou
newer chip.

Tested on powerpc64le (POWER8).

[BZ# 19375]
* sysdeps/powerpc/power7/fpu/s_logb.c (__logb): Fix return for
negative subnormals.