aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)AuthorFilesLines
9 daysLinux: 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)").
9 dayshppa: Update libm-test-ulpsJohn David Anglin1-0/+112
Signed-off-by: John David Anglin <dave.anglin@bell.net>
9 daysRevert "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.
9 daysor1k: Update libm-test-ulpsStafford Horne1-0/+16
Regen to add new functions acospi, asinpi, atan2pi and atanpi.
9 dayshtl: move pthread_sigmask into libc.gfleury7-9/+13
Message-ID: <20241212220612.782313-3-gfleury@disroot.org>
9 dayshtl: move __pthread_sigstate into libc.gfleury1-0/+1
Message-ID: <20241212220612.782313-2-gfleury@disroot.org>
9 dayshtl: move __pthread_sigstate_destroy into libc.gfleury1-0/+1
Message-ID: <20241212220612.782313-1-gfleury@disroot.org>
9 daysReturn 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>
10 daysAdd 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>
11 daysAArch64: Update libm-test-ulpsWilco Dijkstra1-0/+80
Update ulps for acospi, asinpi, atanpi, atan2pi.
11 dayss390: 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.
11 daysor1k: Update libm-test-ulpsStafford Horne1-0/+27
Pick up new functions cospi, "Imaginary part of csin", exp10m1, exp2m1, log10p1, log2p1, sinpi and tanpi.
11 daysnptl: 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>
11 daysImplement 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.
12 daysImplement 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.
12 dayspowerpc64: 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>
13 dayspowerpc: 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>
13 daysAdd 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>
13 dayspowerpc64le: ROP changes for the dl-trampoline functionsPeter Bergner1-9/+31
Add ROP protection for the _dl_runtime_resolve and _dl_profile_resolve functions.
13 daysImplement 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>
2024-12-05x86-64: Update libm-test-ulpsH.J. Lu1-5/+5
Update x86-64 libm-test-ulps to fix FAIL: math/test-float64x-cospi FAIL: math/test-float64x-exp2m1 FAIL: math/test-float64x-sinpi FAIL: math/test-ldouble-cospi FAIL: math/test-ldouble-exp2m1 FAIL: math/test-ldouble-sinpi when building glibc with GCC 7.4. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-04Implement C23 sinpiJoseph Myers38-0/+285
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the sinpi functions (sin(pi*x)). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-04Implement C23 cospiJoseph Myers38-0/+287
C23 adds various <math.h> function families originally defined in TS 18661-4. Add the cospi functions (cos(pi*x)). Tested for x86_64 and x86, and with build-many-glibcs.py.
2024-12-04malloc: Optimize small memory clearing for callocH.J. Lu1-0/+49
Add calloc-clear-memory.h to clear memory size up to 36 bytes (72 bytes on 64-bit targets) for calloc. Use repeated stores with 1 branch, instead of up to 3 branches. On x86-64, it is faster than memset since calling memset needs 1 indirect branch, 1 broadcast, and up to 4 branches. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2024-12-02elf: Consolidate stackinfo.hAdhemerval Zanella7-171/+13
And use sane default the generic implementation. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-11-29Add threaded test of sem_trywaitJoseph Myers2-0/+78
All the existing glibc tests of sem_trywait are single-threaded. Add one that calls sem_trywait and sem_post in separate threads. Tested for x86_64.
2024-11-29nptl: Add new test for pthread_spin_trylockSergey Kolosov2-0/+83
Add a threaded test for pthread_spin_trylock attempting to lock already acquired spin lock and checking for correct return code. Reviewed-by: Florian Weimer <fweimer@redhat.com>