about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Linux: Add execveat system call wrapper sasha/execveatAlexandra Hájková2020-09-0738-3/+304
|
* elf.h: Add aarch64 bti/pac dynamic tag constantsMark Wielaard2020-09-071-0/+2
| | | | | | | | Constants double checked against binutils and the ELF for the Arm 64-bit Architecture (AArch64) Release 2020Q2 document. Only BTI PLT is used in glibc, there's no PAC PLT with glibc, and people are expected to use BIND_NOW.
* x86: Set CPU usable feature bits conservatively [BZ #26552]H.J. Lu2020-09-031-96/+47
| | | | | | Set CPU usable feature bits only for CPU features which are usable in user space and whose usability can be detected from user space, excluding features like FSGSBASE whose enable bit can only be checked in the kernel.
* Update i686 ulps.Patsy Griffin2020-09-021-3/+3
| | | | | | | | | | | | | Without this ULP patch these 3 tests fail on i686: FAIL: math/test-float128-j0 FAIL: math/test-float64x-j0 FAIL: math/test-ldouble-j0 CPU info: Vendor ID: GenuineIntel CPU family: 6 Model: 85 Model name: Intel Xeon Processor (Cascadelake)
* Use LFS readdir in generic POSIX getcwd [BZ# 22899]Adhemerval Zanella2020-09-022-4/+9
| | | | Checked on x86_64-linux-gnu and i686-linux-gnu.
* linux: Remove __ASSUME_ATFCTSAdhemerval Zanella2020-09-022-9/+0
| | | | | | The __have_atfcts is not used anywhere. Checked on x86_64-linux-gnu.
* Sync getcwd with gnulibAdhemerval Zanella2020-09-022-421/+376
| | | | | | | | | | This is the first of a series of patches to sync with Gnulib commit 615b43e1f9. This patch adopts most of the changes of Gnulib, except it retains GETCWD_RETURN_TYPE and does not always use a 64-bit internal API. These remaining discrepancies will be addressed in later patches in this series. Checked on x86_64-linux-gnu and i686-linux-gnu.
* x86-64: Fix FMA4 detection in ifunc [BZ #26534]Ondřej Hošek2020-09-021-1/+1
| | | | | | A typo in commit 107e6a3c2212ba7a3a4ec7cae8d82d73f7c95d0b causes the FMA4 code path to be taken on systems that support FMA, even if they do not support FMA4. Fix this to detect FMA4.
* y2038: nptl: Convert pthread_cond_{clock|timed}wait to support 64 bit timeLukasz Majewski2020-09-025-9/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pthread_cond_clockwait and pthread_cond_timedwait have been converted to support 64 bit time. This change introduces new futex_abstimed_wait_cancelable64 function in ./sysdeps/nptl/futex-helpers.c, which uses futex_time64 where possible and tries to replace low-level preprocessor macros from lowlevellock-futex.h The pthread_cond_{clock|timed}wait only accepts absolute time. Moreover, there is no need to check for NULL passed as *abstime pointer as __pthread_cond_wait_common() always passes non-NULL struct __timespec64 pointer to futex_abstimed_wait_cancellable64(). For systems with __TIMESIZE != 64 && __WORDSIZE == 32: - Conversions between 64 bit time to 32 bit are necessary - Redirection to __pthread_cond_{clock|timed}wait64 will provide support for 64 bit time The futex_abstimed_wait_cancelable64 function has been put into a separate file on the purpose - to avoid issues apparent on the m68k architecture related to small number of available registers (there is not enough registers to put all necessary arguments in them if the above function would be added to futex-internal.h with __always_inline attribute). In fact - new function - namely __futex_abstimed_wait_cancellable32 is used to reduce number of needed registers (as some in-register values are stored on the stack when function call is made). 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 __pthread_cond_{clock|timed}wait64 and __pthread_cond_{clock|timed}wait. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* malloc: Fix mallinfo deprecation declarationAdhemerval Zanella2020-08-313-2/+15
| | | | | | | | | | | | | | | | It fixes the build issue below introduced by e3960d1c57e57 (Add mallinfo2 function that support sizes >= 4GB). It moves the __MALLOC_DEPRECATED to the usual place for function attributes: In file included from ../include/malloc.h:3, from ../sysdeps/x86_64/multiarch/../../../test-skeleton.c:31, from ../sysdeps/x86_64/multiarch/test-multiarch.c:96: ../malloc/malloc.h:118:1: error: empty declaration [-Werror] 118 | __MALLOC_DEPRECATED; It also adds the required deprecated warning suppression on the tests. Checked on x86_64-linux-gnu.
* x32: Add <fixup-asm-unistd.h> and regenerate arch-syscall.hH.J. Lu2020-08-312-0/+22
| | | | | | | | | | | | | | | | X32 uses the same 64-bit syscall interface for set_thread_area. But __NR_set_thread_area is missing from <asm/unistd_x32.h>. A kernel patch was submitted: From 7b05d5b43ae2545e0d4a3edb24205d18bc883626 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" <hjl.tools@gmail.com> Date: Sat, 15 Aug 2020 10:34:00 -0700 Subject: [PATCH] x86-64: Enable x32 set_thread_area X32 uses the common 64-bit syscall interface for set_thread_area. Add <fixup-asm-unistd.h> to provide __NR_set_thread_area. Co-authored-by: Florian Weimer <fweimer@redhat.com>
* Add mallinfo2 function that support sizes >= 4GB.Martin Liska2020-08-313-23/+69
| | | | | The current int type can easily overflow for allocation of more than 4GB.
* Remove obsolete default/nss codeThorsten Kukuk2020-08-292-43/+0
| | | | | All code reading /etc/default/nss and using the internal defines got removed, so the config file should be removed, too.
* AArch64: Improve backwards memmove performanceWilco Dijkstra2020-08-281-3/+4
| | | | | | | | On some microarchitectures performance of the backwards memmove improves if the stores use STR with decreasing addresses. So change the memmove loop in memcpy_advsimd.S to use 2x STR rather than STP. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Add RISC-V 32-bit target to build-many-glibcs.pyZong Li2020-08-271-0/+15
| | | | | | | | | Support building three variants of 32-bit RISC-V glibc as follows: - riscv32-linux-gnu-rv32imac-ilp32 - riscv32-linux-gnu-rv32imafdc-ilp32 - riscv32-linux-gnu-rv32imafdc-ilp32d Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* Documentation for the RISC-V 32-bit portAlistair Francis2020-08-272-1/+11
| | | | | | | There is already RISC-V 64-bit port information in the documentation. Let's add some documentation entries for the RISC-V 32-bit as well. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Build infrastructure for 32-bit portZong Li2020-08-279-10/+69
| | | | | | | | This patch lays out the top-level organisation of the RISC-V 32-bit port. It provides all the Implies files as well as various other fragments of the build infrastructure. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Add rv32 path to RTLDLIST in lddZong Li2020-08-271-1/+1
| | | | Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* riscv32: Specify the arch_minimum_kernel as 5.4Alistair Francis2020-08-272-0/+8
| | | | | | | | | | Specify the minimum kernel version for RISC-V 32-bit as the 5.4 kernel. We require this commit: "waitid: Add support for waiting for the current process group" for the kernel as it adds support for the P_PGID id for the waitid syscall. Without this patch we can't replace the wait4 syscall on 64-bit time_t only systems. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Fix llrint and llround missing exceptions on RV32Zong Li2020-08-271-0/+38
| | | | | | | | | Conversions from a float to a long long on 32-bit RISC-V (RV32) may not raise the correct exceptions on overflow, it also may raise spurious "inexact" exceptions on non overflow cases. This patch fixes the problem, similarly to the fix for MIPS, ARM and S390. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Add the RV32 libm-test-ulpsAlistair Francis2020-08-272-0/+1406
| | | | | | | | | Add a libm-test-ulps for RV32, this is the same as the RV64 one. This dosn't match what is generated by running `make regen-ulps` on RV32 QEMU, but the current in tree RV64 doesn't match that either. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Add 32-bit ABI listsAlistair Francis2020-08-2713-0/+3336
| | | | | | Use the update-abi Make target to generate the abilist for RV32. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Add hard float support for 32-bit CPUsZong Li2020-08-274-0/+124
| | | | | | | This patch adds support for hardware floating-point support for the RV32IF and RV32IFD platforms. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Support the 32-bit ABI implementationAlistair Francis2020-08-277-22/+146
| | | | | | | This patch adds the ABI implementation for 32-bit RISC-V. It contains the Linux-specific and RISC-V architecture code. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Add arch-syscall.h for RV32Alistair Francis2020-08-271-0/+284
| | | | Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Add path of library directories for the 32-bitAlistair Francis2020-08-271-16/+38
| | | | | | | | | | | | | | | | | With RV32 support the list of possible RISC-V system directories increases to: - /lib64/lp64d - /lib64/lp64 - /lib32/ilp32d - /lib32/ilp32 - /lib (only ld.so) This patch changes the add_system_dir () macro to support the new ilp32d and ilp32 directories for RV32. While refactoring this code let's split out the confusing if statements into a loop to make it easier to understand and extend. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Support dynamic loader for the 32-bitZong Li2020-08-271-1/+1
| | | | | | Add the LD_SO_ABI definition for RISC-V 32-bit. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Add support for 32-bit vDSO callsAlistair Francis2020-08-271-6/+17
| | | | Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Use 64-bit-time syscall numbers with the 32-bit portAlistair Francis2020-08-271-0/+23
| | | | | | | | | | | | | | | | | | | sysdep.h redefines only the syscall where the generic implementation still does not have actual 64-bit time_t support: /* Workarounds for generic code needing to handle 64-bit time_t. */ /* Fix sysdeps/unix/sysv/linux/clock_getcpuclockid.c. */ #define __NR_clock_getres __NR_clock_getres_time64 /* Fix sysdeps/nptl/lowlevellock-futex.h. */ #define __NR_futex __NR_futex_time64 [...] This patch also adds a comment that it is a workaround to handle 64-bit time_t and on each #define comment for which implementation it intends to. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Cleanup some of the sysdep.h codeAlistair Francis2020-08-271-13/+4
| | | | | | | | Remove a duplicate inclusion of <sysdeps/unix/sysdep.h> which is already pulled via <sysdeps/unix/sysv/linux/generic/sysdep.h>, and the inclusion of <errno.h> whose definition of `__set_errno' is not needed here. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* RISC-V: Use 64-bit time_t and off_t for RV32 and RV64Alistair Francis2020-08-274-0/+162
| | | | | | | | | | | | | | | | | | | | | | Using the original glibc headers under bits/ let's make small modifications to use 64-bit time_t and off_t for both RV32 and RV64. For the typesizes.h, here are justifications for the changes from the generic version (based on Arnd's very helpful feedback): - All the !__USE_FILE_OFFSET64 types (__off_t, __ino_t, __rlim_t, ...) are changed to match the 64-bit replacements. - __time_t is defined to 64 bit, but no __time64_t is added. This makes sense as we don't have the time64 support for other 32-bit architectures yet, and it will be easy to change when that happens. - __suseconds_t is 64-bit. This matches what we use the kernel ABI for the few drivers that are relying on 'struct timeval' input arguments in ioctl, as well as the adjtimex system call. It means that timeval has to be defined without the padding, unlike timespec, which needs padding. Reviewed-by: Maciej W. Rozycki <macro@wdc.com>
* io/lockf: Include bits/types.h before __OFF_T_MATCHES_OFF64_T checkAlistair Francis2020-08-271-0/+2
| | | | | | | | | It's possible that although __OFF_T_MATCHES_OFF64_T is defined the included the relevent header file. This results in a io/tst-lockf failure for RV32 by calling the non 64-bit version of lockf. This patch fixes the failure by including bits/types.h. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf/tst-libc_dlvsym: Add a TEST_COMPAT around some symbol testsAlistair Francis2020-08-271-0/+5
| | | | | | | | | The _sys_errlist and _sys_siglist symbols are deprecated since 2.32. This patch adds a TEST_COMPAT check around the tests. This fixes test failures on new architectures (such as RV32) that don't have this symbol defined. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* hurd: define BSD 4.3 ioctls only under __USE_MISCSamuel Thibault2020-08-271-0/+2
|
* string: test strncasecmp and strncpy near page boundariesRaphael Moreira Zinsly2020-08-262-0/+78
| | | | | | Add tests to check if strings placed at page boundaries are handled correctly by strncasecmp and strncpy similar to tests for strncmp and strnlen.
* linux: Simplify utimensatAdhemerval Zanella2020-08-241-13/+10
| | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_utimensat or __NR_utimensat_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Simplify timerfd_settimeAdhemerval Zanella2020-08-241-14/+9
| | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_timer_settime or __NR_time_settime_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Simplify timer_gettimeAdhemerval Zanella2020-08-241-12/+8
| | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_timer_gettime or __NR_time_gettime_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Simplify sched_rr_get_intervalAdhemerval Zanella2020-08-241-12/+8
| | | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_sched_rr_get_interval or __NR_sched_rr_get_interval_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Simplify ppollAdhemerval Zanella2020-08-241-11/+10
| | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_ppoll or __NR_ppoll_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Simplify mq_timedsendAdhemerval Zanella2020-08-241-7/+7
| | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_mq_timedsend or __NR_mq_timedsend_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Simplify mq_timedreceiveAdhemerval Zanella2020-08-241-9/+9
| | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_mq_timedreceive or __NR_mq_timedreceive_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Simplify clock_settimeAdhemerval Zanella2020-08-241-9/+9
| | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_clock_settime or __NR_clock_settime_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Simplify clock_nanosleepAdhemerval Zanella2020-08-241-22/+11
| | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_clock_nanosleep or __NR_clock_nanosleep_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Simplify clock_gettimeAdhemerval Zanella2020-08-241-25/+17
| | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_clock_gettime or __NR_clock_gettime_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. It also uses the time64-support functions to simplify it further. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel).
* linux: Simplify clock_adjtimeAdhemerval Zanella2020-08-241-13/+10
| | | | | | | | | | | | With arch-syscall.h it can now assumes the existance of either __NR_clock_adjtime or __NR_clock_adjtime_time64. The 32-bit time_t support is now only build for !__ASSUME_TIME64_SYSCALLS. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Add helper function to optimize 64-bit time_t fallback supportAdhemerval Zanella2020-08-243-1/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These helper functions are used to optimize the 64-bit time_t support on configurations that requires support for 32-bit time_t fallback (!__ASSUME_TIME64_SYSCALLS). The idea is once the kernel advertises that it does not have 64-bit time_t support, glibc will stop to try issue the 64-bit time_t syscall altogether. For instance: #ifndef __NR_symbol_time64 # define __NR_symbol_time64 __NR_symbol #endif int r; if (supports_time64 ()) { r = INLINE_SYSCALL_CALL (symbol, ...); if (r == 0 || errno != ENOSYS) return r; mark_time64_unsupported (); } #ifndef __ASSUME_TIME64_SYSCALLS <32-bit fallback syscall> #endif return r; On configuration with default 64-bit time_t this optimization should be optimized away by the compiler resulting in no overhead.
* S390: Sync HWCAP names with kernel by adding aliases [BZ #25971]Stefan Liebler2020-08-212-0/+6
| | | | | | | Unfortunately some HWCAP names like HWCAP_S390_VX differs between kernel (see <kernel>/arch/s390/include/asm/elf.h) and glibc. Therefore, those HWCAP names from kernel are now introduced as alias
* [vcstocl] Import ProjectQuirks from its own fileSiddhesh Poyarekar2020-08-201-1/+1
| | | | | | ProjectQuirks moved into its own file in gnulib because one cannot import modules with hyphens in them. Adjust the quirks file to reflect this reality.
* build-many-glibcs.py: Add a s390x -O3 glibc variant.Stefan Liebler2020-08-201-2/+11
| | | | | | | | | | | | | | | On s390x, gcc inlines more aggresive compared to other architectures. This occaisionally leads to build warnings / errors. Therefore this patch adds a s390x glibc variant with optimization. There is the ccopts field which contain ABI options which are passed to configure as CC / CXX. Now there is also the cflags field which contains non-ABI options like -g or -O. Those are passed to configure as CFLAGS / CXXFLAGS. Currently CC is passed to conformtest.py or linknamespace.py but not the CFLAGS.