]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
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>
4 years agonptl: Move pthread_cond_destroy implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:35:05 +0000 (11:35 +0100)] 
nptl: Move pthread_cond_destroy implementation into libc

It is necessary to export __pthread_cond_destroy 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>
4 years agonptl: Move pthread_condattr_init implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:32:45 +0000 (11:32 +0100)] 
nptl: Move pthread_condattr_init 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_condattr_destroy implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:30:59 +0000 (11:30 +0100)] 
nptl: Move pthread_condattr_destroy 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_attr_setscope implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:29:16 +0000 (11:29 +0100)] 
nptl: Move pthread_attr_setscope 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_attr_getscope implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:26:00 +0000 (11:26 +0100)] 
nptl: Move pthread_attr_getscope 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_attr_setschedpolicy implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:23:32 +0000 (11:23 +0100)] 
nptl: Move pthread_attr_setschedpolicy 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_attr_getschedpolicy implementation into libc
Florian Weimer [Mon, 10 Feb 2020 10:20:30 +0000 (11:20 +0100)] 
nptl: Move pthread_attr_getschedpolicy 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: Sort routines list in Makefile alphabetically
Florian Weimer [Mon, 10 Feb 2020 10:17:11 +0000 (11:17 +0100)] 
nptl: Sort routines list in Makefile alphabetically

This will make it easier to review changes which move implementations
from libpthread to libc.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agonptl: Use .NOTPARALLEL in Makefile only if actually running tests
Florian Weimer [Mon, 10 Feb 2020 10:28:31 +0000 (11:28 +0100)] 
nptl: Use .NOTPARALLEL in Makefile only if actually running tests

It is safe to build the tests in parallel.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 years agoBlock all signals on timer_create thread (BZ#10815)
Adhemerval Zanella [Mon, 9 Dec 2019 17:33:33 +0000 (14:33 -0300)] 
Block all signals on timer_create thread (BZ#10815)

The behavior of the signal mask on threads created by timer_create
for SIGEV_THREAD timers are implementation-defined and glibc explicit
unblocks all signals before calling the user-defined function.

This behavior, although not incorrect standard-wise, opens a race if a
program using a blocked rt-signal plus sigwaitinfo (and without an
installed signal handler for the rt-signal) receives a signal while
executing the used-defined function for SIGEV_THREAD.

A better alternative discussed in bug report is to rather block all
signals (besides the internal ones not available to application
usage).

This patch fixes this issue by only unblocking SIGSETXID (used on
set*uid function) and SIGCANCEL (used for thread cancellation).

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

4 years agoFix tst-pkey expectations on pkey_get [BZ #23202]
Lucas A. M. Magalhaes [Mon, 17 Feb 2020 12:09:52 +0000 (09:09 -0300)] 
Fix tst-pkey expectations on pkey_get [BZ #23202]

From the GNU C Library manual, the pkey_set can receive a combination of
PKEY_DISABLE_WRITE and PKEY_DISABLE_ACCESS.  However PKEY_DISABLE_ACCESS
is more restrictive than PKEY_DISABLE_WRITE and includes its behavior.

The test expects that after setting
(PKEY_DISABLE_WRITE|PKEY_DISABLE_ACCESS) pkey_get should return the
same.  This may not be true as PKEY_DISABLE_ACCESS will succeed in
describing the state of the key in this case.

The pkey behavior during signal handling is different between x86 and
POWER.  This change make the test compatible with both architectures.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
4 years agoy2038: linux: Provide __gettimeofday64 implementation
Lukasz Majewski [Mon, 27 Jan 2020 14:37:07 +0000 (15:37 +0100)] 
y2038: linux: Provide __gettimeofday64 implementation

In the glibc the gettimeofday can use vDSO (on power and x86 the
USE_IFUNC_GETTIMEOFDAY is defined), gettimeofday syscall or 'default'
___gettimeofday() from ./time/gettime.c (as a fallback).

In this patch the last function (___gettimeofday) has been refactored and
moved to ./sysdeps/unix/sysv/linux/gettimeofday.c to be Linux specific.

The new __gettimeofday64 explicit 64 bit function for getting 64 bit time from
the kernel (by internally calling __clock_gettime64) has been introduced.

Moreover, a 32 bit version - __gettimeofday has been refactored to internally
use __gettimeofday64.

The __gettimeofday is now supposed to be used on systems still supporting 32
bit time (__TIMESIZE != 64) - hence the necessary check for time_t potential
overflow and conversion of struct __timeval64 to 32 bit struct timespec.

The iFUNC vDSO direct call optimization has been removed from both i686 and
powerpc32 (USE_IFUNC_GETTIMEOFDAY is not defined for those architectures
anymore). The Linux kernel does not provide a y2038 safe implementation of
gettimeofday neither it plans to provide it in the future, clock_gettime64
should be used instead. Keeping support for this optimization would require
to handle another build permutation (!__ASSUME_TIME64_SYSCALLS &&
USE_IFUNC_GETTIMEOFDAY) which adds more complexity and has limited use
(since the idea is to eventually have a y2038 safe glibc build).

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 __gettimeofday64 and __gettimeofday.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
[Including some commit message improvement]

4 years agoLinux: Work around kernel bugs in chmod on /proc/self/fd paths [BZ #14578]
Florian Weimer [Tue, 18 Feb 2020 16:52:27 +0000 (17:52 +0100)] 
Linux: Work around kernel bugs in chmod on /proc/self/fd paths [BZ #14578]

It appears that the ability to change symbolic link modes through such
paths is unintended.  On several file systems, the operation fails with
EOPNOTSUPP, even though the symbolic link permissions are updated.
The expected behavior is a failure to update the permissions, without
file system changes.

Reviewed-by: Matheus Castanho <msc@linux.ibm.com>
4 years agoIntroduce <elf-initfini.h> and ELF_INITFINI for all architectures
Florian Weimer [Tue, 18 Feb 2020 13:42:41 +0000 (14:42 +0100)] 
Introduce <elf-initfini.h> and ELF_INITFINI for all architectures

This supersedes the init_array sysdeps directory.  It allows us to
check for ELF_INITFINI in both C and assembler code, and skip DT_INIT
and DT_FINI processing completely on newer architectures.

A new header file is needed because <dl-machine.h> is incompatible
with assembler code.  <sysdep.h> is compatible with assembler code,
but it cannot be included in all assembler files because on some
architectures, it redefines register names, and some assembler files
conflict with that.

<elf-initfini.h> is replicated for legacy architectures which need
DT_INIT/DT_FINI support.  New architectures follow the generic default
and disable it.

4 years agomips: Fix bracktrace result for signal frames
Adhemerval Zanella [Mon, 17 Feb 2020 13:57:56 +0000 (10:57 -0300)] 
mips: Fix bracktrace result for signal frames

MIPS fallback code handle a frame where its FDE can not be obtained
(for instance a signal frame) by reading the kernel allocated signal frame
and adding '2' to the value of 'sc_pc' [1].  The added value is used to
recognize an end of an EH region on mips16 [2].

The fix adjust the obtained signal frame value and remove the libgcc added
value by checking if the previous frame is a signal frame one.

Checked with backtrace and tst-sigcontext-get_pc tests on mips-linux-gnu
and mips64-linux-gnu.

[1] libgcc/config/mips/linux-unwind.h from gcc code.
[2] gcc/config/mips/mips.h from gcc code.  */

4 years agoMove implementation of <file_change_detection.h> into a C file
Florian Weimer [Tue, 18 Feb 2020 12:44:48 +0000 (13:44 +0100)] 
Move implementation of <file_change_detection.h> into a C file

file_change_detection_for_stat partially initialize
struct file_change_detection in some cases, when the size member
alone determines the outcome of all comparisons.  This results
in maybe-uninitialized compiler warnings in case of sufficiently
aggressive inlining.

Once the implementation is moved into a separate C file, this kind
of inlining is no longer possible, so the compiler warnings are gone.

4 years ago<fd_to_filename.h>: Add type safety and port to Hurd
Florian Weimer [Tue, 18 Feb 2020 12:02:37 +0000 (13:02 +0100)] 
<fd_to_filename.h>: Add type safety and port to Hurd

The new type struct fd_to_filename makes the allocation of the
backing storage explicit.

Hurd uses /dev/fd, not /proc/self/fd.

Co-Authored-By: Paul Eggert <eggert@cs.ucla.edu>
4 years agoPrepare redirections for IEEE long double on powerpc64le
Gabriel F. T. Gomes [Thu, 19 Dec 2019 15:06:09 +0000 (12:06 -0300)] 
Prepare redirections for IEEE long double on powerpc64le

All functions that have a format string, which can consume a long double
argument, must have one version for each long double format supported on
a platform.  On powerpc64le, these functions currently have two versions
(i.e.: long double with the same format as double, and long double with
IBM Extended Precision format).  Support for a third long double format
option (i.e. long double with IEEE long double format) is being prepared
and all the aforementioned functions now have a third version (not yet
exported on the master branch, but the code is in).

For these functions to get selected (during build time), references to
them in user programs (or dependent libraries) must get redirected to
the aforementioned new versions of the functions.  This patch installs
the header magic required to perform such redirections.

Notice, however, that since the redirections only happen when
__LONG_DOUBLE_USES_FLOAT128 is set to 1, and no platform (including
powerpc64le) currently does it, no redirections actually happen.
Redirections and the exporting of the new functions will happen at the
same time (when powerpc64le adds ldbl-128ibm-compat to their Implies.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Reviewed-by: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
4 years agoconform/conformtest.py: Extend tokenizer to cover character constants
Florian Weimer [Mon, 17 Feb 2020 16:18:49 +0000 (17:18 +0100)] 
conform/conformtest.py: Extend tokenizer to cover character constants

Such constants are used in __USE_EXTERN_INLINES blocks.

4 years agostdlib: Reduce namespace pollution in <inttypes.h>
Florian Weimer [Mon, 17 Feb 2020 10:30:17 +0000 (11:30 +0100)] 
stdlib: Reduce namespace pollution in <inttypes.h>

The namespace pollution results in conform test failures if the tests
are run __USE_EXTERN_INLINES defined (e.g., when configuring with
CC="gcc -O3" CXX="g++ -O3").

4 years agox86: Avoid single-argument _Static_assert in <tls.h>
Florian Weimer [Mon, 17 Feb 2020 10:08:15 +0000 (11:08 +0100)] 
x86: Avoid single-argument _Static_assert in <tls.h>

Older GCC versions do not support this extension.  Fixes commit f1bdee61797
("x86 tls: Use _Static_assert for TLS access size assertion").

4 years agox86 tls: Use _Static_assert for TLS access size assertion
Samuel Thibault [Sun, 16 Feb 2020 23:40:39 +0000 (00:40 +0100)] 
x86 tls: Use _Static_assert for TLS access size assertion

4 years agohtl: Link internal htl tests against libpthread
Samuel Thibault [Sun, 16 Feb 2020 23:36:53 +0000 (00:36 +0100)] 
htl: Link internal htl tests against libpthread

4 years agopthread: Fix building tst-robust8 with nptl
Samuel Thibault [Sun, 16 Feb 2020 22:53:38 +0000 (23:53 +0100)] 
pthread: Fix building tst-robust8 with nptl

NPTL's pthreadP.h needs internal definitions

4 years agopthread: Move robust mutex tests from nptl to sysdeps/pthread
Samuel Thibault [Sun, 16 Feb 2020 14:30:17 +0000 (14:30 +0000)] 
pthread: Move robust mutex tests from nptl to sysdeps/pthread

tst-robust8.c prints some mutex internals for nptl debugging, this
needed to be made conditioned by getting built with nptl.

4 years agohtl: Remove stub warning for pthread_mutexattr_setpshared
Samuel Thibault [Sun, 16 Feb 2020 14:35:42 +0000 (06:35 -0800)] 
htl: Remove stub warning for pthread_mutexattr_setpshared

It actually is implemented.