about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* LoongArch: Ensure sp 16-byte aligned for tlsdescXi Ruoyao2024-06-142-7/+4
| | | | | | | | | | "ADDI sp, sp, 24" and "ADDI sp, sp, SZFCSREG" (SZFCSREG = 4) are misaligning the stack: the ABI mandates a 16-byte alignment. Fix it by changing the first one to "ADDI sp, sp, 32", and reuse the spare 4th slot for saving fcsr. Reported-by: Jinyang He <hejinyang@loongson.cn> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
* resolv: Track single-request fallback via _res._flags (bug 31476)Florian Weimer2024-06-132-5/+9
| | | | | | | This avoids changing _res.options, which inteferes with change detection as part of automatic reloading of /etc/resolv.conf. Reviewed-by: DJ Delorie <dj@redhat.com>
* x86: Properly set x86 minimum ISA level [BZ #31883]H.J. Lu2024-06-123-3/+17
| | | | | | | | | | | | | | | | | | | | | | Properly set libc_cv_have_x86_isa_level in shell for MINIMUM_X86_ISA_LEVEL defined as (__X86_ISA_V1 + __X86_ISA_V2 + __X86_ISA_V3 + __X86_ISA_V4) Also set __X86_ISA_V2 to 1 for i386 if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 is defined. There are no changes in config.h nor in config.make on x86-64. On i386, -march=x86-64-v2 with GCC generates #define MINIMUM_X86_ISA_LEVEL 2 in config.h and have-x86-isa-level = 2 in config.make. This fixes BZ #31883. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* tunables: sort tunables list (BZ 30027)DJ Delorie2024-06-122-4/+12
| | | | | | | | | | | | Sort tunables list at the time it's generated. Note: adding new tunables will cause other tunable IDs to change, but that was the case before anyway. POSIX does not guarantee the order of "foo in bar" AWK operators, so the order was indeterminate before anyway. Even depending on the order to be the same across multiple calls, such as in this script, is undefined, so sorting the list resolves that also. Note that sorting is not dependent on the user's locale.
* linux: Remove __stack_protAdhemerval Zanella2024-06-122-60/+11
| | | | | | | | | | | | | | | | | | The __stack_prot is used by Linux to make the stack executable if a modules requires it. It is also marked as RELRO, which requires to change the segment permission to RW to update it. Also, there is no need to keep track of the flags: either the stack will have the default permission of the ABI or should be change to PROT_READ | PROT_WRITE | PROT_EXEC. The only additional flag, PROT_GROWSDOWN or PROT_GROWSUP, is Linux only and can be deducted from _STACK_GROWS_DOWN/_STACK_GROWS_UP. Also, the check_consistency function was already removed some time ago. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* <stdio.h>: Acknowledge that getdelim/getline are in POSIXPhilip Kaludercic2024-06-111-12/+2
| | | | | | | | These comments were written in 2003 (added in 2c008571c3a), predating the addition of getdelim(3)/getline(3) in POSIX.1-2008. Reviewed-by: Sam James <sam@gentoo.org> Reviewed-by: Florian Weimer <fweimer@redhat.com>
* localedata: Lowercase day and abday in cs_CZMike FABIAN2024-06-111-15/+15
| | | | | | Resolves: BZ # 25119 Also to sync with CLDR
* x86: Properly set MINIMUM_X86_ISA_LEVEL for i386 [BZ #31867]H.J. Lu2024-06-112-4/+12
| | | | | | | | | | | On i386, set the default minimum ISA level to 0, not 1 (baseline which includes SSE2). There are no changes in config.h nor in config.make on x86-64. This fixes BZ #31867. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Tested-by: Ian Jordan <immoloism@gmail.com> Reviewed-by: Sam James <sam@gentoo.org> Reviewed-by: Florian Weimer <fweimer@redhat.com>
* x86: Enable non-temporal memset tunable for AMDJoe Damato2024-06-101-4/+4
| | | | | | | | | | | | | | | | | | In commit 46b5e98ef6f1 ("x86: Add seperate non-temporal tunable for memset") a tunable threshold for enabling non-temporal memset was added, but only for Intel hardware. Since that commit, new benchmark results suggest that non-temporal memset is beneficial on AMD, as well, so allow this tunable to be set for AMD. See: https://docs.google.com/spreadsheets/d/1opzukzvum4n6-RUVHTGddV6RjAEil4P2uMjjQGLbLcU/edit?usp=sharing which has been updated to include data using different stategies for large memset on AMD Zen2, Zen3, and Zen4. Signed-off-by: Joe Damato <jdamato@fastly.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* hurd: Fix getxattr/listxattr returning ERANGESamuel Thibault2024-06-101-4/+21
| | | | | | The manpage says that when the passed size is zero, they should set the expected size and return 0. ERANGE shall be returned only when the non-zero passed size is not large enough.
* hurd: Fix setxattr return value on replacingSamuel Thibault2024-06-101-4/+3
| | | | | When XATTR_REPLACE is set we shall succeed when the value already exists, and fail with ENODATA otherwise, instead of the converse.
* hurd: Fix getxattr("gnu.translator") returning ENODATASamuel Thibault2024-06-101-1/+10
| | | | | | When no translator is set, __file_get_translator would return EINVAL which is a confusing value. Better check for a passive translation before getting the value.
* hurd: Fix lsetxattr return valueSamuel Thibault2024-06-101-1/+1
| | | | The manpage says that lsetxattr returns 0 on success, like setxattr.
* localedata: add new locales scn_ITDavid Paleino2024-06-072-0/+156
| | | | Signed-off-by: David Paleino <dapal@debian.org>
* support: Fix typo in xgetsockname error messageAvinal Kumar2024-06-051-1/+2
| | | | | | | | | The error message in xgetsockname was incorrectly referring to a different function. This commit fixes that. Suggested-by: Arjun Shankar <arjun@redhat.com> Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* getconf: Add NPROCESSORS_{CONF,ONLN} [BZ #31661]Mohamed Akram2024-06-051-0/+2
| | | | | | | | | These are required by the upcoming POSIX standard and are available on other platforms. Link: https://austingroupbugs.net/view.php?id=339 Signed-off-by: Mohamed Akram <mohd.akram@outlook.com> Reviewed-by: Arjun Shankar <arjun@redhat.com>
* Linux: Add epoll ioctlsJoe Damato2024-06-044-0/+110
| | | | | | | | | | | | | | | | | As of Linux kernel 6.9, some ioctls and a parameters structure have been introduced which allow user programs to control whether a particular epoll context will busy poll. Update the headers to include these for the convenience of user apps. The ioctls were added in Linux kernel 6.9 commit 18e2bf0edf4dd ("eventpoll: Add epoll ioctl for epoll_params") [1] to include/uapi/linux/eventpoll.h. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/?h=v6.9&id=18e2bf0edf4dd Signed-off-by: Joe Damato <jdamato@fastly.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Improve doc for time_t range (BZ 31808)Paul Eggert2024-06-041-1/+11
|
* difftime can throw exceptionsPaul Eggert2024-06-041-3/+2
| | | | | | | | | | | | | difftime can signal an inexact conversion when converting to double, so it should not be marked as pure or nothrow (BZ 31808). Although we could do something more complicated, in which difftime is plain on modern platforms but const and nothrow on obsolescent platforms with 32-bit time_t, it hardly seems worth the trouble. difftime is used so rarely that it's not worth taking pains to optimize calls to it on obsolescent platforms. Reviewed-by: DJ Delorie <dj@redhat.com>
* malloc: New test to check malloc alternate path using memory obstructionsayan paul2024-06-042-0/+73
| | | | | | | | | | | The test aims to ensure that malloc uses the alternate path to allocate memory when sbrk() or brk() fails.To achieve this, the test first creates an obstruction at current program break, tests that obstruction with a failing sbrk(), then checks if malloc is still returning a valid ptr thus inferring that malloc() used mmap() instead of brk() or sbrk() to allocate the memory. Reviewed-by: Arjun Shankar <arjun@redhat.com> Reviewed-by: Zack Weinberg <zack@owlfolio.org>
* math: Fix exp10 undefined left shiftSzabolcs Nagy2024-06-041-3/+3
| | | | | | | Left shift of ki is undefined when ki<0, copy the logic from exp, which uses unsigned arithmetics, to fix it. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* libio: Test for fdopen memory leak without SEEK_END support (bug 31840)Florian Weimer2024-06-042-2/+64
| | | | | The bug report used /dev/mem, but /proc/self/mem works as well (if available).
* Remove memory leak in fdopen (bug 31840)Andreas Schwab2024-06-041-1/+5
| | | | | | | Deallocate the memory for the FILE structure when seeking to the end fails in append mode. Fixes: ea33158c96 ("Fix offset caching for streams and use it for ftell (BZ #16680)")
* Add new AArch64 HWCAP2 definitions from Linux 6.9 to bits/hwcap.hJoseph Myers2024-06-041-0/+15
| | | | | | | Linux 6.9 adds 15 new HWCAP2_* values for AArch64; add them to bits/hwcap.h in glibc. Tested with build-many-glibcs.py for aarch64-linux-gnu.
* Add more NT_ARM_* constants from Linux kernel to elf.hJoseph Myers2024-06-041-0/+4
| | | | | | | | Linux 6.9 adds the ELF note type NT_ARM_FPMR. Add this to glibc's elf.h, along with the previously missed NT_ARM_SSVE, NT_ARM_ZA and NT_ARM_ZT (added in older kernel versions). Tested for x86_64.
* stdlib: Describe __cxa_finalize usage in function commentFlorian Weimer2024-06-031-1/+16
| | | | Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
* elf: Avoid some free (NULL) calls in _dl_update_slotinfoFlorian Weimer2024-06-031-1/+8
| | | | | | | | | | | | | | | | | | | This has been confirmed to work around some interposed mallocs. Here is a discussion of the impact test ust/libc-wrapper/test_libc-wrapper in lttng-tools: New TLS usage in libgcc_s.so.1, compatibility impact <https://inbox.sourceware.org/libc-alpha/8734v1ieke.fsf@oldenburg.str.redhat.com/> Reportedly, this patch also papers over a similar issue when tcmalloc 2.9.1 is not compiled with -ftls-model=initial-exec. Of course the goal really should be to compile mallocs with the initial-exec TLS model, but this commit appears to be a useful interim workaround. Fixes commit d2123d68275acc0f061e73d5f86ca504e0d5a344 ("elf: Fix slow tls access after dlopen [BZ #19924]"). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* x86: Add seperate non-temporal tunable for memsetNoah Goldstein2024-05-307-6/+49
| | | | | | | | | | | The tuning for non-temporal stores for memset vs memcpy is not always the same. This includes both the exact value and whether non-temporal stores are profitable at all for a given arch. This patch add `x86_memset_non_temporal_threshold`. Currently we disable non-temporal stores for non Intel vendors as the only benchmarks showing its benefit have been on Intel hardware. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* x86: Improve large memset perf with non-temporal stores [RHEL-29312]Noah Goldstein2024-05-301-58/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we use `rep stosb` for all medium/large memsets. This is notably worse than non-temporal stores for large (above a few MBs) memsets. See: https://docs.google.com/spreadsheets/d/1opzukzvum4n6-RUVHTGddV6RjAEil4P2uMjjQGLbLcU/edit?usp=sharing For data using different stategies for large memset on ICX and SKX. Using non-temporal stores can be up to 3x faster on ICX and 2x faster on SKX. Historically, these numbers would not have been so good because of the zero-over-zero writeback optimization that `rep stosb` is able to do. But, the zero-over-zero writeback optimization has been removed as a potential side-channel attack, so there is no longer any good reason to only rely on `rep stosb` for large memsets. On the flip size, non-temporal writes can avoid data in their RFO requests saving memory bandwidth. All of the other changes to the file are to re-organize the code-blocks to maintain "good" alignment given the new code added in the `L(stosb_local)` case. The results from running the GLIBC memset benchmarks on TGL-client for N=20 runs: Geometric Mean across the suite New / Old EXEX256: 0.979 Geometric Mean across the suite New / Old EXEX512: 0.979 Geometric Mean across the suite New / Old AVX2 : 0.986 Geometric Mean across the suite New / Old SSE2 : 0.979 Most of the cases are essentially unchanged, this is mostly to show that adding the non-temporal case didn't add any regressions to the other cases. The results on the memset-large benchmark suite on TGL-client for N=20 runs: Geometric Mean across the suite New / Old EXEX256: 0.926 Geometric Mean across the suite New / Old EXEX512: 0.925 Geometric Mean across the suite New / Old AVX2 : 0.928 Geometric Mean across the suite New / Old SSE2 : 0.924 So roughly a 7.5% speedup. This is lower than what we see on servers (likely because clients typically have faster single-core bandwidth so saving bandwidth on RFOs is less impactful), but still advantageous. Full test-suite passes on x86_64 w/ and w/o multiarch. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* elf: add note identifier for dlopen metadataLuca Boccassi2024-05-301-0/+4
| | | | | | | | | | | | | | | | This new note type is defined at https://systemd.io/ELF_DLOPEN_METADATA/ and is used to list shared library dependencies loaded via dlopen(). Distro packagers can use this, via tools like those available at https://github.com/systemd/package-notes to automatically generate dependencies when building projects that make use of this specification. By defining the note id here we can use it in other projects as a stable identifier, for example in 'readelf' to pretty-print its content. Signed-off-by: Luca Boccassi <bluca@debian.org> Reviewed-by: Arjun Shankar <arjun@redhat.com>
* elf: update NT_FDO_PACKAGING_METADATA spec URLLuca Boccassi2024-05-301-1/+1
| | | | | | | | Page was renamed some time ago, there's a redirect but better to point to the right one Signed-off-by: Luca Boccassi <bluca@debian.org> Reviewed-by: Arjun Shankar <arjun@redhat.com>
* LoongArch: Use "$fcsr0" instead of "$r0" in _FPU_{GET,SET}CWXi Ruoyao2024-05-281-2/+2
| | | | | | | | | | | | Clang inline-asm parser does not allow using "$r0" in movfcsr2gr/movgr2fcsr, so everything using _FPU_{GET,SET}CW is now failing to build with Clang on LoongArch. As we now requires Binutils >= 2.41 which supports using "$fcsr0" here, use it instead of "$r0" to fix the issue. Link: https://github.com/loongson-community/discussions/issues/53#issuecomment-2081507390 Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=4142b2368353 Signed-off-by: Xi Ruoyao <xry111@xry111.site>
* x86_64: Reformat elf_machine_relaXin Wang2024-05-271-4/+5
| | | | | | | | | | | A space is added before the left bracket of the x86_64 elf_machine_rela function, in order to harmonize with the rest of the implementation of the function and to make it easier to retrieve the function. The lines where the function definition is located has been re-indented, as well as its left curly bracket placed in the correct position. Signed-off-by: Xin Wang <yw987194828@gmail.com> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* i386: Disable Intel Xeon Phi tests for GCC 15 and above (BZ 31782)Sunil K Pandey2024-05-271-1/+7
| | | | | | | | | | | | | | | This patch disables Intel Xeon Phi tests for GCC 15 and above. GCC 15 removed Intel Xeon Phi ISA support. commit e1a7e2c54d52d0ba374735e285b617af44841ace Author: Haochen Jiang <haochen.jiang@intel.com> Date: Mon May 20 10:43:44 2024 +0800 i386: Remove Xeon Phi ISA support Fixes BZ 31782. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* difftime is pure, not constPaul Eggert2024-05-271-2/+2
| | | | | | | Because difftime's behavior depends on the floating-point environment, the function is pure, not const (BZ 31802). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* parse_fdinfo: Don't advance pointer twice [BZ #31798]H.J. Lu2024-05-271-1/+3
| | | | | | | | | | | | | | | | | | | pidfd_getpid.c has /* Ignore invalid large values. */ if (INT_MULTIPLY_WRAPV (10, n, &n) || INT_ADD_WRAPV (n, *l++ - '0', &n)) return -1; For GCC older than GCC 7, INT_ADD_WRAPV(a, b, r) is defined as _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW) and *l++ - '0' is evaluated twice. Fix BZ #31798 by moving "l++" out of the if statement. Tested with GCC 6.4 and GCC 14.1. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf/Makefile: Split and sort PIE testsH.J. Lu2024-05-251-3/+13
| | | | | | Put each item on a separate line and sort PIE tests. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
* Revert "Test fscanf of long double without <stdio.h>"H.J. Lu2024-05-243-39/+0
| | | | | | | | This reverts commit 30a745450e01e4c6f484dc691c16a54a6ea72288. On ppc64le, without <stdio.h>, vfscanf is used and with <stdio.h> __isoc23_vfscanfieee128 is used. I am reverting this since it doesn't work on all targets.
* sysdeps/ieee754/ldbl-opt/Makefile: Split and sort libnldbl-callsH.J. Lu2024-05-241-42/+233
| | | | | | Put each item on a separate line and sort libnldbl-calls. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
* Test fscanf of long double without <stdio.h>H.J. Lu2024-05-243-0/+39
| | | | | | | Add a test for fscanf of long double without including <stdio.h>. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
* sysdeps/ieee754/ldbl-opt/Makefile: Remove test-nldbl-redirect-staticH.J. Lu2024-05-241-1/+0
| | | | | | Remove $(objpfx)test-nldbl-redirect-static checked in by accident. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
* sysdeps/ieee754/ldbl-opt/Makefile: Split and sort testsH.J. Lu2024-05-241-10/+18
| | | | | | Put each test on a separate line and sort tests. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
* s390x: Regenerate ULPs.Stefan Liebler2024-05-241-0/+20
| | | | | | Needed due to: "Implement C23 log2p1" commit ID 79c52daf4740b00bef43e4f5a4281b3480459b38
* powerpc: Remove duplicated versionsort from libm.a (BZ 31789)Adhemerval Zanella2024-05-231-1/+1
| | | | | | | | | The powerpc32 have an extra versionsort provided by LFS versionsort64.o. It seems that 5226a81f5517bcbc892679cca792006a6bafc53f used the wrong check to create the alias for the LFS to non-LFS version. It should not matter for _DIRENT_MATCHES_DIRENT64 since both symbols have the same implementation. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Update kernel version to 6.9 in header constant testsJoseph Myers2024-05-232-3/+3
| | | | | | | | | | This patch updates the kernel version in the tests tst-mman-consts.py and tst-mount-consts.py to 6.9. (There are no new constants covered by these tests in 6.9 that need any other header changes; tst-pidfd-consts.py was updated separately along with adding new constants relevant to that test.) Tested with build-many-glibcs.py.
* localedata: cv_RU: update translationMike FABIAN2024-05-232-209/+102
| | | | Resolves: BZ # 21271
* math: Provide missing math symbols on libc.a (BZ 31781)Adhemerval Zanella2024-05-233-6/+6
| | | | | | | | | The libc.a for alpha, s390, and sparcv9 does not provide copysignf64x, copysignf128, frexpf64x, frexpf128, modff64x, and modff128. Checked with a static build for the affected ABIs. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* s390: Make utmp32, utmpx32, and login32 shared only (BZ 31790)Adhemerval Zanella2024-05-231-0/+1
| | | | | | The function that work with 'struct utmp32' and 'struct utmpx32' are only for compat symbols. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* microblaze: Remove cacheflush from libc.a (BZ 31788)Adhemerval Zanella2024-05-231-2/+0
| | | | | | microblaze does not export it in libc.so nor the kernel provides the cacheflush syscall. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* powerpc: Remove duplicated llrintf and llrintf32 from libm.a (BZ 31787)Adhemerval Zanella2024-05-232-0/+8
| | | | | | | | Both the generic and POWER6 versions provide definitions of the symbol, which are already provided by the ifunc resolver. Checked on powerpc-linux-gnu-power4. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>