aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)AuthorFilesLines
2025-09-08alpha: Align stack for alphaAdhemerval Zanella1-0/+2
As done already for x86_64 [1] and aarch64 [2]. It fixes misc/tst-misalign-clone on alpha. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=27902 [2] https://sourceware.org/bugzilla/show_bug.cgi?id=27939 Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-09-04x86_64: Unconditionally run test elf/check-dt-x86-64-pltArjun Shankar1-1/+1
The intention of GLIBC_ABI_DT_X86_64_PLT is simply to mark the existence of the fix in f8587a61892cbafd98ce599131bf4f103466f084 ("x86-64: Ignore r_addend for R_X86_64_GLOB_DAT/R_X86_64_JUMP_SLOT"). Testing for GLIBC_ABI_DT_X86_64_PLT does not depend on the linker supporting -z mark-plt. Therefore remove this dependency on linker support and test unconditionally. Fixes commit 399384e0c8193e31aea014220ccfa24300ae5938 ("x86-64: Add GLIBC_ABI_DT_X86_64_PLT [BZ #33212]") Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-09-03Fix sysdeps/mips/dl-machine-reject-phdr.h build with GCC 16Joseph Myers1-1/+1
Building for MIPS has been broken with GCC mainline since mid-July, probably GCC commit 0eac9cfee8cb0b21de866a04d5d59685ab35208f "c, c++: Extend -Wunused-but-set-* warnings [PR44677]", because the variable perfect_match in elf_machine_reject_phdr_p is set unconditionally, but only used if _MIPS_SIM == _ABIO32. Mark it with __attribute__ ((unused)), which seems cleaner in such a conditionally-used case than making all other logic relating to this variable conditional. Tested with build-many-glibcs.py (compilers build, which previously failed) for mips64-linux-gnu.
2025-09-02AArch64: Implement exp2m1 and exp10m1 routinesHasaan Khan17-0/+1283
Vector variants of the new C23 exp2m1 & exp10m1 routines. Note: Benchmark inputs for exp2m1 & exp10m1 are identical to exp2 & exp10 respectively, this also includes the floating point variations. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-09-01nptl: Fix "Arch-sepecific" typo in commentJonathan Wakely1-1/+1
2025-09-01nptl: Drop IS_IN (libpthread) around hidden_proto (__pthread_rwlock_unlock)Xi Ruoyao1-5/+1
Now libpthread is a dummy library and it no longer contains __pthread_rwlock_unlock at all, thus IS_IN (libpthread) does not make sense here. It seems an left over from commit eb29dcde31e7 ("nptl: Move rwlock functions with forwarders into libc") and it caused libc.so to export an unversioned __pthread_rwlock_unlock on Linux ports introduced after the 2.34 release (loongarch and or1k) but the symbol is not ever supposed to be exported on those new ports. Only since the commit 3b2b88cceeb7 ("elf: early conversion of elf p_flags to mprotect flags") the header dependency change happened to pull in libc-lockP.h which sets hidden_proto (__pthread_rwlock_unlock) correctly, the symbol is no longer exported, breaking the ABI on those ports. Remove this #if as a clean up and to prevent such a mess from happening again. Signed-off-by: Xi Ruoyao <xry111@xry111.site> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-08-29x86: Use flag output operands for inline asm in atomic-machine.hUros Bizjak1-48/+48
Use the flag output constraints feature available in gcc 6+ ("=@cc<cond>") instead of explicitly setting a boolean variable with SETcc instruction. This approach decouples the instruction that sets the flags from the code that consumes them, allowing the compiler to create better code when working with flags users. Instead of e.g.: lock add %esi,(%rdi) sets %sil test %sil,%sil jne <...> the compiler now generates: lock add %esi,(%rdi) js <...> No functional changes intended. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Cc: H.J.Lu <hjl.tools@gmail.com> Cc: Florian Weimer <fweimer@redhat.com> Cc: Carlos O'Donell <carlos@redhat.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-08-28x32: Fix, optimize and cleanup RSEQ_* accessorsUros Bizjak1-31/+39
Add missing "memory" clobber to accessors. The "memory" clobber tells the compiler that the assembly code performs memory reads or writes to items other than those listed in the input and output operands (for example, accessing the memory pointed to by one of the input parameters). Use MOVZBL instead of MOVB when reading 1-byte memory location into a register. MOVB to a register actually inserts into the LSB of the word-sized register, making the result dependent on the previous register value. MOVZBL avoids this issue. Change %P asm operand modifiers to %c. The ‘c’ modifier is a generic asm operand modifier that requires a constant operand and prints the constant expression without punctuation. Replace %b asm operand modifiers with explicit casts. Explicit casts inform the compiler which part of the register value is used, allowing it to perform additional optimizations (e.g. narrowing the preceding operation). Remove %q asm operand modifiers. Since the value is already cast to 'long long int', the compiler will emit a 64-bit register name in the assembly without needing %q. No functional changes intended. Tested-by: H.J. Lu <hjl.tools@gmail.com> Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Cc: Florian Weimer <fweimer@redhat.com> Cc: Carlos O'Donell <carlos@redhat.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-08-27x86/configure: Improve portability of isa level checkHenrik Lindström2-2/+2
wc -l pads the output with leading spaces on some systems, e.g. FreeBSD. This results in the check `test "$count" = 1` failing. Use -eq for integer comparison instead. Signed-off-by: Henrik Lindström <henrik@lxm.se> Reviewed-by: Arjun Shankar <arjun@redhat.com>
2025-08-27elf: early conversion of elf p_flags to mprotect flagsCupertino Miranda21-59/+48
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-23Don't pass -c to LIBC_TRY_TEST_CC_OPTIONH.J. Lu2-2/+2
LIBC_TRY_TEST_CC_OPTION is defined with LIBC_TRY_CC_OPTION: dnl Test a compiler option or options with an empty input file. dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false]) AC_DEFUN([LIBC_TRY_CC_OPTION], [AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])], [$2], [$3])]) which passes -S to compiler. Unlike gcc, when -c is also passed to clang 20, we get configure:7838: clang -c -Werror -fsemantic-interposition -xc /dev/null -S -o /dev/null clang: error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument] Don't pass -c to LIBC_TRY_TEST_CC_OPTION since -c isn't needed. This fixes BZ #33318. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-08-22x86: Set have-protected-data to no if unsupportedH.J. Lu3-0/+207
If the building compiler enables no direct external data access by default, access to protected data in shared libraries from executables must be compiled with no direct external data access. If the testing compiler doesn't support it, set have-protected-data to no to disable the tests which requires no direct external data access. Add LIBC_TRY_CC_COMMAND to test a building compiler option or options with an input file. This fixes BZ #33286. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-08-23stdio-common: Convert macros across scanf input specifier testsMaciej W. Rozycki1-8/+10
Convert 'compare_real', 'read_real', and 'verify_input' macros to functions so as to improve readability and avoid pitfalls. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-08-23stdio-common: Adjust header inclusion in scanf input specifier testsMaciej W. Rozycki1-2/+4
Move the inclusion of the data class header from the individual tests to the data-type-specific skeleton, providing for the use of the data type under test in the data class header and reducing duplication. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-08-23stdio-common: Fix NaN input data for scanf input specifier tests [BZ #32857]Maciej W. Rozycki48-1264/+1264
Update NaN input data with 'n-char-sequence' in reference data matching data under test, removing test failures with the M68K host. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-08-22x86_64: Use __seg_fs qualifiers in NPTL accessorsUros Bizjak4-96/+105
Use __seg_fs named address space qualifiers to cast NPTL accessors to %fs: prefixed addresses. Use volatile access only where strictly necessary. Use existing assembly RSEQ_* accessors for x32 to work around the GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121613 because negative value in __rseq_offset is used as an offset from %fs. Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com> Cc: Florian Weimer <fweimer@redhat.com> Cc: Carlos O'Donell <carlos@redhat.com>
2025-08-21x86: Remove an extra space before THREAD_SELFH.J. Lu2-2/+2
After f6dd43d5f7 i386: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF() b0f0c41a5f x86_64: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF() removed the unnecessary __GNUC_PREREQ (6, 0) test, remove the extra space before THREAD_SELF macro name. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-08-20x86_64: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF()Uros Bizjak1-14/+1
Currenty GCC-12 is required as the minimum supported compiler version. Remove stalled __GNUC_PREREQ (6, 0) test for GCC compiler version in THREAD_SELF() macro definition. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Cc: H.J.Lu <hjl.tools@gmail.com> Cc: Florian Weimer <fweimer@redhat.com> Cc: Carlos O'Donell <carlos@redhat.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-08-20i386: Use __seg_gs qualifiers in NPTL accessorsUros Bizjak2-130/+41
Use __seg_gs named address space qualifiers to cast NPTL accessors to %gs: prefixed addresses. Use volatile access only where strictly necessary. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Cc: H.J.Lu <hjl.tools@gmail.com> Cc: Florian Weimer <fweimer@redhat.com> Cc: Carlos O'Donell <carlos@redhat.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-08-20i386: Remove stalled __GNUC_PREREQ (6, 0) test in THREAD_SELF()Uros Bizjak1-14/+1
Currenty GCC-12 is required as the minimum supported compiler version. Remove stalled __GNUC_PREREQ (6, 0) test for GCC compiler version in THREAD_SELF() macro definition. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Cc: H.J.Lu <hjl.tools@gmail.com> Cc: Florian Weimer <fweimer@redhat.com> Cc: Carlos O'Donell <carlos@redhat.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-08-20i386: Use TESTB instead of TESTL in ____longjmp_chk()Uros Bizjak1-1/+1
There is no need to use TESTL when checking the least-significant bit with a TEST instruction. Use TESTB, which is three bytes shorter: f6 44 24 04 01 testb $0x1,0x4(%esp) vs: f7 44 24 04 01 00 00 testl $0x1,0x4(%esp) 00 for the same effect. No functional changes intended. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Cc: H.J.Lu <hjl.tools@gmail.com> Cc: Carlos O'Donell <carlos@redhat.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-08-20x86_64: Use TESTB instead of TESTL in CHECK_INVALID_LONGJMPUros Bizjak1-1/+1
There is no need to use TESTL when checking the least-significant bit with a TEST instruction. Use TESTB, which is three bytes shorter: f6 44 24 f0 01 testb $0x1,-0x10(%rsp) vs: f7 44 24 f0 01 00 00 testl $0x1,-0x10(%rsp) 00 for the same effect. No functional changes intended. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Cc: H.J.Lu <hjl.tools@gmail.com> Cc: Carlos O'Donell <carlos@redhat.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-08-20AArch64: Fix SVE powf routine [BZ #33299]Pierre Blanchard1-8/+8
Fix a bug in predicate logic introduced in last change. A slight performance improvement from relying on all true predicates during conversion from single to double. This fixes BZ #33299. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-08-18i386: Also add GLIBC_ABI_GNU2_TLS version [BZ #33129]H.J. Lu4-14/+14
Since the GNU2 TLS run-time bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31372 affects both i386 and x86-64, also add GLIBC_ABI_GNU2_TLS version to i386 to indicate the working GNU2 TLS run-time. For x86-64, the additional GNU2 TLS run-time bug fix is needed for https://sourceware.org/bugzilla/show_bug.cgi?id=31501 Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-08-18htl: move sem_unlink into libc.gfleury5-10/+11
Message-ID: <20250817104023.91919-8-gfleury@disroot.org>
2025-08-18htl: move sem_{clockwait, timedwait, wait, trywait} into libc.gfleury8-12/+50
Message-ID: <20250817104023.91919-7-gfleury@disroot.org>
2025-08-18htl: move sem_post into libc.gfleury6-5/+11
Message-ID: <20250817104023.91919-6-gfleury@disroot.org>
2025-08-18htl: move sem_open, sem_close into libc.gfleury7-17/+24
Message-ID: <20250817104023.91919-5-gfleury@disroot.org>
2025-08-18htl: move sem_init into libc.gfleury5-3/+9
Message-ID: <20250817104023.91919-4-gfleury@disroot.org>
2025-08-18htl: move sem_getvalue into libc.gfleury5-3/+9
Message-ID: <20250817104023.91919-3-gfleury@disroot.org>
2025-08-18htl: move sem_destroy into libc.gfleury5-3/+9
Message-ID: <20250817104023.91919-2-gfleury@disroot.org>
2025-08-16htl: move __pthread_startup into libc.gfleury1-0/+1
Message-ID: <20250815181500.107433-20-gfleury@disroot.org>
2025-08-16htl: move __pthread_setup into libc.gfleury2-0/+2
Message-ID: <20250815181500.107433-19-gfleury@disroot.org>
2025-08-16htl: move pthread_{join, clockjoin_np, timedjoin_np, tryjoin_np} into libc.gfleury5-8/+26
Message-ID: <20250815181500.107433-18-gfleury@disroot.org>
2025-08-16htl: move pthread_exit into libc.gfleury5-13/+2
Message-ID: <20250815181500.107433-17-gfleury@disroot.org>
2025-08-16htl: move pthread_detach into libc.gfleury5-3/+7
Message-ID: <20250815181500.107433-16-gfleury@disroot.org>
2025-08-16htl: move __pthread_sigstate_init into libc.gfleury1-0/+3
Message-ID: <20250815181500.107433-15-gfleury@disroot.org>
2025-08-16htl: move pthread_mutex_transfer_np into libc.gfleury5-5/+12
Message-ID: <20250815181500.107433-14-gfleury@disroot.org>
2025-08-16htl: move pthread_getattr_np into libc.gfleury5-2/+7
Message-ID: <20250815181500.107433-13-gfleury@disroot.org>
2025-08-16htl: move pthread_testcancel into libc.gfleury5-2/+5
Message-ID: <20250815181500.107433-12-gfleury@disroot.org>
2025-08-16htl: move pthread_kill into libc.gfleury5-5/+14
Message-ID: <20250815181500.107433-11-gfleury@disroot.org>
2025-08-16htl: move pthread_cancel, __pthread_do_cancel into libc.gfleury4-2/+4
Message-ID: <20250815181500.107433-10-gfleury@disroot.org>
2025-08-16htl: move __thread_set_pcsptp into libc.gfleury3-1/+5
Message-ID: <20250815181500.107433-9-gfleury@disroot.org>
2025-08-16htl: move pthread_yield into libc.gfleury4-2/+4
Message-ID: <20250815181500.107433-8-gfleury@disroot.org>
2025-08-16htl: move pthread_getcpuclockid into libc.gfleury5-3/+11
Message-ID: <20250815181500.107433-7-gfleury@disroot.org>
2025-08-16htl: move __pthread_thread_{alloc, start, terminate} into libc.gfleury3-0/+3
Message-ID: <20250815181500.107433-6-gfleury@disroot.org>
2025-08-16htl: move __pthread_stack_alloc into libc.gfleury1-0/+2
Message-ID: <20250815181500.107433-5-gfleury@disroot.org>
2025-08-16htl: move __pthread_init_{specific, static_tls}, __pthread_{alloc}, dealloc} ↵gfleury2-1/+4
into libc. Message-ID: <20250815181500.107433-4-gfleury@disroot.org>
2025-08-16htl: move pthread_get/setconcurrency into libc.gfleury7-6/+28
Message-ID: <20250815181500.107433-3-gfleury@disroot.org>
2025-08-16htl: move pthread_setschedprio into libc.gfleury6-3/+15
Message-ID: <20250815181500.107433-2-gfleury@disroot.org>