summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-11-17Reference COPYING.LIB in <sframe.h> copyright headerFlorian Weimer
Commit 3360913c37f5c3a0c8737b76321fd5ce2608fcd5 ("elf: Add SFrame stack tracing") added this file with an inconsistent copyright header. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2025-11-17htl: move pthread_create to into libcSamuel Thibault
This is notably needed for the main thread structure to be always initialized so that some pthread functions can work from the main thread without other threads, e.g. pthread_cancel.
2025-11-17htl: Move __pthread_enable/disable_asynccancel into libcSamuel Thibault
This is actually needed before we make pthread_cancel available in libc.
2025-11-17hurd: Fix getting rlimit in _hurd_alloc_fdSamuel Thibault
rlim_t is unsigned, and RLIM_INFINITY can be (rlim_t) -1
2025-11-16htl: Add missing includeSamuel Thibault
For IS_IN.
2025-11-16loongarch: Remove TLS_TCB_ALIGNSamuel Thibault
This reverts a part of 9f18265a8ec8 ("Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN"), as loongarch uses this macro internally.
2025-11-16hurd: Fix restoring SSE state on signalSamuel Thibault
mach_port_mod_refs() needs to avoid using SSE&MMX for __sigreturn2 to be able to use it without thrashing SSE&MMX.
2025-11-15Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGNSamuel Thibault
This is the rest of 627f5ede70d7 ("Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN"), for loongarch and or1k which missed it.
2025-11-14math: Optimize frexpl (intel96) with fast path for normal numbersOsama Abdelkader
Add fast path optimization for frexpl (80-bit x87 extended precision) using a single unsigned comparison to identify normal floating-point numbers and return immediately via arithmetic on the exponent field. The implementation uses arithmetic operations (se - ex ) to adjust the exponent directly, which is simpler than bit masking. For subnormals, the traditional multiply-based normalization is retained as it handles the split word format more reliably. The zero/infinity/NaN check groups these special cases together for better branch prediction. Benchmark results on Intel Core i9-13900H (13th Gen): Baseline: 25.543 ns/op Optimized: 25.531 ns/op Speedup: 1.00x (neutral) Zero: 17.774 ns/op Denormal: 23.900 ns/op Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-14Revert __HAVE_64B_ATOMICS configure checkAdhemerval Zanella
The 53807741fb44edb8e7c094cb5e7d4ff4e92a6ec1 added a configure check for 64-bit atomic operations that were not previously enabled on some 32-bit ABIs. However, the NPTL semaphore code casts a sem_t to a new_sem and issues a 64-bit atomic operation for __HAVE_64B_ATOMICS. Since sem_t has 32-bit alignment on 32-bit architectures, this prevents the use of 64-bit atomics even if the ABI supports them. Assume 64-bit atomic support from __WORDSIZE, which maps to how glibc defines it before the broken change. Also rename __HAVE_64B_ATOMICS to USE_64B_ATOMICS to define better the flag meaning. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-14x86: Increase allowable TSX abort rate to 6%.Carlos O'Donell
In pre-commit CI on an E5-2698 v4 we sometimes see ~5% aborts. Set the trip point to 6%. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-11-13htl: Remove errno and herrno from libpthreadSamuel Thibault
libc already has them.
2025-11-13htl: Drop pthread-functions infrastructureSamuel Thibault
All previously forwarded functions are now called directly (either via local call in libc, or through a __export).t
2025-11-13htl: Move __pthread_cleanup_stack out of libc_pthread_init.cSamuel Thibault
It does not actually need to be extern any more.
2025-11-13htl: move {,_IO_}f{,un,try}lockfile implementation into libcSamuel Thibault
2025-11-13linux: Add mseal to mips32 nofpu abilistAdhemerval Zanella
It was missing from 3d52fd274e9.
2025-11-13hppa: Consistently reference LGPL in copyright headerFlorian Weimer
The file was added with a GPL reference (but LGPL statement) in commit 0d6bed71502f053fa702ccbb7dd4fa6741b2a0ed ("hppa: Add ____longjmp_check C implementation."). Reviewed-by: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-11-13Change fromfp functions to return floating types following C23 (bug 28327)Joseph Myers
As discussed in bug 28327, C23 changed the fromfp functions to return floating types instead of intmax_t / uintmax_t. (Although the motivation in N2548 was reducing the use of intmax_t in library interfaces, the new version does have the advantage of being able to specify arbitrary integer widths for e.g. assigning the result to a _BitInt, as well as being able to indicate an error case in-band with a NaN return.) As with other such changes from interfaces introduced in TS 18661, implement the new types as a replacement for the old ones, with the old functions remaining as compat symbols but not supported as an API. The test generator used for many of the tests is updated to handle both versions of the functions. Tested for x86_64 and x86, and with build-many-glibcs.py. Also tested tgmath tests for x86_64 with GCC 7 to make sure that the modified case for older compilers in <tgmath.h> does work. Also tested for powerpc64le to cover the ldbl-128ibm implementation and the other things that are handled differently for that configuration. The new tests fail for ibm128, but all the failures relate to incorrect signs of zero results and turn out to arise from bugs in the underlying roundl, ceill, truncl and floorl implementations that I've reported in bug 33623, rather than indicating any bug in the actual new implementation of the functions for that format. So given fixes for those functions (which shouldn't be hard, and of course should add to the tests for those functions rather than relying only on indirect testing via fromfp), the fromfp tests should start passing for ibm128 as well.
2025-11-12math: Remove float_t and double_t [BZ #33563]Wilco Dijkstra
Remove uses of float_t and double_t. This is not useful on modern machines, and does not help given GCC defaults to -fexcess-precision=fast. One use of double_t remains to allow forcing the precision to double on targets where FLT_EVAL_METHOD=2. This fixes BZ #33563 on i486-pc-linux-gnu. Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-11-12math: Remove ldbl-128/s_fma.cWilco Dijkstra
Remove ldbl-128/s_fma.c - it makes no sense to use emulated float128 operations to emulate FMA. Benchmarking shows dbl-64/s_fma.c is about twice as fast. Remove redundant dbl-64/s_fma.c includes in targets that were trying to work around this issue. Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-11-12linux: Add mseal syscall supportAdhemerval Zanella
It has been added on Linux 6.10 (8be7258aad44b5e25977a98db136f677fa6f4370) as a way to block operations such as mapping, moving to another location, shrinking the size, expanding the size, or modifying it to a pre-existing memory mapping. Although the system only works on 64-bit CPUs, the entrypoint was added for all ABIs (since the kernel might eventually implement it for additional ones and/or the ABI can execute on a 64-bit kernel). Checked on x86_64-linux-gnu and aarch64-linux-gnu. Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-11-12aarch64: fix includes in SME testsYury Khrustalev
Use the correct include for the SIGCHLD macro: signal.h Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-12LoongArch: Call elf_ifunc_invoke for R_LARCH_IRELATIVE in elf_machine_relaXi Ruoyao
When R_LARCH_IRELATIVE is resolved by apply_irel, the ifunc resolver is called via elf_ifunc_invoke so it can read HWCAP from the __ifunc_arg_t argument. But when R_LARCH_IRELATIVE is resolved by elf_machine_rela (it will happen if we dlopen() a shared object containing R_LARCH_IRELATIVE), the ifunc resolver is invoked directly with no or different argument. This causes a segfault if the resolver uses the __ifunc_arg_t. Despite the LoongArch psABI does not specify this argument, IMO it's more convenient to have this argument IMO and per hyrum's rule there may be objects in wild which already relies on this argument (they just didn't blow up because they are not dlopen()ed yet). So make the behavior handling R_LARCH_IRELATIVE of elf_machine_rela same as apply_irel. This fixes BZ #33610. Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2025-11-12hurd: Drop remnants of cthreadsSamuel Thibault
These are not used in GNU/Hurd since very long now.
2025-11-11cdefs: Fix some typos in comments.Bruno Haible
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-11-11stdlib: Do not define once_flag, ONCE_FLAG_INIT for C++Florian Weimer
The definition of once_flag conflicts with std::once_flag in if “using namespace std;” is active. Updates commit a7ddbf456d97ac8d1aa7afd735e196a1488bd874 ("Add once_flag, ONCE_FLAG_INIT and call_once to stdlib.h for C23"). Suggested-by: Jonathan Wakely <jwakely@redhat.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-11-11x86-64: Fix a typo in fesetenv.c [BZ #33619]H.J. Lu
Fix a typo in commit 427c25278d1dae62dffa07ea5cd0fc33f07190af Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Fri Oct 31 17:00:46 2025 -0300 x86: Adapt "%v" usage on clang to emit VEX enconding @@ -103,8 +104,8 @@ __fesetenv (const fenv_t *envp) temp.__mxcsr = envp->__mxcsr; } - __asm__ ("fldenv %0\n" - "%vldmxcsr %1" : : "m" (temp), "m" (temp.__mxcsr)); + asm volatile ("fldenv %0" : "=m" (temp)); + ldmxcsr_inline_asm (&temp.__mxcsr); /* Success. */ return 0; "temp" is input not output. This fixes BZ #33619. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-11-11Set Prefer_No_AVX512 flag for hygon platformXie jiamei
Benchmarks indicate evex can be more profitable on Hygon hardware than AVX512. So add Prefer_No_AVX512 to make it run with evex. Change-Id: Icc59492f71fde7a783a8bd315714ffd6f7ecaf29 Signed-off-by: Li jing <lijing@hygon.cn> Signed-off-by: Xie jiamei <xiejiamei@hygon.cn>
2025-11-10math: Optimize frexpl (binary128) with fast path for normal numbersOsama Abdelkader
Add fast path optimization for frexpl (128-bit IEEE quad precision) using a single unsigned comparison to identify normal floating-point numbers and return immediately via arithmetic on the exponent field. The implementation uses arithmetic operations hx = hx - (ex << 48) to adjust the exponent in place, which is simpler and more efficient than bit masking. For subnormals, the traditional multiply-based normalization is retained for reliability with the split 64-bit word format. The zero/infinity/NaN check groups these special cases together for better branch prediction. This optimization provides the same algorithmic improvements as the other frexp variants while maintaining correctness for all edge cases. Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-10math: Optimize frexp (binary64) with fast path for normal numbersOsama Abdelkader
Add fast path optimization for frexp using a single unsigned comparison to identify normal floating-point numbers and return immediately via arithmetic on the bit representation. The implementation uses asuint64()/asdouble() from math_config.h and arithmetic operations to adjust the exponent, which generates better code than bit masking on ARM and RISC-V architectures. For subnormals, stdc_leading_zeros provides faster normalization than the traditional multiply approach. The zero/infinity/NaN check is simplified to (int64_t)(ix << 1) <= 0, which is more efficient than separate comparisons. Benchmark results on Intel Core i9-13900H (13th Gen): Baseline: 6.778 ns/op Optimized: 4.007 ns/op Speedup: 1.69x (40.9% faster) Zero: 3.580 ns/op (fast path) Denormal: 6.096 ns/op (slower, rare case) Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-11-10math: Optimize frexpf (binary32) with fast path for normal numbersOsama Abdelkader
Add fast path optimization for frexpf using a single unsigned comparison to identify normal floating-point numbers and return immediately via arithmetic on the bit representation. The implementation uses asuint()/asfloat() from math_config.h and arithmetic operations to adjust the exponent, which generates better code than bit masking on ARM and RISC-V architectures. For subnormals, stdc_leading_zeros provides faster normalization than the traditional multiply approach. The zero/infinity/NaN check is simplified to (int32_t)(hx << 1) <= 0, which is more efficient than separate comparisons. Benchmark results on Intel Core i9-13900H (13th Gen): Baseline: 5.858 ns/op Optimized: 4.003 ns/op Speedup: 1.46x (31.7% faster) Zero: 3.580 ns/op (fast path) Denormal: 5.597 ns/op (slower, rare case) Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-11-10benchtests: Add benchmarks for frexp functionsOsama Abdelkader
Add benchmark support for frexp, frexpf, and frexpl to measure the performance improvement of the fast path optimization. - Created frexp-inputs, frexpf-inputs, frexpl-inputs with random test values - Added frexp, frexpf, frexpl to bench-math list - Added CFLAGS to disable builtins for accurate benchmarking These benchmarks will be used to quantify the performance gains from the fast path optimization for normal floating-point numbers. Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
2025-11-10math: Sync acosh from CORE-MATHAdhemerval Zanella
The c9abdf80 fix handle some cases for RNDZ. Checked on x86_64-linux-gnu.
2025-11-10Filter out internal abort during ld.so buildAdhemerval Zanella
clang might generate an abort call when cleanup functions (set by __attribute__ ((cleanup)) calls functions not marked as nothrow. The hurd already provides abort for the loader at sysdeps/mach/hurd/dl-sysdep.c, and adding it rtld-stubbed-symbols triggers duplicate symbols. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-11-10x86: Fix THREAD_GSCOPE_RESET_FLAG build on clangAdhemerval Zanella
clang does not support __seg_fs in asm constraint. Reviewed-by: Uros Bizjak <ubizjak@gmail.com>
2025-11-10x86: Adapt "%v" usage on clang to emit VEX encondingAdhemerval Zanella
clang does not support the %v to select the AVX encoding, nor the '%d' asm contrain, and for AVX build it requires all 3 arguments. This patch add a new internal header, math-inline-asm.h, that adds functions to abstract the inline asm required differences between gcc and clang. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-11-10x86: math: Use of __libgcc_cmp_return__ iff compiler supports itAdhemerval Zanella
clang does not support '__attribute__ ((mode (__libgcc_cmp_return__)))', so use a more close related type instead fo the default 'int'.
2025-11-10string: Check if attribute can declared after function declarationAdhemerval Zanella
Some symbols that might be auto-generated by the compiler are redefined to internal alias (for instance mempcpy to __mempcpy). However, if fortify is enabled, the fortify wrapper is define before the alias re-defined and clang warns attribute declaration must precede definition. Use an asm alias if compiler does not support it, instead of an attribute. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-11-10nss: Suppress clang -Wstring-plus-int on __nss_shlib_revision definitionAdhemerval Zanella
clang issues an warning that adding 'unsigned long' to a string does not append to the string. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-11-10stdlib: Remove mp_clz_tab.cAdhemerval Zanella
The count_leading_zeros is not used anymore, so there is no need to provide the table for possible usage. The hppa already provides the compat symbol on libgcc-compat.c. Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-11-09hurd: make setpriority clamp nice values to 0..2*NZERO-1 [BZ #33614]Samuel Thibault
2025-11-09Revert "hurd: Make rename refuse trailing slashes [BZ #32570]"Samuel Thibault
This reverts commit 2ae4ec56c2b18c46ef8220bcddac4303a4b6ef1c. This introduced regressions, as rename should accept trailing slashes for directories: BZ #33607, BZ #33608 This was rather fixed on the server side: https://cgit.git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=e34000cb395a135dd2ad5c13e6f6d4c5c1006389
2025-11-08Add missing $(rpath-link) to elf/ld.so --library-pathSamuel Thibault
This is notably needed for GNU/Hurd's libmachuser.so and libhurduser.so.
2025-11-08Add missing $(rpath-link) to /elf/ld.so --library-pathSamuel Thibault
This is notably needed for GNU/Hurd's libmachuser.so and libhurduser.so.
2025-11-08nss: Add ERANGE testing to tst-nss-test4 (bug 33361)Carlos O'Donell
This adds testing for the fix added in commit: 0fceed254559836b57ee05188deac649bc505d05 "nss: Group merge does not react to ERANGE during merge (bug 33361)" The in-use group size is increased large enough to trigger ERANGE for initial buffers and cause a retry. The actualy size is approximately twice that required to trigger the defect, though any size larger than NSS_BUFLEN_GROUP triggers the defect. Without the fix the group is not merged and the failure is detected, but with the fix the ERANGE error is handled, buffers are enlarged and subsequently correctly merged. Tested with a/b testing before and after patching. Tested on x86_64 with no regression. Co-authored-by: Patsy Griffin <patsy@redhat.com> Reviewed-by: DJ Delorie <dj@redhat.com>
2025-11-07aarch64: Remove $(aarch64-bti) checkFlorian Weimer
The variable was removed in commit 2c421fc4302ecb729823ca442f9dfab9 ("AArch64: Cleanup PAC and BTI"), so this Makefile fragment is always excluded. Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
2025-11-07posix: Fix invalid flags test for p{write,read}v2Yury Khrustalev
Two tests fail from time to time when a new flag is added for the p{write,read}v2 functions in a new Linux kernel: - misc/tst-preadvwritev2 - misc/tst-preadvwritev64v2 This disrupts when testing Glibc on a system with a newer kernel and it seems we can try improve testing for invalid flags setting all the bits that are not supposed to be supported (rather than setting only the next unsupported bit). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-11-07support: Exit on consistency check failure in resolv_response_add_nameFlorian Weimer
Using TEST_VERIFY (crname_target != crname) instructs some analysis tools that crname_target == crname might hold. Under this assumption, they report a use-after-free for crname_target->offset below, caused by the previous free (crname). Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-11-06AArch64: Fix instability in AdvSIMD sinhJoe Ramsay
Previously presence of special-cases in one lane could affect the results in other lanes due to unconditional scalar fallback. The old WANT_SIMD_EXCEPT option (which has never been enabled in libmvec) has been removed from AOR, making it easier to spot and fix this. No measured change in performance. This patch applies cleanly as far back as 2.41, however there are conflicts with 2.40 where sinh was first introduced. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-06AArch64: Fix instability in AdvSIMD tanJoe Ramsay
Previously presence of special-cases in one lane could affect the results in other lanes due to unconditional scalar fallback. The old WANT_SIMD_EXCEPT option (which has never been enabled in libmvec) has been removed from AOR, making it easier to spot and fix this. 4% improvement in throughput with GCC 14 on Neoverse V1. This bug is present as far back as 2.39 (where tan was first introduced). Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>