aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-01-15stdlib: Reinstate stable mergesort implementation on qsortAdhemerval Zanella7-446/+232
The mergesort removal from qsort implementation (commit 03bf8357e8) had the side-effect of making sorting nonstable. Although neither POSIX nor C standard specify that qsort should be stable, it seems that it has become an instance of Hyrum's law where multiple programs expect it. Also, the resulting introsort implementation is not faster than the previous mergesort (which makes the change even less appealing). This patch restores the previous mergesort implementation, with the exception of machinery that checks the resulting allocation against the _SC_PHYS_PAGES (it only adds complexity and the heuristic not always make sense depending on the system configuration and load). The alloca usage was replaced with a fixed-size buffer. For the fallback mechanism, the implementation uses heapsort. It is simpler than quicksort, and it does not suffer from adversarial inputs. With memory overcommit, it should be rarely triggered. The drawback is mergesort requires O(n) extra space, and since it is allocated with malloc the function is AS-signal-unsafe. It should be feasible to change it to use mmap, although I am not sure how urgent it is. The heapsort is also nonstable, so programs that require a stable sort would still be subject to this latent issue. The tst-qsort5 is removed since it will not create quicksort adversarial inputs with the current qsort_r implementation. Checked on x86_64-linux-gnu and aarch64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-01-15x86-64: Check if mprotect works before rewriting PLTH.J. Lu3-1/+75
Systemd execution environment configuration may prohibit changing a memory mapping to become executable: MemoryDenyWriteExecute= Takes a boolean argument. If set, attempts to create memory mappings that are writable and executable at the same time, or to change existing memory mappings to become executable, or mapping shared memory segments as executable, are prohibited. When it is set, systemd service stops working if PLT rewrite is enabled. Check if mprotect works before rewriting PLT. This fixes BZ #31230. This also works with SELinux when deny_execmem is on. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-01-15aarch64: Add NEWS entry about libmvec for 2.39Szabolcs Nagy1-0/+7
Auto-vectorizing scalar calls is now supported. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-01-14localedata/unicode-gen/utf8_gen.py: fix Hangul syllable nameMike FABIAN2-400/+400
Resolves: BZ # 29506
2024-01-13x86_64: Optimize ffsll function code size.Sunil K Pandey1-5/+5
Ffsll function randomly regress by ~20%, depending on how code gets aligned in memory. Ffsll function code size is 17 bytes. Since default function alignment is 16 bytes, it can load on 16, 32, 48 or 64 bytes aligned memory. When ffsll function load at 16, 32 or 64 bytes aligned memory, entire code fits in single 64 bytes cache line. When ffsll function load at 48 bytes aligned memory, it splits in two cache line, hence random regression. Ffsll function size reduction from 17 bytes to 12 bytes ensures that it will always fit in single 64 bytes cache line. This patch fixes ffsll function random performance regression. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-01-13localedata: Remove redundant commentsMike FABIAN87-260/+14
2024-01-12RISC-V: Enable static-pie.Yanzhang Wang3-1/+77
This patch referents the commit 374cef3 to add static-pie support. And because the dummy link map is used when relocating ourselves, so need not to set __global_pointer$ at this time. It will also check whether toolchain supports to build static-pie. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-01-12linux: Fix fstat64 on alpha and sparc64Adhemerval Zanella1-2/+5
The 551101e8240b7514fc646d1722f8b79c90362b8f change is incorrect for alpha and sparc, since __NR_stat is defined by both kABI. Use __NR_newfstat to check whether to fallback to __NR_fstat64 (similar to what fstatat64 does). Checked on sparc64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-01-12math: remove exp10 wrappersWilco Dijkstra29-8/+71
Remove the error handling wrapper from exp10. This is very similar to the changes done to exp and exp2, except that we also need to handle pow10 and pow10l. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-01-12Benchtests: Increase benchmark iterationsWilco Dijkstra2-2/+2
Increase benchmark iterations for math and vector math functions to improve timing accuracy. Vector math benchmarks now take 1-3 seconds on a modern CPU. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-01-12debug/getwd_chk.c: warning should be emitted for the __getwd_chk symbol.Frederic Cambus1-1/+1
Otherwise the warning message for the getwd symbol ends up being duplicated. Signed-off-by: Frederic Cambus <fred@statdns.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-01-12Make __getrandom_nocancel set errno and add a _nostatus versionXi Ruoyao4-2/+19
The __getrandom_nocancel function returns errors as negative values instead of errno. This is inconsistent with other _nocancel functions and it breaks "TEMP_FAILURE_RETRY (__getrandom_nocancel (p, n, 0))" in __arc4random_buf. Use INLINE_SYSCALL_CALL instead of INTERNAL_SYSCALL_CALL to fix this issue. But __getrandom_nocancel has been avoiding from touching errno for a reason, see BZ 29624. So add a __getrandom_nocancel_nostatus function and use it in tcache_key_initialize. Signed-off-by: Xi Ruoyao <xry111@xry111.site> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-01-11x86-64/cet: Make CET feature check specific to Linux/x86H.J. Lu9-37/+120
CET feature bits in TCB, which are Linux specific, are used to check if CET features are active. Move CET feature check to Linux/x86 directory. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2024-01-11Incorporate translations (zh_CN)Andreas K. Hüttel1-582/+580
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2024-01-11Define ISO 639-3 "glk" (Gilaki)Mike FABIAN1-0/+1
Resolves: BZ # 27163 References: https://iso639-3.sil.org/code/glk https://en.wikipedia.org/wiki/Gilaki_language
2024-01-11resolv: Fix endless loop in __res_context_queryStefan Liebler2-4/+8
Starting with commit 40c0add7d48739f5d89ebba255c1df26629a76e2 "resolve: Remove __res_context_query alloca usage" there is an endless loop in __res_context_query if __res_context_mkquery fails e.g. if type is invalid. Then the scratch buffer is resized to MAXPACKET size and it is retried again. Before the mentioned commit, it was retried only once and with the mentioned commit, there is no check and it retries in an endless loop. This is observable with xtest resolv/tst-resolv-qtypes which times out after 300s. This patch retries mkquery only once as before the mentioned commit. Furthermore, scratch_buffer_set_array_size is now only called with nelem=2 if type is T_QUERY_A_AND_AAAA (also see mentioned commit). The test tst-resolv-qtypes is also adjusted to verify that <func> is really returning with -1 in case of an invalid type. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-01-11localedata: revert all the remaining locale sources to UTF-8Mike FABIAN205-6090/+6088
2024-01-11localedata: am_ET ber_DZ en_GB en_PH en_US fil_PH kab_DZ om_ET om_KE ti_ET ↵Mike FABIAN8-132/+132
tl_PH: convert to UTF-8
2024-01-11localedata: resolve cyclic dependenciesMike FABIAN11-1050/+226
Resolves: BZ # 24006
2024-01-11localedata: kv_RU: convert to UTF-8Mike FABIAN1-57/+57
2024-01-11localedata: add new locale kv_RUMike FABIAN2-0/+165
Resolves: BZ # 30605
2024-01-10elf: Fix tst-nodeps2 test failure.Carlos O'Donell1-1/+4
After 78ca44da0160a0b442f0ca1f253e3360f044b2ec ("elf: Relocate libc.so early during startup and dlmopen (bug 31083)") we start seeing tst-nodeps2 failures when building the testsuite with --enable-hard-coded-path-in-tests. When building the testsuite with --enable-hard-coded-path-in-tests the tst-nodeps2-mod.so is not built with the required DT_RUNPATH values and the test escapes the test framework and loads the system libraries and aborts. The fix is to use the existing $(link-test-modules-rpath-link) variable to set DT_RUNPATH correctly. No regressions on x86_64. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2024-01-10localedata: Sort Makefile variables.Carlos O'Donell1-219/+298
Sort Makefile variables using scrips/sort-makefile-lines.py. No regressions on x86_64.
2024-01-10locale: Sort Makefile variables.Carlos O'Donell1-29/+97
Sort Makefile variables using scrips/sort-makefile-lines.py. No regressions on x86_64.
2024-01-10i386: Remove CET support bitsH.J. Lu12-89/+45
1. Remove _dl_runtime_resolve_shstk and _dl_runtime_profile_shstk. 2. Move CET offsets from x86 cpu-features-offsets.sym to x86-64 features-offsets.sym. 3. Rename x86 cet-control.h to x86-64 feature-control.h since it is only for x86-64 and also used for PLT rewrite. 4. Add x86-64 ldsodefs.h to include feature-control.h. 5. Change TUNABLE_CALLBACK (set_plt_rewrite) to x86-64 only. 6. Move x86 dl-procruntime.c to x86-64. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-01-10x86-64/cet: Move check-cet.awk to x86_64H.J. Lu2-1/+1
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-01-10x86-64/cet: Move dl-cet.[ch] to x86_64 directoriesH.J. Lu3-65/+47
Since CET is only enabled for x86-64, move dl-cet.[ch] to x86_64 directories. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-01-10x86: Move x86-64 shadow stack startup codesH.J. Lu1-1/+1
Move sysdeps/x86/libc-start.h to sysdeps/x86_64/libc-start.h and use sysdeps/generic/libc-start.h for i386. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-01-10Fix deprecated utcnow() usage in build-many-glibcs.pyJoseph Myers1-1/+1
Running build-many-glibcs.py with Python 3.12 or later produces a warning: build-many-glibcs.py:566: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). build_time = datetime.datetime.utcnow() Replace with datetime.datetime.now(datetime.timezone.utc) (the datetime.UTC constant is new in 3.11, so not suitable for use in this script at present).
2024-01-10Fix invalid escape sequence in build-many-glibcs.pyJoseph Myers1-1/+1
Running build-many-glibcs.py with Python 3.12 or later produces a warning: build-many-glibcs.py:173: SyntaxWarning: invalid escape sequence '\.' m = re.fullmatch('([0-9]+)\.([0-9]+)[.0-9]*', l) Use a raw string instead to avoid that warning. (Note: I haven't checked whether any other Python scripts included with glibc might have issues with newer Python versions.)
2024-01-10math: Fix test-fenv.c feupdateenv testsAdhemerval Zanella1-0/+1
The feupdateenv tests added by 802aef27b2 do not restore the floating point mask, which might keep some floating point exception enabled and thus make the feupdateenv_single_test raise an unexpected signal. Checked on x86_64-linux-gnu and aarch64-linux-gnu (on Apple M1 trapping is supported). Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2024-01-09Remove installed header rule on $(..)include/%.hH.J. Lu1-2/+0
On x86-64 machine with [hjl@gnu-cfl-3 x86-glibc]$ ls -l /usr/include/asm/prctl.h sysdeps/unix/sysv/linux/x86_64/include/asm/prctl.h -rw-r--r-- 1 hjl hjl 825 Jan 9 09:41 sysdeps/unix/sysv/linux/x86_64/include/asm/prctl.h -rw-r--r-- 1 root root 1170 Nov 27 16:00 /usr/include/asm/prctl.h [hjl@gnu-cfl-3 x86-glibc]$ glibc configured with --enable-cet build failed: make[2]: Entering directory '/export/gnu/import/git/gitlab/x86-glibc/iconv' ../Makerules:327: update target '/export/build/gnu/tools-build/glibc-cet-gitlab/build-x86_64-linux/gnu/lib-names-64.h' due to: /export/build/gnu/tools-build/glibc-cet-gitlab/build-x86_64-linux/gnu/lib-names-64.stmp : ../Makeconfig:1216: update target '/export/build/gnu/tools-build/glibc-cet-gitlab/build-x86_64-linux/libc-modules.h' due to: /export/build/gnu/tools-build/glibc-cet-gitlab/build-x86_64-linux/libc-modules.stmp : ../Makerules:1126: update target '/usr/include/asm/prctl.h' due to: ../sysdeps/unix/sysv/linux/x86_64/64/../include/asm/prctl.h force-install /usr/bin/install -c -m 644 ../sysdeps/unix/sysv/linux/x86_64/64/../include/asm/prctl.h /usr/include/asm/prctl.h /usr/bin/install: cannot remove '/usr/include/asm/prctl.h': Permission denied make[2]: *** [../Makerules:1126: /usr/include/asm/prctl.h] Error 1 make[2]: Leaving directory '/export/gnu/import/git/gitlab/x86-glibc/iconv' make[1]: *** [Makefile:484: iconv/subdir_lib] Error 2 make[1]: Leaving directory '/export/gnu/import/git/gitlab/x86-glibc' make: *** [Makefile:9: all] Error 2 This is triggered by the rule in Makerules: $(inst_includedir)/%.h: $(..)include/%.h $(+force) $(do-install) Since no files under include/ should be installed, remove it from Makerules. Tested it on x86-64. There are no differences in the installed header files.
2024-01-09i386: Fail if configured with --enable-cetAdhemerval Zanella5-13/+12
Since it is only supported for x86_64. Checked on i686-linux-gnu.
2024-01-09i386: Remove CET supportAdhemerval Zanella31-770/+75
CET is only support for x86_64, this patch reverts: - faaee1f07ed x86: Support shadow stack pointer in setjmp/longjmp. - be9ccd27c09 i386: Add _CET_ENDBR to indirect jump targets in add_n.S/sub_n.S - c02695d7764 x86/CET: Update vfork to prevent child return - 5d844e1b725 i386: Enable CET support in ucontext functions - 124bcde683 x86: Add _CET_ENDBR to functions in crti.S - 562837c002 x86: Add _CET_ENDBR to functions in dl-tlsdesc.S - f753fa7dea x86: Support IBT and SHSTK in Intel CET [BZ #21598] - 825b58f3fb i386-mcount.S: Add _CET_ENDBR to _mcount and __fentry__ - 7e119cd582 i386: Use _CET_NOTRACK in i686/memcmp.S - 177824e232 i386: Use _CET_NOTRACK in memcmp-sse4.S - 0a899af097 i386: Use _CET_NOTRACK in memcpy-ssse3-rep.S - 7fb613361c i386: Use _CET_NOTRACK in memcpy-ssse3.S - 77a8ae0948 i386: Use _CET_NOTRACK in memset-sse2-rep.S - 00e7b76a8f i386: Use _CET_NOTRACK in memset-sse2.S - 90d15dc577 i386: Use _CET_NOTRACK in strcat-sse2.S - f1574581c7 i386: Use _CET_NOTRACK in strcpy-sse2.S - 4031d7484a i386/sub_n.S: Add a missing _CET_ENDBR to indirect jump - target - Checked on i686-linux-gnu.
2024-01-09x86: Move CET infrastructure to x86_64Adhemerval Zanella62-265/+270
The CET is only supported for x86_64 and there is no plan to add kernel support for i386. Move the Makefile rules and files from the generic x86 folder to x86_64 one. Checked on x86_64-linux-gnu and i686-linux-gnu.
2024-01-09localedata: su_ID: make lang_name agree with CLDRMike FABIAN1-1/+1
2024-01-09localedata: add new locale su_IDMike FABIAN2-0/+165
Resolves: BZ # 27312
2024-01-09localedata: add new locale zgh_MAMike FABIAN3-0/+192
Resolves: BZ # 12908 https://iso639-3.sil.org/code/zgh
2024-01-09INSTALL: regenerateMark Wielaard1-7/+7
2024-01-09localedata: add tok/UTF-8 to SUPPORTEDMike FABIAN1-0/+1
2024-01-09localedata: tok: add yY and nN to yesexpr and noexprMike FABIAN1-2/+2
See: https://sourceware.org/bugzilla/show_bug.cgi?id=31221#c2
2024-01-09localedata: tok: convert to UTF-8Mike FABIAN1-3/+3
2024-01-09localedata: add data for tok (Toki Pona)Janet Blackquill1-0/+154
Resolves: BZ # 31221 glibc can recognise its code, but does not have its data. This patch remedies that. Signed-off-by: Janet Blackquill <uhhadd@gmail.com>
2024-01-08Remove ia64-linux-gnuAdhemerval Zanella567-155609/+39
Linux 6.7 removed ia64 from the official tree [1], following the general principle that a glibc port needs upstream support for the architecture in all the components it depends on (binutils, GCC, and the Linux kernel). Apart from the removal of sysdeps/ia64 and sysdeps/unix/sysv/linux/ia64, there are updates to various comments referencing ia64 for which removal of those references seemed appropriate. The configuration is removed from README and build-many-glibcs.py. The CONTRIBUTED-BY, elf/elf.h, manual/contrib.texi (the porting mention), *.po files, config.guess, and longlong.h are not changed. For Linux it allows cleanup some clone2 support on multiple files. The following bug can be closed as WONTFIX: BZ 22634 [2], BZ 14250 [3], BZ 21634 [4], BZ 10163 [5], BZ 16401 [6], and BZ 11585 [7]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43ff221426d33db909f7159fdf620c3b052e2d1c [2] https://sourceware.org/bugzilla/show_bug.cgi?id=22634 [3] https://sourceware.org/bugzilla/show_bug.cgi?id=14250 [4] https://sourceware.org/bugzilla/show_bug.cgi?id=21634 [5] https://sourceware.org/bugzilla/show_bug.cgi?id=10163 [6] https://sourceware.org/bugzilla/show_bug.cgi?id=16401 [7] https://sourceware.org/bugzilla/show_bug.cgi?id=11585 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-01-08localedata: dz_BT, bo_CN: convert to UTF-8Mike FABIAN2-136/+136
2024-01-08localedata: dz_BT, bo_CN: Fix spelling of "phur bu" in both Tibetan and DzongkhaValery Ushakov2-4/+4
Resolves: BZ # 31086
2024-01-08localedata: bo_CN: Fix spelling errors in Tibetan dataValery Ushakov1-20/+23
Resolves: BZ # 31086
2024-01-08localedata: bo_CN: Fix incomplete edit in Tibetan yesexprValery Ushakov1-1/+1
Resolves: BZ # 31086
2024-01-08localedata: dz_BT: Fix spelling errors in Dzongha dataValery Ushakov1-23/+23
Resolves: BZ # 31086
2024-01-08localedata: unicode-gen: Remove redundant \s* from regexp, fix commentsMike FABIAN2-5/+5