aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)AuthorFilesLines
2024-12-18cet: Pass -mshstk to compiler for tst-cet-legacy-10a[-static].cH.J. Lu1-2/+2
Pass -mshstk to compiler to silence Clang: In file included from ../sysdeps/x86_64/tst-cet-legacy-10a.c:2: ../sysdeps/x86_64/tst-cet-legacy-10.c:29:7: error: always_inline function '_get_ssp' requires target feature 'shstk', but would be inlined into function 'do_test' that is compiled without support for 'shstk' 29 | if (_get_ssp () != 0) | ^ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-17AArch64: Improve codegen of AdvSIMD expf familyJoana Cruz5-118/+127
Load the polynomial evaluation coefficients into 2 vectors and use lanewise MLAs. Also use intrinsics instead of native operations. expf: 3% improvement in throughput microbenchmark on Neoverse V1, exp2f: 5%, exp10f: 13%, coshf: 14%. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2024-12-17AArch64: Improve codegen of AdvSIMD atan(2)(f)Joana Cruz3-68/+160
Load the polynomial evaluation coefficients into 2 vectors and use lanewise MLAs. 8% improvement in throughput microbenchmark on Neoverse V1. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2024-12-17AArch64: Improve codegen of AdvSIMD logf function familyJoana Cruz3-40/+66
Load the polynomial evaluation coefficients into 2 vectors and use lanewise MLAs. 8% improvement in throughput microbenchmark on Neoverse V1 for log2 and log, and 2% for log10. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2024-12-16Fix sysdeps/x86/fpu/Makefile: Split and sort testsH.J. Lu1-1/+2
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-16sysdeps/x86/fpu/Makefile: Split and sort testsH.J. Lu1-2/+7
Split and sort tests in sysdeps/x86/fpu/Makefile. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-16Use empty initializer to silence GCC 4.9 or olderH.J. Lu3-6/+6
Use empty initializer to silence GCC 4.9 or older: getaddrinfo.c: In function ‘gaih_inet’: getaddrinfo.c:1135:24: error: missing braces around initializer [-Werror=missing-braces] / sizeof (struct gaih_typeproto)] = {0}; ^ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-15Linux: Check for 0 return value from vDSO getrandom probeFlorian Weimer1-1/+1
As of Linux 6.13, there is no code in the vDSO that declines this initialization request with the special ~0UL state size. If the vDSO has the function, the call succeeds and returns 0. It's expected that the code would follow the “a negative value indicating an error” convention, as indicated in the __cvdso_getrandom_data function comment, so that INTERNAL_SYSCALL_ERROR_P on glibc's side would return true. This commit changes the commit to check for zero to indicate success instead, which covers potential future non-zero success return values and error returns. Fixes commit 4f5704ea347e52ac3f272d1341da10aed6e9973e ("powerpc: Use correct procedure call standard for getrandom vDSO call (bug 32440)").
2024-12-15hppa: Update libm-test-ulpsJohn David Anglin1-0/+112
Signed-off-by: John David Anglin <dave.anglin@bell.net>
2024-12-15Revert "Add braces in initializers for GCC 4.9 or older"H.J. Lu3-6/+6
This reverts commit 8aa2a9e0339215012354f3c4a262edda838134e8. as not all targets need braces.
2024-12-15or1k: Update libm-test-ulpsStafford Horne1-0/+16
Regen to add new functions acospi, asinpi, atan2pi and atanpi.
2024-12-14htl: move pthread_sigmask into libc.gfleury7-9/+13
Message-ID: <20241212220612.782313-3-gfleury@disroot.org>
2024-12-14htl: move __pthread_sigstate into libc.gfleury1-0/+1
Message-ID: <20241212220612.782313-2-gfleury@disroot.org>
2024-12-14htl: move __pthread_sigstate_destroy into libc.gfleury1-0/+1
Message-ID: <20241212220612.782313-1-gfleury@disroot.org>
2024-12-15Return EXIT_UNSUPPORTED if __builtin_add_overflow unavailableH.J. Lu1-0/+7
Since GCC 4.9 doesn't have __builtin_add_overflow: In file included from tst-stringtable.c:180:0: stringtable.c: In function ‘stringtable_finalize’: stringtable.c:185:7: error: implicit declaration of function ‘__builtin_add_overflow’ [-Werror=implicit-function-declaration] else if (__builtin_add_overflow (previous->offset, ^ return EXIT_UNSUPPORTED for GCC 4.9 or older. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14Add braces in initializers for GCC 4.9 or olderH.J. Lu3-6/+6
Add braces to silence GCC 4.9 or older: getaddrinfo.c: In function ‘gaih_inet’: getaddrinfo.c:1135:24: error: missing braces around initializer [-Werror=missing-braces] / sizeof (struct gaih_typeproto)] = {0}; ^ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-13AArch64: Update libm-test-ulpsWilco Dijkstra1-0/+80
Update ulps for acospi, asinpi, atanpi, atan2pi.
2024-12-13s390: Simplify elf_machine_{load_address, dynamic} [BZ #31799]Stefan Liebler2-48/+20
If an executable is static PIE and has a non-zero load address (compare to elf/tst-pie-address-static), it segfaults as elf_machine_load_address() returns 0x0 and elf_machine_dynamic() returns the run-time instead of link-time address of _DYNAMIC. Now rely on __ehdr_start and _DYNAMIC as also done on other architectures. Checked back to old arch-levels that this approach works fine: - 31bit: -march=g5 - 64bit: -march=z900 Note, that there is no static-PIE support on 31bit, but this approach cleans it also up. Furthermore this cleanup in glibc does not change anything regarding the first GOT-element as the s390 ABI (https://github.com/IBM/s390x-abi) explicitely defines: The doubleword at _GLOBAL_OFFSET_TABLE_[0] is set by the linkage editor to hold the address of the dynamic structure, referenced with the symbol _DYNAMIC. This allows a program, such as the dynamic linker, to find its own dynamic structure without having yet processed its relocation entries. This is especially important for the dynamic linker, because it must initialize itself without relying on other programs to relocate its memory image.
2024-12-13or1k: Update libm-test-ulpsStafford Horne1-0/+27
Pick up new functions cospi, "Imaginary part of csin", exp10m1, exp2m1, log10p1, log2p1, sinpi and tanpi.
2024-12-13nptl: Add <thread_pointer.h> for or1kMichael Jeanson1-0/+30
This will be required by the rseq extensible ABI implementation on all Linux architectures exposing the '__rseq_size' and '__rseq_offset' symbols to set the initial value of the 'cpu_id' field which can be used by applications to test if rseq is available and registered. As long as the symbols are exposed it is valid for an application to perform this test even if rseq is not yet implemented in libc for this architecture. Compile tested with build-many-glibcs.py but I don't have access to any hardware to run the tests. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Stafford Horne <shorne@gmail.com>
2024-12-12Implement C23 atan2piJoseph Myers38-0/+285
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the atan2pi functions (atan2(y,x)/pi). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-11Implement C23 atanpiJoseph Myers38-0/+285
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the atanpi functions (atan(x)/pi). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-11powerpc64: Fix dl-trampoline.S big-endian / non-ROP build failurePeter Bergner1-1/+5
Fix a big-endian / non-ROP build failure caused by commit 4d9a4c02 when building dl-trampoline.S. Reported-by: Joseph Myers <josmyers@redhat.com>
2024-12-11powerpc: Use correct procedure call standard for getrandom vDSO call (bug 32440)Florian Weimer1-6/+11
A plain indirect function call does not work on POWER because success and failure are signaled through a flag register, and not via the usual Linux negative return value convention. This has potential security impact, in two ways: the return value could be out of bounds (EAGAIN is 11 on powerpc6le), and no random bytes have been written despite the non-error return value. Fixes commit 461cab1de747f3842f27a5d24977d78d561d45f9 ("linux: Add support for getrandom vDSO"). Reported-by: Ján Stanček <jstancek@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-12-11Add TEST_CC and TEST_CXX supportH.J. Lu2-55/+185
Support testing glibc build with a different C compiler or a different C++ compiler with $ ../glibc-VERSION/configure TEST_CC="gcc-6.4.1" TEST_CXX="g++-6.4.1" 1. Add LIBC_TRY_CC_AND_TEST_CC_OPTION, LIBC_TRY_CC_AND_TEST_CC_COMMAND and LIBC_TRY_CC_AND_TEST_LINK to test both CC and TEST_CC. 2. Add check and xcheck targets to Makefile.in and override build compiler options with ones from TEST_CC and TEST_CXX. Tested on Fedora 41/x86-64: 1. Building with GCC 14.2.1 and testing with GCC 6.4.1 and GCC 11.2.1. 2. Building with GCC 15 and testing with GCC 6.4.1. Support for GCC versions older than GCC 6.2 may need to change the test sources. Other targets may need to update configure.ac under sysdeps and modify Makefile.in to override target build compiler options. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-10powerpc64le: ROP changes for the dl-trampoline functionsPeter Bergner1-9/+31
Add ROP protection for the _dl_runtime_resolve and _dl_profile_resolve functions.
2024-12-10Implement C23 asinpiJoseph Myers38-0/+285
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the asinpi functions (asin(x)/pi). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-09Implement C23 acospiJoseph Myers38-0/+285
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the acospi functions (acos(x)/pi). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-09powerpc64le: ROP changes for the *context and setjmp functionsSachin Monga5-12/+60
Add ROP protection for the getcontext, setcontext, makecontext, swapcontext and __sigsetjmp_symbol functions. Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
2024-12-09nptl: Add <thread_pointer.h> for m68kMichael Jeanson1-0/+30
This will be required by the rseq extensible ABI implementation on all Linux architectures exposing the '__rseq_size' and '__rseq_offset' symbols to set the initial value of the 'cpu_id' field which can be used by applications to test if rseq is available and registered. As long as the symbols are exposed it is valid for an application to perform this test even if rseq is not yet implemented in libc for this architecture. Compile tested with build-many-glibcs.py but I don't have access to any hardware to run the tests. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Arjun Shankar <arjun@redhat.com>
2024-12-09nptl: Add <thread_pointer.h> for RISC-VMichael Jeanson1-0/+40
This will be required by the rseq extensible ABI implementation on all Linux architectures exposing the '__rseq_size' and '__rseq_offset' symbols to set the initial value of the 'cpu_id' field which can be used by applications to test if rseq is available and registered. As long as the symbols are exposed it is valid for an application to perform this test even if rseq is not yet implemented in libc for this architecture. Both code paths tested on a Visionfive 2 with Debian sid. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-12-09nptl: add RSEQ_SIG for RISC-VMichael Jeanson1-0/+44
Enable RSEQ for RISC-V, support was added in Linux 5.18. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-12-09AArch64: Improve codegen in users of ADVSIMD expm1 helperPierre Blanchard5-162/+135
Add inline helper for expm1 and rearrange operations so MOV is not necessary in reduction or around the special-case handler. Reduce memory access by using more indexed MLAs in polynomial. Speedup on Neoverse V1 for expm1 (19%), sinh (8.5%), and tanh (7.5%).
2024-12-09AArch64: Improve codegen in users of ADVSIMD log1p helperPierre Blanchard4-127/+93
Add inline helper for log1p and rearrange operations so MOV is not necessary in reduction or around the special-case handler. Reduce memory access by using more indexed MLAs in polynomial. Speedup on Neoverse V1 for log1p (3.5%), acosh (7.5%) and atanh (10%).
2024-12-09AArch64: Improve codegen in AdvSIMD logsPierre Blanchard3-106/+140
Remove spurious ADRP and a few MOVs. Reduce memory access by using more indexed MLAs in polynomial. Align notation so that algorithms are easier to compare. Speedup on Neoverse V1 for log10 (8%), log (8.5%), and log2 (10%). Update error threshold in AdvSIMD log (now matches SVE log).
2024-12-09AArch64: Improve codegen in AdvSIMD powPierre Blanchard1-53/+62
Remove spurious ADRP. Improve memory access by shuffling constants and using more indexed MLAs. A few more optimisation with no impact on accuracy - force fmas contraction - switch from shift-aided rint to rint instruction Between 1 and 5% throughput improvement on Neoverse V1 depending on benchmark.
2024-12-09s390x: Regenerated ULPs.Stefan Liebler1-0/+60
Needed after: "Implement C23 cospi" commit 0ae0af68d8fa3bf6cbe1e4f1de5929ff71de67b3 and "Implement C23 sinpi" commit 776938e8b8dcf2b59998979e91cc0f9db7d771a8 and "Implement C23 tanpi"
2024-12-09htl: move pthread_condattr_setpshared into libc.gfleury5-3/+11
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-8-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_setclock into libc.gfleury5-4/+12
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-7-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_init into libc.gfleury6-5/+9
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-6-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_getpshared into libc.gfleury5-3/+11
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-5-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_getclock into libc.gfleury5-4/+11
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-4-gfleury@disroot.org>
2024-12-09htl: move __pthread_default_condattr into libc.gfleury1-0/+1
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-3-gfleury@disroot.org>
2024-12-09htl: move pthread_condattr_destroy into libc.gfleury5-5/+6
Signed-off-by: gfleury <gfleury@disroot.org> Message-ID: <20241126205329.2215295-2-gfleury@disroot.org>
2024-12-08math: Add sinpi,cospi,tanpi sparc64 ulpsAndreas K. Hüttel1-0/+61
Linux catbus 6.1.112 #1 SMP Sun Oct 13 10:52:08 PDT 2024 sparc64 sun4v UltraSparc T5 (Niagara5) GNU/Linux gcc (Gentoo 13.3.1_p20240614 p17) 13.3.1 20240614 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-12-08math: Add tanpi aarch64 ulpsAndreas K. Hüttel1-0/+20
Linux dola 5.15.169-gentoo-dist #1 SMP Wed Oct 23 06:25:30 -00 2024 aarch64 GNU/Linux Vendor ID: ARM Model name: Neoverse-N1 gcc (Gentoo Hardened 13.3.1_p20241025 p1) 13.3.1 20241024 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-12-05Implement C23 tanpiJoseph Myers38-0/+285
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the tanpi functions (tan(pi*x)). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-05powerpc: Update ulpsAdhemerval Zanella1-0/+48
From 'Implement C23 cospi' (0ae0af68d8fa3bf6cbe1e4f1de5929ff71de67b3) and 'Implement C23 sinpi' (776938e8b8dcf2b59998979e91cc0f9db7d771a8).
2024-12-05AArch64: Update libm-test-ulpsWilco Dijkstra1-0/+40
Add sinpi/cospi.
2024-12-05i686: Update libm-test-ulpsH.J. Lu1-4/+4
Update i686 libm-test-ulps to fix FAIL: math/test-float64x-cospi FAIL: math/test-float64x-sinpi FAIL: math/test-ldouble-cospi FAIL: math/test-ldouble-sinpi when building glibc with GCC 7.4. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>