aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach
AgeCommit message (Collapse)AuthorFilesLines
2025-11-22htl: move c11 symbols into libc.gfleury4-42/+84
thrd_{create,detach,exit,join}. mtx_{init,destroy,lock,trylock,unlock,timeelock}. cnd_{broadcast,destroy,init,signal,timewait,wait,destroy} tss_{create,delete,get,set}. call_once. Message-ID: <20251121191336.1224485-1-gfleury@disroot.org>
2025-11-21htl: Move pthread_atfork compatibility symbol to libcSamuel Thibault2-1/+1
There is no new symbol version because of the compatibility symbol status.
2025-11-21htl: move pthread_spin_{destroy, lock, init, trylock, unlock) and remove ↵gfleury5-53/+20
_pthread_spin_lock, into libc. Message-ID: <20251120085647.326643-1-gfleury@disroot.org>
2025-11-20hurd: Add missing free_sized and free_aligned_sizedSamuel Thibault4-0/+8
56549264d1e1 ("malloc: add free_sized and free_aligned_sized from C23") missed adding them.
2025-11-18htl: move pthread_hurd_cond_timedwait_np, pthread_hurd_cond_wait_np into libc.gfleury6-6/+20
Message-ID: <20251118125044.1160780-3-gfleury@disroot.org>
2025-11-18htl: move pthread_getname_np/setname_np into libc.gfleury6-6/+25
Message-ID: <20251118125044.1160780-2-gfleury@disroot.org>
2025-11-17htl: move pthread_create to into libcSamuel Thibault5-12/+8
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-16hurd: Fix restoring SSE state on signalSamuel Thibault1-0/+5
mach_port_mod_refs() needs to avoid using SSE&MMX for __sigreturn2 to be able to use it without thrashing SSE&MMX.
2025-11-13htl: Remove errno and herrno from libpthreadSamuel Thibault2-4/+0
libc already has them.
2025-11-13htl: Drop pthread-functions infrastructureSamuel Thibault1-3/+0
All previously forwarded functions are now called directly (either via local call in libc, or through a __export).t
2025-11-13htl: move {,_IO_}f{,un,try}lockfile implementation into libcSamuel Thibault3-12/+3
2025-11-13Change fromfp functions to return floating types following C23 (bug 28327)Joseph Myers2-0/+64
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-12hurd: Drop remnants of cthreadsSamuel Thibault6-82/+0
These are not used in GNU/Hurd since very long now.
2025-11-10Filter out internal abort during ld.so buildAdhemerval Zanella2-0/+4
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-09hurd: make setpriority clamp nice values to 0..2*NZERO-1 [BZ #33614]Samuel Thibault1-0/+3
2025-11-09Revert "hurd: Make rename refuse trailing slashes [BZ #32570]"Samuel Thibault1-16/+3
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-05math: Remove the SVID error handling from tgammafAdhemerval Zanella1-0/+1
It improves latency for about 1.5% and throughput for about 2-4%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-05math: Remove the SVID error handling from lgammaf/lgammaf_rAdhemerval Zanella1-0/+2
It improves latency throughput for about 2%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-05math: Remove the SVID error handling from atan2fAdhemerval Zanella1-0/+1
It improves latency for about 3-6% and throughput for about 5-12%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-04math: Remove the SVID error handling wrapper from sqrtAdhemerval Zanella1-0/+1
i386 and m68k architectures should use math-use-builtins-sqrt.h rather than relying on architecture-specific or inline assembly implementations. The PowerPC optimization for PPC 601/603 (30 years old) is removed. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-04math: Remove the SVID error handling from sinhfAdhemerval Zanella1-0/+1
It improves latency for about 3-10% and throughput for about 5-15%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-04math: Remove the SVID error handling from remainderAdhemerval Zanella1-0/+1
The optimized i386 version is faster than the generic one, and gcc implements it through the builtin. This optimization enables us to migrate the implementation to a C version. The performance on a Zen3 chip is similar to the SVID one. The m68k provided an optimized version through __m81_u(remainderf) (mathimpl.h), and gcc does not implement it through a builtin (different than i386). Performance improves a bit on x86_64 (Zen3, gcc 15.2.1): reciprocal-throughput input master NO-SVID improvement x86_64 subnormals 18.8522 16.2506 13.80% x86_64 normal 421.8260 403.9270 4.24% x86_64 close-exponent 21.0579 18.7642 10.89% i686 subnormals 21.3443 21.4229 -0.37% i686 normal 525.8380 538.807 -2.47% i686 close-exponent 21.6589 21.7983 -0.64% Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-04math: Remove the SVID error handling from remainderfAdhemerval Zanella1-0/+1
The optimized i386 version is faster than the generic one, and gcc implements it through the builtin. This optimization enables us to migrate the implementation to a C version. The performance on a Zen3 chip is similar to the SVID one. The m68k provided an optimized version through __m81_u(remainderf) (mathimpl.h), and gcc does not implement it through a builtin (different than i386). Performance improves a bit on x86_64 (Zen3, gcc 15.2.1): reciprocal-throughput input master NO-SVID improvement x86_64 subnormals 17.5349 15.6125 10.96% x86_64 normal 53.8134 52.5754 2.30% x86_64 close-exponent 20.0211 18.6656 6.77% i686 subnormals 21.8105 20.1856 7.45% i686 normal 73.1945 71.2199 2.70% i686 close-exponent 22.2141 20.331 8.48% Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30math: Remove the SVID error handling wrapper from yn/jnAdhemerval Zanella1-0/+2
Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30math: Remove the SVID error handling wrapper from y1/j1Adhemerval Zanella1-0/+2
Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30math: Remove the SVID error handling wrapper from y0/j0Adhemerval Zanella1-0/+2
Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30math: Remove the SVID error handling from coshfAdhemerval Zanella1-0/+1
It improves latency for about 3-10% and throughput for about 5-15%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30math: Remove the SVID error handling from atanhfAdhemerval Zanella1-0/+1
It improves latency for about 1-10% and throughput for about 5-10%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30math: Remove the SVID error handling from acoshfAdhemerval Zanella1-0/+1
It improves latency for about 3-7% and throughput for about 5-10%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30math: Remove the SVID error handling from asinfAdhemerval Zanella1-0/+1
It improves latency for about 2% and throughput for about 5%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30math: Remove the SVID error handling from acosfAdhemerval Zanella1-0/+1
It improves latency for about 2-10% and throughput for about 5-10%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30math: Remove the SVID error handling from log10fAdhemerval Zanella1-0/+1
It improves latency for about 3-10% and throughput for about 5-10%. Tested on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30i386: Remove the SVID error handling from fmodfAdhemerval Zanella1-0/+1
The optimized i386 version is faster than the generic one, and gcc implements it through the builtin. It allows us to move the implementation to a C one. The performance on a Zen3 chip is slight better: reciprocal-throughput input master no-SVID improvement i686 subnormals 22.4741 20.1571 10.31% i686 normal 74.1631 70.3606 5.13% i686 close-exponent 22.5625 20.2435 10.28% Tested on i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-30i386: Remove the SVID error handling from fmodAdhemerval Zanella1-0/+1
The optimized i386 version is faster than the generic one, and gcc implements it through the builtin. It allows us to move the implementation to a C one. The performance on a Zen3 chip is similar to the SVID one. Tested on i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-28Rename uimaxabs to umaxabs (bug 33325)Joseph Myers2-0/+2
The C2y function uimaxabs has been renamed to umaxabs. Implement this change in glibc, keeping a compat symbol under the old name, copying the test to test the new name and changing the old test to test the compat symbol. Jakub has done the corresponding change to the built-in function in GCC. Tested for x86_64 and x86.
2025-10-20posix: Defined _POSIX_VDISABLE as integer literalAdhemerval Zanella1-1/+1
The constant should be used with c_cc, which for all supported ABIs is defined as unsigned char. By using it as literar char constant, clang triggers an error when compared with signal literal on ABIs that define 'char' as unsigned. On aarch64, clang shows: ../sysdeps/posix/fpathconf.c:118:21: error: right side of operator converted from negative value to unsigned: -1 to 18446744073709551615 [-Werror] #if _POSIX_VDISABLE == -1 ~~~~~~~~~~~~~~~ ^ ~~ Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-10-17Implement C23 memalignmentJoseph Myers2-0/+2
Add the C23 memalignment function (query the alignment of a pointer) to glibc. Given how simple this operation is, it would make sense for compilers to inline calls to this function, but I'm treating that as a compiler matter (compilers should add it as a built-in function) rather than adding an inline version to glibc headers (although such an inline version would be reasonable as well). I've filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122117 for this feature in GCC. Tested for x86_64 and x86.
2025-10-01Implement C23 memset_explicit (bug 32378)Joseph Myers2-0/+4
Add the C23 memset_explicit function to glibc. Everything here is closely based on the approach taken for explicit_bzero. This includes the bits that relate to internal uses of explicit_bzero within glibc (although we don't currently have any such internal uses of memset_explicit), and also includes the nonnull attribute (when we move to nonnull_if_nonzero for various functions following C2y, this function should be included in that change). The function is declared both for __USE_MISC and for __GLIBC_USE (ISOC23) (so by default not just for compilers defaulting to C23 mode). Tested for x86_64 and x86.
2025-09-22hurd: Note BZ #30166 as fixedSamuel Thibault1-31/+0
802b0eba519b ("hurd: implement RLIMIT_AS against Mach RPCs") brought the needed RLIMIT_AS support for memory-crunchy tests.
2025-09-22hurd: implement RLIMIT_AS against Mach RPCsDiego Nieto Cid3-1/+111
Check for VM limit RPCs * config.h.in: add #undef for HAVE_MACH_VM_GET_SIZE_LIMIT and HAVE_MACH_VM_SET_SIZE_LIMIT. * sysdeps/mach/configure.ac: use mach_RPC_CHECK to check for vm_set_size_limit and vm_get_size_limit RPCs in gnumach.defs. * sysdeps/mach/configure: regenerate file. Use vm_get_size_limit to initialize RLIMIT_AS * hurd/hurdrlimit.c(init_rlimit): use vm_get_size_limit to initialize RLIMIT_AS entry of the _hurd_rlimits array. Notify the kernel of the new VM size limits * sysdeps/mach/hurd/setrlimit.c: use the vm_set_size_limit RPC, if available, to notify the kernel of the new limits. Retry RPC calls if they were interrupted by a signal. Message-ID: <03fb90a795b354a366ee73f56f73e6ad22a86cda.1755220108.git.dnietoc@gmail.com>
2025-09-21hurd: catch SIGSEGV on returning from signal handlerSamuel Thibault2-2/+23
On stack overflow typically, we may not actually have room on the stack to trampoline back from the signal handler. We have to detect this before locking the ss, otherwise the signal thread will be stuck on taking the ss lock while trying to post SIGSEGV.
2025-08-27elf: early conversion of elf p_flags to mprotect flagsCupertino Miranda3-2/+3
This patch replaces _dl_stack_flags global variable by _dl_stack_prot_flags. The advantage is that any convertion from p_flags to final used mprotect flags occurs at loading of p_flags. It avoids repeated spurious convertions of _dl_stack_flags, for example in allocate_thread_stack. This modification was suggested in: https://sourceware.org/pipermail/libc-alpha/2025-March/165537.html Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-08-18htl: move sem_unlink into libc.gfleury4-2/+4
Message-ID: <20250817104023.91919-8-gfleury@disroot.org>
2025-08-18htl: move sem_{clockwait, timedwait, wait, trywait} into libc.gfleury4-8/+16
Message-ID: <20250817104023.91919-7-gfleury@disroot.org>
2025-08-18htl: move sem_post into libc.gfleury4-2/+4
Message-ID: <20250817104023.91919-6-gfleury@disroot.org>
2025-08-18htl: move sem_open, sem_close into libc.gfleury4-4/+8
Message-ID: <20250817104023.91919-5-gfleury@disroot.org>
2025-08-18htl: move sem_init into libc.gfleury4-2/+4
Message-ID: <20250817104023.91919-4-gfleury@disroot.org>
2025-08-18htl: move sem_getvalue into libc.gfleury4-2/+4
Message-ID: <20250817104023.91919-3-gfleury@disroot.org>
2025-08-18htl: move sem_destroy into libc.gfleury4-2/+4
Message-ID: <20250817104023.91919-2-gfleury@disroot.org>
2025-08-16htl: move __pthread_setup into libc.gfleury2-0/+2
Message-ID: <20250815181500.107433-19-gfleury@disroot.org>