about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* cdefs: Limit definition of fortification macrosSiddhesh Poyarekar2023-02-021-2/+4
| | | | | | | | | | | | | Define the __glibc_fortify and other macros only when __FORTIFY_LEVEL > 0. This has the effect of not defining these macros on older C90 compilers that do not have support for variable length argument lists. Also trim off the trailing backslashes from the definition of __glibc_fortify and __glibc_fortify_n macros. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit 2337e04e21ba6040926ec871e403533f77043c40)
* Create ChangeLog.old/ChangeLog.26. glibc-2.37Carlos O'Donell2023-01-311-0/+6942
|
* Prepare for glibc 2.37 release.Carlos O'Donell2023-01-312-3/+3
| | | | Update version.h, and include/features.h.
* x86: Fix strncat-avx2.S reading past length [BZ #30065]Noah Goldstein2023-01-312-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Occurs when `src` has no null-term. Two cases: 1) Zero-length check is doing: ``` test %rdx, %rdx jl L(zero_len) ``` which doesn't actually check zero (was at some point `decq` and the flag never got updated). The fix is just make the flag `jle` i.e: ``` test %rdx, %rdx jle L(zero_len) ``` 2) Length check in page-cross case checking if we should continue is doing: ``` cmpq %r8, %rdx jb L(page_cross_small) ``` which means we will continue searching for null-term if length ends at the end of a page and there was no null-term in `src`. The fix is to make the flag: ``` cmpq %r8, %rdx jbe L(page_cross_small) ```
* Update install.texi, and regenerate INSTALL.Carlos O'Donell2023-01-312-17/+17
|
* Update manual/contrib.texi.Carlos O'Donell2023-01-311-4/+12
| | | | | | | | | | | | Thank Yinyu Cai for their maintainership of the LoongArch port. Thank Vineet Gupta for their maintainership of the ARC port. Thank Tulio Magno Quites Machado Filho for their past maintainership of the PowerPC port. Thank Rajalakshmi Srinivasaraghavan for their current maintainership of the PowerPC port.
* Update NEWS file with bug fixes.Carlos O'Donell2023-01-311-6/+75
|
* Regenerate configure.Carlos O'Donell2023-01-312-3/+4
| | | | | | | Run using vanilla upstream autoconf 2.69. Minor whitespace change to sysdeps/loongarch/configure and sysdeps/mach/configure, and nothing else.
* Update all PO files in preparation for release.Carlos O'Donell2023-01-3137-10095/+8069
|
* doc: correct _FORTIFY_SOURCE doc in features.hfanquake2023-01-311-1/+2
|
* libio: Update number of written bytes in dprintf implementationFlorian Weimer2023-01-313-0/+47
| | | | | | | | | | | | The __printf_buffer_flush_dprintf function needs to record that the buffer has been written before reusing it. Without this accounting, dprintf always returns zero. Fixes commit 8ece45e4f586abd212d1c02d74d38ef681a45600 ("libio: Convert __vdprintf_internal to buffers"). Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Account for octal marker in %#o formatAndreas Schwab2023-01-303-0/+56
|
* Use binutils 2.40 branch in build-many-glibcs.pyJoseph Myers2023-01-271-1/+1
| | | | | | | This patch makes build-many-glibcs.py use binutils 2.40 branch. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* Use MPFR 4.2.0, MPC 1.3.1 in build-many-glibcs.pyJoseph Myers2023-01-271-2/+2
| | | | | | | | This patch makes build-many-glibcs.py use the new MPFR 4.2.0 and MPC 1.3.1 releases. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* stdio-common: Handle -1 buffer size in __sprintf_chk & co (bug 30039)Florian Weimer2023-01-254-10/+155
| | | | | | | | | | | | | | | This shows up as an assertion failure when sprintf is called with a specifier like "%.8g" and libquadmath is linked in: Fatal glibc error: printf_buffer_as_file.c:31 (__printf_buffer_as_file_commit): assertion failed: file->stream._IO_write_ptr <= file->next->write_end Fix this by detecting pointer wraparound in __vsprintf_internal and saturate the addition to the end of the address space instead. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Document '%F' format specifierPaul Pluzhnikov2023-01-251-11/+12
| | | | | | | | | | The '%F' format specifier was implemented in commit 6c46718f9f0 on 2000-08-23, but remains undocumented in the manual. https://stackoverflow.com/questions/75157669/format-specifier-f-missing-from-glibcs-documentation Fix that. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* sparc (64bit): Regenerate ulpsAndreas K. Hüttel2023-01-241-3/+4
| | | | | | | Linux catbus 5.15.69-gentoo #1 SMP Sat Sep 24 07:56:24 PDT 2022 sparc64 sun4v UltraSparc T5 (Niagara5) GNU/Linux gcc (Gentoo 11.3.1_p20221209 p3) 11.3.1 20221209 GNU ld (Gentoo 2.38 p4) 2.38 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* ia64: Regenerate ulpsAndreas K. Hüttel2023-01-241-2/+2
| | | | | | | Linux guppy 5.13.0-00002-gdecb01746d6c #368 SMP Sat Aug 14 20:10:13 UTC 2021 ia64 Dual-Core Intel(R) Itanium(R) Processor 9040 GenuineIntel GNU/Linux gcc (Gentoo 12.2.1_p20221231 p8) 12.2.1 20221231 GNU ld (Gentoo 2.40 p1) 2.40 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Update libc.pot for 2.37 release.Carlos O'Donell2023-01-231-306/+282
|
* x86: Cache computation for AMD architecture.Sajan Karumanchi2023-01-181-159/+45
| | | | | | | | All AMD architectures cache details will be computed based on __cpuid__ `0x8000_001D` and the reference to __cpuid__ `0x8000_0006` will be zeroed out for future architectures. Reviewed-by: Premachandra Mallappa <premachandra.mallappa@amd.com>
* manual: Fix typoMartin Joerg2023-01-181-1/+1
| | | | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
* Add STATX_DIOALIGN from Linux 6.1 to bits/statx-generic.hJoseph Myers2023-01-171-0/+1
| | | | | | | Linux 6.1 adds a new STATX_DIOALIGN constant. Add it to glibc's bits/statx-generic.h. Tested for x86_64.
* Add IPPROTO_L2TP from Linux 6.1 to netinet/in.hJoseph Myers2023-01-171-0/+2
| | | | | | | | | Linux 6.1 adds a define IPPROTO_L2TP to its include/uapi/linux/in.h (not strictly a new constant, since it's moved from include/uapi/linux/l2tp.h). Add this constant to glibc's netinet/in.h. Tested for x86_64.
* AArch64: Improve strrchrWilco Dijkstra2023-01-171-25/+33
| | | | | | | | Use shrn for narrowing the mask which simplifies code and speeds up small strings. Unroll the first search loop to improve performance on large strings. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* AArch64: Optimize strnlenWilco Dijkstra2023-01-171-21/+18
| | | | | | | | Optimize strnlen using the shrn instruction and improve the main loop. Small strings are around 10% faster, large strings are 40% faster on modern CPUs. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* AArch64: Optimize strlenWilco Dijkstra2023-01-171-8/+12
| | | | | | | Optimize strlen by unrolling the main loop. Large strings are 64% faster on modern CPUs. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* AArch64: Optimize strcpyWilco Dijkstra2023-01-171-17/+19
| | | | | | Unroll the main loop. Large strings are around 20% faster on modern CPUs. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* AArch64: Improve strchrnulWilco Dijkstra2023-01-171-2/+10
| | | | | | Unroll the main loop, which improves performance slightly. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* AArch64: Optimize strchrWilco Dijkstra2023-01-171-28/+24
| | | | | | | Simplify calculation of the mask using shrn. Unroll the main loop. Small strings are 20% faster on modern CPUs. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* AArch64: Improve strlen_asimdWilco Dijkstra2023-01-171-12/+4
| | | | | | | Use shrn for the mask, merge tst+bne into cbnz, and tweak code alignment. Performance improves slightly as a result. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* AArch64: Optimize memrchrWilco Dijkstra2023-01-171-9/+11
| | | | | | Optimize the main loop - large strings are 43% faster on modern CPUs. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* AArch64: Optimize memchrWilco Dijkstra2023-01-171-13/+14
| | | | | | Optimize the main loop - large strings are 40% faster on modern CPUs. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* hurd: Fix _NOFLSH valueSamuel Thibault2023-01-151-1/+1
| | | | | | shifting 1 (thus an integer) left 31 bit is undefined behavior. We have to make it an unsigned integer to properly get 0x80000000 (like done in other places).
* elf: Fix GL(dl_phdr) and GL(dl_phnum) for static builds [BZ #29864]Adhemerval Zanella2023-01-123-48/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 73fc4e28b9464f0e refactor did not add the GL(dl_phdr) and GL(dl_phnum) for static build, relying on the __ehdr_start symbol, which is always added by the static linker, to get the correct values. This is problematic in some ways: - The segment may see its in-memory size differ from its in-file size (or the binary may have holes). The Linux has fixed is to provide concise values for both AT_PHDR and AT_PHNUM (commit 0da1d5002745c - "fs/binfmt_elf: Fix AT_PHDR for unusual ELF files") - Some archs (alpha for instance) the hidden weak reference is not correctly pulled by the static linker and __ehdr_start address end up being 0, which makes GL(dl_phdr) and GL(dl_phnum) have both invalid values (and triggering a segfault later on libc.so while accessing TLS variables). The safer fix is to just restore the previous behavior to setup GL(dl_phdr) and GL(dl_phnum) for static based on kernel auxv. The __ehdr_start fallback can also be simplified by not assuming weak linkage (as for PIE). The libc-static.c auxv init logic is moved to dl-support.c, since the later is build without SHARED and then GLRO macro is defined to access the variables directly. The _dl_phdr is also assumed to be always non NULL, since an invalid NULL values does not trigger TLS initialization (which is used in various libc systems). Checked on aarch64-linux-gnu, x86_64-linux-gnu, and i686-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* string: Suppress -Wmaybe-unitialized for wordcopy [BZ #19444]Adhemerval Zanella2023-01-121-0/+24
| | | | | | | | | | | | | When compiling with GCC 6+ the sparc build warns that some variables might be used uninitialized. However it does not seem the fact, since the variables are really initialized (and also other targets that use the same code, like powerpc, do not warn about it). So suppress the warning for now. Changes from v1: * Update patch description and the explanation for the suppresion. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* scripts/build-many-glibcs.py: Remove unused RANLIB and STRIP optionAdhemerval Zanella2023-01-121-2/+0
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILSAdhemerval Zanella2023-01-124-287/+27
| | | | | | Allow the variables to be overriden or have the defaults come from the compiler currently in use. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* configure: Allow user override LD, AR, OBJCOPY, and GPROFAdhemerval Zanella2023-01-113-11/+24
| | | | | | | | | | | | The only way to override LD, AR, OBJCOPY, and GPROF is through --with-binutils (setting the environments variables on configure is overridden by LIBC_PROG_BINUTILS). The build-many-glibcs.py (bmg) glibcs option generates a working config, but not fully concise (some tools will be set from environment variable, while other will be set from $CC --print-prog-name). So remove the environment variable set to always use the "$CC --print-prog-name". Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* math: Suppress -O0 warnings for soft-fp fsqrt [BZ #19444]Adhemerval Zanella2023-01-111-0/+11
| | | | | | The patch suppress the same warnings from 87c266d758d29e52bfb717f90, that shows issues for microblaze, mips soft-fp, nios2, and or1k. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* sunrpc: Suppress GCC -O1 warning on user2netname [BZ #19444]Adhemerval Zanella2023-01-111-3/+4
| | | | | | | | The same issue described by 6128e82ebe973163d2dd614d31753c88c0c4d645 also happend with -O1. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* locale: Use correct buffer size for utf8_sequence_error [BZ #19444]Adhemerval Zanella2023-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The buffer used by snprintf might not be large enough for all possible inputs, as indicated by gcc with -O1: ../locale/programs/linereader.c: In function ‘utf8_sequence_error’: ../locale/programs/linereader.c:713:58: error: ‘%02x’ directive output may be truncated writing between 2 and 8 bytes into a region of size between 1 and 13 [-Werror=format-truncation=] 713 | snprintf (buf, sizeof (buf), "0x%02x 0x%02x 0x%02x 0x%02x", | ^~~~ ../locale/programs/linereader.c:713:34: note: directive argument in the range [0, 2147483647] 713 | snprintf (buf, sizeof (buf), "0x%02x 0x%02x 0x%02x 0x%02x", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../locale/programs/linereader.c:713:5: note: ‘snprintf’ output between 20 and 38 bytes into a destination of size 30 713 | snprintf (buf, sizeof (buf), "0x%02x 0x%02x 0x%02x 0x%02x", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 714 | ch1, ch2, ch3, ch4); | ~~~~~~~~~~~~~~~~~~~ Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Add HWCAP2_SVE_EBF16 from Linux 6.1 to AArch64 bits/hwcap.hJoseph Myers2023-01-101-0/+1
| | | | | | | Linux 6.1 adds a new AArch64 HWCAP2 value HWCAP2_SVE_EBF16; add it to the corresponding bits/hwcap.h. Tested with build-many-glibcs.py for aarch64.
* Add _FORTIFY_SOURCE implementation documentation [BZ #28998]Siddhesh Poyarekar2023-01-102-0/+251
| | | | | | | | | | | | There have been multiple requests to provide more detail on how the _FORTIFY_SOURCE macro works, so this patch adds a new node in the Library Maintenance section that does this. A lot of the description is implementation detail, which is why I put this in the appendix and not in the main documentation. Resolves: BZ #28998. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Florian Weimer <fweimer@redhat.com>
* Update copyright dates not handled by scripts/update-copyrightsJoseph Myers2023-01-0621-21/+21
| | | | | | I've updated copyright dates in glibc for 2023. This is the patch for the changes not generated by scripts/update-copyrights and subsequent build / regeneration of generated files.
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-0612181-12183/+12183
|
* Remove trailing whitespace in gmp.hJoseph Myers2023-01-061-1/+1
|
* Remove trailing whitespaceJoseph Myers2023-01-061-1/+1
| | | | | | For some reason this causes a pre-commit check error for a copyright date update commit, even though that commit doesn't touch anything near the line with this whitespace.
* C2x semantics for <tgmath.h>Joseph Myers2023-01-062-162/+297
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <tgmath.h> implements semantics for integer generic arguments that handle cases involving _FloatN / _FloatNx types as specified in TS 18661-3 plus some defect fixes. C2x has further changes to the semantics for <tgmath.h> macros with such types, which should also be considered defect fixes (although handled through the integration of TS 18661-3 in C2x rather than through an issue tracking process). Specifically, the rules were changed because of problems raised with using the macros with the evaluation format types such as float_t and _Float32_t: the older version of the rules didn't allow passing _FloatN / _FloatNx types to the narrowing macros returning float or double, or passing float / double / long double to the narrowing macros returning _FloatN / _FloatNx, which was a problem with the evaluation format types which could be either kind of type depending on the value of FLT_EVAL_METHOD. Thus the new rules allow cases of mixing types which were not allowed before, and, as part of the changes, the handling of integer arguments was also changed: if there is any _FloatNx generic argument, integer generic arguments are treated as _Float32x (not double), while the rule about treating integer arguments to narrowing macros returning _FloatN or _FloatNx as _Float64 not double was removed (no longer needed now double is a valid argument to such macros). I've implemented the changes in GCC's __builtin_tgmath, which thus requires updates to glibc's test expectations so that the tests continue to build with GCC 13 (the test is also updated to test the argument types that weren't allowed before but are now valid under C2x rules). Given those test changes, it's then also necessary to fix the implementations in <tgmath.h> to have appropriate semantics with older GCC so that the tests pass with GCC versions before GCC 13 as well. For some cases (non-narrowing macros with two or three generic arguments; narrowing macros returning _Float32x), the older version of __builtin_tgmath doesn't correspond sufficiently well to C2x semantics, so in those cases <tgmath.h> is adjusted to use the older macro implementation instead of __builtin_tgmath. The older macro implementation is itself adjusted to give the desired semantics, with GCC 7 and later. (It's not possible to get the right semantics in all cases for the narrowing macros with GCC 6 and before when the _FloatN / _FloatNx names are typedefs rather than distinct types.) Tested as follows: with the full glibc testsuite for x86_64, GCC 6, 7, 11, 13; with execution of the math/tests for aarch64, arm, powerpc and powerpc64le, GCC 6, 7, 12 and 13 (powerpc64le only with GCC 12 and 13); with build-many-glibcs.py with GCC 6, 7, 12 and 13.
* time: Set daylight to 1 for matching DST/offset change (bug 29951)Florian Weimer2023-01-054-20/+93
| | | | | | | | | | The daylight variable is supposed to be set to 1 if DST is ever in use for the current time zone. But __tzfile_read used to do this: __daylight = rule_stdoff != rule_dstoff; This check can fail to set __daylight to 1 if the DST and non-DST offsets happen to be the same.
* Fix ldbl-128 built-in function useJoseph Myers2023-01-053-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following issues with built-in function use in sysdeps/ieee754/ldbl-128 and sysdeps/ieee754/float128: * fabsl used __builtin_fabsf128 unconditionally, breaking the build with GCC 6 for several architectures; it should use __builtin_fabsl with an appropriate redirection in float128_private.h. (I'm not particularly concerned with building glibc with GCC 6; rather, I want to be able to run the tgmath.h tests with GCC 6, which is a significantly different case for tgmath.h compared to GCC 7 and later because of the lack of _FloatN / _FloatNx support in the compiler, and at present running the tests with a compiler means building glibc with that compiler.) * Some (conditional) uses of built-in functions had been added to ldbl-128 without appropriate float128_private.h remapping (there was remapping for the macros controlling whether the built-in functions are used, just not for the functions themselves). * s_llrintl.c called __builtin_round not __builtin_llrintl, which is obviously wrong. Tested with build-many-glibcs.py for aarch64-linux-gnu, GCC 6 (where it fixes the glibc build) and GCC 12, and with the glibc testsuite for x86_64.