Commit Graph

34902 Commits

Author SHA1 Message Date
Florian Weimer
9c02d0784d nss_files: Remove RES_USE_INET6 from hosts processing
Since commit 3f8b44be0a ("resolv:
Remove support for RES_USE_INET6 and the inet6 option"),
res_use_inet6 () always evaluates to false.
2019-05-16 15:11:23 +02:00
Florian Weimer
85b0e1e8a6 support: Report NULL blobs explicitly in TEST_COMPARE
Provide an explicit diagnostic if the length is positive, and
do not just crash with a null pointer dereference.  Null pointers
are only valid if the length is zero, so this can only happen with
a faulty test.
2019-05-16 14:50:15 +02:00
Mark Wielaard
11b451c886 dlfcn: Guard __dlerror_main_freeres with __libc_once_get (once) [BZ# 24476]
dlerror.c (__dlerror_main_freeres) will try to free resources which only
have been initialized when init () has been called. That function is
called when resources are needed using __libc_once (once, init) where
once is a __libc_once_define (static, once) in the dlerror.c file.
Trying to free those resources if init () hasn't been called will
produce errors under valgrind memcheck. So guard the freeing of those
resources using __libc_once_get (once) and make sure we have a valid
key. Also add a similar guard to __dlerror ().

	* dlfcn/dlerror.c (__dlerror_main_freeres): Guard using
	__libc_once_get (once) and static_bug == NULL.
	(__dlerror): Check we have a valid key, set result to static_buf
	otherwise.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2019-05-15 23:34:55 +02:00
DJ Delorie
5dde9ef79a Add missing Changelog entry
For 5b06f538c5
2019-05-15 12:11:12 -04:00
Andreas Schwab
32ff397533 Fix crash in _IO_wfile_sync (bug 20568)
When computing the length of the converted part of the stdio buffer, use
the number of consumed wide characters, not the (negative) distance to the
end of the wide buffer.
2019-05-15 16:47:09 +02:00
Florian Weimer
a9368c34d7 nss: Turn __nss_database_lookup into a compatibility symbol
The function uses the internal service_user type, so it is not
really usable from the outside of glibc.  Rename the function
to __nss_database_lookup2 for internal use, and change
__nss_database_lookup to always indicate failure to the caller.

__nss_next already was a compatibility symbol.  The new
implementation always fails and no longer calls __nss_next2.

unscd, the alternative nscd implementation, does not use
__nss_database_lookup, so it is not affected by this change.
2019-05-15 15:07:49 +02:00
Alexandra Hájková
d50f09181e support: Add support_install_rootsbindir
Reviewed by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-05-15 11:37:26 +02:00
Florian Weimer
7ac6fad987 iconv: Remove public declaration of __gconv_transliterate
Commit ba7b4d294b ("Complete the
removal of __gconv_translit_find") added a declaration of the
GLIBC_PRIVATE function, __gconv_transliterate, to the installed
header <gconv.h>.  It should have been added to the internal
<gconv_int.h> header.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2019-05-15 07:16:47 +02:00
Florian Weimer
04b261bdc1 Linux: Add the tgkill function
The tgkill function is sometimes used in crash handlers.

<bits/signal_ext.h> follows the same approach as <bits/unistd_ext.h>
(which was added for the gettid system call wrapper).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2019-05-14 22:55:51 +02:00
Carlos O'Donell
6807f47b81 manual: Adjust twalk_r documentation.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2019-05-14 15:56:56 -04:00
Adhemerval Zanella
da2b83ef6b elf: Fix tst-pldd for non-default --prefix and/or --bindir (BZ#24544)
Use a new libsupport support_bindir_prefix instead of a hardcoded
/usr/bin to create the pldd path on container directory.

Checked on x86_64-linux-gnu with default and non-default --prefix and
--bindir paths, as well with --enable-hardcoded-path-in-tests.

	[BZ #24544]
	* elf/tst-pldd.c (do_test): Use support_bindir_prefix instead of
	pre-defined value.

Reviewed-by: DJ Delorie <dj@redhat.com>
2019-05-14 11:04:41 -03:00
Adhemerval Zanella
c7ac9caaae support: Export bindir path on support_path
Checked on x86_64-linux-gnu.

	* support/Makefile (CFLAGS-support_paths.c): Add -DBINDIR_PATH.
	* support/support.h (support_bindir_prefix): New variable.
	* support/support_paths.c [BINDIR_PATH] (support_bindir_prefix):

Reviewed-by: DJ Delorie <dj@redhat.com>
2019-05-14 11:04:37 -03:00
Adhemerval Zanella
91f043ae84 Make --bindir effective
This allows sets a path using --bindir.  Checked on x86_64-linux-gnu
with a non-default --bindir and checked resulting installed binaries
(pldd for instance).

	* config.make.in (bindir): New variable.

Reviewed-by: DJ Delorie <dj@redhat.com>
2019-05-14 11:04:33 -03:00
Adhemerval Zanella
c50e1c263e x86: Remove arch-specific low level lock implementation
This patch removes the arch-specific x86 assembly implementation for
low level locking and consolidate both 64 bits and 32 bits in a
single implementation.

Different than other architectures, x86 lll_trylock, lll_lock, and
lll_unlock implements a single-thread optimization to avoid atomic
operation, using cmpxchgl instead.  This patch implements by using
the new single-thread.h definitions in a generic way, although using
the previous semantic.

The lll_cond_trylock, lll_cond_lock, and lll_timedlock just use
atomic operations plus calls to lll_lock_wait*.

For __lll_lock_wait_private and __lll_lock_wait the generic implemtation
there is no indication that assembly implementation is required
performance-wise.

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

	* sysdeps/nptl/lowlevellock.h (__lll_trylock): New macro.
	(lll_trylock): Call __lll_trylock.
	* sysdeps/unix/sysv/linux/i386/libc-lowlevellock.S: Remove file.
	* sysdeps/unix/sysv/linux/i386/lll_timedlock_wait.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lll_timedlock_wait.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
	* sysdeps/unix/sysv/linux/x86/lowlevellock.h: New file.
	* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Include
	lowlevellock-futex.h.
2019-05-14 08:48:02 -03:00
Adhemerval Zanella
959aff9fa2 Assume LLL_LOCK_INITIALIZER is 0
Since hppa is not an outlier anymore regarding LLL_LOCK_INITIALIZER value,
we can now assume it 0 for all architectures.

Checked on a build for all major ABIs.

	* nptl/nptl-init.c (__pthread_initialize_minimal_internal): Remove
	initialization for LLL_LOCK_INITIALIZER different than 0.
	* nptl/old_pthread_cond_broadcast.c (__pthread_cond_broadcast_2_0):
	Assume LLL_LOCK_INITIALIZER being 0.
	* nptl/old_pthread_cond_signal.c (__pthread_cond_signal_2_0): Likewise.
	* nptl/old_pthread_cond_timedwait.c (__pthread_cond_timedwait_2_0):
	Likewise.
	* nptl/old_pthread_cond_wait.c (__pthread_cond_wait_2_0): Likewise.
	* sysdeps/nptl/libc-lockP.h (__libc_lock_define_initialized): Likewise.
2019-05-14 08:44:03 -03:00
Adhemerval Zanella
d7e4c642ef Small optimization for lowlevellock
This patch optimizes both __lll_lock_wait_private and __lll_lock_wait
by issuing only one lll_futex_wait.  Since it is defined as an inlined
syscall and inlined syscalls are defined using inlined assembly the
compiler usually can not see both calls are equal and optimize
accordingly.

On aarch64 the resulting binary is change from:

0000000000000060 <__lll_lock_wait>:
  60:   2a0103e5        mov     w5, w1
  64:   b9400001        ldr     w1, [x0]
  68:   aa0003e4        mov     x4, x0
  6c:   7100083f        cmp     w1, #0x2
  70:   540000e1        b.ne    8c <__lll_lock_wait+0x2c>  // b.any
  74:   521900a1        eor     w1, w5, #0x80
  78:   d2800042        mov     x2, #0x2                        // #2
  7c:   93407c21        sxtw    x1, w1
  80:   d2800003        mov     x3, #0x0                        // #0
  84:   d2800c48        mov     x8, #0x62                       // #98
  88:   d4000001        svc     #0x0
  8c:   521900a5        eor     w5, w5, #0x80
  90:   52800046        mov     w6, #0x2                        // #2
  94:   93407ca5        sxtw    x5, w5
  98:   14000008        b       b8 <__lll_lock_wait+0x58>
  9c:   d503201f        nop
  a0:   aa0403e0        mov     x0, x4
  a4:   aa0503e1        mov     x1, x5
  a8:   d2800042        mov     x2, #0x2                        // #2
  ac:   d2800003        mov     x3, #0x0                        // #0
  b0:   d2800c48        mov     x8, #0x62                       // #98
  b4:   d4000001        svc     #0x0
  b8:   885ffc80        ldaxr   w0, [x4]
  bc:   88017c86        stxr    w1, w6, [x4]
  c0:   35ffffc1        cbnz    w1, b8 <__lll_lock_wait+0x58>
  c4:   35fffee0        cbnz    w0, a0 <__lll_lock_wait+0x40>
  c8:   d65f03c0        ret

To:

0000000000000048 <__lll_lock_wait>:
  48:   aa0003e4        mov     x4, x0
  4c:   2a0103e5        mov     w5, w1
  50:   b9400000        ldr     w0, [x0]
  54:   7100081f        cmp     w0, #0x2
  58:   540000c0        b.eq    70 <__lll_lock_wait+0x28>  // b.none
  5c:   52800041        mov     w1, #0x2                        // #2
  60:   885ffc80        ldaxr   w0, [x4]
  64:   88027c81        stxr    w2, w1, [x4]
  68:   35ffffc2        cbnz    w2, 60 <__lll_lock_wait+0x18>
  6c:   34000120        cbz     w0, 90 <__lll_lock_wait+0x48>
  70:   521900a1        eor     w1, w5, #0x80
  74:   aa0403e0        mov     x0, x4
  78:   93407c21        sxtw    x1, w1
  7c:   d2800042        mov     x2, #0x2                        // #2
  80:   d2800003        mov     x3, #0x0                        // #0
  84:   d2800c48        mov     x8, #0x62                       // #98
  88:   d4000001        svc     #0x0
  8c:   17fffff4        b       5c <__lll_lock_wait+0x14>
  90:   d65f03c0        ret

I see similar changes on powerpc and other architectures.  It also aligns
with x86_64 implementation by adding the systemtap probes.

Checker on aarch64-linux-gnu.

	* nptl/lowlevellock.c (__lll_lock_wait, __lll_lock_wait_private):
	Optimize futex call and add systemtap probe.
2019-05-14 08:41:52 -03:00
Adhemerval Zanella
fdb8a0be9b Add single-thread.h header
This patch move the single-thread syscall optimization defintions from
syscall-cancel.h to new header file single-thread.h and also move the
cancellation definitions from pthreadP.h to syscall-cancel.h.

The idea is just simplify the inclusion of both syscall-cancel.h and
single-thread.h (without the requirement of including all pthreadP.h
defintions).

No semantic changes expected, checked on a build for all major ABIs.

	* nptl/pthreadP.h (CANCEL_ASYNC, CANCEL_RESET, LIBC_CANCEL_ASYNC,
	LIBC_CANCEL_RESET, __libc_enable_asynccancel,
	__libc_disable_asynccancel, __librt_enable_asynccancel,
	__libc_disable_asynccancel, __librt_enable_asynccancel,
	__librt_disable_asynccancel): Move to ...
	* sysdeps/unix/sysv/linux/sysdep-cancel.h: ... here.
	(SINGLE_THREAD_P, RTLD_SINGLE_THREAD_P): Move to ...
	* sysdeps/unix/sysv/linux/single-thread.h: ... here.
	* sysdeps/generic/single-thread.h: New file.
	* sysdeps/unix/sysdep.h: Include single-thread.h.
	* sysdeps/unix/sysv/linux/futex-internal.h: Include sysdep-cancel.h.
	* sysdeps/unix/sysv/linux/lowlevellock-futex.h: Likewise.
2019-05-14 08:41:15 -03:00
Mike FABIAN
f6efec90c8 Bug 24535: Update to Unicode 12.1.0
Unicode 12.1.0 Support: Character encoding, character type info, and
transliteration tables are all updated to Unicode 12.1.0, using
the generator scripts contributed by Mike FABIAN (Red Hat).

Some info about the number of characters added or changed:

Total added characters in newly generated CHARMAP: 1
added: <U32FF>     /xe3/x8b/xbf SQUARE ERA NAME REIWA
Total added characters in newly generated WIDTH: 1
added: <U32FF> 2 : eaw=W category=So bidi=L   name=SQUARE ERA NAME REIWA
graph: Added 1 characters in new ctype which were not in old ctype
graph: Added: ㋿ U+32FF SQUARE ERA NAME REIWA
print: Added 1 characters in new ctype which were not in old ctype
print: Added: ㋿ U+32FF SQUARE ERA NAME REIWA
punct: Added 1 characters in new ctype which were not in old ctype
punct: Added: ㋿ U+32FF SQUARE ERA NAME REIWA
2019-05-13 17:25:03 +02:00
Wilco Dijkstra
5ad533e8e6 Fix tcache count maximum (BZ #24531)
The tcache counts[] array is a char, which has a very small range and thus
may overflow.  When setting tcache_count tunable, there is no overflow check.
However the tunable must not be larger than the maximum value of the tcache
counts[] array, otherwise it can overflow when filling the tcache.

	[BZ #24531]
	* malloc/malloc.c (MAX_TCACHE_COUNT): New define.
	(do_set_tcache_count): Only update if count is small enough.
	* manual/tunables.texi (glibc.malloc.tcache_count): Document max value.
2019-05-10 16:38:21 +01:00
Florian Weimer
4aee85f96b sem_close: Use __twalk_r 2019-05-10 14:52:44 +02:00
Adhemerval Zanella
eb669ff5bf support: Fix timespec printf
The patch print timespec members as intmax_t instead of long int.
It avoid the -Werror=format= build issue on x32:

  timespec.c: In function 'test_timespec_before_impl':
  timespec.c:32:23: error: format '%ld' expects argument of type 'long int',
  but argument 4 has type '__time_t' {aka 'const long long int'} [-Werror=format=]

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

	* support/timespec.c (test_timespec_before_impl,
	test_timespec_equal_or_after_impl): print timespec member as intmax_t
	insted of long int.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
2019-05-10 09:39:19 -03:00
Mike Crowe
44ac6ee97a nptl/tst-abstime: Use libsupport
Checked on x86_64-linux-gnu and i686-linux-gnu.

	* nptl/tst-abstime.c: Use libsupport.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-05-09 14:33:53 -03:00
Mike Crowe
495514eec7 nptl: Convert some rwlock tests to use libsupport
Checked on x86_64-linux-gnu and i686-linux-gnu.

	* nptl/tst-rwlock6.c: Use libsupport. This also happens to fix a
	small bug where only tv.tv_usec was checked which could cause an
	erroneous pass if pthread_rwlock_timedrdlock incorrectly took more
	than a second.

	* nptl/tst-rwlock7.c, nptl/tst-rwlock9.c, nptl/tst-rwlock14.c: Use
	libsupport.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-05-09 14:33:53 -03:00
Mike Crowe
40d0816faa nptl: Use recent additions to libsupport in tst-sem5
Checked on x86_64-linux-gnu and i686-linux-gnu.

	* nptl/tst-sem5.c(do_test): Use xclock_gettime, timespec_add and
	TEST_TIMESPEC_NOW_OR_AFTER from libsupport.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-05-09 14:33:53 -03:00
Mike Crowe
d8e0b901a4 nptl: Convert tst-cond11.c to use libsupport
Checked on x86_64-linux-gnu and i686-linux-gnu.

	* nptl/tst-cond11.c: Use libsupport.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-05-09 14:33:53 -03:00
Mike Crowe
5198399651 support: Add timespec.h
It adds useful functions for tests that use struct timespec.

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

	* support/timespec.h: New file.  Provide timespec helper functions
	along with macros in the style of those in check.h.
	* support/timespec.c: New file.  Implement check functions declared
	in support/timespec.h.
	* support/timespec-add.c: New file from gnulib containing
	timespec_add implementation that handles overflow.
	* support/timespec-sub.c: New file from gnulib containing
	timespec_sub implementation that handles overflow.
	* support/README: Mention timespec.h.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-05-09 14:33:53 -03:00
Szabolcs Nagy
18aa51ee0d Move nptl/tst-eintr1 to xtests
Don't run nptl/tst-eintr1 by normal make check because it can spuriously
break testing on various linux kernels. (Currently this affects the
aarch64 glibc buildbot machine which regularly fails and loses test
results.)

	[BZ #24537]
	* nptl/Makefile: Move tst-eintr1 to xtests.
2019-05-09 16:54:51 +01:00
Adhemerval Zanella
ae45cf84af powerpc: trunc/truncf refactor
This patches consolidates all the powerpc trunc{f} implementations on
the generic sysdeps/powerpc/fpu/s_trunc{f}.  The generic implementation
uses either the compiler builts for ISA 2.03+ (which generates the
frim instruction) or a generic implementation which uses FP only
operations.

The IFUNC organization for powerpc64 is also change to be enabled only
for powerpc64 and not for powerpc64le (since minium ISA of 2.08 does not
require the fallback generic implementation).

Checked on powerpc-linux-gnu (built without --with-cpu, with
--with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch),
powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+
and --disable-multi-arch).

	* sysdeps/powerpc/fpu/trunc_to_integer.h (set_fenv_mode): Add
	 TRUNC handling.
	(round_mode): Add definition for TRUNC.
	* sysdeps/powerpc/fpu/s_trunc.c: New file.
	* sysdeps/powerpc/fpu/s_truncf.c: New file.
	* sysdeps/powerpc/powerpc32/fpu/s_trunc.S: Remove file.
	* sysdeps/powerpc/powerpc32/fpu/s_truncf.S: Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-power5+.S:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-ppc32.S:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-power5+.S:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-ppc32.S:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-power5+.c: New
	file.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-ppc32.c:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-power5+.c:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-ppc32.c:
	Likewise.
	* sysdep/powerpc/powerpc32/power5+/fpu/s_trunc.S: Remove file.
	* sysdep/powerpc/powerpc32/power5+/fpu/s_truncf.S: Likewise.
	* sysdep/powerpc/powerpc64/be/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_trunc-power5+, s_trunc-ppc64,
	s_truncf-power5+, and s_truncf-ppc64.
	(CFLAGS-s_trunc-power5+.c, CFLAGS-s_truncf-power5+.c): New rule.
	* sysdep/powerpc/powercp64/be/fpu/multiarch/s_trunc-power5+.c: New
	file.
	* sysdep/powerpc/powercp64/be/fpu/multiarch/s_trunc-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c: Move to ...
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc.c: ... here.
	* sysdep/powerpc/powercp64/be/fpu/multiarch/s_truncf-power5+.c: New
	file.
	* sysdep/powerpc/powercp64/be/fpu/multiarch/s_truncf-ppc64.c:
	Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c: Move to ...
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf.c: ... here.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
	(libm-sysdep_routines): Remove s_trunc-power5+, s_trunc-ppc64,
	s_truncf-power5+, and s_truncf-ppc64.
	* sysdep/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S: Remove
	file.
	* sysdep/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S: Likewise.
	* sysdep/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S:
	Likewise.
	* sysdep/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Likewise.
	* sysdep/powerpc/powerpc64/power5+/fpu/s_trunc.S: Likewise.
	* sysdep/powerpc/powerpc64/power5+/fpu/s_truncf.S: Likewise.

Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
2019-05-09 09:39:28 -03:00
Adhemerval Zanella
a1cb1888b7 powerpc: round/roundf refactor
This patches consolidates all the powerpc round{f} implementations on
the generic sysdeps/powerpc/fpu/s_round{f}.  The generic implementation
uses either the compiler builts for ISA 2.03+ (which generates the
frim instruction) or a generic implementation which uses FP only
operations.

The IFUNC organization for powerpc64 is also change to be enabled only
for powerpc64 and not for powerpc64le (since minium ISA of 2.08 does not
require the fallback generic implementation).

Checked on powerpc-linux-gnu (built without --with-cpu, with
--with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch),
powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+
and --disable-multi-arch).

	* sysdeps/powerpc/fpu/round_to_integer.h (set_fenv_mode): Add
	ROUND handling.
	(round_mode): Add definition for ROUND.
	(round_to_integer_float): Likewise.
	* sysdeps/powerpc/fpu/s_round.c: New file.
	* sysdeps/powerpc/fpu/s_roundf.c: New file.
	* sysdeps/powerpc/powerpc32/fpu/s_round.S: Remove file.
	* sysdeps/powerpc/powerpc32/fpu/s_roundf.S: Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_round-power5+.S:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_round-ppc32.S:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_roundf-power5+.S:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_roundf-ppc32.S:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_round-power5+.c: New
	file.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_round-ppc32.c:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_roundf-power5+.c:
	Likewise.
	* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_roundf-ppc32.c:
	Likewise.
	* sysdep/powerpc/powerpc32/power5+/fpu/s_round.S: Remove file.
	* sysdep/powerpc/powerpc32/power5+/fpu/s_roundf.S: Likewise.
	* sysdep/powerpc/powerpc64/be/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_round-power5+, s_round-ppc64,
	s_roundf-power5+, and s_roundf-ppc64.
	(CFLAGS-s_round-power5+.c, CFLAGS-s_roundf-power5+.c): New rule.
	* sysdep/powerpc/powercp64/be/fpu/multiarch/s_round-power5+.c: New
	file.
	* sysdep/powerpc/powercp64/be/fpu/multiarch/s_round-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c: Move to ...
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round.c: ... here.
	* sysdep/powerpc/powercp64/be/fpu/multiarch/s_roundf-power5+.c: New
	file.
	* sysdep/powerpc/powercp64/be/fpu/multiarch/s_roundf-ppc64.c:
	Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c: Move to ...
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf.c: ... here.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
	(libm-sysdep_routines): Remove s_round-power5+, s_round-ppc64,
	s_roundf-power5+, and s_roundf-ppc64.
	* sysdep/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S: Remove
	file.
	* sysdep/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S: Likewise.
	* sysdep/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S:
	Likewise.
	* sysdep/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_round.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_roundf.S: Likewise.
	* sysdep/powerpc/powerpc64/power5+/fpu/s_round.S: Likewise.
	* sysdep/powerpc/powerpc64/power5+/fpu/s_roundf.S: Likewise.

Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
2019-05-09 09:39:07 -03:00
Adhemerval Zanella
252296c625 powerpc: floor/floorf refactor
This patches consolidates all the powerpc floor{f} implementations on
the generic sysdeps/powerpc/fpu/s_floor{f}.  The generic implementation
uses either the compiler builts for ISA 2.03+ (which generates the
frim instruction) or a generic implementation which uses FP only
operations.

The IFUNC organization for powerpc64 is also change to be enabled only
for powerpc64 and not for powerpc64le (since minium ISA of 2.08 does not
require the fallback generic implementation).

Checked on powerpc-linux-gnu (built without --with-cpu, with
--with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch),
powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+
and --disable-multi-arch).

	* sysdeps/powerpc/fpu/round_to_integer.h (set_fenv_mode):
	Add FLOOR option.
	(round_mode): Add definition for FLOOR.
	* sysdeps/powerpc/fpu/s_floor.c: New file.
	* sysdeps/powerpc/fpu/s_floorf.c: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/s_floor.S: Remove file.
	* sysdeps/powerpc/powerpc32/fpu/s_floorf.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-power5+.S:
	Remove file.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-ppc32.S:
	Likewise
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-power5+.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-ppc32.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-power5+.c:
	New file.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floor-ppc32.c:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-power5+.c:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_floorf-ppc32.c:
	Likewise.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_floor.S: Remove file.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_floorf.S: Remove file.
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile
	(libm-sysdep_routines): Add s_floor-power5+, s_floor-ppc64,
	s_floorf-power5+, and s_floorf-ppc64.
	(CFLAGS-s_floor-power5+.c, CFLAGS-s_floorf-power5+.c): New rule.
	* sysdep/powerpc/powerpc64/be/fpu/multiarch/s_floor-power5+.c: New
	file.
	* sysdep/powerpc/powerpc64/be/fpu/multiarch/s_floor-ppc64.c: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor.c: Move to ...
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_floor.c: ... here.
	* sysdep/powerpc/powerpc64/be/fpu/multiarch/s_floorf-power5+.c: New
	file.
	* sysdep/powerpc/powerpc64/be/fpu/multiarch/s_floorf-ppc64.c:
	Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf.c: Move to ...
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_floorf.c: ... here.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
	(libm-sysdep_routines): Remove s_floor-power5+, s_floor-ppc64,
	s_floorf-power5+, and s_floorf-ppc64.
	* sysdep/powerpc/powerpc64/fpu/multiarch/s_floor-power5+.S: Remove
	file.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floor-ppc64.S: Remove
	file.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-power5+.S:
	Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_floorf-ppc64.S:
	Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_floor.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_floorf.S: Likewise.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S: Likewise.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_floorf.S: Likewise.

Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
2019-05-09 09:38:40 -03:00
Mike Crowe
33647a7294 support: Add xclock_gettime
* support/xclock_gettime.c (xclock_gettime): New file. Provide
	clock_gettime wrapper for use in tests that fails the test rather
	than returning failure.

	* support/xtime.h: New file to declare xclock_gettime.

	* support/Makefile: Add xclock_gettime.c.

	* support/README: Mention xtime.h.
2019-05-08 16:58:17 +02:00
Florian Weimer
b2f601ba9a malloc/tst-mallocfork2: Use process-shared barriers
This synchronization method has a lower overhead and makes
it more likely that the signal arrives during one of the critical
functions.

Also test for fork deadlocks explicitly.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2019-05-08 15:29:13 +02:00
Joseph Myers
7621676f7a Update syscall-names.list for Linux 5.1.
This patch updates syscall-names.list for Linux 5.1 (which has many
new syscalls, mainly but not entirely ones for 64-bit time).

Tested with build-many-glibcs.py (before the revert of the move to
Linux 5.1 there; verified there were no tst-syscall-list failures).

	* sysdeps/unix/sysv/linux/syscall-names.list: Update kernel
	version to 5.1.
	(clock_adjtime64) New syscall.
	(clock_getres_time64) Likewise.
	(clock_gettime64) Likewise.
	(clock_nanosleep_time64) Likewise.
	(clock_settime64) Likewise.
	(futex_time64) Likewise.
	(io_pgetevents_time64) Likewise.
	(io_uring_enter) Likewise.
	(io_uring_register) Likewise.
	(io_uring_setup) Likewise.
	(mq_timedreceive_time64) Likewise.
	(mq_timedsend_time64) Likewise.
	(pidfd_send_signal) Likewise.
	(ppoll_time64) Likewise.
	(pselect6_time64) Likewise.
	(recvmmsg_time64) Likewise.
	(rt_sigtimedwait_time64) Likewise.
	(sched_rr_get_interval_time64) Likewise.
	(semtimedop_time64) Likewise.
	(timer_gettime64) Likewise.
	(timer_settime64) Likewise.
	(timerfd_gettime64) Likewise.
	(timerfd_settime64) Likewise.
	(utimensat_time64) Likewise.
2019-05-07 23:57:26 +00:00
Joseph Myers
13d0931888 Revert "Use Linux 5.1 in build-many-glibcs.py."
This reverts commit c2b11710fb.

Linux 5.1 headers are not in fact usable for glibc testing, because
"[PATCH] uapi: avoid namespace conflict in linux/posix_types.h"
<https://lore.kernel.org/lkml/20190319165123.3967889-1-arnd@arndb.de/>
did not get merged for 5.1 and so many conform/ tests fail.
2019-05-07 22:45:51 +00:00
Joseph Myers
c2b11710fb Use Linux 5.1 in build-many-glibcs.py.
* scripts/build-many-glibcs.py (Context.checkout): Default Linux
	version to 5.1.
2019-05-07 14:49:05 +00:00
Joseph Myers
c4a392cfd1 Use GCC 9 in build-many-glibcs.py.
* scripts/build-many-glibcs.py (Context.checkout): Default GCC
	version to 9 branch.
2019-05-07 14:46:11 +00:00
Anton Youdkevitch
32e902a94e aarch64: thunderx2 memmove performance improvements
The performance improvement is about 20%-30% for
larger cases and about 1%-5% for smaller cases.

Used SIMD load/store instead of GPR for large
overlapping forward moves.

Reused existing memcpy implementation for smaller
or overlapping backward moves.

Fixed the existing memcpy implementation to allow it
to deal with the overlapping case.

Simplified loop tails in the memcpy implementation -
use branchless overlapping sequence of fixed length
load/stores instead of branching depending on the
size.

A cleanup/optimization converting str's to stp's.

Added __memmove_thunderx2 to the list of the
available implementations.
2019-05-03 11:01:34 -07:00
Florian Weimer
ac3da35de5 misc/tst-tsearch: Additional explicit error checking
This avoids an undefined variable warning with certain GCC versions.
2019-05-03 09:22:33 +02:00
Adhemerval Zanella
7dfde28a21 Add missing bug number on CL entry for BZ#24506 (b2af6fb2ed) 2019-05-02 08:46:20 -03:00
Adhemerval Zanella
b2af6fb2ed elf: Fix elf/tst-pldd with --enable-hardcoded-path-in-tests (BZ#24506)
The elf/tst-pldd (added by 1a4c27355e to fix BZ#18035) test does
not expect the hardcoded paths that are output by pldd when the test
is built with --enable-hardcoded-path-in-tests.  Instead of showing
the ABI installed library names for loader and libc (such as
ld-linux-x86-64.so.2 and libc.so.6 for x86_64), pldd shows the default
built ld.so and libc.so.

It makes the tests fail with an invalid expected loader/libc name.

This patch fixes the elf-pldd test by adding the canonical ld.so and
libc.so names in the expected list of possible outputs when parsing
the result output from pldd.  The test now handles both default
build and --enable-hardcoded-path-in-tests option.

Checked on x86_64-linux-gnu (built with and without
--enable-hardcoded-path-in-tests) and i686-linux-gnu.

	* elf/tst-pldd.c (in_str_list): New function.
	(do_test): Add default names for ld and libc as one option.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2019-05-02 08:44:12 -03:00
Florian Weimer
7b807a35a8 misc: Add twalk_r function
The twalk function is very difficult to use in a multi-threaded
program because there is no way to pass external state to the
iterator function.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2019-05-02 11:42:51 +02:00
Paul Eggert
20aa581958 Make mktime etc. compatible with __time64_t
Keep these functions compatible with Gnulib while adding
__time64_t support.  The basic idea is to move private API
declarations from include/time.h to time/mktime-internal.h, since
the former file cannot easily be shared with Gnulib whereas the
latter can.
Also, do some other minor cleanup while in the neighborhood.
* include/time.h: Include stdbool.h, time/mktime-internal.h.
(__mktime_internal): Move this prototype to time/mktime-internal.h,
since Gnulib needs it.
(__localtime64_r, __gmtime64_r) [__TIMESIZE == 64]:
Move these macros to time/mktime-internal.h, since Gnulib needs them.
(__mktime64, __timegm64) [__TIMESIZE != 64]: New prototypes.
(in_time_t_range): New static function.
* posix/bits/types.h (__time64_t) [__TIMESIZE == 64 && !defined __LIBC]:
Do not define as a macro in this case, so that portable code is
less tempted to use __time64_t.
* time/mktime-internal.h: Rewrite so that it does both glibc
and Gnulib work.  Include time.h if not _LIBC.
(mktime_offset_t) [!_LIBC]: Define for gnulib.
(__time64_t, __gmtime64_r, __localtime64_r, __mktime64, __timegm64)
[!_LIBC || __TIMESIZE == 64]: New macros, mostly moved here
from include/time.h.
(__gmtime_r, __localtime_r, __mktime_internal) [!_LIBC]:
New macros, taken from GNulib.
(__mktime_internal): New prototype, moved here from include/time.h.
* time/mktime.c (mktime_min, mktime_max, convert_time)
(ranged_convert, __mktime_internal, __mktime64):
* time/timegm.c (__timegm64):
Use __time64_t, not time_t.
* time/mktime.c: Stop worrying about whether time_t is floating-point.
(__mktime64) [! (_LIBC && __TIMESIZE != 64)]:
Rename from mktime.
(mktime) [_LIBC && __TIMESIZE != 64]: New function.
* time/timegm.c [!_LIBC]: Include libc-config.h, not config.h,
for libc_hidden_def.
Include errno.h.
(__timegm64) [! (_LIBC && __TIMESIZE != 64)]:
Rename from timegm.
(timegm) [_LIBC && __TIMESIZE != 64]: New function.

First cut at publicizing __time64_t
2019-04-30 09:02:17 -07:00
Maciej W. Rozycki
87c266d758 Fix -O1 compilation errors with __ddivl' and __fdivl' [BZ #19444]
Complementing commit 4a06ceea33 ("sysdeps/ieee754/soft-fp: ignore
maybe-uninitialized with -O [BZ #19444]") and commit 27c5e756a2
("sysdeps/ieee754: prevent maybe-uninitialized errors with -O [BZ
#19444]") also fix compilation errors observed at -O1 in `__ddivl' and
`__fdivl' with GCC 9 and RISC-V targets:

In file included from ../soft-fp/soft-fp.h:318,
                 from ../sysdeps/ieee754/soft-fp/s_fdivl.c:27:
../sysdeps/ieee754/soft-fp/s_fdivl.c: In function '__fdivl':
../soft-fp/op-2.h:108:9: error: 'R_f1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  108 |         : (X##_f1 << (2*_FP_W_TYPE_SIZE - (N)))) \
      |         ^
../sysdeps/ieee754/soft-fp/s_fdivl.c:37:14: note: 'R_f1' was declared here
   37 |   FP_DECL_Q (R);
      |              ^
../soft-fp/op-common.h:39:3: note: in expansion of macro '_FP_FRAC_DECL_2'
   39 |   _FP_FRAC_DECL_##wc (X)
      |   ^~~~~~~~~~~~~~
../soft-fp/quad.h:226:24: note: in expansion of macro '_FP_DECL'
  226 | # define FP_DECL_Q(X)  _FP_DECL (2, X)
      |                        ^~~~~~~~
../sysdeps/ieee754/soft-fp/s_fdivl.c:37:3: note: in expansion of macro 'FP_DECL_Q'
   37 |   FP_DECL_Q (R);
      |   ^~~~~~~~~
../soft-fp/op-2.h:109:8: error: 'R_f0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  109 |        | X##_f0) != 0));    \
      |        ^
../sysdeps/ieee754/soft-fp/s_fdivl.c:37:14: note: 'R_f0' was declared here
   37 |   FP_DECL_Q (R);
      |              ^
../soft-fp/op-common.h:39:3: note: in expansion of macro '_FP_FRAC_DECL_2'
   39 |   _FP_FRAC_DECL_##wc (X)
      |   ^~~~~~~~~~~~~~
../soft-fp/quad.h:226:24: note: in expansion of macro '_FP_DECL'
  226 | # define FP_DECL_Q(X)  _FP_DECL (2, X)
      |                        ^~~~~~~~
../sysdeps/ieee754/soft-fp/s_fdivl.c:37:3: note: in expansion of macro 'FP_DECL_Q'
   37 |   FP_DECL_Q (R);
      |   ^~~~~~~~~
In file included from ../soft-fp/soft-fp.h:318,
                 from ../sysdeps/ieee754/soft-fp/s_ddivl.c:31:
../sysdeps/ieee754/soft-fp/s_ddivl.c: In function '__ddivl':
../soft-fp/op-2.h:98:25: error: 'R_f1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   98 |        X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) \
      |                         ^~
../sysdeps/ieee754/soft-fp/s_ddivl.c:41:14: note: 'R_f1' was declared here
   41 |   FP_DECL_Q (R);
      |              ^
../soft-fp/op-2.h:37:36: note: in definition of macro '_FP_FRAC_DECL_2'
   37 |   _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT
      |                                    ^
../soft-fp/quad.h:226:24: note: in expansion of macro '_FP_DECL'
  226 | # define FP_DECL_Q(X)  _FP_DECL (2, X)
      |                        ^~~~~~~~
../sysdeps/ieee754/soft-fp/s_ddivl.c:41:3: note: in expansion of macro 'FP_DECL_Q'
   41 |   FP_DECL_Q (R);
      |   ^~~~~~~~~
../soft-fp/op-2.h:101:17: error: 'R_f0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  101 |       : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \
      |                 ^~
../sysdeps/ieee754/soft-fp/s_ddivl.c:41:14: note: 'R_f0' was declared here
   41 |   FP_DECL_Q (R);
      |              ^
../soft-fp/op-2.h:37:14: note: in definition of macro '_FP_FRAC_DECL_2'
   37 |   _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT
      |              ^
../soft-fp/quad.h:226:24: note: in expansion of macro '_FP_DECL'
  226 | # define FP_DECL_Q(X)  _FP_DECL (2, X)
      |                        ^~~~~~~~
../sysdeps/ieee754/soft-fp/s_ddivl.c:41:3: note: in expansion of macro 'FP_DECL_Q'
   41 |   FP_DECL_Q (R);
      |   ^~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [.../sysd-rules:587: .../math/s_fdivl.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
make[2]: *** [.../sysd-rules:587: .../math/s_ddivl.o] Error 1

This comes from cases in _FP_DIV that return a result described as
FP_CLS_ZERO or FP_CLS_INF and do not initialize the fractional part,
which is then operated on unconditionally in FP_TRUNC_COOKED before
being ignored by _FP_PACK_CANONICAL.

Clearly at this optimization level GCC cannot guarantee to be able to
determine that the fractional part is ultimately unused, so ignore the
error as with the earlier commits referred, letting compilation proceed.

	[BZ #19444]
	* sysdeps/ieee754/soft-fp/s_ddivl.c (__ddivl): Ignore errors
	from `-Wmaybe-uninitialized'.
	* sysdeps/ieee754/soft-fp/s_fdivl.c (__fdivl): Likewise.
2019-04-30 02:24:49 +01:00
Adhemerval Zanella
6cac323c8d powerpc: ceil/ceilf refactor
This patches consolidates all the powerpc ceil{f} implementations on
the generic sysdeps/powerpc/fpu/s_ceil{f}.  The generic implementation
uses either the compiler builts for ISA 2.03+ (which generates the frip
instruction) or a generic implementation which uses FP only operations.

It adds a generic implementation (round_to_integer.h) which is shared
with other rounding to integer routines.  The resulting code should be
similar in term os performance to previous assembly one.

The IFUNC organization for powerpc64 is also change to be enabled only
for powerpc64 and not for powerpc64le (since minium ISA of 2.08 does not
require the fallback generic implementation).

Checked on powerpc-linux-gnu (built without --with-cpu, with
--with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch),
powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+
and --disable-multi-arch).

	* sysdeps/powerpc/fpu/fenv_libc.h (__fesetround_inline_nocheck): New
	function.
	* sysdeps/powerpc/fpu/round_to_integer.h: New file.
	* sysdeps/powerpc/fpu/s_ceil.c: Likewise.
	* sysdeps/powerpc/fpu/s_ceilf.c: Likewise.
	* sysdeps/powerpc/powerpc32/fpu/s_ceil.S: Remove file.
	* sysdeps/powerpc/powerpc32/fpu/s_ceilf.S: Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
	(CFLAGS-s_ceil-power5+.c, CFLAGS-s_ceilf-power5+.c): New rule.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.S:
	Remove file.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.S:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-power5+.c:
	New file.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceil-ppc32.c:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-power5+.c:
	Likewise.
	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_ceilf-ppc32.c:
	Likewise.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_ceil.S: Remove file.
	* sysdeps/powerpc/powerpc32/power5+/fpu/s_ceilf.S: Likewise.
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile: New file.
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-power5+.c:
	Likewise.
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil-ppc64.c:
	Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil.c: Move to ...
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceil.c: ... here.
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-power5+.c: New
	file.
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf-ppc64.c:
	Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf.c: Move to ...
	* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_ceilf.c: ...
	* here.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
	(libm-sysdep_routines): Remove s_ceil-power5+, s_ceil-ppc64,
	s_ceilf-power5+, and s_ceilf-ppc64.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-power5+.S: Remove
	file.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceil-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-power5+.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_ceilf-ppc64.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_ceil.S: Likewise.
	* sysdeps/powerpc/powerpc64/fpu/s_ceilf.S: Likewise.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_ceil.S: Likewise.
	* sysdeps/powerpc/powerpc64/power5+/fpu/s_ceilf.S: Likewise.

Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
2019-04-29 08:43:37 -03:00
Adhemerval Zanella
c4c0848bbb powerpc: Remove power4 mpa optimization
This patch removes the POWER4 optimized mpa optimization used currently
on all powerpc targets.  In fact for newer chips, GCC generates *worse*
code than generic implementation as below.  One possibilty would to
add ifunc variants for the mpa routines (as x86_64), but it will add
complexity only for older chips (and one would need to check if
power5, power5+, and power6 do benefict from this optimization),
and only for specific implementation (since most used one such
as sin, cos, exp, pow where optimized to avoid calling the slow
multiprecision path).

* POWER9 patched
$ ./testrun.sh benchtests/bench-atan
  "atan": {
   "": {
    "duration": 5.12565e+09,
    "iterations": 1.552e+08,
    "max": 100.552,
    "min": 7.799,
    "mean": 33.0261
   },
   "144bits": {
    "duration": 5.12745e+09,
    "iterations": 825000,
    "max": 7517.17,
    "min": 6186.3,
    "mean": 6215.09
   }
  }
$ ./testrun.sh benchtests/bench-acos
  "acos": {
   "": {
    "duration": 5.21741e+09,
    "iterations": 1.269e+08,
    "max": 191.738,
    "min": 7.931,
    "mean": 41.1144
   },
   "slow": {
    "duration": 5.25999e+09,
    "iterations": 198000,
    "max": 26681.7,
    "min": 26463.6,
    "mean": 26565.6
   }
  }

* POWER9 master
$ ./testrun.sh benchtests/bench-atan
  "atan": {
   "": {
    "duration": 5.12815e+09,
    "iterations": 1.552e+08,
    "max": 134.788,
    "min": 7.803,
    "mean": 33.0422
   },
   "144bits": {
    "duration": 5.1209e+09,
    "iterations": 447000,
    "max": 11615.8,
    "min": 11301.8,
    "mean": 11456.2
   }
  }
$ ./testrun.sh benchtests/bench-acos
  "acos": {
   "": {
    "duration": 5.22272e+09,
    "iterations": 1.269e+08,
    "max": 115.981,
    "min": 7.931,
    "mean": 41.1562
   },
   "slow": {
    "duration": 5.28723e+09,
    "iterations": 96000,
    "max": 55434.1,
    "min": 54820.6,
    "mean": 55075.3
   }
  }

* POWER8 patched
$ taskset -c 16 ./testrun.sh benchtests/bench-acos
  "acos": {
   "": {
    "duration": 5.16398e+09,
    "iterations": 9.99e+07,
    "max": 174.408,
    "min": 8.645,
    "mean": 51.6915
   },
   "slow": {
    "duration": 5.16982e+09,
    "iterations": 96000,
    "max": 54830.5,
    "min": 53703.8,
    "mean": 53852.3
   }
  }
* POWER8 master
$ taskset -c 16 ./testrun.sh benchtests/bench-acos
  "acos": {
   "": {
    "duration": 5.17019e+09,
    "iterations": 9.99e+07,
    "max": 186.127,
    "min": 8.633,
    "mean": 51.7537
   },
   "slow": {
    "duration": 5.34225e+09,
    "iterations": 90000,
    "max": 60353.2,
    "min": 59155.3,
    "mean": 59358.4
   }
  }

* POWER7 patched
$ taskset -c 16 benchtests/bench-asin
  "asin": {
   "": {
    "duration": 5.15559e+09,
    "iterations": 6.5e+07,
    "max": 193.335,
    "min": 12.227,
    "mean": 79.3168
   },
   "slow": {
    "duration": 5.20538e+09,
    "iterations": 80000,
    "max": 65705.2,
    "min": 64299.4,
    "mean": 65067.3
   }
  }
* POWER7 master
$ taskset -c 16 benchtests/bench-asin
  "asin": {
   "": {
    "duration": 5.15446e+09,
    "iterations": 6.5e+07,
    "max": 184.575,
    "min": 12.226,
    "mean": 79.2994
   },
   "slow": {
    "duration": 5.20616e+09,
    "iterations": 80000,
    "max": 65705.1,
    "min": 64336.6,
    "mean": 65076.9
   }
  }

Checked on powerpc-linux-gnu (built without --with-cpu, with
--with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch),
powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+
and --disable-multi-arch).

	* sysdeps/powerpc/power4/fpu/Makefile: Remove file.
	* sysdeps/powerpc/power4/fpu/mpa-arch.h: Likewise.
	* sysdeps/powerpc/power4/fpu/mpa.c: Likewise.

Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
2019-04-29 08:43:03 -03:00
Yann Droneaud
f492fc99f4 <semaphore.h>: Add nonnull attributes
Except the following functions, NPTL implementation assume sem_t
argument (or other arguments) are not NULL, so they would benefit
from having the nonnull attribute.

- sem_close(): can cope with a NULL sem_t and return -1 with error EINVAL;
- sem_destroy(): does nothing at all

	* sysdeps/pthread/semaphore.h (sem_init): Add __nonnull attribute.
	(sem_destroy, sem_open, sem_close, sem_unlink): Likewise.
	(sem_wait, sem_timedwait, sem_trywait, sem_post): Likewise.
	(sem_getvalue): Likewise.
2019-04-29 10:11:35 +02:00
Florian Weimer
c57afec0a9 elf: Link sotruss-lib.so with BIND_NOW for --enable-bind-now
The audit module itself can be linked with BIND_NOW; it does not
affect its functionality.

This should complete the leftovers from commit
2d6ab5df3b ("Document and fix
--enable-bind-now [BZ #21015]").
2019-04-26 07:16:56 +02:00
Florian Weimer
a8ff215e56 Makeconfig: Move -Wl,-rpath-link options before library references
Previously, the -Wl,-rpath-link options came after the libraries
injected using LDLIBS-* variables on the link editor command line for
main programs.  As a result, it could happen that installed libraries
that reference glibc libraries used the installed glibc from the system
directories, instead of the glibc from the build tree.  This can lead to
link failures if the wrong version of libpthread.so.0 is used, for
instance, due to differences in the internal GLIBC_PRIVATE interfaces,
as seen with memusagestat and -lgd after commit
f9b645b4b0 ("memusagestat: use local glibc
when linking [BZ #18465]").

The isolation is necessarily imperfect because these installed
libraries are linked against the installed glibc in the system
directories.  However, in most cases, the built glibc will be newer
than the installed glibc, and this link is permitted because of the
ABI backwards compatibility glibc provides.
2019-04-26 07:16:50 +02:00
Florian Weimer
e30fb31c0a Makeconfig: Move $(CC) to +link command variables
This change is needed to add linker flags which come very early in the
command linke (before LDFLAGS) and are not applied to test programs
(only to installed programs).
2019-04-26 07:16:47 +02:00
David Abdurachmanov
deacca0054
riscv: remove DL_RO_DYN_SECTION
While working on enabling D front-end (GDC) in GCC we noticed that
druntime was segfaulting if it is linked dynamically. This was tracked
to DL_RO_DYN_SECTION.

DL_RO_DYN_SECTION lines seem to be copied from MIPS file (which is the
only user of it), but the comment doesn't apply to RISC-V. There is no
such requirement in RISC-V ABI.

        [BZ#24484]
	* sysdeps/riscv/ldsodefs.h: Remove DL_RO_DYN_SECTION as it is not
	required by RISC-V ABI.
2019-04-25 10:53:08 -07:00