about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Fix strnlen doc re array sizePaul Eggert13 days1-7/+10
| | | | | | | | | * manual/string.texi: For strnlen (s, maxlen), do not say that s must be of size maxlen, as it can be smaller if it is null-terminated. This should help avoid confusion such as seen in <https://lists.gnu.org/r/bug-gnulib/2024-06/msg00280.html>. Mention that strnlen and wcsnlen have been in POSIX since POSIX.1-2008.
* arm: Avoid UB in elf_machine_rel()Palmer Dabbelt13 days1-5/+4
| | | | | | | | | | This recently came up during a cleanup to remove misaligned accesses from the RISC-V port. Link: https://sourceware.org/pipermail/libc-alpha/2022-June/139961.html Suggested-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Reviewed-by: Fangrui Song <maskray@google.com>
* LoongArch: Fix tst-gnu2-tls2 test casemengqinggang13 days1-143/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | asm volatile ("movfcsr2gr $t0, $fcsr0" ::: "$t0"); asm volatile ("st.d $t0, %0" :"=m"(restore_fcsr)); generate to the following instructions with -Og flag: movfcsr2gr $t0, $zero addi.d $t0, $sp, 2047(0x7ff) addi.d $t0, $t0, 77(0x4d) st.w $t0, $t0, 0 fcsr0 register and restore_fcsr variable are both stored in t0 register. Change to: asm volatile ("movfcsr2gr %0, $fcsr0" :"=r"(restore_fcsr)); to avoid restore_fcsr address in t0. Comparing float value using memcmp because float value cannot be directly compared for equality. Put LOAD_REGISTER_FCSR and SAVE_REGISTER_FCC after LOAD_REGISTER_FLOAT. Some float instructions may change fcsr register.
* posix: Fix pidfd_spawn/pidfd_spawnp leak if execve fails (BZ 31695)Adhemerval Zanella14 days2-39/+64
| | | | | | | | | | | | | | | | | If the pidfd_spawn/pidfd_spawnp helper process succeeds, but evecve fails for some reason (either with an invalid/non-existent, memory allocation, etc.) the resulting pidfd is never closed, nor returned to caller (so it can call close). Since the process creation failed, it should be up to posix_spawn to also, close the file descriptor in this case (similar to what it does to reap the process). This patch also changes the waitpid with waitid (P_PIDFD) for pidfd case, to avoid a possible pid re-use. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* INSTALL: regenerateAndreas K. Hüttel2024-06-251-5/+6
| | | | Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
* Revert "MIPSr6/math: Use builtin fma and fmaf"Andreas K. Hüttel2024-06-251-13/+0
| | | | | | | Apologies, I mistakenly interpreted this to be already accepted. Reverting until v6 or later is reviewed and approved. This reverts commit 9e06e4a43b58519991acbed1d7f33abc40249226.
* INSTALL: Fix typo ibmlondouble to ibmlongdoubleJoe Simmons-Talbott2024-06-241-1/+1
|
* RISC-V: Execute a PAUSE hint in spin loopsChristoph Müllner2024-06-241-0/+3
| | | | | | | | | | | | | | | | The atomic_spin_nop() macro can be used to run arch-specific code in the body of a spin loop to potentially improve efficiency. RISC-V's Zihintpause extension includes a PAUSE instruction for this use-case, which is encoded as a HINT, which means that it behaves like a NOP on systems that don't implement Zihintpause. Binutils supports Zihintpause since 2.36, so this patch uses the ".insn" directive to keep the code compatible with older toolchains. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
* MIPSr6/math: Use builtin fma and fmafYunQiang Su2024-06-241-0/+13
| | | | | | | | | | | | | MIPSr6 has MADDF.s/MADDF.d instructions, which are fused. In MIPS ISA, double support can be subsetted. Only FMAF is enabled for this case. * sysdeps/mips/fpu/math-use-builtins-fma.h Signed-off-by: YunQiang Su <syq@gcc.gnu.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
* po: incorporate translations (cs, de, hr, ko, pl, ro, ru, sv, uk, zh_CN)Andreas K. Hüttel2024-06-2438-6413/+5952
| | | | Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
* mtrace: make shell commands robust against meta charactersAndreas Schwab2024-06-241-2/+2
| | | | | Use the list form of the open function to avoid interpreting meta characters in the arguments.
* hppa/vdso: Add wrappers for vDSO functionsJohn David Anglin2024-06-231-0/+12
| | | | | | | | | | | | The upcoming parisc (hppa) v6.11 Linux kernel will include vDSO support for gettimeofday(), clock_gettime() and clock_gettime64() syscalls for 32- and 64-bit userspace. The patch below adds the necessary glue code for glibc. Signed-off-by: Helge Deller <deller@gmx.de> Changes in v2: - add vsyscalls for 64-bit too
* Update hppa libm-test-ulpsJohn David Anglin2024-06-231-0/+48
|
* Benchtests: Remove broken walk benchmarksWilco Dijkstra2024-06-216-581/+0
| | | | | | | | | | | | | | The walk benchmarks don't measure anything useful - memory is not initialized properly so doing a single walk in 32MB just measures reading the 4KB zero page for reads and clear_page overhead for writes. The memset variants don't even manage to do a walk in the 32MB region due to using incorrect pointer increments... Neither is it clear why it is walking backwards since this won't confuse modern prefetchers. If you fix the benchmark and print the bandwidth, the results are identical for all sizes larger than ~1KB since it is just testing memory bandwidth of a single 32MB block. This case is already tested by the large benchmark, so overall it doesn't seem useful to keep these. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Update hppa libm-test-ulpsJohn David Anglin2024-06-201-0/+16
|
* RISC-V: Update ulpsJulian Zhu2024-06-201-0/+80
| | | | | | For the exp10m1, exp2m1, log10p1 and log2p1 implementations. Signed-off-by: Julian Zhu <jz531210@gmail.com>
* MIPS: Update ulpsJulian Zhu2024-06-202-0/+108
| | | | | | Update mips32/mips64 ulps for the exp10m1, exp2m1, and log10p1 implementations. Signed-off-by: Julian Zhu <jz531210@gmail.com>
* malloc: Replace shell/Perl gate in mtraceFlorian Weimer2024-06-201-4/+17
| | | | | | | | | | | | | | | | | | | | | | The previous version expanded $0 and $@ twice. The new version defines a q no-op shell command. The Perl syntax error is masked by the eval Perl function. The q { … } construct is executed by the shell without errors because the q shell function was defined, but treated as a non-expanding quoted string by Perl, effectively hiding its context from the Perl interpreter. As before the script is read by require instead of executed directly, to avoid infinite recursion because the #! line contains /bin/sh. Introduce the “fatal” function to produce diagnostics that are not suppressed by “do”. Use “do” instead of “require” because it has fewer requirements on the executed script than “require”. Prefix relative paths with './' because “do” (and “require“ before) searches for the script in @INC if the path is relative and does not start with './'. Use $_ to make the trampoline shorter. Add an Emacs mode marker to indentify the script as a Perl script.
* i386: Update ulpsFlorian Weimer2024-06-201-2/+2
| | | | | This is from a -march=i686 -mtune=generic build with --disable-multi-arch, running on a Cascade Lake CPU.
* s390x: Capture grep output in static PIE checkFlorian Weimer2024-06-202-7/+7
| | | | | | | | | | | The test is not a run-time check, so update the description. Also use readelf -W for a more stable output format and fix an LC_ALL typo. This avoids garbled configure messages: checking for s390-specific static PIE requirements (runtime check)... 0x0000000000000017 (JMPREL) 0x280 yes
* powerpc: Update ulpsFlorian Weimer2024-06-201-1/+13
| | | | | Results based on POWER8 and POWER9 machines running powerpc64-linux-gnu, with and without --disable-multi-arch.
* i386: Update ulpsFlorian Weimer2024-06-202-8/+104
| | | | | | Based on a -march=x86-64-v4 -mfpmath=sse build, with and without --disable-multi-arch, running on a Zen 4 CPU. Also used different -march=x8i6-64-v… settings.
* malloc: Always install mtrace (bug 31892)Florian Weimer2024-06-202-7/+4
| | | | | | | | | | | | | | | | | Generation of the Perl script does not depend on Perl, so we can always install it even if $(PERL) is not set during the build. Change the malloc/mtrace.pl text substition not to rely on $(PERL). Instead use PATH at run time to find the Perl interpreter. The Perl interpreter cannot execute directly a script that starts with “#! /bin/sh”: it always executes it with /bin/sh. There is no perl command line switch to disable this behavior. Instead, use the Perl require function to execute the script. The additional shift calls remove the “.” shell arguments. Perl interprets the “.” as a string concatenation operator, making the expression syntactically valid. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Translations: Regenerate libc.potAndreas K. Hüttel2024-06-191-207/+273
| | | | Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
* LoongArch: Update ulpsXi Ruoyao2024-06-191-0/+60
| | | | | | Add ulps for recently added C23 exp10m1, exp2m1, and log10p1 functions. Signed-off-by: Xi Ruoyao <xry111@xry111.site>
* sparc: Regenerate ULPsAndreas K. Hüttel2024-06-191-0/+80
| | | | | | Linux catbus 5.15.110-gentoo-r1 #1 SMP Fri Jun 9 17:53:23 PDT 2023 sparc64 sun4v UltraSparc T5 (Niagara5) GNU/Linux Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
* s390x: Regenerate ULPs.Stefan Liebler2024-06-191-0/+60
| | | | | | | | Needed due to: - "Implement C23 log10p1" commit ID 55eb99e9a9d840ba452b128be14d6529c2dde039 - "Implement C23 exp2m1, exp10m1" commit ID 7ec903e028271d029818378fd60ddaf6b76b89ac
* LoongArch: Fix _dl_tlsdesc_dynamic in LSX casemengqinggang2024-06-191-9/+9
| | | | | | | HWCAP value is overwritten at the first comparison of the LASX case. The second comparison at LSX get incorrect result. Change to use t0 to save HWCAP value, and use t1 to save comparison result.
* arm: Update ulpsAdhemerval Zanella2024-06-181-0/+48
| | | | For the exp10m1, exp2m1, and log10p1 implementations.
* aarch64: Update ulpsAdhemerval Zanella2024-06-181-0/+60
| | | | For the exp10m1, exp2m1, and log10p1 implementations.
* powerpc: Update ulpsAdhemerval Zanella2024-06-181-0/+60
| | | | For the exp10m1, exp2m1, and log10p1 implementations.
* Linux: Include <dl-symbol-redir-ifunc.h> in dl-sysdep.cFlorian Weimer2024-06-181-0/+1
| | | | | | | | | | The _dl_sysdep_parse_arguments function contains initalization of a large on-stack variable: dl_parse_auxv_t auxv_values = { 0, }; This uses a non-inline version of memset on powerpc64le-linux-gnu, so it must use the baseline memset.
* linux: add definitions for hugetlb page size encodingsCarlos Llamas2024-06-183-6/+45
| | | | | | | | | | | | | | | | | | | | | | A desired hugetlb page size can be encoded in the flags parameter of system calls such as mmap() and shmget(). The Linux UAPI headers have included explicit definitions for these encodings since v4.14. This patch adds these definitions that are used along with MAP_HUGETLB and SHM_HUGETLB flags as specified in the corresponding man pages. This relieves programs from having to duplicate and/or compute the encodings manually. Additionally, the filter on these definitions in tst-mman-consts.py is removed, as suggested by Florian. I then ran this tests successfully, confirming the alignment with the kernel headers. PASS: misc/tst-mman-consts original exit status 0 Signed-off-by: Carlos Llamas <cmllamas@google.com> Tested-by: Florian Weimer <fweimer@redhat.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
* elf: Remove HWCAP_IMPORTANTStefan Liebler2024-06-1811-44/+0
| | | | | | | Remove the definitions of HWCAP_IMPORTANT after removal of LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask. There HWCAP_IMPORTANT was used as default value. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Remove LD_HWCAP_MASK / tunable glibc.cpu.hwcap_maskStefan Liebler2024-06-186-32/+6
| | | | | | | | | | | | Remove the environment variable LD_HWCAP_MASK and the tunable glibc.cpu.hwcap_mask as those are not used anymore in common-code after removal in elf/dl-cache.c:search_cache(). The only remaining user is sparc32 where it is used in elf_machine_matches_host(). If sparc32 does not need it anymore, we can get rid of it at all. Otherwise we could also move LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask to be sparc32 specific. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Remove _DL_PLATFORMS_COUNTStefan Liebler2024-06-189-28/+6
| | | | | | | | | Remove the definitions of _DL_PLATFORMS_COUNT as those are not used anymore after removal in elf/dl-cache.c:search_cache(). Note: On x86, we can also get rid of the definitions HWCAP_PLATFORMS_START and HWCAP_PLATFORMS_COUNT. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Remove _DL_FIRST_PLATFORMStefan Liebler2024-06-182-6/+0
| | | | | | | | | | Remove the definitions of _DL_FIRST_PLATFORM as those were only used in the _DL_HWCAP_PLATFORM definitions and in _dl_string_platform(). Both were removed. Note: Removed on every architecture despite of powerpc, where _dl_string_platform() is still used. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Remove _DL_HWCAP_PLATFORMStefan Liebler2024-06-1810-29/+0
| | | | | | Remove the definitions of _DL_HWCAP_PLATFORM as those are not used anymore after removal in elf/dl-cache.c:search_cache(). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Remove platform strings in dl-procinfo.cStefan Liebler2024-06-186-189/+7
| | | | | | Remove the platform strings in dl-procinfo.c where also the implementation of _dl_string_platform() was removed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Remove _dl_string_platformStefan Liebler2024-06-1810-85/+0
| | | | | | | | | Despite of powerpc where the returned integer is stored in tcb, and the diagnostics output, there is no user anymore. Thus this patch removes the diagnostics output and _dl_string_platform for all other platforms. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* elf: Remove loading legacy hwcaps/platform entries in dynamic loaderStefan Liebler2024-06-181-19/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The legacy hwcaps mechanism was removed with glibc 2.37: See this commit series: - d178c67535f0d159df73843e7c18cbdb39b4d25d x86_64: Remove platform directory library loading test - 6099908fb84debee4c3bcb05d88769410c2aecd1 elf: Remove legacy hwcaps support from the dynamic loader - b78ff5a25dc8ba9d8c6df10bb0a533254bdd193f elf: Remove legacy hwcaps support from ldconfig - 4a7094119ce05cadf927f52cc5d723e2195e65f9 elf: Remove hwcap parameter from add_to_cache signature - cfbf883db36727a84ef7929af49ef68c195b5972 elf: Remove hwcap and bits_hwcap fields from struct cache_entry - 78d9a1620b840deb0880686e4159eaf70708866a Add NEWS entry for legacy hwcaps removal - ab40f20364f4a417a63dd51fdd943742070bfe96 elf: Remove _dl_string_hwcap - e76369ed6371734f77f468eab097ef4e5b5db1c5 elf: Simplify output of hwcap subdirectories in ld.so help According to Florian Weimer, this was an oversight and should also have been removed. As ldconfig does not generate ld.so.cache entries with hwcap/platform bits in the hwcap-field anymore, this patch now skips those entries. Thus currently only named-hwcap-entries and the default entries are allowed. For named-hwcap entries bit 62 is set and also the isa-level bits can be set. For the default entries the hwcap-field is 0. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* x86: Remove HWCAP_START and HWCAP_COUNTStefan Liebler2024-06-181-6/+0
| | | | | | | | | | Both defines are not used anymore. Those were only used for _dl_string_hwcap(), which itself was removed with commit ab40f20364f4a417a63dd51fdd943742070bfe96 "elf: Remove _dl_string_hwcap" Just clean up. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* math: Update mips32/mips64 ulps for log2p1YunQiang Su2024-06-172-0/+40
|
* Convert to autoconf 2.72 (vanilla release, no distribution patches)Andreas K. Hüttel2024-06-1731-1599/+1815
| | | | | | | As discussed at the patch review meeting Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org> Reviewed-by: Simon Chopin <simon.chopin@canonical.com>
* Implement C23 exp2m1, exp10m1Joseph Myers2024-06-1758-3/+9923
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C23 adds various <math.h> function families originally defined in TS 18661-4. Add the exp2m1 and exp10m1 functions (exp2(x)-1 and exp10(x)-1, like expm1). As with other such functions, these use type-generic templates that could be replaced with faster and more accurate type-specific implementations in future. Test inputs are copied from those for expm1, plus some additions close to the overflow threshold (copied from exp2 and exp10) and also some near the underflow threshold. exp2m1 has the unusual property of having an input (M_MAX_EXP) where whether the function overflows (under IEEE semantics) depends on the rounding mode. Although these could reasonably be XFAILed in the testsuite (as we do in some cases for arguments very close to a function's overflow threshold when an error of a few ulps in the implementation can result in the implementation not agreeing with an ideal one on whether overflow takes place - the testsuite isn't smart enough to handle this automatically), since these functions aren't required to be correctly rounding, I made the implementation check for and handle this case specially. The Makefile ordering expected by lint-makefiles for the new functions is a bit peculiar, but I implemented it in this patch so that the test passes; I don't know why log2 also needed moving in one Makefile variable setting when it didn't in my previous patches, but the failure showed a different place was expected for that function as well. The powerpc64le IFUNC setup seems not to be as self-contained as one might hope; it shouldn't be necessary to add IFUNCs for new functions such as these simply to get them building, but without setting up IFUNCs for the new functions, there were undefined references to __GI___expm1f128 (that IFUNC machinery results in no such function being defined, but doesn't stop include/math.h from doing the redirection resulting in the exp2m1f128 and exp10m1f128 implementations expecting to call it). Tested for x86_64 and x86, and with build-many-glibcs.py.
* Implement C23 log10p1Joseph Myers2024-06-1752-2/+3555
| | | | | | | | | | | | | | C23 adds various <math.h> function families originally defined in TS 18661-4. Add the log10p1 functions (log10(1+x): like log1p, but for base-10 logarithms). This is directly analogous to the log2p1 implementation (except that whereas log2p1 has a smaller underflow range than log1p, log10p1 has a larger underflow range). The test inputs are copied from those for log1p and log2p1, plus a few more inputs in that wider underflow range. Tested for x86_64 and x86, and with build-many-glibcs.py.
* Implement C23 logp1Joseph Myers2024-06-1780-12/+725
| | | | | | | | | | | | | | | | | | | | | | | | | | | C23 adds various <math.h> function families originally defined in TS 18661-4. Add the logp1 functions (aliases for log1p functions - the name is intended to be more consistent with the new log2p1 and log10p1, where clearly it would have been very confusing to name those functions log21p and log101p). As aliases rather than new functions, the content of this patch is somewhat different from those actually adding new functions. Tests are shared with log1p, so this patch *does* mechanically update all affected libm-test-ulps files to expect the same errors for both functions. The vector versions of log1p on aarch64 and x86_64 are *not* updated to have logp1 aliases (and thus there are no corresponding header, tests, abilist or ulps changes for vector functions either). It would be reasonable for such vector aliases and corresponding changes to other files to be made separately. For now, the log1p tests instead avoid testing logp1 in the vector case (a Makefile change is needed to avoid problems with grep, used in generating the .c files for vector function tests, matching more than one ALL_RM_TEST line in a file testing multiple functions with the same inputs, when it assumes that the .inc file only has a single such line). Tested for x86_64 and x86, and with build-many-glibcs.py.
* support: Include <limits.h> for NAME_MAX use in temp_file.cFlorian Weimer2024-06-171-0/+1
|
* support: Include <stdlib.h> for atoi use in support_wait_for_thread_exitFlorian Weimer2024-06-171-0/+1
|
* Extend tst-getconf.sh test with NPROCESSORS_CONF and NPROCESSORS_ONLNJan Kurik2024-06-171-0/+4
| | | | Reviewed-by: Arjun Shankar <arjun@redhat.com>