platform/upstream/glibc.git
4 years agomath: Remove inline math tests
Adhemerval Zanella [Tue, 17 Mar 2020 18:46:29 +0000 (15:46 -0300)]
math: Remove inline math tests

With mathinline removal there is no need to keep building and testing
inline math tests.

The gen-libm-tests.py support to generate ULP_I_* is removed and all
libm-test-ulps files are updated to longer have the
i{float,double,ldouble} entries.  The support for no-test-inline is
also removed from both gen-auto-libm-tests and the
auto-libm-test-out-* were regenerated.

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

4 years agoRemove __LIBC_INTERNAL_MATH_INLINES
Adhemerval Zanella [Tue, 17 Mar 2020 16:58:10 +0000 (13:58 -0300)]
Remove __LIBC_INTERNAL_MATH_INLINES

With m68k mathinline.h removal the flag is not used anymore.

Checked with a m68k-linux-gnu build/check.

4 years agomath: Remove mathinline
Adhemerval Zanella [Mon, 16 Mar 2020 19:28:39 +0000 (16:28 -0300)]
math: Remove mathinline

With m68k bits moved to internal headers, no architectures export
additional optimizations on mathinline.

4 years agom68k: Remove mathinline.h
Adhemerval Zanella [Mon, 16 Mar 2020 18:58:45 +0000 (15:58 -0300)]
m68k: Remove mathinline.h

This is similar to x86 (da75c1b180f9355a) and powerpc (32ea72999693b98e)
mathinline.h removal.  The required macros to build the fpu routines
are moved to mathimpl.h, while the inline optimization macros for
atan, tanh, rint, log1p, significand, trunc, floor, ceil, isinf,
finite, scalbn, isnan, scalbln, nearbyint, lrint, and sincos are removed.

The gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94204 was
created to track builtin support.

Checked with a build against m68k-linux-gnu, resulting binaries
are similar with and without the patch.

4 years agooc_FR locale: Fix spelling of Thursday (bug 25639)
Rafał Lużyński [Wed, 18 Mar 2020 23:09:29 +0000 (00:09 +0100)]
oc_FR locale: Fix spelling of Thursday (bug 25639)

As reported by a native speaker:

Thursday: "dijóus" -> "dijòus" (also confirmed by CLDR)

4 years agox86: Remove ARCH_CET_LEGACY_BITMAP [BZ #25397]
H.J. Lu [Wed, 18 Mar 2020 11:35:54 +0000 (04:35 -0700)]
x86: Remove ARCH_CET_LEGACY_BITMAP [BZ #25397]

Since legacy bitmap doesn't cover jitted code generated by legacy JIT
engine, it isn't very useful.  This patch removes ARCH_CET_LEGACY_BITMAP
and treats indirect branch tracking similar to shadow stack by removing
legacy bitmap support.

Tested on CET Linux/x86-64 and non-CET Linux/x86-64.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 years agoFix build with GCC 10 when long double = double.
Joseph Myers [Tue, 17 Mar 2020 22:57:42 +0000 (22:57 +0000)]
Fix build with GCC 10 when long double = double.

On platforms where long double has the same ABI as double, glibc
defines long double functions as aliases for the corresponding double
functions.  The declarations of those functions in <math.h> are
disabled to avoid problems with aliases having incompatible types, but
GCC 10 now gives errors for incompatible types when the long double
function is known to GCC as a built-in function, not just when there
is an incompatible header declaration.

This patch fixes those errors by using appropriate
-fno-builtin-<function> options to compile the double functions.  The
list of CFLAGS-* settings is an appropriately adapted version of that
in sysdeps/ieee754/ldbl-opt/Makefile used there for building nldbl-*.c
files; in particular, the options are used even if GCC does not
currently have a built-in function of a given function, so that adding
such a built-in function in future will not break the glibc build.
Thus, various of the CFLAGS-* settings are only for future-proofing
and may not currently be needed (and it's possible some could be
irrelevant for other reasons).

Tested with build-many-glibcs.py for arm-linux-gnueabi (compilers and
glibcs builds), where it fixes the build that previously failed.

4 years agonscd/cachedumper.c : fix whitespace
DJ Delorie [Tue, 17 Mar 2020 18:03:43 +0000 (14:03 -0400)]
nscd/cachedumper.c : fix whitespace

4 years agoFix nscd/cachedumper.c compile errors
DJ Delorie [Sat, 14 Mar 2020 04:21:40 +0000 (00:21 -0400)]
Fix nscd/cachedumper.c compile errors

4 years agomanual: Fix inconsistent declaration of wcsrchr [BZ #24655]
Girish Joshi [Fri, 6 Mar 2020 19:47:01 +0000 (01:17 +0530)]
manual: Fix inconsistent declaration of wcsrchr [BZ #24655]

Reviewed-by: DJ Delorie <dj@redhat.com>
4 years agonscd: add cache dumper
DJ Delorie [Wed, 19 Feb 2020 17:31:09 +0000 (12:31 -0500)]
nscd: add cache dumper

4 years agoparse_tunables: Fix typo in comment
Jonathan Wakely [Fri, 13 Mar 2020 10:27:23 +0000 (10:27 +0000)]
parse_tunables: Fix typo in comment

4 years agoldconfig: trace origin paths with -v
DJ Delorie [Wed, 19 Feb 2020 17:31:38 +0000 (12:31 -0500)]
ldconfig: trace origin paths with -v

With this patch, -v turns on a "from" trace for each directory
searched, that tells you WHY that directory is being searched -
is it a builtin, from the command line, or from some config file?

4 years agotest-container: print errno when execvp fails
Michael Hudson-Doyle [Wed, 11 Mar 2020 00:05:25 +0000 (13:05 +1300)]
test-container: print errno when execvp fails

I'm debugging a situation where lots of tests using test-container fail
and it's possible knowing errno would help understand why.

Reviewed-by: DJ Delorie <dj@redhat.com>
4 years ago[AArch64] Improve integer memcpy
Wilco Dijkstra [Wed, 11 Mar 2020 17:15:25 +0000 (17:15 +0000)]
[AArch64] Improve integer memcpy

Further optimize integer memcpy.  Small cases now include copies up
to 32 bytes.  64-128 byte copies are split into two cases to improve
performance of 64-96 byte copies.  Comments have been rewritten.

4 years agoAdd NEWS entry for CVE-2020-10029 (bug 25487)
Aurelien Jarno [Wed, 4 Mar 2020 21:32:32 +0000 (22:32 +0100)]
Add NEWS entry for CVE-2020-10029 (bug 25487)

4 years agogcc PR 89877: miscompilation due to missing cc clobber in longlong.h macros
Vineet Gupta [Thu, 28 Mar 2019 22:24:35 +0000 (15:24 -0700)]
gcc PR 89877: miscompilation due to missing cc clobber in longlong.h macros

simple test such as below was failing.

| void main(int argc, char *argv[])
| {
|    size_t total_time = 115424;                       // expected 115.424
|    double secs = (double)total_time/(double)1000;
|    printf("%s %d %lf\n", "secs", total_time, secs);  // prints 113.504
|    printf("%d\n", (size_t)secs);
| }

The printf eventually called into glibc stdlib/divrem.c:__mpn_divrem()
which uses the __arc__ specific inline asm macros from longlong.h which
were causing miscompilation.

include/
2019-03-28  Vineet Gupta <vgupta@synopsys.com>

PR 89877

* longlong.h [__arc__] (add_ssaaaa): Add cc clobber
(sub_ddmmss): Likewise.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
4 years agomips: Fix wrong INTERNAL_SYSCALL_ERROR_P check from bc2eb9321e
Adhemerval Zanella [Tue, 10 Mar 2020 20:24:14 +0000 (17:24 -0300)]
mips: Fix wrong INTERNAL_SYSCALL_ERROR_P check from bc2eb9321e

Checked on mips64-linux-gnu.

4 years agoelf: Fix wrong indentation from commit eb447b7b4b
Adhemerval Zanella [Tue, 10 Mar 2020 19:11:29 +0000 (16:11 -0300)]
elf: Fix wrong indentation from commit eb447b7b4b

4 years agoy2038: linux: Provide __futimesat64 implementation
Lukasz Majewski [Sun, 16 Feb 2020 22:42:14 +0000 (23:42 +0100)]
y2038: linux: Provide __futimesat64 implementation

This conversion patch for supporting 64 bit time for futimesat only differs
from the work performed for futimes (when providing __futimes64) with passing
also the file name (and path) to utimensat.

All the design and conversion decisions are exactly the same as for futimens
conversion.

4 years agoy2038: linux: Provide __lutimes64 implementation
Lukasz Majewski [Sun, 16 Feb 2020 22:02:05 +0000 (23:02 +0100)]
y2038: linux: Provide __lutimes64 implementation

This conversion patch for supporting 64 bit time for lutimes mostly differs from
the work performed for futimes (when providing __futimes64) with adding the
AT_SYMLINK_NOFOLLOW flag to utimensat.
It also supports passing file name instead of file descriptor number, but this
is not relevant for utimensat used to implement it.

All the design and conversion decisions are exactly the same as for futimens
conversion.

4 years agoy2038: linux: Provide __futimes64 implementation
Lukasz Majewski [Sun, 16 Feb 2020 08:32:42 +0000 (09:32 +0100)]
y2038: linux: Provide __futimes64 implementation

This patch provides new __futimes64 explicit 64 bit function for setting file's
64 bit attributes for access and modification time (by specifying file
descriptor number).

Internally, the __utimensat64_helper function is used. This patch is necessary
for having architectures with __WORDSIZE == 32 Y2038 safe.

Moreover, a 32 bit version - __futimes has been refactored to internally use
__futimes64.

The __futimes is now supposed to be used on systems still supporting 32
bit time (__TIMESIZE != 64) - hence the necessary conversion of struct timeval
to 64 bit struct __timeval64.

The check if struct timevals' usec fields are in the range between 0 and 1000000
has been removed as Linux kernel performs it internally in the implementation
of utimensat (the conversion between struct __timeval64 and __timespec64 is not
relevant for this particular check).

Last but not least, checks for tvp{64} not being NULL have been preserved from
the original code as some legacy user space programs may rely on it.

Build tests:
./src/scripts/build-many-glibcs.py glibcs

Run-time tests:
- Run specific tests on ARM/x86 32bit systems (qemu):
  https://github.com/lmajewski/meta-y2038 and run tests:
  https://github.com/lmajewski/y2038-tests/commits/master

Above tests were performed with Y2038 redirection applied as well as without to
test the proper usage of both __futimes64 and __futimes.

4 years agoy2038: fix: Add missing libc_hidden_def for __futimens64
Lukasz Majewski [Tue, 3 Mar 2020 10:21:11 +0000 (11:21 +0100)]
y2038: fix: Add missing libc_hidden_def for __futimens64

The libc_hidden_def () declaration for __futimens64 function was missing,
so it is added in this patch.

4 years agosparc: Move sigreturn stub to assembly
Adhemerval Zanella [Thu, 5 Mar 2020 16:38:24 +0000 (13:38 -0300)]
sparc: Move sigreturn stub to assembly

It seems that some gcc versions might generates a stack frame for the
sigreturn stub requires on sparc signal handling.  For instance:

  $ cat test.c
  #define _GNU_SOURCE
  #include <sys/syscall.h>

  __attribute__ ((__optimize__ ("-fno-stack-protector")))
  void
  __sigreturn_stub (void)
  {
    __asm__ ("mov %0, %%g1\n\t"
            "ta  0x10\n\t"
            : /* no outputs */
            : "i" (SYS_rt_sigreturn));
  }
  $ gcc -v
  [...]
  gcc version 9.2.1 20200224 (Debian 9.2.1-30)
  $ gcc -O2 -m64 test.c -S -o -
  [...]
    __sigreturn_stub:
          save    %sp, -176, %sp
  #APP
  ! 9 "t.c" 1
          mov 101, %g1
          ta  0x10

  ! 0 "" 2
  #NO_APP
          .size   __sigreturn_stub, .-__sigreturn_stub

As indicated by kernel developers [1], the sigreturn stub can not change
the register window or the stack pointer since the kernel has setup the
restore frame at a precise location relative to the stack pointer when
the stub is invoked.

I tried to play with some compiler flags and even with _Noreturn and
__builtin_unreachable after the asm does not help (and Sparc does not
support naked functions).

To avoid similar issues, as the stack-protector support also have
stumbled, this patch moves the implementation of the sigreturn stubs to
assembly.

Checked on sparcv9-linux-gnu and sparc64-linux-gnu with gcc 9.2.1
and gcc 7.5.0.

[1] https://lkml.org/lkml/2016/5/27/465

4 years agoldbl-128ibm: Let long double files have specific compiler flags
Tulio Magno Quites Machado Filho [Thu, 15 Feb 2018 17:44:47 +0000 (15:44 -0200)]
ldbl-128ibm: Let long double files have specific compiler flags

Soon, powerpc64le will need to provide extra compiler flags to the long
double files in order to continue to build using the IBM 128-bit
extended floating point type as long double.

4 years agoldbl-128ibm-compat: Add tests for IBM long double functions
Rajalakshmi Srinivasaraghavan [Mon, 28 May 2018 21:56:35 +0000 (18:56 -0300)]
ldbl-128ibm-compat: Add tests for IBM long double functions

This patch creates test-ibm128* tests from the long double function tests.
In order to explicitly test IBM long double functions -mabi=ibmlongdouble is
added to CFLAGS.

Likewise, update the test headers to correct choose ULPs when redirects
are enabled.

Co-authored-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Co-authored-by: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
4 years agopowerpc: Fix feraiseexcept and feclearexcept macros
Matheus Castanho [Tue, 3 Mar 2020 18:20:38 +0000 (15:20 -0300)]
powerpc: Fix feraiseexcept and feclearexcept macros

A recent change to fenvinline.h modified the check if __e is a
a power of 2 inside feraiseexcept and feclearexcept macros.  It
introduced the use of the powerof2 macro but also removed the
if statement checking whether __e != 0 before issuing an mtfsb*
instruction.  This is problematic because powerof2 (0) evaluates
to 1 and without the removed if __e is allowed to be 0 when
__builtin_clz is called.  In that case the value 32 is passed
to __MTFSB*, which is invalid.

This commit uses __builtin_popcount instead of powerof2 to fix this
issue and avoid the extra check for __e != 0.  This was the approach
used by the initial versions of that previous patch.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
4 years agoarm: Fix softp-fp Implies (BZ #25635)
Adhemerval Zanella [Thu, 5 Mar 2020 13:14:41 +0000 (13:14 +0000)]
arm: Fix softp-fp Implies (BZ #25635)

The commit "arm: Split BE/LE abilist"
(1673ba87fefe019c834c09d33673d1d453ea698d) changed the soft-fp order for
ARM selection when __SOFTFP__ is defined by the compiler.

On 2.30 the sysdeps order is:

2.30
sysdeps/unix/sysv/linux/arm
sysdeps/arm/nptl
sysdeps/unix/sysv/linux
sysdeps/nptl
sysdeps/pthread
sysdeps/gnu
sysdeps/unix/inet
sysdeps/unix/sysv
sysdeps/unix/arm
sysdeps/unix
sysdeps/posix
sysdeps/arm/nofpu
sysdeps/ieee754/soft-fp
sysdeps/arm
sysdeps/wordsize-32
sysdeps/ieee754/flt-32
sysdeps/ieee754/dbl-64
sysdeps/ieee754
sysdeps/generic

While on master is:

sysdeps/unix/sysv/linux/arm/le
sysdeps/unix/sysv/linux/arm
sysdeps/arm/nptl
sysdeps/unix/sysv/linux
sysdeps/nptl
sysdeps/pthread
sysdeps/gnu
sysdeps/unix/inet
sysdeps/unix/sysv
sysdeps/unix/arm
sysdeps/unix
sysdeps/posix
sysdeps/arm/le
sysdeps/arm
sysdeps/wordsize-32
sysdeps/ieee754/flt-32
sysdeps/ieee754/dbl-64
sysdeps/arm/nofpu
sysdeps/ieee754/soft-fp
sysdeps/ieee754
sysdeps/generic

It make the build select some routines (fadd, fdiv, fmul, fsub, and fma)
on ieee754/flt-32 and ieee754/dbl-64 that requires fenv support to be
correctly rounded which in turns lead to math failures since the
__SOFTFP__ does not have fenv support.

With this patch the order is now:

sysdeps/unix/sysv/linux/arm/le
sysdeps/unix/sysv/linux/arm
sysdeps/arm/nptl
sysdeps/unix/sysv/linux
sysdeps/nptlsysdeps/pthread
sysdeps/gnu
sysdeps/unix/inet
sysdeps/unix/sysv
sysdeps/unix/arm
sysdeps/unix
sysdeps/posix
sysdeps/arm/le/nofpu
sysdeps/arm/nofpu
sysdeps/ieee754/soft-fp
sysdeps/arm/le
sysdeps/arm
sysdeps/wordsize-32
sysdeps/ieee754/flt-32
sysdeps/ieee754/dbl-64
sysdeps/ieee754
sysdeps/generic

Checked on arm-linux-gnuaebi.

4 years agoRemove reference of --without-fp on configure
Adhemerval Zanella [Thu, 5 Mar 2020 12:41:42 +0000 (12:41 +0000)]
Remove reference of --without-fp on configure

4 years agolinux/sysipc: Include linux/posix_types.h for __kernel_mode_t
Adhemerval Zanella [Fri, 6 Mar 2020 12:25:32 +0000 (09:25 -0300)]
linux/sysipc: Include linux/posix_types.h for __kernel_mode_t

The posix_types.h (where __kernel_mode_t is defined) is included
implicitly, which might not happen on older kernels.

4 years agoImprove IFUNC check [BZ #25506]
Fangrui Song [Wed, 5 Feb 2020 05:55:44 +0000 (21:55 -0800)]
Improve IFUNC check [BZ #25506]

GNU ld's RISCV port does not support IFUNC. ld -no-pie produces no
relocation and the test passed incorrectly. Be more rigid by testing
IRELATIVE explicitly.

Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agolinux: Clear mode_t padding bits (BZ#25623)
Adhemerval Zanella [Tue, 3 Mar 2020 17:59:13 +0000 (14:59 -0300)]
linux: Clear mode_t padding bits (BZ#25623)

The kernel might not clear the padding value for the ipc_perm mode
fields in compat mode (32 bit running on a 64 bit kernel).  It was
fixed on v4.14 when the ipc compat code was refactored to move
(commits 553f770ef71b469391684626c0ebccb6fa1e).

Although it is most likely a kernel issue, it was shown only due
BZ#18231 fix which made all the SysVIPC mode_t 32-bit regardless of
the kABI.

This patch fixes it by explicitly zeroing the upper bits for such
cases.  The __ASSUME_SYSVIPC_BROKEN_MODE_T case already handles
it with the shift.

(The aarch64 ipc_priv.h is superflous since
__ASSUME_SYSVIPC_DEFAULT_IPC_64 is now defined as default).

Checked on i686-linux-gnu on 3.10 and on 4.15 kernel.

4 years agolinux: Remove aarch64 ipc_priv.h
Adhemerval Zanella [Wed, 4 Mar 2020 12:06:47 +0000 (09:06 -0300)]
linux: Remove aarch64 ipc_priv.h

The aarch64 ipc_priv.h is superflous since
__ASSUME_SYSVIPC_DEFAULT_IPC_64 is now defined as default.

4 years agoLinux: Use __fstatat64 in fchmodat implementation
Florian Weimer [Thu, 5 Mar 2020 12:27:53 +0000 (13:27 +0100)]
Linux: Use __fstatat64 in fchmodat implementation

fstatat64 depends on inlining to produce the desired __fxstatat64
call, which does not happen with -Os, leading to a link failure
with an undefined reference to fstatat64.  __fxstatat64 has a macro
definition in include/sys/stat.h and thus avoids the problem.

4 years agoLinux: Use AT_FDCWD in utime, utimes when calling utimensat
Florian Weimer [Thu, 5 Mar 2020 15:09:52 +0000 (16:09 +0100)]
Linux: Use AT_FDCWD in utime, utimes when calling utimensat

0 is a valid descriptor without any special meaning.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agoS390: Remove backchain-based fallback and use generic backtrace.c.
Stefan Liebler [Thu, 5 Mar 2020 11:52:19 +0000 (12:52 +0100)]
S390: Remove backchain-based fallback and use generic backtrace.c.

After recent discussions:
- "[PATCH] s390: Remove backchain-based fallback from backtrace"
  https://www.sourceware.org/ml/libc-alpha/2020-02/msg00287.html

- "Re: [PATCH 07/11] s390: Implement backtrace on top of <unwind-link.h>"
  https://www.sourceware.org/ml/libc-alpha/2020-02/msg00637.html

We've checked and decided to remove the backchain:
We don't know of any environments without libgcc. Thus the backchain
unwinder is not used. If somebody builds with -mbackchain and without
fasynchronous-unwind-tables and has libgcc installed, then the
libgcc unwinder is called but not the backchain-based fallback.

This step allows to get rid of the s390x specific backtrace.c files at all.
Furthermore the now used debug/backtrace.c version has some more
advantages:
- Free all resources if necessary. (libc_freeres_fn)
- Remove NULL address above _start.
- Check whether we make any progress while getting addresses.

4 years agomanual: Fix wrong declaration of wcschr [BZ #24654]
Girish Joshi [Thu, 5 Mar 2020 08:31:43 +0000 (09:31 +0100)]
manual: Fix wrong declaration of wcschr [BZ #24654]

4 years agomanual: Fix typo in parse_printf_format example [BZ #24638]
Girish Joshi [Wed, 4 Mar 2020 12:20:07 +0000 (13:20 +0100)]
manual: Fix typo in parse_printf_format example [BZ #24638]

4 years agoUpdate translations
Siddhesh Poyarekar [Wed, 4 Mar 2020 01:57:32 +0000 (07:27 +0530)]
Update translations

Incorporated updated translations from translationproject.org

4 years agoConvert Python scripts to Python 3
Alistair Francis [Sat, 4 Jan 2020 18:03:17 +0000 (10:03 -0800)]
Convert Python scripts to Python 3

Change all of the #! lines in Python scripts that are called from
Makefiles to reference /usr/bin/python3.

All of the scripts called from Makefiles are already run with Python 3,
so let's make sure they are explicitly using Python 3 if called
manually.

4 years agoalpha: Do not build with -fpic
Florian Weimer [Tue, 3 Mar 2020 14:41:49 +0000 (15:41 +0100)]
alpha: Do not build with -fpic

The combination of GCC 10 and binutils 2.35 (both unreleased) is no
longer able to link the dynamic linker, due to a GP16 relocation
overflow error:

glibc/alpha-linux-gnu/elf/librtld.os: in function `calloc': glibc/elf/../include/rtld-malloc.h:44:(.text+0xd98): relocation truncated to fit: GPREL16 against symbol `__rtld_calloc' defined in .data.rel.ro section in glibc/alpha-linux-gnu/elf/librtld.os
glibc/alpha-linux-gnu/elf/librtld.os: in function `malloc': glibc/elf/../include/rtld-malloc.h:56:(.text+0x2978): relocation truncated to fit: GPREL16 against symbol `__rtld_malloc' defined in .data.rel.ro section in glibc/alpha-linux-gnu/elf/librtld.os

This is arguably a linker bug; the object files and their section size
requirements look reasonable enough.

Using -fPIC (the default) works around this issue.

4 years agoy2038: linux: Provide __utime64 implementation
Lukasz Majewski [Thu, 6 Feb 2020 12:25:35 +0000 (13:25 +0100)]
y2038: linux: Provide __utime64 implementation

This patch replaces auto generated wrapper (as described in
sysdeps/unix/sysv/linux/syscalls.list) for utime with one which adds extra
support for setting file's access and modification 64 bit time on machines
with __TIMESIZE != 64.

Internally, the __utimensat_time64 helper function is used. This patch is
necessary for having architectures with __WORDSIZE == 32 && __TIMESIZE != 64
Y2038 safe.

Moreover, a 32 bit version - __utime has been refactored to internally use
__utime64.
The __utime is now supposed to be used on systems still supporting 32
bit time (__TIMESIZE != 64) - hence the necessary conversion between struct
utimbuf and struct __utimbuf64.

Build tests:
./src/scripts/build-many-glibcs.py glibcs

Run-time tests:
- Run specific tests on ARM/x86 32bit systems (qemu):
  https://github.com/lmajewski/meta-y2038 and run tests:
  https://github.com/lmajewski/y2038-tests/commits/master

Above tests were performed with Y2038 redirection applied as well as
without to test proper usage of both __utime64 and __utime.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoy2038: linux: Provide __utimes64 implementation
Lukasz Majewski [Thu, 6 Feb 2020 11:34:48 +0000 (12:34 +0100)]
y2038: linux: Provide __utimes64 implementation

This patch provides new __utimes64 explicit 64 bit function for setting file's
64 bit attributes for access and modification time.

Internally, the __utimensat64_helper function is used. This patch is necessary
for having architectures with __WORDSIZE == 32 Y2038 safe.

Moreover, a 32 bit version - __utimes has been refactored to internally use
__utimes64.

The __utimes is now supposed to be used on systems still supporting 32
bit time (__TIMESIZE != 64) - hence the necessary conversion of struct
timeval to 64 bit struct __timeval64.

Build tests:
./src/scripts/build-many-glibcs.py glibcs

Run-time tests:
- Run specific tests on ARM/x86 32bit systems (qemu):
  https://github.com/lmajewski/meta-y2038 and run tests:
  https://github.com/lmajewski/y2038-tests/commits/master

Above tests were performed with Y2038 redirection applied as well as without
to test proper usage of both __utimes64 and __utimes.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoy2038: Introduce struct __utimbuf64 - new internal glibc type
Lukasz Majewski [Thu, 6 Feb 2020 13:25:30 +0000 (14:25 +0100)]
y2038: Introduce struct __utimbuf64 - new internal glibc type

This type is a glibc's "internal" type to store file's access and modification
times in __time64_t rather than __time_t, which makes it Y2038-proof.

Build tests:
./src/scripts/build-many-glibcs.py glibcs

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
4 years agomicroblaze: vfork is always available
Florian Weimer [Tue, 3 Mar 2020 11:53:10 +0000 (12:53 +0100)]
microblaze: vfork is always available

Due to the built-in tables, __NR_vfork is always defined, so the
fork-based fallback code is never used.

(It appears that the vfork system call was wired up when the port was
contributed to the kernel.)

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agom68k: getpagesize syscall number is always available
Florian Weimer [Sun, 9 Feb 2020 16:02:48 +0000 (17:02 +0100)]
m68k: getpagesize syscall number is always available

Due to the built-in tables, __NR_getpagesize is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: epoll_pwait syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:51:14 +0000 (12:51 +0100)]
Linux: epoll_pwait syscall number is always available

Due to the built-in tables, __NR_epoll_pwait is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agox86_64: Do not define __NR_semtimedop in <sysdep.h>
Florian Weimer [Tue, 3 Mar 2020 11:50:55 +0000 (12:50 +0100)]
x86_64: Do not define __NR_semtimedop in <sysdep.h>

The definition is always available from the built-in system call table.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoia64: Do not define __NR_semtimedop in <sysdep.h>
Florian Weimer [Tue, 3 Mar 2020 11:50:35 +0000 (12:50 +0100)]
ia64: Do not define __NR_semtimedop in <sysdep.h>

The definition is always available from the built-in system call table.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: open_by_handle_at syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:50:07 +0000 (12:50 +0100)]
Linux: open_by_handle_at syscall number is always available

Due to the built-in tables, __NR_open_by_handle_at is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: set_robust_list syscall number is always available
Florian Weimer [Sun, 9 Feb 2020 15:38:33 +0000 (16:38 +0100)]
Linux: set_robust_list syscall number is always available

Due to the built-in tables, __NR_set_robust_list is always defined
(although it may not be available at run time).

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: pciconfig_iobase syscall number is always available on alpha
Florian Weimer [Tue, 3 Mar 2020 11:20:59 +0000 (12:20 +0100)]
Linux: pciconfig_iobase syscall number is always available on alpha

Due to the built-in tables, __NR_pciconfig_iobase is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: getdents64 syscall number is always available on MIPS
Florian Weimer [Tue, 3 Mar 2020 11:20:31 +0000 (12:20 +0100)]
Linux: getdents64 syscall number is always available on MIPS

Due to the built-in tables, __NR_getdents64 is always defined,
although it may not be supported at run time.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: Clean up preadv2, pwritev2 system call names
Florian Weimer [Tue, 3 Mar 2020 11:18:22 +0000 (12:18 +0100)]
Linux: Clean up preadv2, pwritev2 system call names

With the built-in tables __NR_preadv2 and __NR_pwritev2 are always
defined.

The kernel has never defined __NR_preadv64v2 and __NR_pwritev64v2
and is unlikely to do so, given that the preadv2 and pwritev2 system
calls themselves are 64-bit.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: exit_group syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:17:24 +0000 (12:17 +0100)]
Linux: exit_group syscall number is always available

Due to the built-in tables, __NR_exit_group is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: set_tid_address syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:16:55 +0000 (12:16 +0100)]
Linux: set_tid_address syscall number is always available

Due to the built-in tables, __NR_set_tid_address is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: pkey_mprotect syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:16:35 +0000 (12:16 +0100)]
Linux: pkey_mprotect syscall number is always available

Due to the built-in tables, __NR_pkey_mprotect is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: rt_sigqueueinfo syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:16:15 +0000 (12:16 +0100)]
Linux: rt_sigqueueinfo syscall number is always available

Due to the built-in tables, __NR_rt_sigqueueinfo is always defined.

sysdeps/pthread/time_routines.c is not updated because it is shared with
Hurd.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: getrandom syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:15:38 +0000 (12:15 +0100)]
Linux: getrandom syscall number is always available

Due to the built-in tables, __NR_getrandom is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: Clean up preadv, pwritev system call names
Florian Weimer [Tue, 3 Mar 2020 11:15:06 +0000 (12:15 +0100)]
Linux: Clean up preadv, pwritev system call names

The names __NR_preadv64, __NR_pwritev64 appear to be a glibc invention.
With the built-in tables, __NR_preadv and __NR_pwritev are always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: Clean up pread64/pwrite64 system call names
Florian Weimer [Sun, 9 Feb 2020 15:07:00 +0000 (16:07 +0100)]
Linux: Clean up pread64/pwrite64 system call names

Linux removed the last definitions of __NR_pread and __NR_pwrite
in commit 4ba66a9760722ccbb691b8f7116cad2f791cca7b, the removal
of the blackfin port.  All architectures now define __NR_pread64 and
__NR_pwrite64 only.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: sigaltstack syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:13:29 +0000 (12:13 +0100)]
Linux: sigaltstack syscall number is always available

Due to the built-in tables, __NR_sigaltstack is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: sched_getaffinity syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:13:07 +0000 (12:13 +0100)]
Linux: sched_getaffinity syscall number is always available

Due to the built-in tables, __NR_sched_getaffinity is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: sched_setaffinity syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:12:42 +0000 (12:12 +0100)]
Linux: sched_setaffinity syscall number is always available

Due to the built-in tables, __NR_sched_setaffinity is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: statx syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:12:11 +0000 (12:12 +0100)]
Linux: statx syscall number is always available

Due to the built-in tables, __NR_statx is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: mq_* syscall numbers are always available
Florian Weimer [Tue, 3 Mar 2020 11:11:49 +0000 (12:11 +0100)]
Linux: mq_* syscall numbers are always available

Due to the built-in tables, __NR_mq_getsetattr, __NR_mq_notify,
__NR_mq_open, __NR_mq_timedreceive, __NR_mq_timedsend, __NR_mq_unlink
are always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: mlock2 syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:11:26 +0000 (12:11 +0100)]
Linux: mlock2 syscall number is always available

Due to the built-in tables, __NR_mlock2 is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: copy_file_range syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:11:01 +0000 (12:11 +0100)]
Linux: copy_file_range syscall number is always available

Due to the built-in tables, __NR_copy_file_range is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoLinux: renameat2 syscall number is always available
Florian Weimer [Tue, 3 Mar 2020 11:06:39 +0000 (12:06 +0100)]
Linux: renameat2 syscall number is always available

Due to the built-in tables, __NR_renameat2 is always defined.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agobuild-many-glibcs.py: Add list-compilers, list-glibcs commands
Florian Weimer [Sat, 29 Feb 2020 11:44:31 +0000 (12:44 +0100)]
build-many-glibcs.py: Add list-compilers, list-glibcs commands

These commands are helpful for scripting the distribution of
build-many-glibcs.py runs across multiple builders.

4 years agobuild-many-glibcs.py: Add --shallow option
Florian Weimer [Fri, 28 Feb 2020 11:32:28 +0000 (12:32 +0100)]
build-many-glibcs.py: Add --shallow option

The history is not used by build-many-glibcs.py itself.
--replace-sources deletes an existing source tree before switching
the version.  But some users prefer to have the full history
available, therefore make shallow clones optional with the --shallow
option.

4 years agoFixed typo in run_command_array() in support/shell-container.c
Girish Joshi [Mon, 2 Mar 2020 20:19:29 +0000 (15:19 -0500)]
Fixed typo in run_command_array() in support/shell-container.c

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

4 years agoAdd missing libc_hidden_def for __utimensat64
Andreas Schwab [Mon, 2 Mar 2020 15:25:24 +0000 (16:25 +0100)]
Add missing libc_hidden_def for __utimensat64

4 years agoelf: Add elf/check-wx-segment, a test for the presence of WX segments
Florian Weimer [Mon, 2 Mar 2020 13:24:27 +0000 (14:24 +0100)]
elf: Add elf/check-wx-segment, a test for the presence of WX segments

Writable, executable segments defeat security hardening.  The
existing check for DT_TEXTREL does not catch this.

hppa and SPARC currently keep the PLT in an RWX load segment.

4 years agoi386: Use comdat instead of .gnu.linkonce for i386 setup pic register (BZ #20543)
Adhemerval Zanella [Fri, 28 Feb 2020 13:46:14 +0000 (10:46 -0300)]
i386: Use comdat instead of .gnu.linkonce for i386 setup pic register (BZ #20543)

GCC has moved from using .gnu.linkonce for i386 setup pic register with
minimum current version (as for binutils minimum binutils that support
comdat).

Trying to pinpoint when binutils has added comdat support for i686, it
seems it was around 2004 [1].  I also checking with some ancient
binutils older than 2.16 I see:

test.o: In function `__x86.get_pc_thunk.bx':
test.o(.text.__x86.get_pc_thunk.bx+0x0): multiple definition of `__x86.get_pc_thunk.bx'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../i386-linux-gnu/crti.o(.gnu.linkonce.t.__x86.get_pc_thunk.bx+0x0): first defined here

Which seems that such version can not handle either comdat at all or
a mix of linkonce and comdat.  For binutils 2.16.1 I am getting a
different issue trying to link a binary with and more recent
ctri.o (unrecognized relocation (0x2b) in section `.init', which is
R_386_GOT32X and old binutils won't generate it anyway).

So I think that either unlikely someone will use an older binutils than
the one used to glibc and even this scenario may fail with some issue
as the R_386_GOT32X.  Also, 2.16.1 is quite old and not really supported
(glibc itself required 2.25).

Checked on i686-linux-gnu.

[1] https://gcc.gnu.org/ml/gcc/2004-05/msg00030.html

4 years agoldbl-128ibm-compat: link tst-ldbl-efgcvt against loader too
Paul E. Murphy [Thu, 27 Feb 2020 19:57:57 +0000 (13:57 -0600)]
ldbl-128ibm-compat: link tst-ldbl-efgcvt against loader too

This also requires the linker workaround to ensure everything links
correctly.  See comment in sysdeps/powerpc/powerpc64/le/Makefile
for details.

4 years agoldbl-128ibm-compat: enforce ibm128 on compat tests
Paul E. Murphy [Fri, 7 Feb 2020 20:06:53 +0000 (14:06 -0600)]
ldbl-128ibm-compat: enforce ibm128 on compat tests

For lack of a more comprehensive solution, tack on the ibm128 ABI
compiler options for the totalorder{,mag}l compat tests which exist
prior to enabling this feature.

4 years agoldbl-128ibm-compat: Provide nexttoward functions
Gabriel F. T. Gomes [Tue, 5 Jun 2018 19:54:40 +0000 (16:54 -0300)]
ldbl-128ibm-compat: Provide nexttoward functions

The functions in the nexttoward family are special, in the sense that
they always have a long double argument, regardless of their suffix
(i.e.: nexttowardf and nexttoward have a long double argument, besides
the float and double arguments).

On top of that, they are also special because nexttoward functions are
not part of the _FloatN API, hence __nexttowardf128 do not exist.

This patch adds 4 new function implementations for the new long double
format:

  __nexttoward_to_ieee128
  __nexttowardf_to_ieee128
  __nexttowardieee128 (as an alias to __nextafterieee128)

Likewise, rename "long double" "_Float128" in shared ldbl-128
files to ensure correct type is used irrespective of ABI
switches.

Thank you to those who helped out with this patch:

Co-Authored-By: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
4 years agoldbl-128ibm-compat: Provide a significand implementation
Tulio Magno Quites Machado Filho [Mon, 18 Jun 2018 23:57:14 +0000 (20:57 -0300)]
ldbl-128ibm-compat: Provide a significand implementation

Reuse the template in order to provide the global symbol
__significandieee128.

4 years agoldbl-128ibm-compat: Redirect complex math functions
Rajalakshmi Srinivasaraghavan [Wed, 4 Apr 2018 01:45:24 +0000 (07:15 +0530)]
ldbl-128ibm-compat: Redirect complex math functions

The API doesn't change, i.e. compilers using a long double format compatible
with the IEEE 128-bit extended precision format are redirected from *l
functions to __*ieee128 symbols using the same mechanism already
used with -mlong-double-64 for complex math functions.

4 years agoldbl-128ibm-compat: Redirect long double functions to f128/ieee128 functions
Tulio Magno Quites Machado Filho [Wed, 20 Jun 2018 00:41:16 +0000 (21:41 -0300)]
ldbl-128ibm-compat: Redirect long double functions to f128/ieee128 functions

Modify the headers to redirect long double functions to global __*f128
symbols or to __*ieee128 otherwise.

Most of the functions in math.h benefit from the infrastructure already
available for __LDBL_COMPAT.  The only exceptions are nexttowardf and
nexttoward that need especial treatment.

Both math/bits/mathcalls-helper-functions.h and math/bits/mathcalls.h
were modified in order to provide alternative redirection destinations
that are essential to support functions that should not be redirected to
the same name pattern of the rest of the functions, i.e.: __fpclassify,
__signbit, __iseqsig, __issignaling, isinf, finite and isnan, which will
be redirected to __*f128 instead of __*ieee128 used for the rest.

4 years agoposix: Remove posix waitid
Adhemerval Zanella [Tue, 19 Nov 2019 21:34:19 +0000 (18:34 -0300)]
posix: Remove posix waitid

The POSIX waitid implementation is problematic in some ways:

  - It emulates using waitpid, which default implementation calls
    wait4 and wait4 returns ENOSYS as default.

  - Also by using waitpid it does not allod support the WNOWAIT,
    WEXITED, WSTOPPED, or WCONTINUED flag.  With current POSIX
    specification the flags are no longer marked as optional.

Also due BZ#23091 Hurd still uses the implementation, so it is moved
to as a Hurd arch-specific folder (with some minor cleanups).

Checked against a i686-gnu (run-built-tests=no)

4 years agoposix: Refactor tst-waitid (BZ #14666)
Adhemerval Zanella [Tue, 19 Nov 2019 20:21:26 +0000 (17:21 -0300)]
posix: Refactor tst-waitid (BZ #14666)

The main changes are:

  - Adapt to libsupport.
  - Synchronize the signal handler using atomics.
  - Replace waitpid by waitid calls.
  - Use support_process_state_wait to wait for child state.
  - Add tests for P_PGID and P_ALL.
  - Use sigwaitinfo instead of global state set by the signal handler.

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

4 years agosupport: Add support_process_state_wait
Adhemerval Zanella [Tue, 19 Nov 2019 20:17:05 +0000 (17:17 -0300)]
support: Add support_process_state_wait

It allows parent process to wait for child state using a polling
strategy over procfs on Linux.  The polling is used over ptrace to
avoid the need to handle signals on the target pid and to handle some
system specific limitation (such as YAMA).

The polling has some limitations, such as resource consumption due
the procfs read in a loop and the lack of synchronization after the
state is obtained.

The interface idea is to simplify some sleep synchronization waitid
tests and is to reduce timeouts by replacing arbitrary waits.

4 years agomalloc/tst-mallocfork2: Kill lingering process for unexpected failures
Adhemerval Zanella [Thu, 20 Feb 2020 17:37:04 +0000 (14:37 -0300)]
malloc/tst-mallocfork2: Kill lingering process for unexpected failures

If the test fails due some unexpected failure after the children
creation, either in the signal handler by calling abort or in the main
loop; the created children might not be killed properly.

This patches fixes it by:

  * Avoid aborting in the signal handler by setting a flag that
    an error has occured and add a check in the main loop.

  * Add a atexit handler to handle kill child processes.

Checked on x86_64-linux-gnu.

4 years agoelf: Apply attribute_relro to pointers in elf/dl-minimal.c
Florian Weimer [Wed, 26 Feb 2020 14:58:23 +0000 (15:58 +0100)]
elf: Apply attribute_relro to pointers in elf/dl-minimal.c

The present code leaves the function pointers unprotected, but moves
some of the static functions into .data.rel.ro instead.  This causes
the linker to produce an allocatable, executable, writable section
and eventually an RWX load segment.  Not only do we really do not
want that, it also breaks valgrind because valgrind does not load
debuginfo from the mmap interceptor if all it sees are RX and RWX
mappings.

Fixes commit 3a0ecccb599a6b1ad4b149dc569c0080e92d057b ("ld.so: Do not
export free/calloc/malloc/realloc functions [BZ #25486]").

4 years agopowerpc: Refactor fenvinline.h
Rogerio Alves [Mon, 10 Feb 2020 15:09:02 +0000 (12:09 -0300)]
powerpc: Refactor fenvinline.h

This patch refactor fenviline.h replaces some statements for
builtins.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
4 years agonss_nis: Use NSS_DECLARE_MODULE_FUNCTIONS
Florian Weimer [Tue, 25 Feb 2020 15:15:09 +0000 (16:15 +0100)]
nss_nis: Use NSS_DECLARE_MODULE_FUNCTIONS

This commit removes the minor optimization based on strong aliases
because it loses type safety.

4 years agocsu: Use ELF constructor instead of _init in libc.so
Florian Weimer [Mon, 24 Feb 2020 10:50:24 +0000 (11:50 +0100)]
csu: Use ELF constructor instead of _init in libc.so

On !ELF_INITFINI architectures, _init is no longer called by the
dynamic linker.  We can use an ELF constructor instead because the
constructor order does not matter.  (The other constructors are used
to set up libio vtable bypasses and do not depend on this
initialization routine.)

4 years agoldbl-128ibm: make ieee754.h work with IEEE 128 long double
Paul E. Murphy [Fri, 7 Feb 2020 20:07:01 +0000 (14:07 -0600)]
ldbl-128ibm: make ieee754.h work with IEEE 128 long double

Instead of attempting something more creative, just copy
the small struct from ldbl-128 and enable it when IEEE
long double is present, and update the ibm long double
variant if supported.

Likewise, provide a shadow copy of math_ldbl.h to prevent
the ibm128 specific long double header from poisoning
unrelated files due to it's usage in math_private.h.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
4 years agoldbl-128ibm-compat: fixup subdir location of several funcs
Paul E. Murphy [Fri, 7 Feb 2020 20:06:41 +0000 (14:06 -0600)]
ldbl-128ibm-compat: fixup subdir location of several funcs

We want to ensure that if a second file is built to support
ieee128 long double, we built its companion implementation
with ibm128 long double.  The shared object versions of these
files build correctly because the aliasing is sufficiently
complex to prevent the redirects from applying when defining
them.

However, this does not prevent the static object variants
from becoming quietly broken due to redirects.  This is
intentionally avoided by marking such objects to be built
with -mabi=ibmlongdouble.

Shuffle the misplaced routines to build against the subdir
which defines the needed symbols.

4 years agoldbl-128ibm-compat: enforce correct abi flags on internal file
Paul E. Murphy [Fri, 7 Feb 2020 20:06:35 +0000 (14:06 -0600)]
ldbl-128ibm-compat: enforce correct abi flags on internal file

A number of utility files and helper objects should also be
explicitly configured to build with the ibm128 ABI to prevent
gremlins when enabling IEEE long double.

4 years agoldbl-128ibm-compat: Provide ieee128 symbols to narrow functions
Tulio Magno Quites Machado Filho [Wed, 13 Jun 2018 20:12:46 +0000 (17:12 -0300)]
ldbl-128ibm-compat: Provide ieee128 symbols to narrow functions

Move the narrow math aliasing macros into a new sysdep header file
math-narrow-alias-float128.h.  Then, provide an override header
to supply the necessary changes to supply the *ieee128 aliases of
these symbols.

This adds ieee128 aliases for faddl, fdivl, fmull, fsubl, daddl, ddivl,
dmull, dsubl.

4 years agoUndefine redirections after long double definition on __LDBL_COMPAT [BZ #23294]
Tulio Magno Quites Machado Filho [Tue, 19 Jun 2018 00:11:26 +0000 (21:11 -0300)]
Undefine redirections after long double definition on __LDBL_COMPAT [BZ #23294]

After defining the long double redirections to double, __MATHDECL_1 has
to be redefined to its previous state in order to avoid redirecting all
subsequent types.

4 years agonios2: Fix Linux kABI for syscall return
Adhemerval Zanella [Thu, 20 Feb 2020 13:08:06 +0000 (10:08 -0300)]
nios2: Fix Linux kABI for syscall return

From the type introduced at 861be5fd66.

4 years agoFix use-after-free in glob when expanding ~user (bug 25414)
Andreas Schwab [Wed, 19 Feb 2020 16:21:46 +0000 (17:21 +0100)]
Fix use-after-free in glob when expanding ~user (bug 25414)

The value of `end_name' points into the value of `dirname', thus don't
deallocate the latter before the last use of the former.

4 years agonptl: Move pthread_setschedparam implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:51:05 +0000 (11:51 +0100)]
nptl: Move pthread_setschedparam implementation into libc

This is part of the libpthread removal project:

  <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agonptl: Move pthread_getschedparam implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:49:13 +0000 (11:49 +0100)]
nptl: Move pthread_getschedparam implementation into libc

This is part of the libpthread removal project:

  <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoAdd hidden prototypes for __sched_getparam, __sched_getscheduler
Florian Weimer [Mon, 10 Feb 2020 09:38:37 +0000 (10:38 +0100)]
Add hidden prototypes for __sched_getparam, __sched_getscheduler

This will enable them to be used in libc.so without PLTs.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agonptl: Move pthread_cond_init implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:47:13 +0000 (11:47 +0100)]
nptl: Move pthread_cond_init implementation into libc

It is necessary to export __pthread_cond_init from libc because
the C11 condition variable needs it and is still left in libpthread.

This is part of the libpthread removal project:

  <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>