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

Branches

Name Last Modified Last Commit
aaribaud/master 2018-10-23 18:56:02 UTC 9 hours ago
Y2038: provide size of default time_t for target architecture

Author: Albert ARIBAUD (3ADEV)
Author Date: 2018-10-11 17:47:29 UTC

    Y2038: provide size of default time_t for target architecture

    To determine whether the default time_t interfaces are 32-bit
    and so need conversions, or are 64-bit and so are compatible
    with the internal 64-bit type without conversions, a macro
    giving the size of the default time_t is also required.
    This macro is called __TIMESIZE.

    This macro can then be used instead of __WORDSIZE in msq-pad.h
    and shm-pad.h files, which in turn allows removing their x86
    variants, and in sem-pad.h files but keeping the x86 variant.

    This patch was tested by running 'make check' on branch master
    then applying this patch and running 'make check' again, and
    checking that both 'make check' yield identical results.
    This was done on x86_64-linux-gnu and i686-linux-gnu.

 * bits/timesize.h: New file.
 * stdlib/Makefile (headers): Add bits/timesize.h.
 * sysdeps/unix/sysv/linux/bits/msq-pad.h: Replace __WORDSIZE with __TIMESIZE.
 * sysdeps/unix/sysv/linux/bits/sem-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/bits/shm-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/hppa/bits/msq-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/hppa/bits/sem-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/hppa/bits/shm-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/mips/bits/msq-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/powerpc/bits/msq-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/powerpc/bits/sem-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/powerpc/bits/shm-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/sparc/bits/msq-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/sparc/bits/sem-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/sparc/bits/shm-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/x86/bits/msq-pad.h: Delete file.
 * sysdeps/unix/sysv/linux/x86/bits/shm-pad.h: Likewise.
 * sysdeps/unix/sysv/linux/x86/bits/timesize.h: New file.

master 2018-10-23 17:57:02 UTC 10 hours ago
Fix tst-preadvwritev2 build failure on HURD

Author: Adhemerval Zanella
Author Date: 2018-10-23 17:53:12 UTC

Fix tst-preadvwritev2 build failure on HURD

Commit 7a16bdbb9ff41 uses IOV_MAX, which is not defined on hurd.

Checked on a build for i686-gnu.

 * misc/tst-preadvwritev2-common.c (IOV_MAX): Define if not
 defined.

release/2.26/master 2018-10-22 12:20:23 UTC 2018-10-22
Disable -Wrestrict for two nptl/tst-attr3.c tests.

Author: Joseph Myers
Author Date: 2017-12-18 22:55:28 UTC

Disable -Wrestrict for two nptl/tst-attr3.c tests.

nptl/tst-attr3 fails to build with GCC mainline because of
(deliberate) aliasing between the second (attributes) and fourth
(argument to thread start routine) arguments to pthread_create.

Although both those arguments are restrict-qualified in POSIX,
pthread_create does not actually dereference its fourth argument; it's
an opaque pointer passed to the thread start routine. Thus, the
aliasing is actually valid in this case, and it's deliberate in the
test. So this patch makes the test disable -Wrestrict for the two
pthread_create calls in question. (-Wrestrict was added in GCC 7,
hence the __GNUC_PREREQ conditions, but the particular warning in
question is new in GCC 8.)

Tested compilation with build-many-glibcs.py for aarch64-linux-gnu.

 * nptl/tst-attr3.c: Include <libc-diag.h>.
 (do_test) [__GNUC_PREREQ (7, 0)]: Ignore -Wrestrict for two tests.

(cherry picked from commit 40c4162df6766fb1e8ede875ca8df25d8075d3a5)

release/2.27/master 2018-10-22 11:16:08 UTC 2018-10-22
signal: Use correct type for si_band in siginfo_t [BZ #23562]

Author: Ilya Yu. Malakhov
Author Date: 2018-10-22 11:16:08 UTC

signal: Use correct type for si_band in siginfo_t [BZ #23562]

(cherry picked from commit f997b4be18f7e57d757d39e42f7715db26528aa0)

release/2.28/master 2018-10-22 11:03:57 UTC 2018-10-22
signal: Use correct type for si_band in siginfo_t [BZ #23562]

Author: Ilya Yu. Malakhov
Author Date: 2018-10-22 11:03:57 UTC

signal: Use correct type for si_band in siginfo_t [BZ #23562]

(cherry picked from commit f997b4be18f7e57d757d39e42f7715db26528aa0)

aaribaud/y2038 2018-10-18 19:41:24 UTC 2018-10-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.

google/grte/v5-2.27/master 2018-10-12 19:59:53 UTC 2018-10-12
Undid the dl_enable_fastload environment variable changes.

Author: Raman Tenneti
Author Date: 2018-08-17 18:31:35 UTC

Undid the dl_enable_fastload environment variable changes.

aaribaud/make-check 2018-10-09 22:21:43 UTC 2018-10-09
Y2038: make __tz_convert compatible with 64-bit-time

Author: Albert ARIBAUD (3ADEV)
Author Date: 2018-06-18 19:14:43 UTC

Y2038: make __tz_convert compatible with 64-bit-time

Now that __time_64_t exists, we can switch internal function
__tz_convert from 32-bit to 64-bit time. This involves switching
some other internal functions and turning some implementations
which use these into wrappers between public 32-bit and internal
64-bit time.

* __tz_compute: Pass timer as a __time64_t rather than time_t.
* __offtime: Pass __timer as a __time64_t value rather than
  a const time_t pointer.
* __tz_convert: Likewise.
* localtime: provide a 64-bit time version and make the 32-bit
  time version a wrapper of it.
* localtime_r: Likewise.
* ctime: Likewise.
* ctime_r: Likewise.
* gmtime: Likewise.
* gmtime_r: Likewise.

azanella/generic-strings 2018-10-02 15:32:35 UTC 2018-10-02
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.

release/2.24/master 2018-09-10 12:31:19 UTC 2018-09-10
Fix segfault in maybe_script_execute.

Author: Stefan Liebler
Author Date: 2018-09-06 12:27:03 UTC

Fix segfault in maybe_script_execute.

If glibc is built with gcc 8 and -march=z900,
the testcase posix/tst-spawn4-compat crashes with a segfault.

In function maybe_script_execute, the new_argv array is dynamically
initialized on stack with (argc + 1) elements.
The function wants to add _PATH_BSHELL as the first argument
and writes out of bounds of new_argv.
There is an off-by-one because maybe_script_execute fails to count
the terminating NULL when sizing new_argv.

ChangeLog:

 * sysdeps/unix/sysv/linux/spawni.c (maybe_script_execute):
 Increment size of new_argv by one.

(cherry picked from commit 28669f86f6780a18daca264f32d66b1428c9c6f1)

release/2.25/master 2018-09-10 12:29:21 UTC 2018-09-10
Fix segfault in maybe_script_execute.

Author: Stefan Liebler
Author Date: 2018-09-06 12:27:03 UTC

Fix segfault in maybe_script_execute.

If glibc is built with gcc 8 and -march=z900,
the testcase posix/tst-spawn4-compat crashes with a segfault.

In function maybe_script_execute, the new_argv array is dynamically
initialized on stack with (argc + 1) elements.
The function wants to add _PATH_BSHELL as the first argument
and writes out of bounds of new_argv.
There is an off-by-one because maybe_script_execute fails to count
the terminating NULL when sizing new_argv.

ChangeLog:

 * sysdeps/unix/sysv/linux/spawni.c (maybe_script_execute):
 Increment size of new_argv by one.

(cherry picked from commit 28669f86f6780a18daca264f32d66b1428c9c6f1)

azanella/qsort-refactor 2018-09-04 18:45:12 UTC 2018-09-04
stdlib: Implement introsort with qsort

Author: Adhemerval Zanella
Author Date: 2018-09-03 18:30:15 UTC

stdlib: Implement introsort with qsort

This patch adds a introsort implementation on qsort to avoid worse-case
performance of quicksort to O(nlog n). The fallback used is a simple
heapsort based on Linux implementation. As a side note the introsort
implementation is similar the one used on libstdc++ for std::sort.

The performance shown some regression due heapsort usage, as expected:

Results for member size 4
  MostlySorted
  nmemb | base | patched | diff
       32 | 1809 | 2034 | 12.44
     4096 | 796888 | 1051955 | 32.01
    32768 | 7616495 | 10820159 | 42.06
   524288 | 142093487 | 250602727 | 76.36

  Repeated
  nmemb | base | patched | diff
       32 | 1875 | 2046 | 9.12
     4096 | 912206 | 1123392 | 23.15
    32768 | 8690714 | 10223479 | 17.64
   524288 | 171229868 | 287344355 | 67.81

  Sorted
  nmemb | base | patched | diff
       32 | 1367 | 1354 | -0.95
     4096 | 341229 | 1153712 | 238.10
    32768 | 3358312 | 10983978 | 227.07
   524288 | 66206257 | 232996299 | 251.92

  Unsorted
  nmemb | base | patched | diff
       32 | 2182 | 2209 | 1.24
     4096 | 990920 | 1101897 | 11.20
    32768 | 10119221 | 11319451 | 11.86
   524288 | 188297819 | 295723362 | 57.05

Results for member size 8
  MostlySorted
  nmemb | base | patched | diff
       32 | 1976 | 2061 | 4.30
     4096 | 720747 | 1048324 | 45.45
    32768 | 7161384 | 10927694 | 52.59
   524288 | 133265602 | 264259752 | 98.30

  Repeated
  nmemb | base | patched | diff
       32 | 2123 | 2265 | 6.69
     4096 | 913059 | 1124658 | 23.17
    32768 | 8785972 | 11353472 | 29.22
   524288 | 171667139 | 303675135 | 76.90

  Sorted
  nmemb | base | patched | diff
       32 | 1193 | 1128 | -5.45
     4096 | 301818 | 1101787 | 265.05
    32768 | 2961904 | 10964479 | 270.18
   524288 | 58873679 | 230789472 | 292.01

  Unsorted
  nmemb | base | patched | diff
       32 | 2099 | 2407 | 14.67
     4096 | 1024575 | 1154641 | 12.69
    32768 | 10017934 | 11635442 | 16.15
   524288 | 188778771 | 310044501 | 64.24

Results for member size 32
  MostlySorted
  nmemb | base | patched | diff
       32 | 3864 | 4423 | 14.47
     4096 | 1102305 | 1898226 | 72.21
    32768 | 9915730 | 19176780 | 93.40
   524288 | 193398884 | 478171367 | 147.25

  Repeated
  nmemb | base | patched | diff
       32 | 4636 | 3730 | -19.54
     4096 | 1359433 | 1847693 | 35.92
    32768 | 13028460 | 19120804 | 46.76
   524288 | 251463610 | 571423413 | 127.24

  Sorted
  nmemb | base | patched | diff
       32 | 1223 | 1165 | -4.74
     4096 | 310945 | 1922987 | 518.43
    32768 | 2975730 | 19160622 | 543.90
   524288 | 63995389 | 423600523 | 561.92

  Unsorted
  nmemb | base | patched | diff
       32 | 4612 | 5024 | 8.93
     4096 | 1436912 | 1989848 | 38.48
    32768 | 14043593 | 20652436 | 47.06
   524288 | 269586508 | 641284939 | 137.88

Checked on x86_64-linux-gnu.

 * stdlib/qsort.c (lg): New function.
 (R_HEAP): New define.
 * stdlib/qsort_common.c (R_CMP_ARG_USE): New define.
 (R_HEAP): New function: fallback heapsort implementation.
 (R_FUNC): Use fallback heapsort if quicksort depth exceeds
 2 times log2 of total element number.

ibm/2.28/master 2018-08-22 17:19:03 UTC 2018-08-22
Merge branch release/2.28/master into ibm/2.28/master

Author: Tulio Magno Quites Machado Filho
Author Date: 2018-08-22 17:19:03 UTC

Merge branch release/2.28/master into ibm/2.28/master

gabriel/powerpc-ieee128-printscan 2018-08-10 21:09:30 UTC 2018-08-10
[TEMP] powerpc64le: Convert default long double format to IEEE binary128

Author: Gabriel F. T. Gomes
Author Date: 2018-06-04 19:33:57 UTC

[TEMP] powerpc64le: Convert default long double format to IEEE binary128

Do not commit!

A commit similar to this would be added only when all other changes are
ready, but without the temporary header redirections (explained below).
This commit is provided in a personal branch to help other developers
test the branch.

  A note about temporary header redirections:

  On powerpc64le, the implementation of long double with IEEE binary128
  format is not complete. The redirections of the stdio.h, stdlib.h,
  argp.h, err.h, and error.h functions are supposed to be reused from
  bits/stdio-ldbl.h, etc., by changing the definition of
  __LDBL_REDIR_DECL based on the value of __HAVE_FLOAT128_UNLIKE_LDBL.

  However, we can only redirect all or none. In the meantime,
  bits/stdio-ieee128.h, etc. allows us to redirect part of them for
  testing purposes.

arm/ilp32 2018-08-03 10:57:56 UTC 2018-08-03
aarch64: Update ILP32 abilists for glibc 2.28

Author: Szabolcs Nagy
Author Date: 2018-08-03 10:56:37 UTC

aarch64: Update ILP32 abilists for glibc 2.28

This will need to be merged with the initial ilp32 abilist commit.

2018-08-03 Szabolcs Nagy <szabolcs.nagy@arm.com>

 * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Update.
 * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist: Likewise.
 * sysdeps/unix/sysv/linux/aarch64/ilp32/libpthread.abilist: Likewise.

azanella/aarch64-mempcpy 2018-07-05 12:18:18 UTC 2018-07-05
aarch64: ifunc mem* cleanups

Author: Adhemerval Zanella
Author Date: 2018-07-05 12:08:16 UTC

aarch64: ifunc mem* cleanups

aaribaud/y2038-submitted-v1 2018-06-13 08:21:00 UTC 2018-06-13
Y2038: make __mktime_internal compatible with 64-bit-time

Author: Albert ARIBAUD (3ADEV)
Author Date: 2018-05-02 11:15:50 UTC

Y2038: make __mktime_internal compatible with 64-bit-time

This implies that its callers be 64-bit-time compatible too.
It is done by creating 64-bit-time versions of these and
turning their original 32-bit-time versions into wrappers
(at a slight execution time cost).

The callers affected are:

      * mktime
      * timelocal (as an alias of mktime)
      * timegm

zack/elf-builtin-expect-conversion 2018-06-12 14:02:27 UTC 2018-06-12
Convert __builtin_expect to __glibc_(un)likely throughout elf/.

Author: Zack Weinberg
Author Date: 2018-06-01 16:53:59 UTC

Convert __builtin_expect to __glibc_(un)likely throughout elf/.

In the previous patch I didn't change a use of __builtin_expect to
__glibc_(un)likely that happened to be right next to the code I was
actually working on; Andreas asked why not, and I said that there were
a bunch more uses of __builtin_expect in that file and I would convert
them all in a separate patch. This is that patch, converting all of
elf/.

I would appreciate someone checking over this patch very carefully
indeed. In a whole bunch of places, __builtin_expect was used in a
way that did not map mechanically to the newer convention. The test
suite caught one mistake; I'm not confident I didn't make any more.

Writing this patch gave me a deeper appreciation for why we _want_ to
switch to __glibc_(un)likely, but also for how difficult it can be. I
now think that people should _not_ be asked to change existing uses of
__builtin_expect in a patch whose purpose is something else.

 * elf/dl-addr.c, elf/dl-cache.c, elf/dl-close.c, elf/dl-deps.c
 * elf/dl-environ.c, elf/dl-error-skeleton.c, elf/dl-fini.c
 * elf/dl-fptr.c, elf/dl-init.c, elf/dl-libc.c, elf/dl-minimal.c
 * elf/dl-open.c, elf/dl-reloc.c, elf/dl-runtime.c
 * elf/dl-sysdep.c, elf/dl-tls.c, elf/dl-version.c, elf/ldconfig.c
 * elf/rtld.c: Replace __builtin_expect with __glibc_likely or
 __glibc_unlikely, as appropriate, throughout.

hjl/pr23240/fw 2018-06-06 15:32:12 UTC 2018-06-06
Check non-lazy binding with LD_PRELOAD and weak reference

Author: H.J. Lu
Author Date: 2018-05-27 14:15:35 UTC

Check non-lazy binding with LD_PRELOAD and weak reference

Check non-lazy binding with

1. Reference to unrelocated IFUNC function with LD_PRELOAD.
2. Weak reference.

 [BZ #23176]
 [BZ #23240]
 * elf/Makefile (tests): Add reldep6a.
 (tests-internal): Add ifuncpreload1
 (modules-names): Add ifuncpreloadmod1a and ifuncpreloadmod1b.
 ($(objpfx)reldep6a): New.
 ($(objpfx)reldep6a.out): Likewise.
 (reldep6a-ENV): Likewise.
 ($(objpfx)ifuncpreload1): Likewise.
 ($(objpfx)ifuncpreload1.out): Likewise.
 (ifuncpreload1-ENV): Likewise.
 * elf/ifuncpreload1.c: New file.
 * elf/ifuncpreloadmod1a.c: Likewise.
 * elf/ifuncpreloadmod1b.c: Likewise.
 * elf/reldep6a.c: Likewise.

fw/bug21242 2018-06-06 14:02:02 UTC 2018-06-06
ld.so: Introduce delayed relocation processing

Author: Florian Weimer
Author Date: 2018-06-06 14:02:02 UTC

ld.so: Introduce delayed relocation processing

This makes it possible to use IFUNC resolvers which depend
on relocations themselves, as long as these reloctions do
not depend on IFUNCs.

So far, delayed relocation processing is only implemented for
x86-64.

zack/remove-mode-bits 2018-06-01 01:28:17 UTC 2018-06-01
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.

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.

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

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)

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.

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.

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

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.

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.

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/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.

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.

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.

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

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.

hjl/erms/2.22 2016-06-06 20:23:12 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.

hjl/erms/ifunc 2016-05-25 17:10:45 UTC 2016-05-25
X86-64: Add dummy memcopy.h and wordcopy.c

Author: H.J. Lu
Author Date: 2016-04-01 21:01:24 UTC

X86-64: Add dummy memcopy.h and wordcopy.c

Since x86-64 doesn't use memory copy functions, add dummy memcopy.h and
wordcopy.c to reduce code size. It reduces the size of libc.so by about
1 KB.

 * sysdeps/x86_64/memcopy.h: New file.
 * sysdeps/x86_64/wordcopy.c: Likewise.

1100 of 273 results

Other repositories

Name Last Modified
lp:glibc 9 hours ago
11 of 1 result
You can't create new repositories for GLibC.