aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)AuthorFilesLines
2024-05-31x86_64: Use shadow stack for backtrace implementationfw/x86-shstk-backtraceFlorian Weimer6-4/+94
Test failures: FAIL: debug/tst-backtrace4 FAIL: misc/tst-sigcontext-get_pc The return address of signal handlers is not on the shadow stack.
2024-05-30x86_64: Always initialize ssp_base in the TCB if SHSTK is enabledFlorian Weimer2-0/+37
2024-05-30nptl: Wire up __nptl_arch_thread_initFlorian Weimer1-0/+24
2024-05-28LoongArch: Use "$fcsr0" instead of "$r0" in _FPU_{GET,SET}CWXi Ruoyao1-2/+2
Clang inline-asm parser does not allow using "$r0" in movfcsr2gr/movgr2fcsr, so everything using _FPU_{GET,SET}CW is now failing to build with Clang on LoongArch. As we now requires Binutils >= 2.41 which supports using "$fcsr0" here, use it instead of "$r0" to fix the issue. Link: https://github.com/loongson-community/discussions/issues/53#issuecomment-2081507390 Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=4142b2368353 Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2024-05-27x86_64: Reformat elf_machine_relaXin Wang1-4/+5
A space is added before the left bracket of the x86_64 elf_machine_rela function, in order to harmonize with the rest of the implementation of the function and to make it easier to retrieve the function. The lines where the function definition is located has been re-indented, as well as its left curly bracket placed in the correct position. Signed-off-by: Xin Wang <yw987194828@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-27i386: Disable Intel Xeon Phi tests for GCC 15 and above (BZ 31782)Sunil K Pandey1-1/+7
This patch disables Intel Xeon Phi tests for GCC 15 and above. GCC 15 removed Intel Xeon Phi ISA support. commit e1a7e2c54d52d0ba374735e285b617af44841ace Author: Haochen Jiang <haochen.jiang@intel.com> Date: Mon May 20 10:43:44 2024 +0800 i386: Remove Xeon Phi ISA support Fixes BZ 31782. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-27parse_fdinfo: Don't advance pointer twice [BZ #31798]H.J. Lu1-1/+3
pidfd_getpid.c has /* Ignore invalid large values. */ if (INT_MULTIPLY_WRAPV (10, n, &n) || INT_ADD_WRAPV (n, *l++ - '0', &n)) return -1; For GCC older than GCC 7, INT_ADD_WRAPV(a, b, r) is defined as _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW) and *l++ - '0' is evaluated twice. Fix BZ #31798 by moving "l++" out of the if statement. Tested with GCC 6.4 and GCC 14.1. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-05-24sysdeps/ieee754/ldbl-opt/Makefile: Split and sort libnldbl-callsH.J. Lu1-42/+233
Put each item on a separate line and sort libnldbl-calls. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-24sysdeps/ieee754/ldbl-opt/Makefile: Remove test-nldbl-redirect-staticH.J. Lu1-1/+0
Remove $(objpfx)test-nldbl-redirect-static checked in by accident. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-24sysdeps/ieee754/ldbl-opt/Makefile: Split and sort testsH.J. Lu1-10/+18
Put each test on a separate line and sort tests. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-24s390x: Regenerate ULPs.Stefan Liebler1-0/+20
Needed due to: "Implement C23 log2p1" commit ID 79c52daf4740b00bef43e4f5a4281b3480459b38
2024-05-23Update kernel version to 6.9 in header constant testsJoseph Myers2-3/+3
This patch updates the kernel version in the tests tst-mman-consts.py and tst-mount-consts.py to 6.9. (There are no new constants covered by these tests in 6.9 that need any other header changes; tst-pidfd-consts.py was updated separately along with adding new constants relevant to that test.) Tested with build-many-glibcs.py.
2024-05-23math: Provide missing math symbols on libc.a (BZ 31781)Adhemerval Zanella3-6/+6
The libc.a for alpha, s390, and sparcv9 does not provide copysignf64x, copysignf128, frexpf64x, frexpf128, modff64x, and modff128. Checked with a static build for the affected ABIs. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-23s390: Make utmp32, utmpx32, and login32 shared only (BZ 31790)Adhemerval Zanella1-0/+1
The function that work with 'struct utmp32' and 'struct utmpx32' are only for compat symbols. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-23microblaze: Remove cacheflush from libc.a (BZ 31788)Adhemerval Zanella1-2/+0
microblaze does not export it in libc.so nor the kernel provides the cacheflush syscall. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-23powerpc: Remove duplicated llrintf and llrintf32 from libm.a (BZ 31787)Adhemerval Zanella2-0/+8
Both the generic and POWER6 versions provide definitions of the symbol, which are already provided by the ifunc resolver. Checked on powerpc-linux-gnu-power4. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-23powerpc: Remove duplicate strchrnul and strncasecmp_l libc.a (BZ 31786)Adhemerval Zanella3-1/+19
For powerpc64 the generic version provides a weak definition of strchrnul, which are already provided by the ifunc resolver. The powerpc32 version is slight different, where for static case there is no iFUNC support. The strncasecmp_l is provided ifunc resolver. Checked on powerpc-linux-gnu-power4 and powerpc64-linux-gnu. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-23loongarch: Remove duplicate strnlen in libc.a (BZ 31785)Adhemerval Zanella1-0/+2
The generic version provides weak definitions of strnlen, which are already provided by the ifunc resolver. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-23aarch64: Remove duplicate memchr/strlen in libc.a (BZ 31777)Adhemerval Zanella2-0/+6
The generic version provides weak definitions of memchr/strlen, which are already provided by the ifunc resolvers. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-23Update PIDFD_* constants for Linux 6.9Joseph Myers2-9/+8
Linux 6.9 adds some more PIDFD_* constants. Add them to glibc's sys/pidfd.h, including updating comments that said FLAGS was reserved and must be 0, along with updating tst-pidfd-consts.py. Tested with build-many-glibcs.py.
2024-05-22Don't provide XXXf128_do_not_use aliases [BZ #31757]H.J. Lu4-0/+10
Don't provide __nexttowardf128_do_not_use, nexttowardf128_do_not_use, finitef128_do_not_use, isinff128_do_not_use and isnanf128_do_not_use. This fixes BZ #31757. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-05-21math: Fix isnanf128 static build (BZ 31774)Adhemerval Zanella1-0/+4
Some static implementation of float128 routines might call __isnanf128, which is not provided by the static object. Checked on x86_64-linux-gnu. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-05-21math: Fix i386 and m68k exp10 on static build (BZ 31775)Adhemerval Zanella2-4/+14
The commit 08ddd26814 removed the static exp10 on i386 and m68k with an empty w_exp10.c (required for the ABIs that uses the newly implementation). This patch fixes by adding the required symbols on the arch-specific w_exp{f}_compat.c implementation. Checked on i686-linux-gnu and with a build for m68k-linux-gnu. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
2024-05-21math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488)Adhemerval Zanella5-13/+17
The commit 16439f419b removed the static fmod/fmodf on i386 and m68k with and empty w_fmod.c (required for the ABIs that uses the newly implementation). This patch fixes by adding the required symbols on the arch-specific w_fmod{f}_compat.c implementation. To statically build fmod fails on some ABI (alpha, s390, sparc) because it does not export the ldexpf128, this is also fixed by this patch. Checked on i686-linux-gnu and with a build for m68k-linux-gnu. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Tested-by: Aurelien Jarno <aurelien@aurel32.net>
2024-05-21Remove the clone3 symbol from libc.a [BZ #31770]H.J. Lu11-11/+0
clone3 isn't exported from glibc and is hidden in libc.so. Fix BZ #31770 by removing clone3 alias. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-05-21aarch64/fpu: Add vector variants of powJoe Ramsay21-12/+2236
Plus a small amount of moving includes around in order to be able to remove duplicate definition of asuint64. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2024-05-21LoongArch: Update ulpscaiyinyu1-0/+20
For the log2p1 implementation.
2024-05-21LoongArch: Fix tst-gnu2-tls2 compiler errormengqinggang3-2/+8
Add -mno-lsx to tst-gnu2-tlsmod*.c if gcc support -mno-lsx. Add escape character '\' in vector support test function.
2024-05-20i386: Don't define stpncpy alias when used in IFUNC [BZ #31768]H.J. Lu1-0/+2
Fix BZ #31768 by not defining stpncpy alias when used in IFUNC. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
2024-05-20powerpc: Update ulpsAdhemerval Zanella1-0/+24
For the log2p1 implementation.
2024-05-20arm: Update ulpsAdhemerval Zanella1-0/+16
For the log2p1 implementation.
2024-05-20aarch64: Update ulpsAdhemerval Zanella1-0/+20
For the log2p1 implementation.
2024-05-20Implement C23 log2p1Joseph Myers39-1/+294
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the log2p1 functions (log2(1+x): like log1p, but for base-2 logarithms). This illustrates the intended structure of implementations of all these function families: define them initially with a type-generic template implementation. If someone wishes to add type-specific implementations, it is likely such implementations can be both faster and more accurate than the type-generic one and can then override it for types for which they are implemented (adding benchmarks would be desirable in such cases to demonstrate that a new implementation is indeed faster). The test inputs are copied from those for log1p. Note that these changes make gen-auto-libm-tests depend on MPFR 4.2 (or later). The bulk of the changes are fairly generic for any such new function. (sysdeps/powerpc/nofpu/Makefile only needs changing for those type-generic templates that use fabs.) Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-05-20Update syscall lists for Linux 6.9Joseph Myers1-2/+2
Linux 6.9 has no new syscalls. Update the version number in syscall-names.list to reflect that it is still current for 6.9. Tested with build-many-glibcs.py.
2024-05-20Rename procutils_read_file to __libc_procutils_read_file [BZ #31755]H.J. Lu3-5/+7
Fix BZ #31755 by renaming the internal function procutils_read_file to __libc_procutils_read_file. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-05-20nearbyint: Don't define alias when used in IFUNC [BZ #31759]H.J. Lu2-0/+4
Fix BZ #31759 by not defining nearbyint aliases when used in IFUNC. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2024-05-18socket: Use may_alias on sockaddr structs (bug 19622)Florian Weimer6-8/+8
This supports common coding patterns. The GCC C front end before version 7 rejects the may_alias attribute on a struct definition if it was not present in a previous forward declaration, so this attribute can only be conditionally applied. This implements the spirit of the change in Austin Group issue 1641. Suggested-by: Marek Polacek <polacek@redhat.com> Suggested-by: Jakub Jelinek <jakub@redhat.com> Reviewed-by: Sam James <sam@gentoo.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-05-16powerpc64: Fix by using the configure value $libc_cv_cc_submachine [BZ ↵Manjunath Matti2-4/+4
#31629] This patch ensures that $libc_cv_cc_submachine, which is set from "--with-cpu", overrides $CFLAGS for configure time tests. Suggested-by: Peter Bergner <bergner@linux.ibm.com> Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
2024-05-16aarch64/fpu: Add vector variants of cbrtJoe Ramsay14-0/+526
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2024-05-16aarch64/fpu: Add vector variants of hypotJoe Ramsay14-0/+329
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2024-05-15LoongArch: Add support for TLS Descriptorsmengqinggang14-8/+1071
This is mostly based on AArch64 and RISC-V implementation. Add R_LARCH_TLS_DESC32 and R_LARCH_TLS_DESC64 relocations. For _dl_tlsdesc_dynamic function slow path, temporarily save and restore all vector registers.
2024-05-14aarch64: Fix AdvSIMD libmvec routines for big-endianJoe Ramsay17-85/+119
Previously many routines used * to load from vector types stored in the data table. This is emitted as ldr, which byte-swaps the entire vector register, and causes bugs for big-endian when not all lanes contain the same value. When a vector is to be used this way, it has been replaced with an array and the load with an explicit ld1 intrinsic, which byte-swaps only within lanes. As well, many routines previously used non-standard GCC syntax for vector operations such as indexing into vectors types with [] and assembling vectors using {}. This syntax should not be mixed with ACLE, as the former does not respect endianness whereas the latter does. Such examples have been replaced with, for instance, vcombine_* and vgetq_lane* intrinsics. Helpers which only use the GCC syntax, such as the v_call helpers, do not need changing as they do not use intrinsics. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2024-05-09powerpc: Fix __fesetround_inline_nocheck on POWER9+ (BZ 31682)Adhemerval Zanella2-14/+8
The e68b1151f7460d5fa88c3a567c13f66052da79a7 commit changed the __fesetround_inline_nocheck implementation to use mffscrni (through __fe_mffscrn) instead of mtfsfi. For generic powerpc ceil/floor/trunc, the function is supposed to disable the floating-point inexact exception enable bit, however mffscrni does not change any exception enable bits. This patch fixes by reverting the optimization for the __fesetround_inline_nocheck. Checked on powerpc-linux-gnu. Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
2024-05-08x86_64: Fix missing wcsncat function definition without multiarch (x86-64-v4)Gabi Falk1-3/+3
This code expects the WCSCAT preprocessor macro to be predefined in case the evex implementation of the function should be defined with a name different from __wcsncat_evex. However, when glibc is built for x86-64-v4 without multiarch support, sysdeps/x86_64/wcsncat.S defines WCSNCAT variable instead of WCSCAT to build it as wcsncat. Rename the variable to WCSNCAT, as it is actually a better naming choice for the variable in this case. Reported-by: Kenton Groombridge Link: https://bugs.gentoo.org/921945 Fixes: 64b8b6516b ("x86: Add evex optimized functions for the wchar_t strcpy family") Signed-off-by: Gabi Falk <gabifalk@gmx.com> Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
2024-05-07support: Add envp argument to support_capture_subprogramAdhemerval Zanella1-1/+1
So tests can specify a list of environment variables. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2024-05-07elf: Only process multiple tunable once (BZ 31686)Adhemerval Zanella2-0/+7
The 680c597e9c3 commit made loader reject ill-formatted strings by first tracking all set tunables and then applying them. However, it does not take into consideration if the same tunable is set multiple times, where parse_tunables_string appends the found tunable without checking if it was already in the list. It leads to a stack-based buffer overflow if the tunable is specified more than the total number of tunables. For instance: GLIBC_TUNABLES=glibc.malloc.check=2:... (repeat over the number of total support for different tunable). Instead, use the index of the tunable list to get the expected tunable entry. Since now the initial list is zero-initialized, the compiler might emit an extra memset and this requires some minor adjustment on some ports. Checked on x86_64-linux-gnu and aarch64-linux-gnu. Reported-by: Yuto Maeda <maeda@cyberdefense.jp> Reported-by: Yutaro Shimizu <shimizu@cyberdefense.jp> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2024-05-06Add crt1-2.0.o for glibc 2.0 compatibility testsH.J. Lu1-0/+4
Starting from glibc 2.1, crt1.o contains _IO_stdin_used which is checked by _IO_check_libio to provide binary compatibility for glibc 2.0. Add crt1-2.0.o for tests against glibc 2.0. Define tests-2.0 for glibc 2.0 compatibility tests. Add and update glibc 2.0 compatibility tests for stderr, matherr and pthread_kill. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-05-06powerpc: Optimized strncmp for power10Amrita H S5-1/+304
This patch is based on __strcmp_power10. Improvements from __strncmp_power9: 1. Uses new POWER10 instructions - This code uses lxvp to decrease contention on load by loading 32 bytes per instruction. 2. Performance implication - This version has around 38% better performance on average. - Minor performance regression is seen for few small sizes and specific combination of alignments. Signed-off-by: Amrita H S <amritahs@linux.ibm.com> Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
2024-05-03or1k: Add hard float supportStafford Horne32-218/+1425
This patch adds hardware floating point support to OpenRISC. Hardware floating point toolchain builds are enabled by passing the machine specific argument -mhard-float to gcc via CFLAGS. With this enabled GCC generates floating point instructions for single-precision operations and exports __or1k_hard_float__. There are 2 main parts to this patch. - Implement fenv functions to update the FPCSR flags keeping it in sync with sfp (software floating point). - Update machine context functions to store and restore the FPCSR state. *On mcontext_t ABI* This patch adds __fpcsr to mcontext_t. This is an ABI change, but also an ABI fix. The Linux kernel has always defined padding in mcontext_t that space was missing from the glibc ABI. In Linux this unused space has now been re-purposed for storing the FPCSR. This patch brings OpenRISC glibc in line with the Linux kernel and other libc implementation (musl). Compatibility getcontext, setcontext, etc symbols have been added to allow for binaries expecting the old ABI to continue to work. *Hard float ABI* The calling conventions and types do not change with OpenRISC hard-float so glibc hard-float builds continue to use dynamic linker /lib/ld-linux-or1k.so.1. *Testing* I have tested this patch both with hard-float and soft-float builds and the test results look fine to me. Results are as follows: Hard Float # failures FAIL: elf/tst-sprof-basic (Haven't figured out yet, not related to hard-float) FAIL: gmon/tst-gmon-pie (PIE bug in or1k toolchain) FAIL: gmon/tst-gmon-pie-gprof (PIE bug in or1k toolchain) FAIL: iconvdata/iconv-test (timeout, passed when run manually) FAIL: nptl/tst-cond24 (Timeout) FAIL: nptl/tst-mutex10 (Timeout) # summary 6 FAIL 4289 PASS 86 UNSUPPORTED 16 XFAIL 2 XPASS # versions Toolchain: or1k-smhfpu-linux-gnu Compiler: gcc version 14.0.1 20240324 (experimental) [master r14-9649-gbb04a11418f] (GCC) Binutils: GNU assembler version 2.42.0 (or1k-smhfpu-linux-gnu) using BFD version (GNU Binutils) 2.42.0.20240324 Linux: Linux buildroot 6.9.0-rc1-00008-g4dc70e1aadfa #112 SMP Sat Apr 27 06:43:11 BST 2024 openrisc GNU/Linux Tester: shorne Glibc: 2024-04-25 b62928f907 Florian Weimer x86: In ld.so, diagnose missing APX support in APX-only builds (origin/master, origin/HEAD) Soft Float # failures FAIL: elf/tst-sprof-basic FAIL: gmon/tst-gmon-pie FAIL: gmon/tst-gmon-pie-gprof FAIL: nptl/tst-cond24 FAIL: nptl/tst-mutex10 # summary 5 FAIL 4295 PASS 81 UNSUPPORTED 16 XFAIL 2 XPASS # versions Toolchain: or1k-smh-linux-gnu Compiler: gcc version 14.0.1 20240324 (experimental) [master r14-9649-gbb04a11418f] (GCC) Binutils: GNU assembler version 2.42.0 (or1k-smh-linux-gnu) using BFD version (GNU Binutils) 2.42.0.20240324 Linux: Linux buildroot 6.9.0-rc1-00008-g4dc70e1aadfa #112 SMP Sat Apr 27 06:43:11 BST 2024 openrisc GNU/Linux Tester: shorne Glibc: 2024-04-25 b62928f907 Florian Weimer x86: In ld.so, diagnose missing APX support in APX-only builds (origin/master, origin/HEAD) Documentation: https://raw.githubusercontent.com/openrisc/doc/master/openrisc-arch-1.4-rev0.pdf Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-05-03or1k: Add hard float libm-test-ulpsStafford Horne5-1/+1117
This patch adds the ulps test file to prepare for the upcoming hard float patch. This is separated out to make the hard float patch smaller. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>