Commit graph

41955 commits

Author SHA1 Message Date
Samuel Thibault
53a71b9f66 hurd: Mark more memory-hungry tests as unsupported
until RLIMIT_AS support gets commited in gnumach.
2025-01-11 04:17:38 +01:00
Michael Jeanson
072795229c Linux: Update internal copy of '<sys/rseq.h>'
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-10 20:20:48 +00:00
Michael Jeanson
540c817266 nptl: Remove the rseq area from 'struct pthread'
The rseq extensible ABI implementation moved the rseq area to the 'extra
TLS' block, remove the unused 'rseq_area' member of 'struct pthread'.

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-10 20:20:39 +00:00
Michael Jeanson
93d0bfbe8f nptl: Move the rseq area to the 'extra TLS' block
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-10 20:20:27 +00:00
Michael Jeanson
494d65129e nptl: Introduce <rseq-access.h> for RSEQ_* accessors
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-10 20:20:17 +00:00
Michael Jeanson
be440f6c38 nptl: add rtld_hidden_proto to __rseq_size and __rseq_offset
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-10 20:19:53 +00:00
Michael Jeanson
304221775c Add Linux 'extra TLS'
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-10 20:19:40 +00:00
Michael Jeanson
0e411c5d30 Add generic 'extra TLS'
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-10 20:19:28 +00:00
Michael Jeanson
c813c1490d nptl: Add rseq auxvals
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-10 20:19:07 +00:00
Florian Weimer
4a9a8a5098 Add missing include guards to <dl-tls.h>
Some architecture-specific variants lack header inclusion guards.
Add them for consistency with the generic version.
2025-01-10 19:02:47 +01:00
Sam James
c3d1dac96b
malloc: obscure calloc use in tst-calloc
Similar to a9944a52c9 and
f9493a15ea, we need to hide calloc use from
the compiler to accommodate GCC's r15-6566-g804e9d55d9e54c change.

First, include tst-malloc-aux.h, but then use `volatile` variables
for size.

The test passes without the tst-malloc-aux.h change but IMO we want
it there for consistency and to avoid future problems (possibly silent).

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-01-10 03:57:06 +00:00
H.J. Lu
dad44389f2 configure: Clear libc_cv_cc_wimplicit_fallthrough if not supported
Clear libc_cv_cc_wimplicit_fallthrough if -Wimplicit-fallthrough isn't
supported.  Tested with GCC 6.4.1 on x86-64.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2025-01-10 09:07:05 +08:00
Florian Weimer
d1da011118 elf: Always define TLS_TP_OFFSET
This will be needed to compute __rseq_offset outside of the TLS
relocation machinery.

Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
2025-01-09 19:30:44 +01:00
Florian Weimer
9b71570c46 x86: Add missing #include <features.h> to <thread_pointer.h>
It is required for __GNUC_PREREQ.

Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
2025-01-09 19:30:41 +01:00
Florian Weimer
7a3e2e877a Move <thread_pointer.h> to kernel-independent sysdeps directories
Hurd is expected to use the same thread ABI as Linux.

Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
2025-01-09 19:30:16 +01:00
Adhemerval Zanella
9cc9f8e11e math: Fix acosf when building with gcc <= 11
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-09 12:53:58 -03:00
Siddhesh Poyarekar
e41aabcc93 tests: Verify inheritance of cpu affinity
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-09 10:51:38 -05:00
Stefan Liebler
82688ca310 s390x: Regenerated ULPs
ULPs update needed if build with gcc 11.5 or 10.5.
2025-01-09 10:02:21 +01:00
H.J. Lu
502a71c578 i686: Regenerate multiarch ulps
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-09 07:06:35 +08:00
DJ Delorie
0bba6c29a1 Revert "configure: default to --prefix=/usr on GNU/Linux"
This reverts commit 81439a116c.
2025-01-08 16:55:05 -05:00
Darius Rad
274f73978c
riscv: Update nofpu libm test ulps
Fixes math test failures.

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-08 21:38:24 +01:00
Florian Weimer
39183f47d8 elf: Minimize library dependencies of tst-nolink-libc.c
On 32-bit Arm, -fasynchronous-unwind-tables creates a reference
to the symbol __aeabi_unwind_cpp_pr0.  Compile the tests without
this flag even if it is passed as part of CC, to avoid linker
failures.
2025-01-08 16:55:31 +01:00
Samuel Thibault
a4c414796a include/string.h: Also redirect calls if not inlined in libpthread
htl's pt-alloc.c calls __mempcpy, which is #defined to
__builtin_mempcpy, but which does not happen to get inlined (the size is
dynamic), and then gcc emits a reference to mempcpy, thus violating
symbol exposition standard. We thus also have to redirect such
references to __mempcpy too.
2025-01-07 20:53:18 +01:00
Stafford Horne
e3ec3fbe64 or1k: Update fpu libm-test-ulps 2025-01-07 16:13:26 +00:00
Andreas K. Hüttel
2750548afe
math: update powerpc ulps (this time LE)
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-07 15:58:45 +01:00
Florian Weimer
706209867f elf: Second ld.so relocation only if libc.so has been loaded
Commit 8f8dd904c4 (“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 8f8dd904c4 (“elf:
rtld_multiple_ref is always true”).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2025-01-07 09:19:01 +01:00
Florian Weimer
a257f201dd Revert "x86_64: Remove unused padding from tcbhead_t"
This reverts commit 30d3fd7f4f.

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-07 09:17:01 +01:00
Florian Weimer
c4ed6a380e Revert "nptl: More useful padding in struct pthread"
This reverts commit 7c22dcda27.

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-07 09:16:47 +01:00
Samuel Thibault
2d196c2e10 tst-xdirent: Fix allocating dirent for readdir_r call
As documented in the glibc manual, “Some systems don’t define the d_name
element sufficiently long”, and it provides an example of using a union to
properly allocate the storage under the dirent.
2025-01-07 01:56:41 +01:00
Samuel Thibault
75fed76dfd hurd: Accept null arguments for utimensat pathname
This follows Linux' behavior, making it a replacement for the futimens
interface.
2025-01-07 01:36:43 +01:00
Samuel Thibault
fb1059d42a mach: Make clock_nanosleep also check tv_sec 2025-01-07 01:24:21 +01:00
Samuel Thibault
7bc54f0965 htl: Fix making pthread_join check timeout value 2025-01-07 01:02:20 +01:00
Adhemerval Zanella
15b7a675bd i386: Update libm-test-ulps
gcc version 14.2.1 targeting '-m32 -march=i586'.
2025-01-06 16:04:04 -03:00
Michael Jeanson
ddf0a10e63 nptl: Add <thread_pointer.h> for C-SKY
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-06 18:33:28 +00:00
Michael Jeanson
f3e690ae84 nptl: Add <thread_pointer.h> for microblaze
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-06 18:33:28 +00:00
Andreas K. Hüttel
2af56da855
math: update i686 multiarch ulps
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-06 19:24:01 +01:00
Samuel Thibault
6ab5980f4c hurd: Fix shutdown() errno on non-sock 2025-01-06 18:03:16 +01:00
Andreas K. Hüttel
ff806e9233
math: update mips64 ulps
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-06 12:31:52 +01:00
mengqinggang
d4cdb601df LoongArch: Regenerate preconfigure. [bug 32521]
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-06 10:27:03 +08:00
Stafford Horne
9327c8edcd or1k: Update nofpu libm-test-ulps
Updates tolerances due to change to use CORE-MATH
2025-01-06 00:31:40 +00:00
Andreas K. Hüttel
db92aff28f
math: update alpha ulps
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-05 20:02:53 +01:00
H.J. Lu
c2567b18fd loongarch: Drop __GI_XXX for strcpy/stpcpy IFUNC implementations
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-05 05:40:07 +08:00
John David Anglin
d7b37322c5 hppa: Update libm-test-ulps
Signed-off-by: John David Anglin <dave.anglin@bell.net>
2025-01-04 10:39:35 -05:00
Andreas K. Hüttel
377a61c020
math: update loongarch64 ulps
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-04 14:57:31 +01:00
Andreas K. Hüttel
5ecdbe3305
Regenerate libc.pot
Only changes to line numbers

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2025-01-04 11:05:03 +01:00
H.J. Lu
8e524ff79b loongarch: Provide stpcpy in stpcpy-aligned.S for rtld [BZ #32512]
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-04 06:50:02 +08:00
Luna Lamb
f86b4cf875 AArch64: Improve codegen in SVE expm1f and users
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-03 21:42:51 +00:00
Joe Ramsay
080998f6e7 AArch64: Add vector tanpi routines
Vector variant of the new C23 tanpi. New tests pass on AArch64.
2025-01-03 21:39:56 +00:00
Joe Ramsay
40c3a06293 AArch64: Add vector cospi routines
Vector variant of the new C23 cospi. New tests pass on AArch64.
2025-01-03 21:39:56 +00:00
Joe Ramsay
6050b45716 AArch64: Add vector sinpi to libmvec
Vector variant of the new C23 sinpi. New tests pass on AArch64.
2025-01-03 21:39:56 +00:00