View Bazaar branches
Get this repository:
git clone https://git.launchpad.net/glibc

Branches

Name Last Modified Last Commit
master 2018-05-25 20:00:51 UTC 2018-05-25
Remove sysdeps/sparc/sparc64/soft-fp directory.

Author: Joseph Myers
Author Date: 2018-05-25 20:00:51 UTC

Remove sysdeps/sparc/sparc64/soft-fp directory.

As per <https://sourceware.org/ml/libc-alpha/2014-10/msg00369.html>,
there should not be separate sysdeps/<arch>/soft-fp directories when
those are used by all configurations that use sysdeps/<arch>, and,
more generally, should not be sysdeps/foo/Implies files pointing to a
subdirectory foo/bar. This patch eliminates the
sysdeps/sparc/sparc64/soft-fp directory accordingly, merging its
contents into sysdeps/sparc/sparc64. This completes removing the
unnecessary <arch>/soft-fp sysdeps directories.

sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c is removed rather than moved.
It was not in fact used previously - the ldbl-128 version of
e_ilogbl.c was used instead - and moving it into sysdeps/sparc/sparc64
results in it being used, but causing a build failure because of
FP_DECL_EX declaring an unused variable (as I noted in
<https://sourceware.org/ml/libc-alpha/2013-10/msg00457.html> that file
doesn't appear to use FP_DECL_EX). Given that the file was previously
unused and so presumably not tested recently, removing it is the safe
way to avoid this patch changing what actually gets built into glibc
(if this file should turn out more efficient than the ldbl-128
e_ilogbl.c, it can always be added back in future with the build
failure fixed).

Tested with build-many-glibcs.py that installed stripped shared
libraries for sparc configurations are unchanged by this patch.

 * sysdeps/sparc/sparc64/Implies: Remove sparc/sparc64/soft-fp.
 * sysdeps/sparc/sparc64/Makefile [$(subdir) = soft-fp]
 (sparc64-quad-routines): New variable. Moved from ....
 [$(subdir) = soft-fp] (sysdep_routines): Add
 $(sparc64-quad-routines). Moved from ....
 [$(subdir) = math] (CPPFLAGS): Add -I../soft-fp/. Moved from ....
 * sysdeps/sparc/sparc64/soft-fp/Makefile: ... here. Remove file.
 * sysdeps/sparc/sparc64/Versions (libc): Add GLIBC_2.2 symbols
 moved from ....
 * sysdeps/sparc/sparc64/soft-fp/Versions: ... here. Remove file.
 * sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c: Remove file.
 * sysdeps/sparc/sparc64/soft-fp/qp_add.c: Move to ....
 * sysdeps/sparc/sparc64/qp_add.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_cmp.c: Move to ....
 * sysdeps/sparc/sparc64/qp_cmp.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_cmpe.c: Move to ....
 * sysdeps/sparc/sparc64/qp_cmpe.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_div.c: Move to ....
 * sysdeps/sparc/sparc64/qp_div.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_dtoq.c: Move to ....
 * sysdeps/sparc/sparc64/qp_dtoq.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_feq.c: Move to ....
 * sysdeps/sparc/sparc64/qp_feq.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_fge.c: Move to ....
 * sysdeps/sparc/sparc64/qp_fge.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_fgt.c: Move to ....
 * sysdeps/sparc/sparc64/qp_fgt.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_fle.c: Move to ....
 * sysdeps/sparc/sparc64/qp_fle.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_flt.c: Move to ....
 * sysdeps/sparc/sparc64/qp_flt.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_fne.c: Move to ....
 * sysdeps/sparc/sparc64/qp_fne.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_itoq.c: Move to ....
 * sysdeps/sparc/sparc64/qp_itoq.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_mul.c: Move to ....
 * sysdeps/sparc/sparc64/qp_mul.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_neg.S: Move to ....
 * sysdeps/sparc/sparc64/qp_neg.S: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_qtod.c: Move to ....
 * sysdeps/sparc/sparc64/qp_qtod.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c: Move to ....
 * sysdeps/sparc/sparc64/qp_qtoi.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_qtos.c: Move to ....
 * sysdeps/sparc/sparc64/qp_qtos.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c: Move to ....
 * sysdeps/sparc/sparc64/qp_qtoui.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c: Move to ....
 * sysdeps/sparc/sparc64/qp_qtoux.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_qtox.c: Move to ....
 * sysdeps/sparc/sparc64/qp_qtox.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_sqrt.c: Move to ....
 * sysdeps/sparc/sparc64/qp_sqrt.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_stoq.c: Move to ....
 * sysdeps/sparc/sparc64/qp_stoq.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_sub.c: Move to ....
 * sysdeps/sparc/sparc64/qp_sub.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_uitoq.c: Move to ....
 * sysdeps/sparc/sparc64/qp_uitoq.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_util.c: Move to ....
 * sysdeps/sparc/sparc64/qp_util.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_uxtoq.c: Move to ....
 * sysdeps/sparc/sparc64/qp_uxtoq.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/qp_xtoq.c: Move to ....
 * sysdeps/sparc/sparc64/qp_xtoq.c: ... here.
 * sysdeps/sparc/sparc64/soft-fp/sfp-machine.h: Move to ....
 * sysdeps/sparc/sparc64/sfp-machine.h: ... here.

release/2.26/master 2018-05-24 14:27:38 UTC 2018-05-24
Add NEWS entry for CVE-2018-11236

Author: Florian Weimer
Author Date: 2018-05-24 14:27:38 UTC

Add NEWS entry for CVE-2018-11236

release/2.27/master 2018-05-24 13:50:29 UTC 2018-05-24
NEWS: Move security-lated changes before bug list

Author: Florian Weimer
Author Date: 2018-05-24 13:50:29 UTC

NEWS: Move security-lated changes before bug list

This matches the practice for previous releases.

aaribaud/y2038-2.26-rfc-3 2018-05-22 22:37:48 UTC 2018-05-22
Y2038: add _TIME_BITS support

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-09-06 08:00:42 UTC

Y2038: add _TIME_BITS support

This makes all previously defined Y2038-proof API types, functions and
implementations the default when _TIME_BITS==64 and __WORDSIZE==32 (so
that 64-bit architectures are unaffected).

Note: it is assumed that the API is consistent, i.e. for each API type
which is enabled here, all API functions which depend on this type are
enabled and mapped to Y2038-proof implementations.

azanella/bz12683 2018-05-14 13:34:30 UTC 2018-05-14
nptl: Remove THREAD_ATOMIC_* macros

Author: Adhemerval Zanella
Author Date: 2017-01-24 23:05:56 UTC

nptl: Remove THREAD_ATOMIC_* macros

This patch removes the ununsed THREAD_ATOMIC_* macros now that nptl
code is using C11 atomics.

Checked on x86_64-linux-gnu and i686-linux-gnu.

 * manual/pattern.texi (THREAD_ATOMIC_BIT_SET): Remove.
 (THREAD_ATOMIC_CMPXCHG_VAL): Likewise.
 * nptl/pthreadP.h (THREAD_ATOMIC_CMPXCHG_VAL): Likewise.
 (THREAD_ATOMIC_BIT_SET): Likewise.
 * sysdeps/i386/nptl/tls.h (THREAD_ATOMIC_CMPXCHG_VAL): Likewise.
 (THREAD_ATOMIC_AND): Likewise.
 * sysdeps/x86_64/nptl/tls.h (THREAD_ATOMIC_CMPXCHG_VAL): Likewise.
 (THREAD_ATOMIC_AND): Likewise.

google/grte/v5-2.27/master 2018-05-11 19:54:53 UTC 2018-05-11
Second try at dealing with ancient mktemp

Author: Stan Shebs
Author Date: 2018-05-11 19:54:53 UTC

Second try at dealing with ancient mktemp

fw/libm-noprivate-2.27 2018-05-10 10:42:05 UTC 2018-05-10
Use custom x86 feature selection in libm

Author: Florian Weimer
Author Date: 2018-05-10 09:50:00 UTC

Use custom x86 feature selection in libm

ibm/2.22/master 2018-04-19 18:21:54 UTC 2018-04-19
Merge branch 'release/2.22/master' into ibm/2.22/master

Author: Tulio Magno Quites Machado Filho
Author Date: 2018-04-19 18:21:54 UTC

Merge branch 'release/2.22/master' into ibm/2.22/master

aaribaud/y2038-2.26-rfc-2 2018-04-18 19:50:45 UTC 2018-04-18
Y2038: add _TIME_BITS support

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-09-06 08:00:42 UTC

Y2038: add _TIME_BITS support

This makes all previously defined Y2038-proof API types, functions and
implementations the default when _TIME_BITS==64 and __WORDSIZE==32 (so
that 64-bit architectures are unaffected).

Note: it is assumed that the API is consistent, i.e. for each API type
which is enabled here, all API functions which depend on this type are
enabled and mapped to Y2038-proof implementations.

release/2.22/master 2018-04-13 17:30:20 UTC 2018-04-13
glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332]

Author: Paul Eggert
Author Date: 2017-10-22 08:00:57 UTC

glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332]

(cherry picked from commit a159b53fa059947cc2548e3b0d5bdcf7b9630ba8)

aaribaud/y2038-2.26-rfc-2-candidate 2018-04-12 18:51:09 UTC 2018-04-12
Y2038: add _TIME_BITS support

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-09-06 08:00:42 UTC

Y2038: add _TIME_BITS support

This makes all previously defined Y2038-proof API types, functions and
implementations the default when _TIME_BITS==64 and __WORDSIZE==32 (so
that 64-bit architectures are unaffected).

Note: it is assumed that the API is consistent, i.e. for each API type
which is enabled here, all API functions which depend on this type are
enabled and mapped to Y2038-proof implementations.

zack/wip-check-localplt-2 2018-03-26 13:05:19 UTC 2018-03-26
WIP finer-grained, more aggressive local PLT call check

Author: Zack Weinberg
Author Date: 2018-03-18 21:01:06 UTC

WIP finer-grained, more aggressive local PLT call check

zack/wip-pthread-no-dupe-defns 2018-03-26 12:30:46 UTC 2018-03-26
[Bug 15368] Move pthread_kill to libc and use it to implement raise.

Author: Zack Weinberg
Author Date: 2018-03-23 13:16:59 UTC

[Bug 15368] Move pthread_kill to libc and use it to implement raise.

The fix for bug #15368 was unnecessarily Linux-specific. To recap,
POSIX specifies raise to be async-signal-safe, but also specifies it
to be equivalent to pthread_kill(pthread_self(), sig), which is not
an async-signal-safe sequence of operations; a signal handler could
run in between pthread_self and pthread_kill, and do something (such
as calling fork, which is also async-signal-safe) that would invalidate
the thread descriptor. This is even true in the hypothetical case of
a port that doesn't implement multithreading: kill(getpid(), sig) will
fire the signal twice if a signal handler runs in between, calls fork,
and then returns on both sides of the fork. I don't see anything in
the standards to forbid that.

The Linux-specific fix was to override the definitions of raise in
both libpthread and libc to the same unitary function that blocks
signals, retrieves TID and PID directly from the kernel, calls tgkill,
and only then unblocks signals. This patch generalizes that to any
port: pthread_kill is moved from libpthread to libc, with a forwarding
stub left behind. The definition of raise in libpthread is also
replaced with a forwarding stub. The Linux-specific definition of
raise is deleted; those ports will now use sysdeps/pthread/raise.c,
which blocks signals first, then calls pthread_self and pthread_kill,
and then unblocks signals. Similarly, sysdeps/posix/raise.c (which
would be used on a port that didn't implement multithreading) blocks
signals, calls getpid and kill, and then unblocks signals. Thus,
ports need only implement the primitives correctly and do not need to
worry about making raise async-signal-safe.

The only wrinkle was that up till now, we did not bother initializing
the ->tid field of the initial thread's descriptor unless libpthread
was loaded; now that raise calls pthread_kill even in a single-
threaded environment, that won't fly. This is abstractly easy to fix;
the tricky part was figuring out _where_ to put the calls (two of
them, as it happens) to __pthread_initialize_pids, and I'd appreciate
careful eyes on those changes.

You might be wondering why it's safe to rely on the TID in the thread
descriptor, rather than calling gettid directly. Since all signals
are blocked from before calling pthread_self until after pthread_kill
uses the TID to call tgkill, the question is whether some _other_
thread could do something that would invalidate the calling thread's
descriptor, and I believe there is no such thing.

While I was at it I fixed another bug: raise was returning an error
code on failure (like pthread_kill does) instead of setting errno as
specified. This is user-visible but I don't think it's worth recording
as a fixed bug, nobody bothers checking whether raise failed anyway.

 * nptl/pt-raise.c
 * sysdeps/unix/sysv/linux/pt-raise.c
 * sysdeps/unix/sysv/linux/raise.c:
 Remove file.

 * sysdeps/unix/sysv/linux/pthread_kill.c: Use __is_internal_signal
 to check for forbidden signals. Use INTERNAL_SYSCALL_CALL to call
 getpid. Provide __libc_pthread_kill, with __pthread_kill as
 strong alias and pthread_kill as weak alias.

 * sysdeps/posix/raise.c: Block signals around the calls to
 __getpid and __kill. Provide __libc_raise, with raise as strong
 alias, libc_hidden_def for raise, and gsignal as weak alias.
 * sysdeps/pthread/raise.c: New file. Implement by blocking
 signals, calling pthread_self and pthread_kill, and then
 unblocking signals again. Provide same symbols as above.

 * sysdeps/generic/internal-signals.h: Define all of the same
 functions that sysdeps/unix/sysv/linux/internal-signals.h does,
 with sensible default definitions.
 * sysdeps/unix/sysv/linux/internal-signals.h: Clarify comments.

 * nptl/pthread_kill.c: Define __libc_pthread_kill, with
 __pthread_kill as strong alias and pthread_kill as weak alias.
 * nptl/pthread_self.c: Define __pthread_self, with
 pthread_self as weak alias.
 * signal/raise.c: Define __libc_raise, with raise as strong alias,
 libc_hidden_def for raise, and gsignal as weak alias.

 * nptl/Makefile: Move pthread_kill from libpthread-routines to
 routines. Remove pt-raise from libpthread-routines.
 * nptl/Versions (libc/GLIBC_2.28): Add pthread_kill.
 (libc/GLIBC_PRIVATE): Add __libc_pthread_kill and __libc_raise.
 * sysdeps/generic/pt-compat-stubs.S: Add stubs for raise and
 pthread_kill.

 * nptl/nptl-init.c (__pthread_initialize_minimal_internal):
 Don't call __pthread_initialize_pids here.
 * csu/libc-tls.c (__libc_setup_tls):
        Call __pthread_initialize_pids after all other setup.
 * elf/rtld.c (init_tls): Likewise.

 * include/pthreadP.h: New forwarder.
 * include/pthread.h: Add multiple inclusion guard. Declare
 __pthread_self.
 * include/signal.h: Declare __pthread_kill.

 * sysdeps/**/libc.abilist (GLIBC_2.28): Add pthread_kill.

zack/remove-mode-bits 2018-03-10 20:24:41 UTC 2018-03-10
Use PRINTF_LDBL_IS_DBL instead of __ldbl_is_dbl.

Author: Zack Weinberg
Author Date: 2018-03-07 14:08:49 UTC

Use PRINTF_LDBL_IS_DBL instead of __ldbl_is_dbl.

After all that prep work, nldbl-compat.c can now use PRINTF_LDBL_IS_DBL
instead of __no_long_double to control the behavior of printf-like
functions; this is the last thing we needed __no_long_double for, so it
can go away entirely.

 * stdio-common/vfprintf-internal.c
 (__vfprintf_internal, __vfwprintf_internal): Don't use __ldbl_is_dbl.
 * sysdeps/generic/math_ldbl_opt.h: Remove __ldbl_is_dbl.
 * sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h: Remove __ldbl_is_dbl
 and __no_long_double.
 * sysdeps/ieee754/ldbl-opt/math_ldbl_opt.c: Remove file.
 * sysdeps/ieee754/ldbl-opt/Makefile (routines): Remove math_ldbl_opt.
 * sysdeps/ieee754/ldbl-opt/nldbl-compat.c
 (__nldbl_cleanup, set_no_long_double, clear_no_long_double): Remove.
 (__nldbl___asprintf, __nldbl_dprintf, __nldbl_fprintf)
 (__nldbl_fwprintf, __nldbl_printf, __nldbl_sprintf)
 (__nldbl_vfprintf, __nldbl___vsprintf, __nldbl_obstack_vprintf)
 (__ndlbl_obstack_printf, __nldbl_snprintf, __nldbl_swprintf)
 (__nldbl_vasprintf, __nldbl_vdprintf, __nldbl_vfwprintf)
 (__nldbl_vprintf, __nldbl_vsnprintf, __ndlbl_vswprintf)
 (__nldbl_vwprintf, __nldbl_wprintf):
 Directly call the appropriate __v*printf_internal routine, passing
 PRINTF_LDBL_IS_DBL. Do not mess with __no_long_double. Normalize
 variable names.
 (__nldbl___fprintf_chk, __nldbl___fwprintf_chk)
 (__nldbl___printf_chk, __nldbl___snprintf_chk)
 (__nldbl___sprintf_chk, __nldbl___swprintf_chk)
 (__nldbl___vfprintf_chk, __nldbl___vfwprintf_chk)
 (__nldbl___vprintf_chk, __nldbl___vsnprintf_chk)
 (__nldbl___vsprintf_chk, __nldbl___vswprintf_chk)
 (__nldbl___vwprintf_chk, __nldbl___wprintf_chk)
 (__nldbl___vasprintf_chk, __nldbl___asprintf_chk)
 (__nldbl___vdprintf_chk, __nldbl___dprintf_chk)
 (__nldbl___obstack_vprintf_chk, __nldbl___obstack_printf_chk):
 Likewise, and also pass PRINTF_FORTIFY when appropriate.
 (__nldbl_syslog, __nldbl_vsyslog):
 Directly call __vsyslog_internal, passing PRINTF_LDBL_IS_DBL.
 (__nldbl_syslog_chk): Likewise, and also pass PRINTF_FORTIFY when
 appropriate.
 (__nldbl_vsyslog_chk): Likewise, and also pass PRINTF_FORTIFY when
 appropriate. Remove libc_hidden_proto and libc_hidden_def.

mfabian/collation-update-2.27 2018-03-02 10:31:16 UTC 2018-03-02
Remove the lines from cmn_TW.UTF-8.in which cannot work at the moment.

Author: Mike FABIAN
Author Date: 2017-12-21 17:56:52 UTC

Remove the lines from cmn_TW.UTF-8.in which cannot work at the moment.

See this bug https://sourceware.org/bugzilla/show_bug.cgi?id=22898

These lines don’t yet work because of a glibc bug, not because of
problems in the locale data. No matter what sorting rules one uses,
these characters cannot be sorted at all at the moment.

As soon as that bug is fixed, these lines should be added back to the
test file.

 * localedata/cmn_TW.UTF-8.in: Remove the lines which cannot
        be sorted correctly at the moment because of a bug.

zack/c99-compliant-scanf 2018-02-22 04:27:27 UTC 2018-02-22
Use C99-compliant scanf under _GNU_SOURCE with modern compilers.

Author: Zack Weinberg
Author Date: 2018-02-10 16:58:35 UTC

Use C99-compliant scanf under _GNU_SOURCE with modern compilers.

The only difference between noncompliant and C99-compliant scanf is
that the former accepts the archaic GNU extension '%as' (also %aS and
%a[...]) meaning to allocate space for the input string with malloc.
This extension conflicts with C99's use of %a as a format _type_
meaning to read a floating-point number; POSIX.1-2008 standardized
equivalent functionality using the modifier letter 'm' instead (%ms,
%mS, %m[...]).

The extension was already disabled in most conformance modes:
specifically, any mode that doesn't involve _GNU_SOURCE and _does_
involve either strict conformance to C99 or loose conformance to both
C99 and POSIX.1-2001 would get the C99-compliant scanf. With
compilers new enough to use -std=gnu11 instead of -std=gnu89, or
equivalent, that includes the default mode.

This patch tightens things up further: you now get C99-compliant scanf
in all configurations except when _GNU_SOURCE is defined *and*
__STDC_VERSION__ or __cplusplus (whichever is relevant) indicates
C89/C++98. This leaves the old scanf available under e.g. -std=c89
-D_GNU_SOURCE, but removes it from e.g. -std=gnu11 -D_GNU_SOURCE (it
was already not present under -std=gnu11 without -D_GNU_SOURCE) and
from -std=gnu89 without -D_GNU_SOURCE.

There needs to be an internal override so we can compile the
noncompliant scanf itself. This is the same problem we had when we
removed 'gets' from _GNU_SOURCE and it's dealt with the same way:
there's a new __GLIBC_USE symbol, DEPRECATED_SCANF, which defaults to
off under the appropriate conditions for external code, but can be
overridden by individual files within stdio.

We also run into problems with PLT bypass, because libc_hidden_proto
uses __REDIRECT and so does the logic in stdio.h for choosing which
implementation of scanf to use; __REDIRECT isn't transitive, so a
couple of files that use sscanf internally have to bridge the gap with
macros. I'm open to better ideas if anyone has one (N.B. I would
accept "internal code shouldn't call *scanf ever" as a better idea,
but I'm not gonna make that decision unilaterally). Fortunately,
elf/check-localplt will catch any new internal uses of *scanf that
aren't shimmed.

On a related note, the interaction of the C99/not-C99 scanf redirect
with the __LDBL_COMPAT scanf redirect was complicated, confusing, and
possibly wrong. I tried to match the intent rather than the letter of
the previous behavior. I do not have access to physical hardware for
which __LDBL_COMPAT is relevant, so my ability to test it is limited.
Careful review and maybe even some volunteer testing would be
appreciated.

Finally, there are several tests in stdio-common that use the
extension. bug21 is a regression test for a crash, and still
exercises the relevant code if changed to use %ms instead of %as.
scanf14 through scanf17 are more complicated since they are actually
testing the subtleties of the extension - under what circumstances is
'a' treated as a modifier letter, etc. My approach here is to
duplicate scanf14.c and scanf16.c; the originals change to use %ms
instead, the copies select precisely the right conformance mode to get
%as with the old GNU meaning, plus everything else they need (it's not
as simple as saying -std=gnu89, unfortunately). scanf15 and scanf17
become simpler because they no longer need to avoid _GNU_SOURCE, and
all of them no longer need diagnostic overrides. Yay!

--
 * include/features.h (__GLIBC_USE_DEPRECATED_SCANF): New __GLIBC_USE
        parameter. Only use deprecated scanf when __USE_GNU is defined
        and __STDC_VERSION__ is less than 199901L or __cplusplus is less
        than 201103L, whichever is relevant for the language being compiled.

 * libio/stdio.h, libio/bits/stdio-ldbl.h: Decide whether or
 not to redirect scanf, fscanf, sscanf, vscanf, vfscanf, and
 vsscanf to their __isoc99_ variants based only on
        __GLIBC_USE(DEPRECATED_SCANF).

 * libio/iovsscanf.c, libio/vscanf.c, stdio-common/fscanf.c
 * stdio-common/scanf.c, stdio-common/vfscanf.c:
 Override __GLIBC_USE_DEPRECATED_SCANF to 1.
 * stdio-common/sscanf.c: Likewise. Remove ldbl_hidden_def for
 __sscanf.
 * stdio-common/isoc99_sscanf.c: Add libc_hidden_def for __isoc99_sscanf.
        * include/stdio.h: Provide libc_hidden_proto for __isoc99_sscanf,
 not sscanf.

 * misc/mntent_r.c, time/tzset.c: Redirect sscanf to __isoc99_scanf
 with a macro.

 * stdio-common/bug21.c, stdio-common/scanf14.c:
 Use %ms instead of %as, %mS instead of %aS, %m[] instead of %a[];
 remove DIAG_IGNORE_NEEDS_COMMENT for -Wformat.
 * stdio-common/scanf16.c: Likewise. Add __attribute__((format(scanf)))
 to xscanf, xfscanf, xsscanf.

 * stdio-common/scanf14a.c: New copy of scanf14.c which still uses
 %as, %aS, %a[]. Use conformance mode -std=gnu89,
 _POSIX_C_SOURCE=199506L, _XOPEN_SOURCE=1, _XOPEN_SOURCE_EXTENDED=1,
 which will use the nonconformant scanf implementation.
 Remove DIAG_IGNORE_NEEDS_COMMENT for -Wformat.
 * stdio-common/scanf16a.c: New copy of scanf16.c which still uses
 %as, %aS, %a[]. Use conformance mode -std=gnu89,
 _POSIX_C_SOURCE=199506L, _XOPEN_SOURCE=1, _XOPEN_SOURCE_EXTENDED=1,
 _ISOC99_SOURCE=1, which will use the nonconformant scanf
 implementation. Add __attribute__((format(scanf))) to xscanf,
 xfscanf, xsscanf.

 * stdio-common/scanf15.c, stdio-common/scanf17.c: No need to
 override feature selection macros or provide definitions of u_char etc.
 * stdio-common/Makefile (tests): Add scanf14a and scanf16a.
 (CFLAGS-scanf15.c, CFLAGS-scanf17.c): Remove.
 (CFLAGS-scanf14a.c, CFLAGS-scanf16a.c): New.

arm/ilp32 2018-02-21 15:55:26 UTC 2018-02-21
aarch64: Fix bits/utmp.h for GCC 8

Author: Szabolcs Nagy
Author Date: 2018-02-21 15:51:22 UTC

aarch64: Fix bits/utmp.h for GCC 8

The same suppression of -Wstringop-truncation warnings as in commit
7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c but for aarch64.

2018-02-21 Szabolcs Nagy <szabolcs.nagy@arm.com>

 * sysdeps/unix/sysv/linux/aarch64/bits/utmp.h (struct utmp): Use
 __attribute_nonstring__.

release/2.25/master 2018-02-12 13:34:48 UTC 2018-02-12
powerpc: Fix syscalls during early process initialization [BZ #22685]

Author: Tulio Magno Quites Machado Filho
Author Date: 2018-01-12 20:50:33 UTC

powerpc: Fix syscalls during early process initialization [BZ #22685]

The tunables framework needs to execute syscall early in process
initialization, before the TCB is available for consumption. This
behavior conflicts with powerpc{|64|64le}'s lock elision code, that
checks the TCB before trying to abort transactions immediately before
executing a syscall.

This patch adds a powerpc-specific implementation of __access_noerrno
that does not abort transactions before the executing syscall.

Tested on powerpc{|64|64le}.

 [BZ #22685]
 * sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION_IMPL): Renamed
 from ABORT_TRANSACTION.
 (ABORT_TRANSACTION): Redirect to ABORT_TRANSACTION_IMPL.
 * sysdeps/powerpc/powerpc64/sysdep.h (ABORT_TRANSACTION,
 ABORT_TRANSACTION_IMPL): Likewise.
 * sysdeps/unix/sysv/linux/powerpc/not-errno.h: New file. Reuse
 Linux code, but remove the code that aborts transactions.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 4612268a0ad8e3409d8ce2314dd2dd8ee0af5269)

shebs/clangify 2018-02-07 21:00:02 UTC 2018-02-07
Use clang integrated assembler except when asm is output and not required to ...

Author: Stan Shebs
Author Date: 2018-02-07 21:00:02 UTC

Use clang integrated assembler except when asm is output and not required to be valid

ibm/2.26/master 2018-02-02 17:18:56 UTC 2018-02-02
Merge branch 'release/2.26/master' into ibm/2.26/master

Author: Tulio Magno Quites Machado Filho
Author Date: 2018-02-02 17:18:56 UTC

Merge branch 'release/2.26/master' into ibm/2.26/master

azanella/c11-threads 2018-02-02 17:00:00 UTC 2018-02-02
Add manual documentation for threads.h

Author: Juan Manuel Torres Palma
Author Date: 2016-12-06 22:47:02 UTC

Add manual documentation for threads.h

This patch updates the manual and adds a new chapter to the manual,
explaining types macros, constants and functions defined by ISO C11
threads.h standard.

 * manual/Makefile (chapters): Add isothreads.texi.
 * manual/isothreads.texi: New file. Add new chapter for ISO C11
 threads documentation.

aaribaud/y2038-temp 2018-02-01 11:16:04 UTC 2018-02-01
Y2038: add _TIME_BITS support

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-09-06 08:00:42 UTC

Y2038: add _TIME_BITS support

This makes all previously defined Y2038-proof API types, functions and
implementations the default when _TIME_BITS==64 and __WORDSIZE==32 (so
that 64-bit architectures are unaffected).

Note: it is assumed that the API is consistent, i.e. for each API type
which is enabled here, all API functions which depend on this type are
enabled and mapped to Y2038-proof implementations.

azanella/qsort-refactor 2018-01-23 18:46:01 UTC 2018-01-23
stdlib: Remove undefined behavior from qsort implementation

Author: Adhemerval Zanella
Author Date: 2018-01-16 16:24:53 UTC

stdlib: Remove undefined behavior from qsort implementation

Internally qsort is implemented on top of __qsort_r by casting the
function pointer to another type (__compar_fn_t tp __compar_d_fn_t)
and passing a NULL extra argument. Casting function pointer with
different types for subsequent function call is undefined-behaviour
(C11 6.3.2.3):

  "[8] A pointer to a function of one type may be converted to a pointer
  to a function of another type and back again; the result shall compare
  equal to the original pointer. If a converted pointer is used to call
  a function whose type is not compatible with the referenced type,
  the behavior is undefined."

Also 'compatible' in this case also does not apply according to
6.7.6.3 Function declarators (including prototypes):

  "[15] For two function types to be compatible, both shall specify
  compatible return types. (146) Moreover, the parameter type lists,
  if both are present, shall agree in the number of parameters and
  in use of the ellipsis terminator; corresponding parameters shall
  have compatible types. [...]"

Although this works on all architectures glibc supports (mostly because
it casts function pointers with similar calling conventions), I think
it is worth to avoid it. This patch fixes it by adding a common
implementation (qsort_common.c) which redefines the function based
on the required types.

For x86_64 (i7-4790K, gcc 7.2.1) shows a slight better performance
for qsort:

Results for member size 4
  Sorted
  nmemb | base | patched | diff
        32| 1304 | 1257 | -3.60
      4096| 330707 | 302235 | -8.61
     32768| 3300210 | 3020728 | -8.47
    524288| 65673289 | 59306436 | -9.69

  Repeated
  nmemb | base | patched | diff
        32| 1885 | 1873 | -0.64
      4096| 951490 | 904864 | -4.90
     32768| 9272366 | 8542801 | -7.87
    524288| 183337854 | 168426795 | -8.13

  MostlySorted
  nmemb | base | patched | diff
        32| 1836 | 1776 | -3.27
      4096| 758359 | 709937 | -6.39
     32768| 7199982 | 6855890 | -4.78
    524288| 139242170 | 129385161 | -7.08

  Unsorted
  nmemb | base | patched | diff
        32| 2073 | 1941 | -6.37
      4096| 1058383 | 969021 | -8.44
     32768| 10310116 | 9462116 | -8.22
    524288| 202427388 | 186560908 | -7.84

Results for member size 8
  Sorted
  nmemb | base | patched | diff
        32| 1224 | 1205 | -1.55
      4096| 336100 | 325554 | -3.14
     32768| 3539890 | 3264125 | -7.79
    524288| 67268510 | 66107684 | -1.73

  Repeated
  nmemb | base | patched | diff
        32| 2096 | 2118 | 1.05
      4096| 1015585 | 979114 | -3.59
     32768| 9871981 | 9028606 | -8.54
    524288| 189710172 | 174903867 | -7.80

  MostlySorted
  nmemb | base | patched | diff
        32| 2318 | 2346 | 1.21
      4096| 805051 | 759158 | -5.70
     32768| 8346363 | 7810444 | -6.42
    524288| 143597264 | 135900146 | -5.36

  Unsorted
  nmemb | base | patched | diff
        32| 2364 | 2301 | -2.66
      4096| 1076998 | 1014018 | -5.85
     32768| 10442153 | 9888078 | -5.31
    524288| 206235337 | 192479957 | -6.67

Results for member size 32
  Sorted
  nmemb | base | patched | diff
        32| 1214 | 1184 | -2.47
      4096| 332449 | 325865 | -1.98
     32768| 3313274 | 3331750 | 0.56
    524288| 70786673 | 69067176 | -2.43

  Repeated
  nmemb | base | patched | diff
        32| 4913 | 4813 | -2.04
      4096| 1693735 | 1624137 | -4.11
     32768| 17054760 | 15896739 | -6.79
    524288| 332149265 | 316328778 | -4.76

  MostlySorted
  nmemb | base | patched | diff
        32| 5490 | 5332 | -2.88
      4096| 1394312 | 1312703 | -5.85
     32768| 12743599 | 12360726 | -3.00
    524288| 240249011 | 231603294 | -3.60

  Unsorted
  nmemb | base | patched | diff
        32| 6251 | 6047 | -3.26
      4096| 1959306 | 1695241 | -13.48
     32768| 17204840 | 16430388 | -4.50
    524288| 342716199 | 329496913 | -3.86

Checked on x86_64-linux-gnu.

 * stdlib/qsort.c: Move common code to stdlib/qsort_common.c
 and parametrize the function definition based wether to use
 the '_r' variant.
 * stdlib/qsort_common.c: New file.

release/2.23/master 2018-01-19 17:54:03 UTC 2018-01-19
x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

Author: H.J. Lu
Author Date: 2018-01-19 17:53:50 UTC

x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

_dl_runtime_profile calls _dl_call_pltexit, passing a pointer to
La_x86_64_retval which is allocated on stack. The lrv_vector0
field in La_x86_64_retval must be aligned to size of vector register.
When allocating stack space for La_x86_64_retval, we need to make sure
that the address of La_x86_64_retval + RV_VECTOR0_OFFSET is aligned to
VEC_SIZE. This patch checks the alignment of the lrv_vector0 field
and pads the stack space if needed.

Tested with x32 and x86-64 on SSE4, AVX and AVX512 machines. It fixed

FAIL: elf/tst-audit10
FAIL: elf/tst-audit4
FAIL: elf/tst-audit5
FAIL: elf/tst-audit6
FAIL: elf/tst-audit7

on x32 AVX512 machine.

(cherry picked from commit 207a72e2988c6d6343f50fe0128eb4fc4edfdd15)

 [BZ #22715]
 * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile): Properly
 align La_x86_64_retval to VEC_SIZE.

release/2.24/master 2018-01-19 17:52:15 UTC 2018-01-19
x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

Author: H.J. Lu
Author Date: 2018-01-19 17:51:58 UTC

x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

_dl_runtime_profile calls _dl_call_pltexit, passing a pointer to
La_x86_64_retval which is allocated on stack. The lrv_vector0
field in La_x86_64_retval must be aligned to size of vector register.
When allocating stack space for La_x86_64_retval, we need to make sure
that the address of La_x86_64_retval + RV_VECTOR0_OFFSET is aligned to
VEC_SIZE. This patch checks the alignment of the lrv_vector0 field
and pads the stack space if needed.

Tested with x32 and x86-64 on SSE4, AVX and AVX512 machines. It fixed

FAIL: elf/tst-audit10
FAIL: elf/tst-audit4
FAIL: elf/tst-audit5
FAIL: elf/tst-audit6
FAIL: elf/tst-audit7

on x32 AVX512 machine.

(cherry picked from commit 207a72e2988c6d6343f50fe0128eb4fc4edfdd15)

 [BZ #22715]
 * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile): Properly
 align La_x86_64_retval to VEC_SIZE.

azanella/qsort-smooth 2018-01-18 12:30:55 UTC 2018-01-18
stdlib: Use smoothsort for qsort{_r}

Author: Adhemerval Zanella
Author Date: 2017-08-31 23:24:15 UTC

stdlib: Use smoothsort for qsort{_r}

This patch changes the internal qsort implementation to use the smoothsort
algorithm instead of a combination of quicksort/mergesort. Current
implementation has some issues:

 * stdlib/Makefile (routines): Remove msort.
 (CFLAGS-msort.c): Remove rule.
 * stdlib/msort.c: Remove file.
 * stdlib/qsort.c (__qsort_r, qsort): Reimplement using smoothsort.
 * stdlib/qsort_common.c: New file.

hjl/pr22715/2.24 2018-01-17 14:36:33 UTC 2018-01-17
x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

Author: H.J. Lu
Author Date: 2018-01-16 03:39:56 UTC

x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

_dl_runtime_profile calls _dl_call_pltexit, passing a pointer to
La_x86_64_retval which is allocated on stack. The lrv_vector0
field in La_x86_64_retval must be aligned to size of vector register.
When allocating stack space for La_x86_64_retval, we need to make sure
that the address of La_x86_64_retval + RV_VECTOR0_OFFSET is aligned to
VEC_SIZE. This patch checks the alignment of the lrv_vector0 field
and pads the stack space if needed.

Tested with x32 and x86-64 on SSE4, AVX and AVX512 machines. It fixed

FAIL: elf/tst-audit10
FAIL: elf/tst-audit4
FAIL: elf/tst-audit5
FAIL: elf/tst-audit6
FAIL: elf/tst-audit7

on x32 AVX512 machine.

(cherry picked from commit 207a72e2988c6d6343f50fe0128eb4fc4edfdd15)

 [BZ #22715]
 * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile): Properly
 align La_x86_64_retval to VEC_SIZE.

hjl/pr22715/2.25 2018-01-17 13:10:59 UTC 2018-01-17
x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

Author: H.J. Lu
Author Date: 2018-01-16 03:39:56 UTC

x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

_dl_runtime_profile calls _dl_call_pltexit, passing a pointer to
La_x86_64_retval which is allocated on stack. The lrv_vector0
field in La_x86_64_retval must be aligned to size of vector register.
When allocating stack space for La_x86_64_retval, we need to make sure
that the address of La_x86_64_retval + RV_VECTOR0_OFFSET is aligned to
VEC_SIZE. This patch checks the alignment of the lrv_vector0 field
and pads the stack space if needed.

Tested with x32 and x86-64 on SSE4, AVX and AVX512 machines. It fixed

FAIL: elf/tst-audit10
FAIL: elf/tst-audit4
FAIL: elf/tst-audit5
FAIL: elf/tst-audit6
FAIL: elf/tst-audit7

on x32 AVX512 machine.

(cherry picked from commit 207a72e2988c6d6343f50fe0128eb4fc4edfdd15)

 [BZ #22715]
 * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile): Properly
 align La_x86_64_retval to VEC_SIZE.

hjl/pr22715/2.26 2018-01-17 12:43:35 UTC 2018-01-17
x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

Author: H.J. Lu
Author Date: 2018-01-16 03:39:56 UTC

x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]

_dl_runtime_profile calls _dl_call_pltexit, passing a pointer to
La_x86_64_retval which is allocated on stack. The lrv_vector0
field in La_x86_64_retval must be aligned to size of vector register.
When allocating stack space for La_x86_64_retval, we need to make sure
that the address of La_x86_64_retval + RV_VECTOR0_OFFSET is aligned to
VEC_SIZE. This patch checks the alignment of the lrv_vector0 field
and pads the stack space if needed.

Tested with x32 and x86-64 on SSE4, AVX and AVX512 machines. It fixed

FAIL: elf/tst-audit10
FAIL: elf/tst-audit4
FAIL: elf/tst-audit5
FAIL: elf/tst-audit6
FAIL: elf/tst-audit7

on x32 AVX512 machine.

(cherry picked from commit 207a72e2988c6d6343f50fe0128eb4fc4edfdd15)

 [BZ #22715]
 * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile): Properly
 align La_x86_64_retval to VEC_SIZE.

azanella/aarch64-split-stack 2018-01-17 11:26:35 UTC 2018-01-17
aarch64: Add split-stack TCB field

Author: Adhemerval Zanella
Author Date: 2017-01-24 11:27:45 UTC

aarch64: Add split-stack TCB field

This patch adds split-stack support pointer guard on glibc for aarch64.
Different from other architectures (powerpc, s390) where the memory is
placed on TCB, aarch64 one is placed before thread pointer initial
position. It has an advantage over extending TCB because for aarch64
TLS variable placement take in consideration tcbhead_t size and by
changing its value would require to also update the static linker
(and it would also add incompatibility with glibc and older linkers).

For aarch64 tcb direct access is fastest for thread local variable on
all mode and related TLS access. It requires just a direct load with
displacement of -8 (since thread pointer points to tcbhead_t).

It also adds a loader symbol (__tcb_private_ss) to signal the existence
of the split stack guard area.

Checked on aarch64-linux-gnu.

 * sysdeps/aarch64/Makefile [$(subdir) = elf] (sysdeps-dl-routines):
 Add tcb-version.
 * sysdeps/aarch64/Versions [ld] (GLIBC_2.26): Add
 __libc_tcb_private_ss.
 * sysdeps/aarch64/nptl/tls.h (tcbprehead_t): New struct.
 (TLS_PRE_TCB_SIZE): Take tcbprehead_t in consideration.
 (TLS_DEFINE_INIT_TP): Likewise.
 (THREAD_SELF): Likewise.
 (DB_THREAD_SELF): Likewise.
 * sysdeps/aarch64/tcb-version.c: New file.
 * sysdeps/unix/sysv/linux/aarch64/ld.abilist (GLIBC_2.26): Add.
 (__libc_tcb_private_ss): Likewise.
 * sysdeps/aarch64/nptl/tcb-offsets.sym (PTHREAD_SIZEOF): Rename to
 PTHREAD_PRE_TCB_SIZE.

azanella/generic-strings 2018-01-15 10:54:40 UTC 2018-01-15
sh: Add string-fzb.h

Author: Adhemerval Zanella
Author Date: 2017-02-21 20:14:16 UTC

sh: Add string-fzb.h

Use the SH cmp/str on has_{zero,eq,zero_eq}.

Checked on sh4-linux-gnu.

 Adhemerval Zanella <adhemerval.zanella@linaro.org>

 * sysdeps/sh/string-fzb.h: New file.

hjl/x86/sincosf 2018-01-08 13:34:27 UTC 2018-01-08
x86-64: Add sincosf with vector FMA

Author: H.J. Lu
Author Date: 2017-12-20 19:06:35 UTC

x86-64: Add sincosf with vector FMA

Since the x86-64 assembly version of sincosf is higly optimized with
vector instructions, there isn't much room for improvement. However
s_sincosf.c written in C with vector math and intrinsics can be
optimized by GCC with FMA.

On Skylake, bench-sincosf reports performance improvement:

           Assembly FMA improvement
max 104.042 101.008 3%
min 9.426 8.586 10%
mean 20.6209 18.2238 13%

 * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
 Add s_sincosf-sse2 and s_sincosf-fma.
 (CFLAGS-s_sincosf-fma.c): New.
 * sysdeps/x86_64/fpu/multiarch/s_sincosf-fma.c: New file.
 * sysdeps/x86_64/fpu/multiarch/s_sincosf-sse2.S: Likewise.
 * sysdeps/x86_64/fpu/multiarch/s_sincosf.c: Likewise.
 * sysdeps/x86_64/fpu/s_sincosf.S: Don't add alias if
 __sincosf is defined.

ibm/2.24/master 2017-12-19 17:18:07 UTC 2017-12-19
Merge branch release/2.24/master into ibm/2.24/master

Author: Gabriel F. T. Gomes
Author Date: 2017-12-19 17:18:07 UTC

Merge branch release/2.24/master into ibm/2.24/master

hjl/x86/math 2017-12-16 14:16:01 UTC 2017-12-16
x86-64: Add sincosf with FMA

Author: H.J. Lu
Author Date: 2017-12-16 14:16:01 UTC

 x86-64: Add sincosf with FMA

hjl/cet/setjmp 2017-12-08 02:09:37 UTC 2017-12-08
x86: Add feature_1 to tcbhead_t [BZ #22563]

Author: H.J. Lu
Author Date: 2017-12-07 13:47:21 UTC

x86: Add feature_1 to tcbhead_t [BZ #22563]

On x86, padding in struct __jmp_buf_tag is used for shadow stack pointer
to support Shadow Stack in Intel Control-flow Enforcemen Technology.
cancel_jmp_buf has been updated to include saved_mask so that it is as
large as struct __jmp_buf_tag. We must suport the old cancel_jmp_buf
in existing binaries. Since symbol versioning doesn't work on
cancel_jmp_buf, feature_1 is added to tcbhead_t so that setjmp and
longjmp can check if shadow stack is enabled. NB: Shadow stack is
enabled only if all modules are shadow stack enabled.

 [BZ #22563]
 * sysdeps/i386/nptl/tcb-offsets.sym (FEATURE_1_OFFSET): New.
 * sysdeps/i386/nptl/tls.h (tcbhead_t): Add feature_1.
 * sysdeps/x86_64/nptl/tcb-offsets.sym (FEATURE_1_OFFSET): New.
 * sysdeps/x86_64/nptl/tls.h (tcbhead_t): Rename __glibc_unused1
 to feature_1.

hjl/pr22353/master 2017-10-30 12:44:19 UTC 2017-10-30
Add strcpy-stosb.S

Author: H.J. Lu
Author Date: 2017-10-27 13:31:57 UTC

Add strcpy-stosb.S

hjl/pr22363/master 2017-10-29 21:15:47 UTC 2017-10-29
x32: Set GLRO(dl_platform) to "x86_64" by default [BZ #22363]

Author: H.J. Lu
Author Date: 2017-10-29 21:12:01 UTC

x32: Set GLRO(dl_platform) to "x86_64" by default [BZ #22363]

Set dl_platform to "x86_64" for x32 by default since kernel may set it
to "i686". This fixed:

FAIL: elf/tst-platform-1

on x32. Tested on x86-64 and x32.

 [BZ #22363]
 * sysdeps/x86/cpu-features.c (init_cpu_features): Set
 GLRO(dl_platform) to "x86_64" by default for x32.

hjl/pr22362/master 2017-10-29 02:05:09 UTC 2017-10-29
Use newly built crt*.o files to build shared objects [BZ #22362]

Author: H.J. Lu
Author Date: 2017-10-29 00:41:16 UTC

Use newly built crt*.o files to build shared objects [BZ #22362]

When multi-lib GCC is used to build glibc, the search order of GCC driver
for crt*.o is -B*/`gcc -print-multi-directory`, the installed diretory,
-B*/. This patch extends multi-lib support from nptl/Makefile to
csu/Makefile so that -B/glibc-build-directory/csu/ will pick up the newly
built crt*.o.

Tested on x86-64 for i686 and x32.

 [BZ #22362]
 * config.make.in (multidir): New.
 * configure.ac (libc_cv_multidir): New. AC_SUBST.
 * configure: Regenerated.
 * csu/Makefile [$(multidir) != .](multilib-extra-objs): New.
 [$(multidir) != .](extra-objs): Add $(multilib-extra-objs).
 [$(multidir) != .]($(addprefix $(objpfx)$(multidir)/, $(install-lib))):
 New target.
 * nptl/Makefile: Don't include multidir.mk.
 ($(objpfx)multidir.mk): Removed.

hjl/pr22298/master 2017-10-15 14:48:58 UTC 2017-10-15
Define __PTHREAD_MUTEX_HAVE_PREV only if undefined [BZ #22298]

Author: H.J. Lu
Author Date: 2017-10-15 14:48:58 UTC

Define __PTHREAD_MUTEX_HAVE_PREV only if undefined [BZ #22298]

It is incorrect to define __PTHREAD_MUTEX_HAVE_PREV to 1 only when
__WORDSIZE == 64. For x32, __PTHREAD_MUTEX_HAVE_PREV should be 1, but
it has __WORDSIZE == 32. This patch defines __PTHREAD_MUTEX_HAVE_PREV
based on __WORDSIZE only if it is undefined. __PTHREAD_MUTEX_HAVE_PREV
check is changed from "#ifdef" to "#if" to support values of 0 or 1.

 [BZ #22298]
 * nptl/allocatestack.c (allocate_stack): Check if
 __PTHREAD_MUTEX_HAVE_PREV is non-zero, instead if
 __PTHREAD_MUTEX_HAVE_PREV is defined.
 * nptl/descr.h (pthread): Likewise.
 * nptl/nptl-init.c (__pthread_initialize_minimal_internal):
 Likewise.
 * nptl/pthread_create.c (START_THREAD_DEFN): Likewise.
 * sysdeps/nptl/fork.c (__libc_fork): Likewise.
 * sysdeps/nptl/pthread.h (PTHREAD_MUTEX_INITIALIZER): Likewise.
 * sysdeps/nptl/bits/thread-shared-types.h
 (__PTHREAD_MUTEX_HAVE_PREV): Define only if it is undefined.
 (__pthread_internal_list): Check __pthread_internal_list instead
 of __WORDSIZE.
 (__PTHREAD_SPINS_DATA): Likewise.
 (__PTHREAD_SPINS): Likewise.
 (__pthread_mutex_s): Likewise.
 * sysdeps/x86/nptl/bits/pthreadtypes-arch.h
 (__PTHREAD_MUTEX_HAVE_PREV): Defined.

hjl/pr22284/2.26 2017-10-12 22:56:40 UTC 2017-10-12
Support profiling PIE [BZ #22284]

Author: H.J. Lu
Author Date: 2017-10-12 10:45:55 UTC

Support profiling PIE [BZ #22284]

Since PIE can be loaded at any address, we need to subtract load address
from PCs.

 [BZ #22284]
 * gmon/gmon.c [PIC]: Include <link.h>.
 [PIC] (callback): New function.
 (write_hist): Add an argument for load address. Subtract load
 address from PCs.
 (write_call_graph): Likewise.
 (write_gmon): Call __dl_iterate_phdr to get load address, pass
 it to write_hist and write_call_graph.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

(cherry picked from commit d165ca64980f90ccace088670652cc203d1b5411)

hjl/nsz/math 2017-09-30 02:39:47 UTC 2017-09-30
i386: Replace assembly versions of e_powf with generic e_powf.c

Author: H.J. Lu
Author Date: 2017-09-30 02:39:47 UTC

i386: Replace assembly versions of e_powf with generic e_powf.c

This patch replaces i386 assembly versions of e_powf with generic
e_powf.c.

 * sysdeps/i386/fpu/e_powf.S: Removed.
 * sysdeps/i386/fpu/e_powf_log2_data.c: Likewise.
 * sysdeps/i386/fpu/w_powf.c: Likewise.
 * sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_powf.c.
 * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
 * sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
 Add e_powf-sse2.
 (CFLAGS-e_powf-sse2.c): New.
 * sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c: New file.
 * sysdeps/i386/i686/fpu/multiarch/e_powf.c: Likewise.

nsz/math 2017-09-29 10:51:12 UTC 2017-09-29
Do not wrap logf, log2f and powf

Author: Szabolcs Nagy
Author Date: 2017-09-13 17:14:26 UTC

Do not wrap logf, log2f and powf

The new generic logf, log2f and powf code don't need wrappers any more,
they set errno inline so only use the wrappers on targets that need it.

2017-09-19 Szabolcs Nagy <szabolcs.nagy@arm.com>

 * sysdeps/ieee754/flt-32/e_log2f.c (__log2f): Define without wrapper.
 * sysdeps/ieee754/flt-32/e_logf.c (__logf): Likewise
 * sysdeps/ieee754/flt-32/e_powf.c (__powf): Likewise
 * sysdeps/ieee754/flt-32/w_log2f.c: New file.
 * sysdeps/ieee754/flt-32/w_logf.c: New file.
 * sysdeps/ieee754/flt-32/w_powf.c: New file.
 * sysdeps/i386/fpu/w_log2f.c: New file.
 * sysdeps/i386/fpu/w_logf.c: New file.
 * sysdeps/i386/fpu/w_powf.c: New file.
 * sysdeps/m68k/m680x0/fpu/w_log2f.c: New file.
 * sysdeps/m68k/m680x0/fpu/w_logf.c: New file.
 * sysdeps/m68k/m680x0/fpu/w_powf.c: New file.

hjl/pr22053/master 2017-08-31 13:49:37 UTC 2017-08-31
Remove zero terminator for .eh_frame in libc.so [BZ #22053]

Author: H.J. Lu
Author Date: 2017-08-31 13:49:37 UTC

Remove zero terminator for .eh_frame in libc.so [BZ #22053]

elf/sofini.c has a zero terminator for .eh_frame in libc.so. It was
added before -eh-frame-hdr is added to ld. Since -eh-frame-hdr is
always used to build libc.so, zero terminator in elf/sofini.c can be
removed.

 [BZ #22053]
 * elf/sofini.c (__FRAME_END__): Removed.

hjl/fma/master 2017-08-28 15:14:40 UTC 2017-08-28
Mention x86-64 FMA optimization in NEWS

Author: H.J. Lu
Author Date: 2017-08-16 15:56:24 UTC

Mention x86-64 FMA optimization in NEWS

 * NEWS: Mention x86-64 FMA optimization.

hjl/pr21967/master 2017-08-25 18:44:24 UTC 2017-08-25
x86: Add MathVec_Prefer_No_AVX512 to cpu-features [BZ #21967]

Author: H.J. Lu
Author Date: 2017-08-25 18:01:03 UTC

x86: Add MathVec_Prefer_No_AVX512 to cpu-features [BZ #21967]

AVX512 functions in mathvec are used on machines with AVX512. An AVX2
wrapper is also provided and it can be used when the AVX512 version
isn't profitable. MathVec_Prefer_No_AVX512 is addded to cpu-features.
If glibc.tune.hwcaps=MathVec_Prefer_No_AVX512 is set in GLIBC_TUNABLES
environment variable, the AVX2 wrapper will be used.

 [BZ #21967]
 * sysdeps/x86/cpu-features.h (bit_arch_MathVec_Prefer_No_AVX512):
 New.
 (index_arch_MathVec_Prefer_No_AVX512): Likewise.
 * sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)):
 Handle MathVec_Prefer_No_AVX512.

zack/anon-unions 2017-08-23 11:42:53 UTC 2017-08-23
RFC: Use anonymous union for siginfo_t

Author: Zack Weinberg
Author Date: 2017-08-11 13:43:59 UTC

RFC: Use anonymous union for siginfo_t

C2011 officially includes an 'anonymous union' feature, and GCC has
supported it for many years. It makes sub-fields of a union that's a
struct field appear to be fields of the parent struct. If we use this
in the definition of siginfo_t, we don't need to define lots of
innocuous-looking identifiers like 'si_pid' as macros expanding to
chains of field accessors. The catch, however, is that the compiler
used to compile *programs that use glibc* - not just glibc itself -
must accept the use of this feature (in system headers) even when
running in an older conformance mode.

This patch only touches siginfo_t, but if people like the idea, we
could also do it for several other types:

netinet/in.h (in6_addr)
sys/stat.h (stat)
utmp.h (utmp)
signal.h (sigaction, sigevent_t)
ucontext.h (ucontext_t)

and maybe also - these use names in the user namespace for the fields
that would be removed:

net/if.h (ifaddr)
ifaddrs.h (ifaddrs)
netinet/in6.h (ip6_hdr) (really should be bitfields instead)
netinet/icmp6.h (many)
net/if_ppp.h (ifpppstatsreq, ifpppcstatsreq)
net/if_shaper.h (shaperconf)
a.out.h (exec) (only some versions)
sys/quota.h (dqblk?) (the dq_* macros refer to a field that doesn't exist?!)

There are still more hits in sunrpc and nis, but since hopefully that
code is going to go away, I don't propose to mess with them. And
there may be even more that aren't caught by grepping for
'#define IDENT IDENT.IDENT'.

As a side note (and this could be split for commit if felt
appropriate), the siginfo_t field aliases 'si_int' and 'si_ptr' are
not in POSIX. There are a few uses of these within glibc itself, and
a handful more in third-party software (not glibc, not uclibc, and not
linux) so I have preserved them, but put them under __USE_MISC and
added a deprecation warning.

This passes the glibc testsuite on x86-64-linux, which probably
*doesn't* test the case where someone is compiling a program in
an older conformance mode that uses siginfo_t
(-std=c99 -D_XOPEN_SOURCE=600, perhaps).

What do you think?

zw

 * sysdeps/unix/sysv/linux/bits/types/siginfo_t.h (siginfo_t):
 Use C2011 anonymous union and anonymous struct-in-union features
 to define this type. Rename some public fields with their
 official names.
 (si_pid, si_uid, si_timerid, si_overrun, si_status, si_utime)
 (si_stime, si_value, si_addr, si_addr_lsb, si_lower, si_upper)
 (si_pkey, si_band, si_fd, si_call_addr, si_syscall, si_arch):
 Do not define as macros.
 (si_int, si_ptr): Define only when __USE_MISC, with deprecation
 warnings.
 * sysdeps/unix/sysv/linux/ia64/bits/siginfo-arch.h
 * sysdeps/unix/sysv/linux/sparc/bits/siginfo-arch.h
 * sysdeps/unix/sysv/linux/tile/bits/siginfo-arch.h
 (__SI_SIGFAULT_ADDL): Define all fields with their public names
 when __USE_GNU, or with impl-namespace names otherwise.
 (si_imm, si_segvflags, si_isr, si_trapno): Do not define as macros.

 * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread)
 Use si_value.sival_ptr instead of si_ptr.
 * sysdeps/unix/sysv/linux/tst-getpid1.c (do_test):
 Use si_value.sival_int instead of si_int.

hjl/gmp 2017-08-22 12:02:20 UTC 2017-08-22
rshift.c: Replace assert with DEBUG and abort

Author: H.J. Lu
Author Date: 2017-08-22 00:07:36 UTC

rshift.c: Replace assert with DEBUG and abort

assert in stdlib/rshift.c should be for debug purpose only and there is
no such check in any rshift assembly implementations nor in lshift.c.
This patch replaces assert with DEBUG and abort, similar to lshift.c
so that generic GMP codes from libc.a can be linked with libc.so in
atest-exp, atest-exp2 and atest-sincos, which depend on the GMP
implementation in glibc.

 * stdlib/rshift.c (mpn_rshift): Replace ssert with DEBUG and
 abort.

hjl/fma/2.26 2017-08-16 15:46:05 UTC 2017-08-16
x86-64: Optimize e_expf with FMA [BZ #21912]

Author: H.J. Lu
Author Date: 2017-08-16 15:43:35 UTC

x86-64: Optimize e_expf with FMA [BZ #21912]

FMA optimized e_expf improves performance by more than 50% on Skylake.

 [BZ #21912]
 * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
 Add e_expf-fma.
 * sysdeps/x86_64/fpu/multiarch/e_expf-fma.S: New file.
 * sysdeps/x86_64/fpu/multiarch/e_expf.c: Likewise.
 * sysdeps/x86_64/fpu/multiarch/ifunc-fma.h: Likewise.

(cherry picked from commit 24a2e6588d2e0c91b4003878b0625d4a9360e8f3)

fw/tst-gmon 2017-08-15 11:44:56 UTC 2017-08-15
gmon: Add test for basic mcount/gprof functionality

Author: Florian Weimer
Author Date: 2017-08-15 11:44:56 UTC

gmon: Add test for basic mcount/gprof functionality

hjl/pr21864/master 2017-08-13 16:58:33 UTC 2017-08-13
Don't compile non-lib modules as lib modules [BZ #21864]

Author: H.J. Lu
Author Date: 2017-07-30 04:04:09 UTC

Don't compile non-lib modules as lib modules [BZ #21864]

Some programs have more than one source files. These non-lib modules
should not be compiled with -DMODULE_NAME=libc. This patch puts these
non-lib modules in $(others-extras) and adds $(others-extras) to
all-nonlib.

 [BZ #21864]
 * Makerules (all-nonlib): Add $(others-extras).
 * catgets/Makefile (others-extras): New.
 * elf/Makefile (others-extras): Likewise.
 * nss/Makefile (others-extras): Likewise.

aaribaud/y2038-2.25-dev 2017-08-09 10:07:41 UTC 2017-08-09
Y2038: implement Y2038-ready adjtimex, ntp_adjtime

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-08-09 10:07:41 UTC

Y2038: implement Y2038-ready adjtimex, ntp_adjtime

hjl/pr21913/master 2017-08-07 20:05:12 UTC 2017-08-07
i386: Add <startup.h> [BZ #21913]

Author: H.J. Lu
Author Date: 2017-07-19 21:32:42 UTC

i386: Add <startup.h> [BZ #21913]

On Linux/i386, there are 3 ways to make a system call:

1. call *%gs:SYSINFO_OFFSET. This requires TLS initialization.
2. call *_dl_sysinfo. This requires relocation of _dl_sysinfo.
3. int $0x80. This is slower than #2 and #3, but works everywhere.

When an object file is compiled with PIC, #1 is prefered since it is
faster than #3 and doesn't require relocation of _dl_sysinfo. For
dynamic executables, ld.so initializes TLS. However, for static
executables, before TLS is initialized by __libc_setup_tls, #3 should
be used for syscalls.

This patch adds <startup.h> which defines _startup_fatal and defaults
it to __libc_fatal. It replaces __libc_fatal with _startup_fatal in
static executables where it is called before __libc_setup_tls is called.
This header file is included in all files containing functions which are
called before __libc_setup_tls is called. On Linux/i386, when PIE is
enabled by default, _startup_fatal is turned into ABORT_INSTRUCTION and
I386_USE_SYSENTER is defined to 0 so that "int $0x80" is used for system
calls before __libc_setup_tls is called.

 [BZ #21913]
 * config.h.in (BUILD_PIE_DEFAULT): New.
 * csu/libc-tls.c: Include <startup.h>.
 * elf/dl-tunables.c: Likewise.
 * sysdeps/unix/sysv/linux/i386/brk.c: Likewise.
 * csu/libc-tls.c: Include <startup.h>.
 (__libc_setup_tls): Call _startup_fatal instead of __libc_fatal.
 * sysdeps/generic/startup.h: New file.
 * sysdeps/unix/sysv/linux/i386/startup.h: Likewise.

hjl/xgetbv/2.25 2017-08-04 18:15:17 UTC 2017-08-04
x86-64: Use _dl_runtime_resolve_opt only with AVX512F [BZ #21871]

Author: H.J. Lu
Author Date: 2017-07-28 22:13:40 UTC

x86-64: Use _dl_runtime_resolve_opt only with AVX512F [BZ #21871]

On AVX machines with XGETBV (ECX == 1) like Skylake processors,

(gdb) disass _dl_runtime_resolve_avx_opt
Dump of assembler code for function _dl_runtime_resolve_avx_opt:
   0x0000000000015890 <+0>: push %rax
   0x0000000000015891 <+1>: push %rcx
   0x0000000000015892 <+2>: push %rdx
   0x0000000000015893 <+3>: mov $0x1,%ecx
   0x0000000000015898 <+8>: xgetbv
   0x000000000001589b <+11>: mov %eax,%r11d
   0x000000000001589e <+14>: pop %rdx
   0x000000000001589f <+15>: pop %rcx
   0x00000000000158a0 <+16>: pop %rax
   0x00000000000158a1 <+17>: and $0x4,%r11d
   0x00000000000158a5 <+21>: bnd je 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.

is slower than:

(gdb) disass _dl_runtime_resolve_avx_slow
Dump of assembler code for function _dl_runtime_resolve_avx_slow:
   0x0000000000015850 <+0>: vorpd %ymm0,%ymm1,%ymm8
   0x0000000000015854 <+4>: vorpd %ymm2,%ymm3,%ymm9
   0x0000000000015858 <+8>: vorpd %ymm4,%ymm5,%ymm10
   0x000000000001585c <+12>: vorpd %ymm6,%ymm7,%ymm11
   0x0000000000015860 <+16>: vorpd %ymm8,%ymm9,%ymm9
   0x0000000000015865 <+21>: vorpd %ymm10,%ymm11,%ymm10
   0x000000000001586a <+26>: vpcmpeqd %xmm8,%xmm8,%xmm8
   0x000000000001586f <+31>: vorpd %ymm9,%ymm10,%ymm10
   0x0000000000015874 <+36>: vptest %ymm10,%ymm8
   0x0000000000015879 <+41>: bnd jae 0x158b0 <_dl_runtime_resolve_avx>
   0x000000000001587c <+44>: vzeroupper
   0x000000000001587f <+47>: bnd jmpq 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.
(gdb)

since xgetbv takes much more cycles than single cycle operations like
vpord/vvpcmpeq/ptest. _dl_runtime_resolve_opt should be used only with
AVX512 where AVX512 instructions lead to lower CPU frequency on Skylake
server.

 [BZ #21871]
 * sysdeps/x86/cpu-features.c (init_cpu_features): Set
 bit_arch_Use_dl_runtime_resolve_opt only with AVX512F.

(cherry picked from commit d2cf37c0a2a375cf2fde69f1afbcc49e45368fc4)

hjl/ifunc/x86 2017-08-02 15:35:33 UTC 2017-08-02
x86: Remove assembly versions of HAS_CPU_FEATURE/HAS_ARCH_FEATURE

Author: H.J. Lu
Author Date: 2017-07-18 22:36:20 UTC

x86: Remove assembly versions of HAS_CPU_FEATURE/HAS_ARCH_FEATURE

Since all x86 IFUNC selectors are implemented in C, assembly versions of
HAS_CPU_FEATURE and HAS_ARCH_FEATURE can be removed.

 * sysdeps/x86/cpu-features.h [__ASSEMBLER__]
 (LOAD_RTLD_GLOBAL_RO_RDX, HAS_FEATURE, LOAD_FUNC_GOT_EAX,
 HAS_CPU_FEATURE, HAS_ARCH_FEATURE): Removed.

hjl/xgetbv/master 2017-08-02 15:12:41 UTC 2017-08-02
x86-64: Use _dl_runtime_resolve_opt only with AVX512F [BZ #21871]

Author: H.J. Lu
Author Date: 2017-07-28 22:13:40 UTC

x86-64: Use _dl_runtime_resolve_opt only with AVX512F [BZ #21871]

On AVX machines with XGETBV (ECX == 1) like Skylake processors,

(gdb) disass _dl_runtime_resolve_avx_opt
Dump of assembler code for function _dl_runtime_resolve_avx_opt:
   0x0000000000015890 <+0>: push %rax
   0x0000000000015891 <+1>: push %rcx
   0x0000000000015892 <+2>: push %rdx
   0x0000000000015893 <+3>: mov $0x1,%ecx
   0x0000000000015898 <+8>: xgetbv
   0x000000000001589b <+11>: mov %eax,%r11d
   0x000000000001589e <+14>: pop %rdx
   0x000000000001589f <+15>: pop %rcx
   0x00000000000158a0 <+16>: pop %rax
   0x00000000000158a1 <+17>: and $0x4,%r11d
   0x00000000000158a5 <+21>: bnd je 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.

is slower than:

(gdb) disass _dl_runtime_resolve_avx_slow
Dump of assembler code for function _dl_runtime_resolve_avx_slow:
   0x0000000000015850 <+0>: vorpd %ymm0,%ymm1,%ymm8
   0x0000000000015854 <+4>: vorpd %ymm2,%ymm3,%ymm9
   0x0000000000015858 <+8>: vorpd %ymm4,%ymm5,%ymm10
   0x000000000001585c <+12>: vorpd %ymm6,%ymm7,%ymm11
   0x0000000000015860 <+16>: vorpd %ymm8,%ymm9,%ymm9
   0x0000000000015865 <+21>: vorpd %ymm10,%ymm11,%ymm10
   0x000000000001586a <+26>: vpcmpeqd %xmm8,%xmm8,%xmm8
   0x000000000001586f <+31>: vorpd %ymm9,%ymm10,%ymm10
   0x0000000000015874 <+36>: vptest %ymm10,%ymm8
   0x0000000000015879 <+41>: bnd jae 0x158b0 <_dl_runtime_resolve_avx>
   0x000000000001587c <+44>: vzeroupper
   0x000000000001587f <+47>: bnd jmpq 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.
(gdb)

since xgetbv takes much more cycles than single cycle operations like
vpord/vvpcmpeq/ptest. _dl_runtime_resolve_opt should be used only with
AVX512 where AVX512 instructions lead to lower CPU frequency on Skylake
server.

 [BZ #21871]
 * sysdeps/x86/cpu-features.c (init_cpu_features): Set
 bit_arch_Use_dl_runtime_resolve_opt only with AVX512F.

hjl/pr21815/master 2017-08-02 14:50:15 UTC 2017-08-02
Compile tst-prelink.c without PIE [BZ #21815]

Author: H.J. Lu
Author Date: 2017-07-19 19:04:14 UTC

Compile tst-prelink.c without PIE [BZ #21815]

tst-prelink.c checks for conflict with GLOB_DAT relocation against
stdout. On i386, there is no GLOB_DAT relocation against stdout with
PIE. Compile tst-prelink.c without PIE to generate GLOB_DAT relocation.

 [BZ #21815]
 * elf/Makefile (CFLAGS-tst-prelink.c): New.
 (LDFLAGS-tst-prelink): Likewise.

aaribaud/y2038-2.25 2017-08-02 10:56:01 UTC 2017-08-02
Y2038: add Y2038-ready getrusage

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-08-02 10:56:01 UTC

Y2038: add Y2038-ready getrusage

hjl/ifunc/master 2017-07-30 00:06:08 UTC 2017-07-30
x86-64: Use IFUNC memcpy and mempcpy in libc.a

Author: H.J. Lu
Author Date: 2017-07-09 13:42:29 UTC

x86-64: Use IFUNC memcpy and mempcpy in libc.a

Since apply_irel is called before memcpy and mempcpy are called, we
can use IFUNC memcpy and mempcpy in libc.a.

 * sysdeps/x86_64/memmove.S (MEMCPY_SYMBOL): Don't check SHARED.
 (MEMPCPY_SYMBOL): Likewise.
 * sysdeps/x86_64/multiarch/ifunc-impl-list.c
 (__libc_ifunc_impl_list): Test memcpy and mempcpy in libc.a.
 * sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Also include
 in libc.a.
 * sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise.
 * sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S:
 Likewise.
 * sysdeps/x86_64/multiarch/memcpy.c: Also include in libc.a.
 (__hidden_ver1): Don't use in libc.a.
 * sysdeps/x86_64/multiarch/memmove-sse2-unaligned-erms.S
 (__mempcpy): Don't create a weak alias in libc.a.
 * sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: Support
 libc.a.
 * sysdeps/x86_64/multiarch/mempcpy.c: Also include in libc.a.
 (__hidden_ver1): Don't use in libc.a.

hjl/pr21752/master 2017-07-19 18:10:31 UTC 2017-07-19
Avoid accessing corrupted stack from __stack_chk_fail [BZ #21752]

Author: H.J. Lu
Author Date: 2017-07-19 17:56:19 UTC

Avoid accessing corrupted stack from __stack_chk_fail [BZ #21752]

__libc_argv[0] points to address on stack and __libc_secure_getenv
accesses environment variables which are on stack. We should avoid
accessing stack when stack is corrupted.

This patch also renames function argument in __fortify_fail_abort
from do_backtrace to need_backtrace to avoid confusion with do_backtrace
from enum __libc_message_action.

 [BZ #21752]
 * debug/fortify_fail.c (__fortify_fail_abort): Don't pass down
 __libc_argv[0] if we aren't doing backtrace. Rename do_backtrace
 to need_backtrace.
 * sysdeps/posix/libc_fatal.c (__libc_message): Don't call
 __libc_secure_getenv if we aren't doing backtrace.

hjl/pr21666/2.25 2017-07-19 10:39:49 UTC 2017-07-19
Avoid .symver on common symbols [BZ #21666]

Author: H.J. Lu
Author Date: 2017-06-23 21:38:46 UTC

Avoid .symver on common symbols [BZ #21666]

The .symver directive on common symbol just creates a new common symbol,
not an alias and the newer assembler with the bug fix for

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

will issue an error. Before the fix, we got

$ readelf -sW libc.so | grep "loc[12s]"
  5109: 00000000003a0608 8 OBJECT LOCAL DEFAULT 36 loc1
  5188: 00000000003a0610 8 OBJECT LOCAL DEFAULT 36 loc2
  5455: 00000000003a0618 8 OBJECT LOCAL DEFAULT 36 locs
  6575: 00000000003a05f0 8 OBJECT GLOBAL DEFAULT 36 locs@GLIBC_2.2.5
  7156: 00000000003a05f8 8 OBJECT GLOBAL DEFAULT 36 loc1@GLIBC_2.2.5
  7312: 00000000003a0600 8 OBJECT GLOBAL DEFAULT 36 loc2@GLIBC_2.2.5

in libc.so. The versioned loc1, loc2 and locs have the wrong addresses.
After the fix, we got

$ readelf -sW libc.so | grep "loc[12s]"
  6570: 000000000039e3b8 8 OBJECT GLOBAL DEFAULT 34 locs@GLIBC_2.2.5
  7151: 000000000039e3c8 8 OBJECT GLOBAL DEFAULT 34 loc1@GLIBC_2.2.5
  7307: 000000000039e3c0 8 OBJECT GLOBAL DEFAULT 34 loc2@GLIBC_2.2.5

 [BZ #21666]
 * misc/regexp.c (loc1): Add __attribute__ ((nocommon));
 (loc2): Likewise.
 (locs): Likewise.

(cherry picked from commit 388b4f1a02f3a801965028bbfcd48d905638b797)

linaro/2.23/master 2017-07-13 14:36:20 UTC 2017-07-13
Ignore and remove LD_HWCAP_MASK for AT_SECURE programs (bug #21209)

Author: Siddhesh Poyarekar
Author Date: 2017-03-07 15:22:04 UTC

Ignore and remove LD_HWCAP_MASK for AT_SECURE programs (bug #21209)

The LD_HWCAP_MASK environment variable may alter the selection of
function variants for some architectures. For AT_SECURE process it
means that if an outdated routine has a bug that would otherwise not
affect newer platforms by default, LD_HWCAP_MASK will allow that bug
to be exploited.

To be on the safe side, ignore and disable LD_HWCAP_MASK for setuid
binaries.

 [BZ #21209]
 * elf/rtld.c (process_envvars): Ignore LD_HWCAP_MASK for
 AT_SECURE processes.
 * sysdeps/generic/unsecvars.h: Add LD_HWCAP_MASK.

(cherry picked from commit 1c1243b6fc33c029488add276e56570a07803bfd)

hjl/pr21120/2.24 2017-06-30 16:53:31 UTC 2017-06-30
i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120]

Author: H.J. Lu
Author Date: 2017-06-30 16:11:08 UTC

i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120]

GCC 7 changed the definition of max_align_t on i386:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9b5c49ef97e63cc63f1ffa13baf771368105ebe2

As a result, glibc malloc no longer returns memory blocks which are as
aligned as max_align_t requires.

This causes malloc/tst-malloc-thread-fail to fail with an error like this
one:

error: allocation function 0, size 144 not aligned to 16

This patch moves the MALLOC_ALIGNMENT definition to <malloc-alignment.h>
and increases the malloc alignment to 16 for i386.

 [BZ #21120]
 * malloc/malloc.c (MALLOC_ALIGNMENT): Moved to ...
 * sysdeps/generic/malloc-alignment.h: Here. New file.
 * sysdeps/i386/malloc-alignment.h: Likewise.
 * sysdeps/generic/malloc-machine.h: Include <malloc-alignment.h>.

(cherry picked from commit 4e61a6be446026c327aa70cef221c9082bf0085d)

hjl/pr21120/2.25 2017-06-30 16:19:29 UTC 2017-06-30
i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120]

Author: H.J. Lu
Author Date: 2017-06-30 16:11:08 UTC

i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120]

GCC 7 changed the definition of max_align_t on i386:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9b5c49ef97e63cc63f1ffa13baf771368105ebe2

As a result, glibc malloc no longer returns memory blocks which are as
aligned as max_align_t requires.

This causes malloc/tst-malloc-thread-fail to fail with an error like this
one:

error: allocation function 0, size 144 not aligned to 16

This patch moves the MALLOC_ALIGNMENT definition to <malloc-alignment.h>
and increases the malloc alignment to 16 for i386.

 [BZ #21120]
 * malloc/malloc-internal.h (MALLOC_ALIGNMENT): Moved to ...
 * sysdeps/generic/malloc-alignment.h: Here. New file.
 * sysdeps/i386/malloc-alignment.h: Likewise.
 * sysdeps/generic/malloc-machine.h: Include <malloc-alignment.h>.

(cherry picked from commit 4e61a6be446026c327aa70cef221c9082bf0085d)

hjl/pr21120/master 2017-06-30 14:43:58 UTC 2017-06-30
i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120]

Author: H.J. Lu
Author Date: 2017-06-29 17:26:04 UTC

i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120]

GCC 7 changed the definition of max_align_t on i386:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9b5c49ef97e63cc63f1ffa13baf771368105ebe2

As a result, glibc malloc no longer returns memory blocks which are as
aligned as max_align_t requires.

This causes malloc/tst-malloc-thread-fail to fail with an error like this
one:

error: allocation function 0, size 144 not aligned to 16

This patch moves the MALLOC_ALIGNMENT definition to <malloc-alignment.h>
and increases the malloc alignment to 16 for i386.

 [BZ #21120]
 * malloc/malloc-internal.h (MALLOC_ALIGNMENT): Moved to ...
 * sysdeps/generic/malloc-alignment.h: Here. New file.
 * sysdeps/i386/malloc-alignment.h: Likewise.
 * sysdeps/generic/malloc-machine.h: Include <malloc-alignment.h>.

hjl/pr14995 2017-06-28 18:13:24 UTC 2017-06-28
Check linker support for INSERT in linker script

Author: H.J. Lu
Author Date: 2017-06-26 19:46:08 UTC

Check linker support for INSERT in linker script

Since gold doesn't support INSERT in linker script:

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

tst-split-dynreloc fails to link with gold. Check if linker supports
INSERT in linker script before using it.

 * config.make.in (have-insert): New.
 * configure.ac (libc_cv_insert): New. Set to yes if linker
 supports INSERT in linker script.
 (AC_SUBST(libc_cv_insert): New.
 * configure: Regenerated.
 * sysdeps/x86_64/Makefile (tests): Add tst-split-dynreloc only
 if $(have-insert) == yes.

hjl/pr21666/master 2017-06-23 18:29:38 UTC 2017-06-23
x86-64: Optimize L(between_2_3) in memcmp-avx2-movbe.S

Author: H.J. Lu
Author Date: 2017-06-23 18:29:38 UTC

x86-64: Optimize L(between_2_3) in memcmp-avx2-movbe.S

Turn

 movzbl -1(%rdi, %rdx), %edi
 movzbl -1(%rsi, %rdx), %esi
 orl %edi, %eax
 orl %esi, %ecx

into

 movb -1(%rdi, %rdx), %al
 movb -1(%rsi, %rdx), %cl

 * sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S (between_2_3):
 Replace movzbl and orl with movb.

zack/errno-prettyprint 2017-06-22 22:28:45 UTC 2017-06-22
Add pretty-printer for errno.

Author: Zack Weinberg
Author Date: 2017-06-22 22:28:45 UTC

Add pretty-printer for errno.

This patch adds the actual pretty-printer for errno. I could have
used Python's built-in errno module to get the symbolic names for the
constants, but it seemed better to do something entirely under our
control, so there's a .pysym file generated from errnos.texi, with a
hook that allows the Hurd to add additional constants. Then a .py
module is generated from that plus errno.h in the usual manner; many
thanks to the authors of the .pysym mechanism.

There is also a test which verifies that the .py file (not the .pysym
file) covers all of the constants defined in errno.h.

hurd-add-errno-constants.awk has been manually tested, but the
makefile logic that runs it has not been tested.

 * stdlib/errno-printer.py: New pretty-printer.
 * stdlib/test-errno-constants.py: New special test.
 * stdlib/test-errno-printer.c, stdlib/test-errno-printer.py:
 New pretty-printer test.
 * stdlib/make-errno-constants.awk: New script to generate the
 .pysym file needed by errno-printer.py.
 * stdlib/Makefile: Install, run, and test all of the above, as
 appropriate.

 * sysdeps/mach/hurd/hurd-add-errno-constants.awk: New script to
 add Mach/Hurd-specific errno constants to the .pysym file used by
 stdlib/errno-printer.py.
 * sysdeps/mach/hurd/Makefile: Hook hurd-add-errno-constants.awk
 into the generation of that .pysym file.

hjl/memcmp/avx2 2017-06-21 17:16:07 UTC 2017-06-21
Add do_test2

Author: H.J. Lu
Author Date: 2017-06-21 17:16:07 UTC

Add do_test2

zack/build-layout-experiment 2017-06-08 19:39:03 UTC 2017-06-08
Prepare for radical source tree reorganization.

Author: Zack Weinberg
Author Date: 2017-06-08 19:39:03 UTC

Prepare for radical source tree reorganization.

All top-level files and directories are moved into a temporary storage
directory, REORG.TODO, except for files that will certainly still
exist in their current form at top level when we're done (COPYING,
COPYING.LIB, LICENSES, NEWS, README), all old ChangeLog files (which
are moved to the new directory OldChangeLogs, instead), and the
generated file INSTALL (which is just deleted; in the new order, there
will be no generated files checked into version control).

hjl/avx2/master 2017-06-08 12:07:18 UTC 2017-06-08
x86-64: Optimize strrchr/wcsrchr with AVX2

Author: H.J. Lu
Author Date: 2017-05-26 19:21:55 UTC

x86-64: Optimize strrchr/wcsrchr with AVX2

Optimize strrchr/wcsrchr with AVX2 to check 32 bytes with vector
instructions. It is as fast as SSE2 version for small data sizes
and up to 1X faster for large data sizes on Haswell. Select AVX2
version on AVX2 machines where vzeroupper is preferred and AVX
unaligned load is fast.

 * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
 strrchr-sse2, strrchr-avx2, wcsrchr-sse2 and wcsrchr-avx2.
 * sysdeps/x86_64/multiarch/ifunc-impl-list.c
 (__libc_ifunc_impl_list): Add tests for __strrchr_avx2,
 __strrchr_sse2, __wcsrchr_avx2 and __wcsrchr_sse2.
 * sysdeps/x86_64/multiarch/strrchr-avx2.S: New file.
 * sysdeps/x86_64/multiarch/strrchr-sse2.S: Likewise.
 * sysdeps/x86_64/multiarch/strrchr.c: Likewise.
 * sysdeps/x86_64/multiarch/wcsrchr-avx2.S: Likewise.
 * sysdeps/x86_64/multiarch/wcsrchr-sse2.S: Likewise.
 * sysdeps/x86_64/multiarch/wcsrchr.c: Likewise.

hjl/avx2/fix 2017-06-06 12:31:48 UTC 2017-06-06
x86-64: Move wcsnlen.S to multiarch/wcsnlen-sse4_1.S

Author: H.J. Lu
Author Date: 2017-06-06 12:31:48 UTC

x86-64: Move wcsnlen.S to multiarch/wcsnlen-sse4_1.S

Since wcsnlen.S uses pminud which is the part of SSE4.1, move wcsnlen.S
to multiarch/wcsnlen-sse4_1.S.

 * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
 wcsnlen-sse4_1 and wcsnlen-c.
 * sysdeps/x86_64/multiarch/ifunc-impl-list.c
 (__libc_ifunc_impl_list): Test __wcsnlen_sse4_1 and
 __wcsnlen_sse2.
 * sysdeps/x86_64/multiarch/ifunc-sse4_1.h: New file.
 * sysdeps/x86_64/multiarch/wcsnlen-c.c: Likewise.
 * sysdeps/x86_64/multiarch/wcsnlen-sse4_1.S: Likewise.
 * sysdeps/x86_64/multiarch/wcsnlen.c: Likewise.
 * sysdeps/x86_64/wcsnlen.S: Removed.

hjl/avx2/c 2017-06-05 22:09:59 UTC 2017-06-05
x86-64: Optimize strrchr/wcsrchr with AVX2

Author: H.J. Lu
Author Date: 2017-05-26 19:21:55 UTC

x86-64: Optimize strrchr/wcsrchr with AVX2

Optimize strrchr/wcsrchr with AVX2 to check 32 bytes with vector
instructions. It is as fast as SSE2 version for small data sizes
and up to 1X faster for large data sizes on Haswell. Select AVX2
version on AVX2 machines where vzeroupper is preferred and AVX
unaligned load is fast.

 * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
 strrchr-sse2, strrchr-avx2, wcsrchr-sse2 and wcsrchr-avx2.
 * sysdeps/x86_64/multiarch/ifunc-impl-list.c
 (__libc_ifunc_impl_list): Add tests for __strrchr_avx2,
 __strrchr_sse2, __wcsrchr_avx2 and __wcsrchr_sse2.
 * sysdeps/x86_64/multiarch/strrchr-avx2.S: New file.
 * sysdeps/x86_64/multiarch/strrchr-sse2.S: Likewise.
 * sysdeps/x86_64/multiarch/strrchr.c: Likewise.
 * sysdeps/x86_64/multiarch/wcsrchr-avx2.S: Likewise.
 * sysdeps/x86_64/multiarch/wcsrchr-sse2.S: Likewise.
 * sysdeps/x86_64/multiarch/wcsrchr.c: Likewise.

zack/build-experiments 2017-06-01 12:47:44 UTC 2017-06-01
Experimenting with alternatives to VPATH.

Author: Zack Weinberg
Author Date: 2017-06-01 12:47:44 UTC

Experimenting with alternatives to VPATH.

hjl/master 2017-05-29 13:47:22 UTC 2017-05-29
x86: Update __x86_shared_non_temporal_threshold

Author: H.J. Lu
Author Date: 2017-05-12 20:38:04 UTC

x86: Update __x86_shared_non_temporal_threshold

__x86_shared_non_temporal_threshold was set to 6 times of per-core
shared cache size, based on the large memcpy micro benchmark in glibc
on a 8-core processor. For a processor with more than 8 cores, the
threshold is too low. Set __x86_shared_non_temporal_threshold to the
3/4 of the total shared cache size so that it is unchanged on 8-core
processors. On processors with less than 8 cores, the threshold is
lower.

 * sysdeps/x86/cacheinfo.c (__x86_shared_non_temporal_threshold):
 Set to the 3/4 of the total shared cache size.

tuliom/float128 2017-05-25 19:14:47 UTC 2017-05-25
powerpc64le: Enable float128

Author: Paul E. Murphy
Author Date: 2016-08-09 21:48:54 UTC

powerpc64le: Enable float128

Add ulps for the float128 type, bits/floatn.h, and float128-abi.h.

Likewise, sqrt is not implemented in libgcc. The sfp-machine.h
header is taken from libgcc, and used to build a P7/P8 soft-fp
sqrtf128.

 * sysdeps/powerpc/fpu/libm-test-ulps: Regenerated.
 * sysdeps/powerpc/fpu/math_private.h:
 (__ieee754_sqrtf128): New inline override.
 * sysdeps/powerpc/powerpc64le/Implies-before: New file.
 * sysdeps/powerpc/powerpc64le/Makefile: New file.
 * sysdeps/powerpc/powerpc64le/bits/floatn.h: New file.
 * sysdeps/powerpc/powerpc64le/fpu/e_sqrtf128.c: New file.
 * sysdeps/powerpc/powerpc64le/fpu/sfp-machine.h: New file.
 * sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c: New file.

 * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist:
 Regenerated.
 * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
 Likewise.

 * sysdeps/unix/sysv/linux/powerpc/powerpc64le/float128-abi.h
 New file.

hjl/cacheinfo/master 2017-05-24 13:35:25 UTC 2017-05-24
x86: Add cache info to cpu_features

Author: H.J. Lu
Author Date: 2017-05-24 03:22:13 UTC

x86: Add cache info to cpu_features

This patch adds cache info to cpu_features to support tunables for both
cache info as well as CPU features in a single x86 namespace. Since
init_cacheinfo is in libc.so and cpu_features is in ld.so, cache info
and CPU features must be in a place for tunables.

 * sysdeps/x86/cacheinfo.c (init_cacheinfo): Use data_size,
 shared_size and non_temporal_threshold from cpu_features if
 they aren't zero.
 * sysdeps/x86/cpu-features.h (cache_info): New.
 (cpu_features): Add cache.

aaribaud/y2038-2.23 2017-05-24 08:29:39 UTC 2017-05-24
Add __fstatat64_t64, __fxstatat_t64

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-05-24 08:27:17 UTC

Add __fstatat64_t64, __fxstatat_t64

hjl/x86/optimize 2017-05-22 20:15:35 UTC 2017-05-22
Add x86_cache.non_temporal_threshold to GLIBC_TUNABLES

Author: H.J. Lu
Author Date: 2017-05-22 19:00:43 UTC

Add x86_cache.non_temporal_threshold to GLIBC_TUNABLES

Add support for "glibc.x86_cache.non_temporal_threshold=number" to
GLIBC_TUNABLES.

 * elf/dl-tunables.list (x86_cache): New name space.
 * sysdeps/x86/cacheinfo.c [HAVE_TUNABLES] (TUNABLE_NAMESPACE):
 New.
 [HAVE_TUNABLES]: Include <elf/dl-tunables.h>.
 [HAVE_TUNABLES] (DL_TUNABLE_CALLBACK (set_non_temporal_threshold)):
 New.
 [HAVE_TUNABLES] (init_cacheinfo): Call TUNABLE_SET_VAL_WITH_CALLBACK
 with set_non_temporal_threshold.

dj/malloc-tcache 2017-05-11 21:27:35 UTC 2017-05-11
Tweak Makefile, asserts, comments.

Author: DJ Delorie
Author Date: 2017-05-11 21:25:10 UTC

Tweak Makefile, asserts, comments.

* Un-Wundef-ify -DUSE_TCACHE
* More asserts in tcache get/put functions
* Clarify redundancy in tcache structure

linaro/2.21/master 2017-04-21 13:07:56 UTC 2017-04-21
Make io/ftwtest-sh remove temporary files on early exit.

Author: Joseph Myers
Author Date: 2015-10-21 21:18:21 UTC

Make io/ftwtest-sh remove temporary files on early exit.

The test io/ftwtest-sh creates a directory that at some points during
the test does not have execute permission. To avoid leaving behind
such a directory that prevents the build directory from being removed
with a simple "rm -rf", it traps various signals to make the directory
executable and remove it before exit. However, this doesn't cover the
case where one of the tests simply fails (which happens with cross
testing if testing on a remote system where the path to the build
directory involves a symlink, or if that remote system fell over
during testing - I think the latter is the case where the directory is
left behind with bad permissions).

This patch makes that test also trap signal 0 (exit) so that the
directory gets properly removed in such failure cases as well.

Tested in both configurations where the test passes and where it fails
to verify that the result of the test is unchanged but the directory
is no longer left behind where it was previously left behind.

 * io/ftwtest-sh: Also trap on exit to remove temporary files.

hjl/pr21258/2.23 2017-04-20 14:55:44 UTC 2017-04-20
x86-64: Improve branch predication in _dl_runtime_resolve_avx512_opt [BZ #21258]

Author: H.J. Lu
Author Date: 2017-03-21 17:59:31 UTC

x86-64: Improve branch predication in _dl_runtime_resolve_avx512_opt [BZ #21258]

On Skylake server, _dl_runtime_resolve_avx512_opt is used to preserve
the first 8 vector registers. The code layout is

  if only %xmm0 - %xmm7 registers are used
     preserve %xmm0 - %xmm7 registers
  if only %ymm0 - %ymm7 registers are used
     preserve %ymm0 - %ymm7 registers
  preserve %zmm0 - %zmm7 registers

Branch predication always executes the fallthrough code path to preserve
%zmm0 - %zmm7 registers speculatively, even though only %xmm0 - %xmm7
registers are used. This leads to lower CPU frequency on Skylake
server. This patch changes the fallthrough code path to preserve
%xmm0 - %xmm7 registers instead:

  if whole %zmm0 - %zmm7 registers are used
    preserve %zmm0 - %zmm7 registers
  if only %ymm0 - %ymm7 registers are used
     preserve %ymm0 - %ymm7 registers
  preserve %xmm0 - %xmm7 registers

Tested on Skylake server.

 [BZ #21258]
 * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve_opt):
 Define only if _dl_runtime_resolve is defined to
 _dl_runtime_resolve_sse_vex.
 * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_opt):
 Fallthrough to _dl_runtime_resolve_sse_vex.

(cherry picked from commit c15f8eb50cea7ad1a4ccece6e0982bf426d52c00)

fw/accept4 2017-04-14 08:30:01 UTC 2017-04-14
Assume that accept4 is always available and works

Author: Florian Weimer
Author Date: 2017-04-14 08:30:01 UTC

Assume that accept4 is always available and works

Simplify the Linux accept4 implementation based on the assumption
that it is available in some way. __ASSUME_ACCEPT4_SOCKETCALL was
previously unused, so remove it. Its functionality is implied
by the complex #if condition in accept4.c.

hjl/hwcap/master 2017-04-07 15:09:47 UTC 2017-04-07
x86: Set dl_hwcap from CPU features

Author: H.J. Lu
Author Date: 2017-04-05 22:24:30 UTC

x86: Set dl_hwcap from CPU features

On x86, the usage of AT_HWCAP in glibc is obsolete since addition of
dl_x86_cpu_features. dl_hwcap, which was set from AT_HWCAP, is used by
dynamic linker to build an array of hardware capability names, which are
added to search path when loading shared object. dl_hwcap was unused on
x86-64 and only SSE2 was used on i386.

This patch sets dl_hwcap with new hardware capabilities from CPU
features. Currently, 2 capabilities, SSE2 and AVX2, are supported.
The maximum number of hardware capabilities is 64. Since x86-64
includes SSE2, SSE2 is skipped on x86-64. dl_x86_cap_flags is kepted
for i386 and is used by _dl_show_auxv. dl_x86_hwcap_flags is added
for new hardware capabilities.

 * sysdeps/i386/dl-hwcap.h: New file.
 * sysdeps/x86/dl-hwcap.h: Likewise.
 * sysdeps/x86_64/dl-hwcap.h: Likewise.
 * sysdeps/x86_64/dl-procinfo.h: Likewise.
 * sysdeps/i386/dl-procinfo.c (_dl_x86_hwcap_flags): New.
 * sysdeps/i386/dl-procinfo.h: Include <dl-hwcap.h>.
 (_DL_HWCAP_COUNT): Removed.
 (HWCAP_I386_XXX): Likewise.
 (HWCAP_IMPORTANT): Likewise.
 (_dl_procinfo): Likewise.
 (_dl_hwcap_string): Likewise.
 (_dl_string_hwcap): Likewise.
 * sysdeps/unix/sysv/linux/i386/dl-procinfo.h (_dl_procinfo):
 Replace _DL_HWCAP_COUNT with 32.
 * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h [!IS_IN (ldconfig)]:
 Include <sysdeps/x86_64/dl-procinfo.h>.
 * sysdeps/x86/cpu-features.c: Include <dl-hwcap.h>.
 (init_cpu_features): Set dl_hwcap and dl_hwcap_mask.
 * sysdeps/x86_64/dl-procinfo.c (_dl_x86_hwcap_flags): New.

gentoo/2.25 2017-03-20 14:57:14 UTC 2017-03-20
posix_spawn: fix stack setup on ia64 [BZ #21275]

Author: Mike Frysinger
Author Date: 2017-03-20 08:47:56 UTC

posix_spawn: fix stack setup on ia64 [BZ #21275]

The ia64-specific clone2 call expects the base of the stack mapping and
the stack size as sep arguments, not an initial stack value as on other
stack-grows-down architectures. Reuse the stack-grows-up macro so we
pass in the right stack base.

Reported-by: Matt Turner <mattst88@gentoo.org>
(cherry picked from commit ddc3fb333469c2997798742dc0509dc1e3201d91)
(cherry picked from commit 27ab0d9518746dfb59ed2ba59daefc981dc10e38)

gentoo/2.24 2017-03-20 14:56:52 UTC 2017-03-20
posix_spawn: fix stack setup on ia64 [BZ #21275]

Author: Mike Frysinger
Author Date: 2017-03-20 08:47:56 UTC

posix_spawn: fix stack setup on ia64 [BZ #21275]

The ia64-specific clone2 call expects the base of the stack mapping and
the stack size as sep arguments, not an initial stack value as on other
stack-grows-down architectures. Reuse the stack-grows-up macro so we
pass in the right stack base.

Reported-by: Matt Turner <mattst88@gentoo.org>
(cherry picked from commit ddc3fb333469c2997798742dc0509dc1e3201d91)
(cherry picked from commit 7043946c7921c0e3850dd2b3d948336624bb0f62)

fw/out_buffer 2017-03-10 19:45:25 UTC 2017-03-10
WIP struct out_buffer

Author: Florian Weimer
Author Date: 2017-03-10 19:45:25 UTC

WIP struct out_buffer

fw/bug16145 2017-03-09 15:34:11 UTC 2017-03-09
WIP reorganization to improve scalability of localtime

Author: Florian Weimer
Author Date: 2017-03-09 15:33:57 UTC

WIP reorganization to improve scalability of localtime

aaribaud/y2038-pre-5th-draft 2017-02-22 07:06:33 UTC 2017-02-22
Add 64-bit version of ctime_r

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-02-22 07:06:33 UTC

Add 64-bit version of ctime_r

aaribaud/y2038 2017-02-22 07:06:33 UTC 2017-02-22
Add 64-bit version of ctime_r

Author: Albert ARIBAUD (3ADEV)
Author Date: 2017-02-22 07:06:33 UTC

Add 64-bit version of ctime_r

release/2.19/master 2017-02-20 21:04:52 UTC 2017-02-20
Fix powerpc software sqrt (bug 17964).

Author: Joseph Myers
Author Date: 2015-02-12 23:05:37 UTC

Fix powerpc software sqrt (bug 17964).

As Adhemerval noted in
<https://sourceware.org/ml/libc-alpha/2015-01/msg00451.html>, the
powerpc sqrt implementation for when _ARCH_PPCSQ is not defined is
inaccurate in some cases.

The problem is that this code relies on fused multiply-add, and relies
on the compiler contracting a * b + c to get a fused operation. But
sysdeps/ieee754/dbl-64/Makefile disables contraction for e_sqrt.c,
because the implementation in that directory relies on *not* having
contracted operations.

While it would be possible to arrange makefiles so that an earlier
sysdeps directory can disable the setting in
sysdeps/ieee754/dbl-64/Makefile, it seems a lot cleaner to make the
dependence on fused operations explicit in the .c file. GCC 4.6
introduced support for __builtin_fma on powerpc and other
architectures with such instructions, so we can rely on that; this
patch duly makes the code use __builtin_fma for all such fused
operations.

Tested for powerpc32 (hard float).

2015-02-12 Joseph Myers <joseph@codesourcery.com>

 [BZ #17964]
 * sysdeps/powerpc/fpu/e_sqrt.c (__slow_ieee754_sqrt): Use
 __builtin_fma instead of relying on contraction of a * b + c.

(cherry picked from commit e8bd5286c68bc35be3b41e94c15c4387dcb3bec9)

fw/math-split-tests 2017-02-17 07:22:29 UTC 2017-02-17
RFC: Run libm tests separately for each function

Author: Joseph Myers
Author Date: 2017-02-16 23:08:20 UTC

RFC: Run libm tests separately for each function

At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
about 40 MB of libm-test-*.c sources, which would grow to maybe 70 or
80 MB when the complex inverse trig and hyperbolic functions move to
the auto-libm-test-* mechanism (that move is practical now that tests
for all functions don't need regenerating for any change to
auto-libm-test-in but you can instead regenerate each
auto-libm-test-out-* file independently; auto-libm-test-out-casin and
auto-libm-test-out-casinh take about 38 minutes each to generate on my
system after such a move, auto-libm-test-out-cacos and
auto-libm-test-out-cacosh take about 80 minutes each).

This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 40
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).

All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.

This should remove the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.

Any comments? Especially regarding the use of iterators; there is
existing precedent (in elf/Makefile) for using o-iterator.mk as a
generic iterator with object-suffixes-left set to something other than
a list of object suffixes, but maybe there should be a differently
named iterator for such generic uses?

2017-02-16 Joseph Myers <joseph@codesourcery.com>

 * math/Makefile (libm-tests-generated): Remove variable.
 (libm-tests-base-normal): New variable.
 (libm-tests-base-finite): Likewise.
 (libm-tests-base-inline): Likewise.
 (libm-tests-base): Likewise.
 (libm-tests-normal): Likewise.
 (libm-tests-finite): Likewise.
 (libm-tests-inline): Likewise.
 (libm-tests-vector): Likewise.
 (libm-tests): Define in terms of these new variables.
 (libm-tests-for-type): New variable.
 (libm-tests.o): Move definition.
 (tests): Move addition of $(libm-tests).
 (generated): Update for new and removed libm test files.
 ($(objpfx)libm-test.c): Remove target.
 ($(objpfx)libm-have-vector-test.h): Likewise.
 (CFLAGS-test-double-vlen2.c): Remove variable.
 (CFLAGS-test-double-vlen4.c): Likewise.
 (CFLAGS-test-double-vlen8.c): Likewise.
 (CFLAGS-test-float-vlen4.c): Likewise.
 (CFLAGS-test-float-vlen8.c): Likewise.
 (CFLAGS-test-float-vlen16.c): Likewise.
 (CFLAGS-test-float.c): Likewise.
 (CFLAGS-test-float-finite.c): Likewise.
 (CFLAGS-libm-test-support-float.c): Likewise.
 (CFLAGS-test-double.c): Likewise.
 (CFLAGS-test-double-finite.c): Likewise.
 (CFLAGS-libm-test-support-double.c): Likewise.
 (CFLAGS-test-ldouble.c): Likewise.
 (CFLAGS-test-ldouble-finite.c): Likewise.
 (CFLAGS-libm-test-support-ldouble.c): Likewise.
 (libm-test-inline-cflags): New variable.
 (CFLAGS-test-ifloat.c): Remove variable.
 (CFLAGS-test-idouble.c): Likewise.
 (CFLAGS-test-ildouble.c): Likewise.
 ($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
 dependencies.
 ($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
 ($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
 ($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
 ($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
 ($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
 Likewise.
 (dependencies on libm-test-support-*.o): Remove.
 ($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
 rules using iterators.
 ($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
 Likewise.
 ($(objpfx)libm-test-support-$(o).o): Likewise.
 ($(addprefix $(objpfx),$(filter-out $(tests-static)
 $(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
 instead.
 ($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
 define rule instead.
 * math/README.libm-test: Update.
 * math/libm-test-acos.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-acosh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-asin.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-asinh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-atan.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-atan2.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-atanh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cabs.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cacos.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cacosh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-canonicalize.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-carg.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-casin.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-casinh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-catan.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-catanh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cbrt.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-ccos.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-ccosh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-ceil.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cexp.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cimag.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-clog.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-clog10.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-conj.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-copysign.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cos.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cosh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cpow.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-cproj.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-creal.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-csin.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-csinh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-csqrt.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-ctan.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-ctanh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-erf.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-erfc.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-exp.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-exp10.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-exp2.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-expm1.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fabs.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fdim.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-floor.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fma.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fmax.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fmin.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fminmag.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fmod.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fpclassify.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-frexp.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fromfp.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-fromfpx.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-getpayload.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-hypot.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-ilogb.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-iscanonical.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-iseqsig.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-isfinite.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-isgreater.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-isinf.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-isless.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-islessequal.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-islessgreater.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-isnan.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-isnormal.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-issignaling.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-issubnormal.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-isunordered.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-iszero.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-j0.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-j1.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-jn.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-lgamma.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-llogb.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-llrint.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-llround.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-log.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-log10.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-log1p.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-log2.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-logb.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-lrint.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-lround.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-modf.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-nearbyint.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-nextafter.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-nextdown.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-nexttoward.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-nextup.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-pow.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-remainder.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-remquo.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-rint.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-round.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-roundeven.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-scalb.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-scalbln.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-scalbn.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-setpayload.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-signbit.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-significand.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-sin.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-sincos.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-sinh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-sqrt.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-tan.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-tanh.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-tgamma.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-totalorder.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-totalordermag.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-trunc.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-ufromfp.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-y0.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-y1.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-yn.inc: Include libm-test-driver.c.
 (do_test): New function.
 * math/libm-test-driver.c: Do not include libm-have-vector-test.h.
 (HAVE_VECTOR): Remove macro.
 (START): Do not call HAVE_VECTOR.
 * math/test-double-vlen2.h (FUNC_TEST): Remove macro.
 * math/test-double-vlen4.h (FUNC_TEST): Remove macro.
 * math/test-double-vlen8.h (FUNC_TEST): Remove macro.
 * math/test-float-vlen16.h (FUNC_TEST): Remove macro.
 * math/test-float-vlen4.h (FUNC_TEST): Remove macro.
 * math/test-float-vlen8.h (FUNC_TEST): Remove macro.
 * math/test-math-vector.h (FUNC_TEST): New macro.
 (WRAPPER_DECL): Rename to WRAPPER_DECL_f.
 * sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
 (double-vlen4-funcs): Likewise.
 (double-vlen4-avx2-funcs): Likewise.
 (double-vlen8-funcs): Likewise.
 (float-vlen4-funcs): Likewise.
 (float-vlen8-funcs): Likewise.
 (float-vlen8-avx2-funcs): Likewise.
 (float-vlen16-funcs): Likewise.
 (CFLAGS-test-double-vlen4-avx2.c): Remove variable.
 (CFLAGS-test-float-vlen8-avx2.c): Likewise.
 * sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
 macro.
 (TEST_VECTOR_sin): Likewise.
 (TEST_VECTOR_sincos): Likewise.
 (TEST_VECTOR_log): Likewise.
 (TEST_VECTOR_exp): Likewise.
 (TEST_VECTOR_pow): Likewise.
 * sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
 Likewise.
 (TEST_VECTOR_sin): Likewise.
 (TEST_VECTOR_sincos): Likewise.
 (TEST_VECTOR_log): Likewise.
 (TEST_VECTOR_exp): Likewise.
 (TEST_VECTOR_pow): Likewise.
 * sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
 Likewise.
 (TEST_VECTOR_sinf): Likewise.
 (TEST_VECTOR_sincosf): Likewise.
 (TEST_VECTOR_logf): Likewise.
 (TEST_VECTOR_expf): Likewise.
 (TEST_VECTOR_powf): Likewise.
 * sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
 Likewise.
 (TEST_VECTOR_sinf): Likewise.
 (TEST_VECTOR_sincosf): Likewise.
 (TEST_VECTOR_logf): Likewise.
 (TEST_VECTOR_expf): Likewise.
 (TEST_VECTOR_powf): Likewise.
 * math/gen-libm-have-vector-test.sh: Remove file.
 * math/libm-test.inc: Likewise.
 * math/libm-test-support-double.c: Likewise.
 * math/libm-test-support-float.c: Likewise.
 * math/libm-test-support-ldouble.c: Likewise.
 * math/test-double-finite.c: Likewise.: Likewise.
 * math/test-double.c: Likewise.
 * math/test-float-finite.c: Likewise.
 * math/test-float.c: Likewise.
 * math/test-idouble.c: Likewise.
 * math/test-ifloat.c: Likewise.
 * math/test-ildouble.c: Likewise.
 * math/test-ldouble-finite.c: Likewise.
 * math/test-ldouble.c: Likewise.
 * sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
 * sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
 * sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
 * sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
 * sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
 * sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
 * sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
 * sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
 * sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
 * sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.

fw/bug21041 2017-01-24 17:32:30 UTC 2017-01-24
WIP delayed IFUNC relocation

Author: Florian Weimer
Author Date: 2017-01-24 17:32:30 UTC

WIP delayed IFUNC relocation

google/grte/v4-2.19/master 2017-01-19 22:01:46 UTC 2017-01-19
Fix nan functions handling of payload strings (BZ16962, CVE-2014-9761)

Author: Joseph Myers
Author Date: 2017-01-19 22:01:46 UTC

Fix nan functions handling of payload strings (BZ16962, CVE-2014-9761)

gentoo/2.23 2016-12-08 05:38:41 UTC 2016-12-08
alpha: fix trunc for big input values

Author: Aurelien Jarno
Author Date: 2016-08-02 07:18:59 UTC

alpha: fix trunc for big input values

The alpha specific version of trunc and truncf always add and subtract
0x1.0p23 or 0x1.0p52 even for big values. This causes this kind of
errors in the testsuite:

  Failure: Test: trunc_towardzero (0x1p107)
  Result:
   is: 1.6225927682921334e+32 0x1.fffffffffffffp+106
   should be: 1.6225927682921336e+32 0x1.0000000000000p+107
   difference: 1.8014398509481984e+16 0x1.0000000000000p+54
   ulp : 0.5000
   max.ulp : 0.0000

Change this by returning the input value when its absolute value is
greater than 0x1.0p23 or 0x1.0p52. NaN have to go through the add and
subtract operations to get possibly silenced.

Finally remove the code to handle inexact exception, trunc should never
generate such an exception.

Changelog:
 * sysdeps/alpha/fpu/s_trunc.c (__trunc): Return the input value
 when its absolute value is greater than 0x1.0p52.
 [_IEEE_FP_INEXACT] Remove.
 * sysdeps/alpha/fpu/s_truncf.c (__truncf): Return the input value
 when its absolute value is greater than 0x1.0p23.
 [_IEEE_FP_INEXACT] Remove.

(cherry picked from commit b74d259fe793499134eb743222cd8dd7c74a31ce)
(cherry picked from commit 3a5aa2ee4ffc515c8e7e615ea38d6b3b20ed0a30)

dj/malloc 2016-11-10 21:08:28 UTC 2016-11-10
Updates to trace2wl

Author: DJ Delorie
Author Date: 2016-11-10 21:08:28 UTC

Updates to trace2wl

* command line option -p to show progress
* command line option -f to use file-based buffers
* reduced memory footprint
* more 32/64-bit fixes

hjl/libmvec/master 2016-07-19 20:20:10 UTC 2016-07-19
Don't compile do_test with -mavx/-mavx/-mavx512

Author: H.J. Lu
Author Date: 2016-07-19 20:01:36 UTC

Don't compile do_test with -mavx/-mavx/-mavx512

Don't compile do_test with -mavx, -mavx nor -mavx512 since they won't run
on non-AVX machines.

 [BZ #20384]
 * sysdeps/x86_64/fpu/Makefile (extra-test-objs): Add
 test-double-libmvec-sincos-avx-main.o,
 test-double-libmvec-sincos-avx2-main.o,
 test-double-libmvec-sincos-main.o,
 test-float-libmvec-sincosf-avx-main.o,
 test-float-libmvec-sincosf-avx2-main.o and
 test-float-libmvec-sincosf-main.o.
 test-float-libmvec-sincosf-avx512-main.o.
 ($(objpfx)test-double-libmvec-sincos): Also link with
 $(objpfx)test-double-libmvec-sincos-main.o.
 ($(objpfx)test-double-libmvec-sincos-avx): Also link with
 $(objpfx)test-double-libmvec-sincos-avx-main.o.
 ($(objpfx)test-double-libmvec-sincos-avx2): Also link with
 $(objpfx)test-double-libmvec-sincos-avx2-main.o.
 ($(objpfx)test-float-libmvec-sincosf): Also link with
 $(objpfx)test-float-libmvec-sincosf-main.o.
 ($(objpfx)test-float-libmvec-sincosf-avx): Also link with
 $(objpfx)test-float-libmvec-sincosf-avx2-main.o.
 [$(config-cflags-avx512) == yes] (extra-test-objs): Add
 test-double-libmvec-sincos-avx512-main.o and
 ($(objpfx)test-double-libmvec-sincos-avx512): Also link with
 $(objpfx)test-double-libmvec-sincos-avx512-main.o.
 ($(objpfx)test-float-libmvec-sincosf-avx512): Also link with
 $(objpfx)test-float-libmvec-sincosf-avx512-main.o.
 (CFLAGS-test-double-libmvec-sincos.c): Removed.
 (CFLAGS-test-float-libmvec-sincosf.c): Likewise.
 (CFLAGS-test-double-libmvec-sincos-main.c): New.
 (CFLAGS-test-double-libmvec-sincos-avx-main.c): Likewise.
 (CFLAGS-test-double-libmvec-sincos-avx2-main.c): Likewise.
 (CFLAGS-test-float-libmvec-sincosf-main.c): Likewise.
 (CFLAGS-test-float-libmvec-sincosf-avx-main.c): Likewise.
 (CFLAGS-test-float-libmvec-sincosf-avx2-main.c): Likewise.
 (CFLAGS-test-float-libmvec-sincosf-avx512-main.c): Likewise.
 (CFLAGS-test-double-libmvec-sincos-avx.c): Set to -DREQUIRE_AVX.
 (CFLAGS-test-float-libmvec-sincosf-avx.c ): Likewise.
 (CFLAGS-test-double-libmvec-sincos-avx2.c): Set to
 -DREQUIRE_AVX2.
 (CFLAGS-test-float-libmvec-sincosf-avx2.c ): Likewise.
 (CFLAGS-test-double-libmvec-sincos-avx512.c): Set to
 -DREQUIRE_AVX512F.
 (CFLAGS-test-float-libmvec-sincosf-avx512.c): Likewise.
 * sysdeps/x86_64/fpu/test-double-libmvec-sincos.c: Rewritten.
 * sysdeps/x86_64/fpu/test-float-libmvec-sincosf.c: Likewise.
 * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx-main.c: New
 file.
 * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx2-main.c:
 Likewise.
 * sysdeps/x86_64/fpu/test-double-libmvec-sincos-avx512-main.c:
 Likewise.
 * sysdeps/x86_64/fpu/test-double-libmvec-sincos-main.c:
 Likewise.
 * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx-main.c:
 Likewise.
 * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx2-main.c:
 Likewise.
 * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-avx512-main.c:
 Likewise.
 * sysdeps/x86_64/fpu/test-float-libmvec-sincosf-main.c:
 Likewise.

ibm/2.19/master 2016-07-11 17:16:01 UTC 2016-07-11
Merge branch 'release/2.19/master' into ibm/2.19/master

Author: Tulio Magno Quites Machado Filho
Author Date: 2016-07-11 17:16:01 UTC

Merge branch 'release/2.19/master' into ibm/2.19/master

Conflicts:
 NEWS

hjl/pr20309/master 2016-06-29 14:38:22 UTC 2016-06-29
X86-64: Properly align stack in _dl_tlsdesc_dynamic

Author: H.J. Lu
Author Date: 2016-06-29 11:01:58 UTC

X86-64: Properly align stack in _dl_tlsdesc_dynamic

Since _dl_tlsdesc_dynamic is called via PLT, we need to add 8 bytes for
push in the PLT entry to align the stack.

 [BZ #20309]
 * configure.ac (have-mtls-dialect-gnu2): Set to yes if
 -mtls-dialect=gnu2 works.
 * configure: Regenerated.
 * elf/Makefile [have-mtls-dialect-gnu2 = yes]
 (tests): Add tst-gnu2-tls1.
 (modules-names): Add tst-gnu2-tls1mod.
 ($(objpfx)tst-gnu2-tls1): New.
 (tst-gnu2-tls1mod.so-no-z-defs): Likewise.
 (CFLAGS-tst-gnu2-tls1mod.c): Likewise.
 * elf/tst-gnu2-tls1.c: New file.
 * elf/tst-gnu2-tls1mod.c: Likewise.
 * sysdeps/x86_64/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Add 8
 bytes for push in the PLT entry to align the stack.

hjl/benchtests/wall-time 2016-06-21 18:31:45 UTC 2016-06-21
Force to use clock_gettime

Author: H.J. Lu
Author Date: 2016-06-21 18:31:45 UTC

Force to use clock_gettime

hjl/erms/2.23 2016-06-06 20:34:29 UTC 2016-06-06
Count number of logical processors sharing L2 cache

Author: H.J. Lu
Author Date: 2016-05-27 22:16:22 UTC

Count number of logical processors sharing L2 cache

For Intel processors, when there are both L2 and L3 caches, SMT level
type should be ued to count number of available logical processors
sharing L2 cache. If there is only L2 cache, core level type should
be used to count number of available logical processors sharing L2
cache. Number of available logical processors sharing L2 cache should
be used for non-inclusive L2 and L3 caches.

 * sysdeps/x86/cacheinfo.c (init_cacheinfo): Count number of
 available logical processors with SMT level type sharing L2
 cache for Intel processors.

1100 of 279 results

Other repositories

Name Last Modified
lp:glibc 2018-05-25
11 of 1 result
You can't create new repositories for GLibC.