aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)AuthorFilesLines
2025-01-10Linux: Update internal copy of '<sys/rseq.h>'Michael Jeanson1-0/+11
Sync the internal copy of '<sys/rseq.h>' with the latest Linux kernel 'include/uapi/linux/rseq.h'. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-01-10nptl: Move the rseq area to the 'extra TLS' blockMichael Jeanson11-57/+205
Move the rseq area to the newly added 'extra TLS' block, this is the last step in adding support for the rseq extended ABI. The size of the rseq area is now dynamic and depends on the rseq features reported by the kernel through the elf auxiliary vector. This will allow applications to use rseq features past the 32 bytes of the original rseq ABI as they become available in future kernels. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-01-10nptl: Introduce <rseq-access.h> for RSEQ_* accessorsMichael Jeanson4-0/+239
In preparation to move the rseq area to the 'extra TLS' block, we need accessors based on the thread pointer and the rseq offset. The ONCE variant of the accessors ensures single-copy atomicity for loads and stores which is required for all fields once the registration is active. A separate header is required to allow including <atomic.h> which results in an include loop when added to <tcb-access.h>. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-01-10nptl: add rtld_hidden_proto to __rseq_size and __rseq_offsetMichael Jeanson2-15/+28
This allows accessing the internal aliases of __rseq_size and __rseq_offset from ld.so without ifdefs and avoids dynamic symbol binding at run time for both variables. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-01-10Add Linux 'extra TLS'Michael Jeanson1-0/+71
Add the Linux implementation of 'extra TLS' which will allocate space for the rseq area at the end of the TLS blocks in allocation order. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-01-10Add generic 'extra TLS'Michael Jeanson1-0/+46
Add the logic to append an 'extra TLS' block in the TLS block allocator with a generic stub implementation. The duplicated code in 'csu/libc-tls.c' and 'elf/dl-tls.c' is to handle both statically linked applications and the ELF dynamic loader. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-01-10nptl: Add rseq auxvalsMichael Jeanson5-9/+49
Get the rseq feature size and alignment requirement from the auxiliary vector for use inside the dynamic loader. Use '__rseq_size' directly to store the feature size. If the main thread registration fails or is disabled by tunable, reset the value to 0. This will be used in the TLS block allocator to compute the size and alignment of the rseq area block for the extended ABI support. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-01-10Add missing include guards to <dl-tls.h>Florian Weimer5-0/+20
Some architecture-specific variants lack header inclusion guards. Add them for consistency with the generic version.
2025-01-09elf: Always define TLS_TP_OFFSETFlorian Weimer4-0/+12
This will be needed to compute __rseq_offset outside of the TLS relocation machinery. Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
2025-01-09x86: Add missing #include <features.h> to <thread_pointer.h>Florian Weimer1-0/+2
It is required for __GNUC_PREREQ. Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
2025-01-09Move <thread_pointer.h> to kernel-independent sysdeps directoriesFlorian Weimer11-0/+0
Hurd is expected to use the same thread ABI as Linux. Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
2025-01-09math: Fix acosf when building with gcc <= 11Adhemerval Zanella7-15/+7
GCC <= 11 wrongly assumes the rounding is to nearest and performs a constant folding where it should evaluate since the result is not exact [1]. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57245
2025-01-09tests: Verify inheritance of cpu affinitySiddhesh Poyarekar2-0/+72
Add a couple of tests to verify that CPU affinity set using sched_setaffinity and pthread_setaffinity_np are inherited by a child process and child thread. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-01-09s390x: Regenerated ULPsStefan Liebler1-0/+2
ULPs update needed if build with gcc 11.5 or 10.5.
2025-01-09i686: Regenerate multiarch ulpsH.J. Lu1-3/+3
Regenerate i686 multiarch ulps on Intel Core i7-1195G7 compiled with -O2 -march=i686 using GCC 14.2.1. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-01-08Revert "configure: default to --prefix=/usr on GNU/Linux"DJ Delorie2-7/+2
This reverts commit 81439a116cf48583127ddf1f09809440aa40969a.
2025-01-08riscv: Update nofpu libm test ulpsDarius Rad1-4/+40
Fixes math test failures. Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-07or1k: Update fpu libm-test-ulpsStafford Horne1-6/+165
2025-01-07math: update powerpc ulps (this time LE)Andreas K. Hüttel1-8/+8
Linux bogsucker 6.1.55-gentoo-dist-hardened #1 SMP Sun Oct 1 18:03:02 UTC 2023 ppc64le POWER9 (architected), altivec supported CHRP IBM pSeries (emulated by qemu) GNU/Linux Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-07elf: Second ld.so relocation only if libc.so has been loadedFlorian Weimer3-0/+36
Commit 8f8dd904c4a2207699bb666f30acceb5209c8d3f (“elf: rtld_multiple_ref is always true”) removed some code that happened to enable compatibility with programs that do not link against libc.so. Such programs cannot call dlopen or any dynamic linker functions (except __tls_get_addr), so this is not really useful. Still ld.so should not crash with a null-pointer dereference or undefined symbol reference in these cases. In the main relocation loop, call _dl_relocate_object unconditionally because it already checks if the object has been relocated. If libc.so was loaded, self-relocate ld.so against it and call __rtld_mutex_init and __rtld_malloc_init_real to activate the full implementations. Those are available only if libc.so is there, so skip these initialization steps if libc.so is absent. Without libc.so, the global scope can be completely empty. This can cause ld.so self-relocation to fail because if it uses symbol-based relocations, which is why the second ld.so self-relocation is not performed if libc.so is missing. The previous concern regarding GOT updates through self-relocation no longer applies because function pointers are updated explicitly through __rtld_mutex_init and __rtld_malloc_init_real, and not through relocation. However, the second ld.so self-relocation is still delayed, in case there are other symbols being used. Fixes commit 8f8dd904c4a2207699bb666f30acceb5209c8d3f (“elf: rtld_multiple_ref is always true”). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-01-07Revert "x86_64: Remove unused padding from tcbhead_t"Florian Weimer1-0/+12
This reverts commit 30d3fd7f4f4bc8f767d73ad4e4b005c1bd234310. The padding is required by Chromium's MaybeUpdateGlibcTidCache in sandbox/linux/services/namespace_sandbox.cc. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-01-07hurd: Accept null arguments for utimensat pathnameSamuel Thibault1-5/+11
This follows Linux' behavior, making it a replacement for the futimens interface.
2025-01-07mach: Make clock_nanosleep also check tv_secSamuel Thibault1-0/+1
2025-01-06i386: Update libm-test-ulpsAdhemerval Zanella1-29/+29
gcc version 14.2.1 targeting '-m32 -march=i586'.
2025-01-06nptl: Add <thread_pointer.h> for C-SKYMichael 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: Florian Weimer <fweimer@redhat.com>
2025-01-06nptl: Add <thread_pointer.h> for microblazeMichael 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: Florian Weimer <fweimer@redhat.com>
2025-01-06math: update i686 multiarch ulpsAndreas K. Hüttel1-36/+36
Linux waikiki 6.6.53-gentoo #1 SMP Wed Oct 2 13:21:27 CEST 2024 x86_64 AMD EPYC 7532 32-Core Processor AuthenticAMD GNU/Linux Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-06hurd: Fix shutdown() errno on non-sockSamuel Thibault1-0/+5
2025-01-06math: update mips64 ulpsAndreas K. Hüttel1-0/+141
Linux matoro-mipsdev 6.12.0-gentoo-mips #2 SMP Tue Nov 19 15:34:04 EST 2024 mips64 Cavium Octeon II V0.10 EBB6800 (CN6880p2.2-1200-AAP) GNU/Linux Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-06LoongArch: Regenerate preconfigure. [bug 32521]mengqinggang2-0/+2
Add "mtls_descriptor=desc" to preconfigure.ac and regenerate preconfigure. Fix failure: elf/tst-gnu2-tls2. Reported-by: Joseph S. Myers <josmyers@redhat.com> Reported-by: Andreas K. Huettel <dilfridge@gentoo.org>
2025-01-06or1k: Update nofpu libm-test-ulpsStafford Horne1-12/+8
Updates tolerances due to change to use CORE-MATH
2025-01-05math: update alpha ulpsAndreas K. Hüttel1-12/+96
Linux matoro-alphadev 6.12.3-gentoo-alpha #1 Sun Dec 8 04:39:11 EST 2024 alpha EV68CB Titan GNU/Linux Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-05loongarch: Drop __GI_XXX for strcpy/stpcpy IFUNC implementationsH.J. Lu4-5/+0
There is no need for __GI_XXX symbols, like __GI___strcpy_aligned since __strcpy_aligned is used directly. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-01-04hppa: Update libm-test-ulpsJohn David Anglin1-13/+13
Signed-off-by: John David Anglin <dave.anglin@bell.net>
2025-01-04math: update loongarch64 ulpsAndreas K. Hüttel1-0/+140
Linux matoro-loongdev 6.12.0-gentoo-loongarch64 #1 SMP PREEMPT Fri Nov 22 00:38:46 EST 2024 loongarch64 GNU/Linux Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-04loongarch: Provide stpcpy in stpcpy-aligned.S for rtld [BZ #32512]H.J. Lu1-0/+1
When stpcpy-aligned.S is used in rtld, provide stpcpy as a weak alias of __stpcpy. This fixes BZ #32512. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-01-03AArch64: Improve codegen in SVE expm1f and usersLuna Lamb4-45/+44
Use unpredicated muls, use absolute compare and improve memory access. Expm1f, sinhf and tanhf show 7%, 5% and 1% improvement in throughput microbenchmark on Neoverse V1.
2025-01-03AArch64: Add vector tanpi routinesJoe Ramsay14-1/+349
Vector variant of the new C23 tanpi. New tests pass on AArch64.
2025-01-03AArch64: Add vector cospi routinesJoe Ramsay14-0/+332
Vector variant of the new C23 cospi. New tests pass on AArch64.
2025-01-03AArch64: Add vector sinpi to libmvecJoe Ramsay14-0/+322
Vector variant of the new C23 sinpi. New tests pass on AArch64.
2025-01-03AArch64: Improve codegen for SVE log1pf usersYat Long Poon5-122/+95
Reduce memory access by using lanewise MLA and reduce number of MOVPRFXs. Move log1pf implementation to inline helper function. Speedup on Neoverse V1 for log1pf (10%), acoshf (-1%), atanhf (2%), asinhf (2%).
2025-01-03AArch64: Improve codegen for SVE logsYat Long Poon4-47/+114
Reduce memory access by using lanewise MLA and moving constants to struct and reduce number of MOVPRFXs. Update maximum ULP error for double log_sve from 1 to 2. Speedup on Neoverse V1 for log (3%), log2 (5%), and log10 (4%).
2025-01-03AArch64: Improve codegen in SVE tansLuna Lamb2-41/+68
Improves memory access. Tan: MOVPRFX 7 -> 2, LD1RD 12 -> 5, move MOV away from return. Tanf: MOV 2 -> 1, MOVPRFX 6 -> 3, LD1RW 5 -> 4, move mov away from return.
2025-01-03AArch64: Improve codegen in AdvSIMD asinhLuna Lamb1-55/+119
Improves memory access and removes spills. Load the polynomial evaluation coefficients into 2 vectors and use lanewise MLAs. Reduces MOVs 6->3 , LDR 11->5, STR/STP 2->0, ADRP 3->2.
2025-01-04Rename have-mtls-descriptor to have-test-mtls-descriptorH.J. Lu2-5/+5
Since have-mtls-descriptor is only used for glibc testing, rename it to have-test-mtls-descriptor. Also enable tst-gnu2-tls2-amx only if $(have-test-mtls-descriptor) == gnu2. Tested with GCC 14 and Clang 19/18/17 on x86-64. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-01-03math: update powerpc ulpsAndreas K. Hüttel1-25/+25
Linux timberdoodle 6.1.60-gentoo-dist-hardened #1 SMP Fri Dec 1 22:10:49 UTC 2023 ppc64 POWER9 (architected), altivec supported CHRP IBM pSeries (emulated by qemu) GNU/Linux Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-03math: update sparc ulpsAndreas K. Hüttel1-15/+95
Linux catbus 6.1.112 #1 SMP Sun Oct 13 10:52:08 PDT 2024 sparc64 sun4v UltraSparc T5 (Niagara5) GNU/Linux Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-03math: update s390 ulpsAndreas K. Hüttel1-15/+95
Linux lgentoo4 6.8.9-gentoo #1 SMP Tue May 7 09:52:48 EDT 2024 s390x 8561 IBM GNU/Linux Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-03not-cancel.h: Support testing fortify build with ClangH.J. Lu1-5/+5
When Clang is used to test fortify glibc build configured with --enable-fortify-source=N clang issues errors like In file included from tst-rfc3484.c:60: In file included from ./getaddrinfo.c:81: ../sysdeps/unix/sysv/linux/not-cancel.h:36:10: error: reference to overloaded function could not be resolved; did you mean to call it? 36 | __typeof (open64) __open64_nocancel; | ^~~~~~~~ ../include/bits/../../io/bits/fcntl2.h:127:1: note: possible target for call 127 | open64 (__fortify_clang_overload_arg (const char *, ,__path), int __oflag, | ^ ../include/bits/../../io/bits/fcntl2.h:118:1: note: possible target for call 118 | open64 (__fortify_clang_overload_arg (const char *, ,__path), int __oflag) | ^ ../include/bits/../../io/bits/fcntl2.h:114:1: note: possible target for call 114 | open64 (const char *__path, int __oflag, mode_t __mode, ...) | ^ ../io/fcntl.h:219:12: note: possible target for call 219 | extern int open64 (const char *__file, int __oflag, ...) __nonnull ((1)); | ^ because clang fortify support for functions with variable arguments relies on function overload. Update not-cancel.h to avoid __typeof on functions with variable arguments. Co-Authored-By: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-01-02RISC-V: Regenerate ULPsAurelien Jarno1-1/+158
Generated on a VisionFive 2 board running Linux version 6.12.6 and GCC 14.2.0. Needed due to: - commit bbd578b38df4 ("math: Use expm1f from CORE-MATH") - commit 8ae9e513762b ("math: Use log1pf from CORE-MATH") - commit 0ae0af68d8fa ("Implement C23 cospi") - commit 776938e8b8dc ("Implement C23 sinpi") - commit f9e90e4b4ce7 ("Implement C23 tanpi") - commit 28d102d15c6a ("Implement C23 acospi") - commit f962932206ec ("Implement C23 asinpi") - commit ffe79c446ced ("Implement C23 atanpi") - commit 3374de90386f ("Implement C23 atan2pi") - commit a357d6273f79 ("math: Use atanf from CORE-MATH") - commit 6f9bacf36b20 ("math: Use atan2f from CORE-MATH") - commit e5ca265a9c90 ("new inputs with large errors for [a]cospi, [a]sinpi, [a]tanpi, atan2pi") Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>