aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-08-16Linux: Fix enum fsconfig_command detection in <sys/mount.h>Florian Weimer1-3/+3
The #ifdef FSOPEN_CLOEXEC check did not work because the macro was always defined in this header prior to the check, so that the <linux/mount.h> contents did not matter. Fixes commit 774058d72942249f71d74e7f2b639f77184160a6 ("linux: Fix sys/mount.h usage with kernel headers").
2022-08-16elf: Run tst-audit-tlsdesc, tst-audit-tlsdesc-dlopen everywhereFlorian Weimer1-16/+24
The test is valid for all TLS models, but we want to make a reasonable effort to test the GNU2 model specifically. For example, aarch64 defaults to GNU2, but does not have -mtls-dialect=gnu2, and the test was not run there. Suggested-by: Martin Coufal <mcoufal@redhat.com>
2022-08-15Move ip_mreqn structure from Linux to genericSamuel Thibault2-8/+13
I.e. from sysdeps/unix/sysv/linux/bits/in.h to netinet/in.h It is following both the BSD and Linux definitions. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-15malloc: Do not use MAP_NORESERVE to allocate heap segmentsFlorian Weimer2-8/+1
Address space for heap segments is reserved in a mmap call with MAP_ANONYMOUS | MAP_PRIVATE and protection flags PROT_NONE. This reservation does not count against the RSS limit of the process or system. Backing memory is allocated using mprotect in alloc_new_heap and grow_heap, and at this point, the allocator expects the kernel to provide memory (subject to memory overcommit). The SIGSEGV that might generate due to MAP_NORESERVE (according to the mmap manual page) does not seem to occur in practice, it's always SIGKILL from the OOM killer. Even if there is a way that SIGSEGV could be generated, it is confusing to applications that this only happens for secondary heaps, not for large mmap-based allocations, and not for the main arena. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-08-15Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485)Florian Weimer1-2/+5
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-08-15non-linux: bits/in.h: Add more RFC optionsSamuel Thibault1-0/+10
2022-08-12arm: Remove nested functionf rom relocate_pc24Adhemerval Zanella1-10/+13
Checked on arm-linux-gnueabihf.
2022-08-12linux: Fix sys/mount.h usage with kernel headersAdhemerval Zanella3-8/+137
Now that kernel exports linux/mount.h and includes it on linux/fs.h, its definitions might clash with glibc exports sys/mount.h. To avoid the need to rearrange the Linux header to be always after glibc one, the glibc sys/mount.h is changed to: 1. Undefine the macros also used as enum constants. This covers prior inclusion of <linux/mount.h> (for instance MS_RDONLY). 2. Include <linux/mount.h> based on the usual __has_include check (needs to use __has_include ("linux/mount.h") to paper over GCC bugs. 3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined. (FSOPEN_CLOEXEC should be a very close proxy.) 4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined. (Added in the same commit on the Linux side.) This patch also adds some tests to check if including linux/fs.h and linux/mount.h after and before sys/mount.h does work. Checked on x86_64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-12linux: Use compile_c_snippet to check linux/mount.h availabilityAdhemerval Zanella1-0/+5
Checked on x86_64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-12linux: Mimic kernel defition for BLOCK_SIZEAdhemerval Zanella1-1/+1
To avoid possible warnings if the kernel header is included before sys/mount.h. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-12linux: Use compile_c_snippet to check linux/pidfd.h availabilityAdhemerval Zanella1-3/+5
Instead of tying to a specific kernel version. Checked on x86_64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-12glibcextract.py: Add compile_c_snippetAdhemerval Zanella1-0/+19
It might be used on tests to check if a snippet build with the provided compiler and flags. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-12LoongArch: Add pointer mangling support.caiyinyu3-3/+74
2022-08-11AArch64: Fix typo in sve configure check (BZ# 29394)Wilco Dijkstra2-4/+4
Fix a typo in the SVE configure check. This fixes [BZ# 29394].
2022-08-11libio: Improve performance of IO locksWilco Dijkstra1-9/+19
Improve performance of recursive IO locks by adding a fast path for the single-threaded case. To reduce the number of memory accesses for locking/unlocking, only increment the recursion counter if the lock is already taken. On Neoverse V1, a microbenchmark with many small freads improved by 2.9x. Multithreaded performance improved by 2%. Reviewed-by: Cristian Rodríguez <crrodriguez@opensuse.org>
2022-08-11tst-process_madvise: Check process_madvise-syscall support.Stefan Liebler1-2/+5
So far this test checks if pidfd_open-syscall is supported, which was introduced with linux 5.3. The process_madvise-syscall was introduced with linux 5.10. Thus you'll get FAILs if you are running a kernel in between. This patch adds a check if the first process_madvise-syscall returns ENOSYS and in this case will fail with UNSUPPORTED. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-10elf.h: Add ELFCOMPRESS_ZSTDFangrui Song1-0/+1
From the approved generic ABI proposal https://groups.google.com/g/generic-abi/c/satyPkuMisk ("Add new ch_type value: ELFCOMPRESS_ZSTD"). Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-08-10inet: Turn __ivaliduser into a compatibility symbolFlorian Weimer2-13/+8
It is not declared in a header file, and as the comment indicates, it is not expected to be used.
2022-08-09x86: Fix `#define STRCPY` guard in strcpy-sse2.SNoah Goldstein1-1/+1
`#ifndef STPCPY` is incorrect for checking if `STRCPY` is already defined. It doesn't end up mattering as the whole check is guarded by `#if IS_IN (libc)` but is incorrect none the less.
2022-08-09elf: Replace `strcpy` call with `memcpy` [BZ #29454]Noah Goldstein1-2/+3
GCC normally does this optimization for us in strlen_pass::handle_builtin_strcpy but only for optimized build. To avoid needing to include strcpy.S in the rtld build to support the debug build, just do the optimization by hand.
2022-08-08soft-fp: Add fixhf[uns][di|si] and float[uns][di|si]hfKito Cheng8-0/+360
Add more IEEE half conversion routines: - Convert 32-bit/64-bit integer to IEEE half. - Convert IEEE half to 32-bit/64-bit integer. They are required by RISC-V _Float16 support, tested with RISC-V GCC.
2022-08-05i386: Use cmpl instead of cmpAdhemerval Zanella2-12/+12
Clang cannot assemble cmp in the AT&T dialect mode.
2022-08-05i386: Use fldt instead of fld on e_logl.SAdhemerval Zanella1-2/+2
Clang cannot assemble fldt in the AT&T dialect mode.
2022-08-04i386: Replace movzx with movzblFangrui Song1-18/+18
Similar to 6720d36b6623c5e48c070d86acf61198b33e144e for x86-64. Clang cannot assemble movzx in the AT&T dialect mode. Change movzx to movzbl, which follows the AT&T dialect and is used elsewhere in the file.
2022-08-04dlfcn: Pass caller pointer to static dlopen implementation (bug 29446)Florian Weimer1-1/+1
Fixes commit 0c1c3a771eceec46e66ce1183cf988e2303bd373 ("dlfcn: Move dlopen into libc").
2022-08-04malloc: Correct the documentation of the top_pad defaultFlorian Weimer3-2/+3
DEFAULT_TOP_PAD is defined as 131072 in sysdeps/generic/malloc-machine.h.
2022-08-04i386: Remove RELA supportAdhemerval Zanella2-197/+1
Now that prelink is not support, there is no need to keep supporting rela for non bootstrap.
2022-08-04arm: Remove RELA supportAdhemerval Zanella2-106/+1
Now that prelink is not support, there is no need to keep supporting rela for non bootstrap.
2022-08-04Remove ldd libc4 supportAdhemerval Zanella13-136/+2
The older libc versions are obsolete for over twenty years now.
2022-08-04Assume only FLAG_ELF_LIBC6 suportLucas A. M. Magalhaes16-394/+14
The older libc versions are obsolete for over twenty years now. This patch removes the special flags for libc5 and libc4 and assumes that all libraries cached are libc6 compatible and use FLAG_ELF_LIBC6. Checked with a build for all affected architectures. Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-08-04Remove left over LD_LIBRARY_VERSION usagesAdhemerval Zanella5-11/+0
The environment variable was removed by d2db60d8d830ef68c8d20a77ac3572d610aa40b1.
2022-08-04Linux: Remove exit system call from _exitFlorian Weimer1-1/+0
exit only terminates the current thread, not the whole process, so it is the wrong fallback system call in this context. All supported Linux versions implement the exit_group system call anyway.
2022-08-04LoongArch: Add vdso support for gettimeofday.caiyinyu2-0/+23
2022-08-03Update kernel version to 5.19 in header constant testsJoseph Myers3-4/+4
This patch updates the kernel version in the tests tst-mman-consts.py, tst-mount-consts.py and tst-pidfd-consts.py to 5.18. (There are no new constants covered by these tests in 5.19, or in 5.17 or 5.18 in the case of tst-mount-consts.py that previously used version 5.16, that need any other header changes.) Tested with build-many-glibcs.py.
2022-08-03assert: Do not use stderr in libc-internal assertFlorian Weimer7-22/+50
Redirect internal assertion failures to __libc_assert_fail, based on based on __libc_message, which writes directly to STDERR_FILENO and calls abort. Also disable message translation and reword the error message slightly (adjusting stdlib/tst-bz20544 accordingly). As a result of these changes, malloc no longer needs its own redefinition of __assert_fail. __libc_assert_fail needs to be stubbed out during rtld dependency analysis because the rtld rebuilds turn __libc_assert_fail into __assert_fail, which is unconditionally provided by elf/dl-minimal.c. This change is not possible for the public assert macro and its __assert_fail function because POSIX requires that the diagnostic is written to stderr. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-08-03nptl: Remove uses of assert_perrorFlorian Weimer1-8/+3
__pthread_sigmask cannot actually fail with valid pointer arguments (it would need a really broken seccomp filter), and we do not check for errors elsewhere. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-08-03stdio: Clean up __libc_message after unconditional abortFlorian Weimer4-40/+25
Since commit ec2c1fcefb200c6cb7e09553f3c6af8815013d83 ("malloc: Abort on heap corruption, without a backtrace [BZ #21754]"), __libc_message always terminates the process. Since commit a289ea09ea843ced6e5277c2f2e63c357bc7f9a3 ("Do not print backtraces on fatal glibc errors"), the backtrace facility has been removed. Therefore, remove enum __libc_message_action and the action argument of __libc_message, and mark __libc_message as _No_return. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-08-02Update syscall lists for Linux 5.19Joseph Myers3-2/+4
Linux 5.19 has no new syscalls, but enables memfd_secret in the uapi headers for RISC-V. Update the version number in syscall-names.list to reflect that it is still current for 5.19 and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py.
2022-08-02Use Linux 5.19 in build-many-glibcs.pyJoseph Myers1-1/+1
This patch makes build-many-glibcs.py use Linux 5.19. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
2022-08-02socket: Check lengths before advancing pointer in CMSG_NXTHDRArjun Shankar7-29/+276
The inline and library functions that the CMSG_NXTHDR macro may expand to increment the pointer to the header before checking the stride of the increment against available space. Since C only allows incrementing pointers to one past the end of an array, the increment must be done after a length check. This commit fixes that and includes a regression test for CMSG_FIRSTHDR and CMSG_NXTHDR. The Linux, Hurd, and generic headers are all changed. Tested on Linux on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x. [BZ #28846] Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-08-02Don't use unsupported format string in ld.so (bug 29427)Andreas Schwab1-1/+1
The dynamic loader does not support printf format strings that contain a literal field width or precision, they have to be specified indirectly.
2022-08-02htl: Let pthread_self and cancellability called earlySamuel Thibault2-1/+15
When applications redirect some functions they might get called before libpthread is fully initialized. They may still expected pthread_self and cancellable functions to work, so cope with such calls in that situation.
2022-08-01stdlib: Simplify arc4random_uniformAdhemerval Zanella1-99/+30
It uses the bitmask with rejection [1], which calculates a mask being the lowest power of two bounding the request upper bound, successively queries new random values, and rejects values outside the requested range. Performance-wise, there is no much gain in trying to conserve bits since arc4random is wrapper on getrandom syscall. It should be cheaper to just query a uint32_t value. The algorithm also avoids modulo and divide operations, which might be costly depending of the architecture. [1] https://www.pcg-random.org/posts/bounded-rands.html Reviewed-by: Yann Droneaud <ydroneaud@opteya.com>
2022-08-01malloc: Use __getrandom_nocancel during tcache initiailizationFlorian Weimer1-1/+2
Cancellation currently cannot happen at this point because dlopen as used by the unwind link always performs additional allocations for libgcc_s.so.1, even if it has been loaded already as a dependency of the main executable. But it seems prudent not to rely on this quirk. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-08-01Remove spurious references to _dl_open_hookFlorian Weimer2-9/+0
_dl_open_hook was removed in commit 466c1ea15f461edb8e3ffaf5d86d708 ("dlfcn: Rework static dlopen hooks"). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-08-01wcsmbs: Add missing test-c8rtomb/test-mbrtoc8 dependencyH.J. Lu1-0/+2
Make test-c8rtomb.out and test-mbrtoc8.out depend on $(gen-locales) for xsetlocale (LC_ALL, "de_DE.UTF-8"); xsetlocale (LC_ALL, "zh_HK.BIG5-HKSCS"); Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-08-01stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in uchar.h.Tom Honermann1-0/+8
gcc 13 issues the following diagnostic for the uchar.h header when the -Wc++20-compat option is enabled in C++ modes that do not enable char8_t as a builtin type (C++17 and earlier by default; subject to _GNU_SOURCE and the gcc -f[no-]char8_t option). warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat] This change modifies the uchar.h header to suppress the diagnostic through the use of '#pragma GCC diagnostic' directives for gcc 10 and later (the -Wc++20-compat option was added in gcc version 10). Unfortunately, a bug in gcc currently prevents those directives from having the intended effect as reported at https://gcc.gnu.org/PR106423. A patch for that issue has been submitted and is available in the email thread archive linked below. https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598736.html
2022-07-30Open master branch for glibc 2.37 developmentglibc-2.36.9000Carlos O'Donell2-2/+25
2022-07-29Create ChangeLog.old/ChangeLog.25.glibc-2.36Carlos O'Donell1-0/+10229
2022-07-29Prepare for glibc 2.36 release.Carlos O'Donell2-3/+3
Update version.h, and include/features.h.