]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
25 hours agobenchtests: Create objdir in the bench-%.c generation rule master
Adhemerval Zanella [Tue, 28 Jul 2026 14:27:33 +0000 (11:27 -0300)] 
benchtests: Create objdir in the bench-%.c generation rule

The $(objpfx)bench-%.c rule writes its output into $(objpfx) without
ensuring that directory exists.  Serial builds happened to satisfy
that ordering, with parallel builds the generation recipe can
run before the directory is created, failing with:

  cannot create .../benchtests/bench-xxx.c-tmp: Directory nonexistent

Add the standard $(make-target-directory).

Reviewed-by: Florian Weimer <fweimer@redhat.com>
31 hours agomisc: Makefile style fix
Yury Khrustalev [Mon, 20 Jul 2026 15:39:21 +0000 (16:39 +0100)] 
misc: Makefile style fix

34 hours agoelf: test: handle different rootsbindir in tst-ldconfig-cache
Xi Ruoyao [Sat, 25 Jul 2026 16:11:44 +0000 (00:11 +0800)] 
elf: test: handle different rootsbindir in tst-ldconfig-cache

When compiling a glibc for a merged-/usr distro people may set
rootsbindir=/usr/sbin.  But tst-ldconfig-cache has hard-coded
/sbin/ldconfig path and so it fails with a different rootsbindir.

Fix it by using support_install_rootsbindir like run_ldconfig in
test-container.c.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
35 hours agolocaledata: Add brh_PK locale for Brahui language [BZ #33952]
Hammad Mengal [Mon, 20 Jul 2026 07:09:58 +0000 (12:09 +0500)] 
localedata: Add brh_PK locale for Brahui language [BZ #33952]

Add locale data for Brahui (brh), a Dravidian language spoken by
approximately 2.8 million people (2023 Pakistan Census) primarily in
Balochistan, Pakistan.  Brahui is the only Dravidian language written
in the Perso-Arabic (Nastaliq) script.

The ISO 639-3 code brh is added to iso-639.def.  Brahui has no ISO
639-1 or ISO 639-2 code, so the three-letter code is used for both the
terminology and bibliographic fields, as is already done for other
639-3-only entries such as brx (Bodo).

Locale content follows CLDR locale brh, for which the submitter is the
contributing native speaker.

Changes since v3:
  - iso-639.def: place Brahui before Braj, restoring alphabetical
    order by English language name.
  - LC_TIME: add first_weekday 1 and first_workday 2.  The previous
    value of 7 selected Saturday, which does not match CLDR territory
    data for PK (firstDay = sun); ur_PK and sd_PK both use 1.
  - LC_TIME: reorder d_t_fmt and date_fmt so the date precedes the
    time, matching the CLDR brh date-time combination pattern and the
    shape used by sd_PK, and use U+060C ARABIC COMMA as the separator,
    which is the comma in the CLDR brh punctuation exemplar set.
  - LC_TIME: abday repeats the full day names, as Brahui has no
    distinct abbreviated forms; CLDR brh gives identical values at the
    abbreviated and wide widths, and ur_PK, pa_PK and fa_IR do the
    same.
  - LC_TIME: am_pm now matches the CLDR brh day-period values.
  - LC_MONETARY: n_sep_by_space 1, matching p_sep_by_space, so that
    positive and negative amounts are spaced alike.
  - LC_MESSAGES: yesexpr accepts U+062C and U+0647, and noexpr accepts
    U+0627, since these initials occur in attested spellings of the
    affirmative and negative words.
  - LC_CTYPE: add transliterations for U+06C1 and U+06B7.
  - LC_TELEPHONE: use the "+%c %a %l" form.
  - LC_IDENTIFICATION: record CLDR as the source; bump revision.

Signed-off-by: Hammad Mengal <hammadalo99@gmail.com>
Reviewed-by: Mike FABIAN <mfabian@redhat.com>
2 days agomath: Fix sinh worst-case results for |x| > 36.736801 [BZ 34441]
Adhemerval Zanella [Mon, 27 Jul 2026 16:37:19 +0000 (13:37 -0300)] 
math: Fix sinh worst-case results for |x| > 36.736801 [BZ 34441]

The CORE-MATH import mistranslated the accurate path result scaling
'th *= sp.f' as 'th *= asuint64 (sp)' (commit 106f8c2ed68), and two of
the 51 exceptional-case table entries were dropped when the table was
moved to e_sinh_data.c (commit f05c4907a27).

Checked on x86_64-linux-gnu and aarch64-linux-gnu.

2 days agoAArch64: Add ifunc masking tunable
Wilco Dijkstra [Mon, 6 Jul 2026 12:25:23 +0000 (12:25 +0000)] 
AArch64: Add ifunc masking tunable

Remove the glibc.cpu.name tunable since it's unused and out of date.
Add support for glibc.cpu.hwcaps to adjust ifunc selection for debugging
and benchmarking.  Only allow disabling of features that are (a) used by
ifuncs, (b) safe to disable to a more generic ifunc without any security
impact.

Reviewed-by: Yury Khrustalev <yury.khrustalev@arm.com>
2 days agohurd: fix fork's longjmp demangling on i386
Samuel Thibault [Sun, 26 Jul 2026 22:59:36 +0000 (00:59 +0200)] 
hurd: fix fork's longjmp demangling on i386

i386's setjmp does not actually mangle ebp.

4 days agohurd: Make the readlink __fstatat64 references optional
Samuel Thibault [Fri, 24 Jul 2026 21:10:02 +0000 (23:10 +0200)] 
hurd: Make the readlink __fstatat64 references optional

They may show up or not depending on the toolchain in use.

4 days agoNEWS: add 2.45 section
Andreas K. Hüttel [Sat, 25 Jul 2026 00:12:28 +0000 (09:12 +0900)] 
NEWS: add 2.45 section

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
4 days agoversion.h: bump to 2.44.9000 / development glibc-2.44.9000
Andreas K. Hüttel [Sat, 25 Jul 2026 00:10:58 +0000 (09:10 +0900)] 
version.h: bump to 2.44.9000 / development

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
5 days agoChangeLog.old/ChangeLog.33: add glibc-2.44
Andreas K. Hüttel [Fri, 24 Jul 2026 13:16:45 +0000 (22:16 +0900)] 
ChangeLog.old/ChangeLog.33: add

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
5 days agoversion.h, include/features.h: Increase version number
Andreas K. Hüttel [Fri, 24 Jul 2026 13:10:57 +0000 (22:10 +0900)] 
version.h, include/features.h: Increase version number

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
5 days agoNEWS: drop empty section
Andreas K. Hüttel [Fri, 24 Jul 2026 12:53:17 +0000 (21:53 +0900)] 
NEWS: drop empty section

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
5 days agopo: update (only line number changes)
Andreas K. Hüttel [Fri, 24 Jul 2026 12:48:02 +0000 (21:48 +0900)] 
po: update (only line number changes)

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
5 days agolibc.pot: regenerate
Andreas K. Hüttel [Fri, 24 Jul 2026 12:12:27 +0000 (21:12 +0900)] 
libc.pot: regenerate

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 days agohurd: Make setitimer clear interval on value being 0
Samuel Thibault [Wed, 22 Jul 2026 20:24:29 +0000 (22:24 +0200)] 
hurd: Make setitimer clear interval on value being 0

posix says value being 0 means disabling a timer, regardless of the
interval, so we should clear the interval in that case, so a further
setitimer call does not see a non-zero interval.

6 days agohurd: xfail more tests waiting for barrier setpshared support
Samuel Thibault [Wed, 22 Jul 2026 20:22:19 +0000 (22:22 +0200)] 
hurd: xfail more tests waiting for barrier setpshared support

8 days agomanual/install.texi, INSTALL: update version numbers
Andreas K. Hüttel [Tue, 21 Jul 2026 15:29:10 +0000 (00:29 +0900)] 
manual/install.texi, INSTALL: update version numbers

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
8 days agoresolv: Disable TCP servers in tst-resolv-res_init-failure
Florian Weimer [Tue, 21 Jul 2026 13:54:27 +0000 (15:54 +0200)] 
resolv: Disable TCP servers in tst-resolv-res_init-failure

This avoids spurious xaccept errors on slow systems.  With this
change, the test still reproduces the original bug.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
8 days agoNEWS: mention more recent developments
Andreas K. Hüttel [Mon, 20 Jul 2026 08:21:29 +0000 (17:21 +0900)] 
NEWS: mention more recent developments

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
8 days agomath: test: Fix unsupported check in test-narrowing-trap
Yury Khrustalev [Thu, 16 Jul 2026 13:09:33 +0000 (14:09 +0100)] 
math: test: Fix unsupported check in test-narrowing-trap

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
8 days agohurd: demangle pointers on fork's longjmp
Samuel Thibault [Mon, 20 Jul 2026 15:10:44 +0000 (17:10 +0200)] 
hurd: demangle pointers on fork's longjmp

The thread state structure requires plain pointers, while the jmpbuf has
mangled pointers.

Fixes 78f1f0e39cd41d28ae771eb3498bc33780c85cfd
("Consolidate the C pointer guard and align the assembly
implementations")

8 days agohurd: Add __readlink and readlink to dl-sysdep.c
Samuel Thibault [Mon, 20 Jul 2026 18:17:08 +0000 (20:17 +0200)] 
hurd: Add __readlink and readlink to dl-sysdep.c

Fixes fcea66cd4685f9f3719e09cac52c73b9ece4bade
("Add system-wide tunables: Filters")
which adds calling it from rtld.

8 days agohurd: Add __fstatat64 to dl-sysdep.c
Samuel Thibault [Mon, 20 Jul 2026 09:15:46 +0000 (11:15 +0200)] 
hurd: Add __fstatat64 to dl-sysdep.c

Fixes b9957a70b82203d91b0659b93cfe8632f954aba3
("Add system-wide tunables: cache ld.so.cache")
which adds calling it from rtld.

8 days agomanual: Add stability warning regarding system-wide tunables
Florian Weimer [Mon, 20 Jul 2026 13:53:56 +0000 (15:53 +0200)] 
manual: Add stability warning regarding system-wide tunables

And mention system-wide tunables in NEWS.
Reviewed-by: Andreas K. Hüttel <dilfridge@gentoo.org>
9 days agocontrib.texi: update
Andreas K. Hüttel [Mon, 20 Jul 2026 14:12:23 +0000 (23:12 +0900)] 
contrib.texi: update

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
9 days agoNEWS: insert list of fixed bugs
Andreas K. Hüttel [Mon, 20 Jul 2026 08:31:33 +0000 (17:31 +0900)] 
NEWS: insert list of fixed bugs

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
9 days agoNEWS: editorial changes
Andreas K. Hüttel [Mon, 20 Jul 2026 05:24:35 +0000 (14:24 +0900)] 
NEWS: editorial changes

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
11 days agomath: Update tanh from CORE-MATH (revision cf237fa0)
Adhemerval Zanella [Fri, 17 Jul 2026 17:14:44 +0000 (17:14 +0000)] 
math: Update tanh from CORE-MATH (revision cf237fa0)

Sync the double-precision tanh implementation with CORE-MATH revision
cf237fa0.

Checked on aarch64-linux-gnu.

11 days agoRevert "malloc: Remove dynamic mmap/trim threshold [BZ #30769]"
Peter Bergner [Fri, 17 Jul 2026 17:24:38 +0000 (01:24 +0800)] 
Revert "malloc: Remove dynamic mmap/trim threshold [BZ #30769]"

This change causes large degradations on multiple SPEC benchmarks,
so we have to revert this commit.

GLIBC BZ: https://sourceware.org/PR34394

This reverts commit 17a79a51208c5648fe70983085833bf15d83d0f1

Signed-off-by: Peter Bergner <bergner@tenstorrent.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
12 days agoAdd RWF_NOSIGNAL from Linux 6.18 to bits/uio-ext.h
Adhemerval Zanella [Mon, 6 Jul 2026 14:18:36 +0000 (11:18 -0300)] 
Add RWF_NOSIGNAL from Linux 6.18 to bits/uio-ext.h

It was added by commit db2ab24a341ce89351a1bede37a96a3e3ce1726a.

Reviewed-by: Carlos O'Donell <carlos@redaht.com>
12 days agomath: Fix inaccurate sin/cos/tan for large arguments (BZ 34376)
Adhemerval Zanella [Thu, 16 Jul 2026 21:21:20 +0000 (18:21 -0300)] 
math: Fix inaccurate sin/cos/tan for large arguments (BZ 34376)

The Payne-Hanek range reducer __branred delivers the reduced argument
as a double-double with only about 93 significant bits.  For arguments
extremely close to a multiple of pi/2 the true reduced argument can be
as small as 2^-61, so most of those bits cancel and sin/cos/tan can be
wrong by up to ~143000 ulp.  This inaccuracy used to be handled by the
multiple-precision slow paths, which was removed by commit
649095838b8 ("sin/cos slow paths: remove slow paths from huge range
reduction") and commit 476d692e8a8 ("math: Remove slow paths in tan
[BZ #15267]").

Restore the e_rem_pio2.c (removed as unused by commit ca3aac57efa
"Remove unused math files") and use __ieee754_rem_pio2 for
the huge-argument reduction instead of __branred, which is removed.

It also does not depend on precise IEEE double rounding, so the nofma
and vector-width workarounds for branred.c are no longer needed.

The file is restored trimmed to its huge-argument path, the callers
reduce smaller arguments themselves and handle non-finite inputs, so
only 1e8 < |x| < 2^1024 reaches __ieee754_rem_pio2.

Checked on x86_64-linux-gnu, aarch64-linux-gnu, armv7a-linux-gnueabihf,
and i686-linux-gnu.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
12 days agobenchtests: Add path-oriented workloads to tan
Adhemerval Zanella [Thu, 16 Jul 2026 21:21:19 +0000 (18:21 -0300)] 
benchtests: Add path-oriented workloads to tan

The tan input list spans the full binary64 range, so a single number mixes
the kernel, and the i__branred reductions in one average.  Add two named
workloads that isolate the ends of that spread, so each can be measured
separately:

  - workload-fast.wrf: uniform random inputs in [-pi, pi].

  - workload-slow.wrf: |x| in [2^27, 2^1024), log-uniform over binades.

The existing full-range inputs are replaced as the default workload.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
12 days agobenchtests: Add path-oriented workloads to sin
Adhemerval Zanella [Thu, 16 Jul 2026 21:21:18 +0000 (18:21 -0300)] 
benchtests: Add path-oriented workloads to sin

The sin input list spans the full binary64 range, so a single number mixes
the kernel, the reduce_sincos reduction , and the __branred reduction in
one average.  Add three named workloads that isolate the paths __cos
actually dispatches to, so each can be measured separately:

  - workload-fast.wrf: uniform random inputs in [-pi, pi].

  - workload-moderate.wrf: |x| in [4, 6.7e7], log-uniform over binades.

  - workload-slow.wrf: |x| in [2^27, 2^1024), log-uniform over binades.

The existing full-range inputs are replaced as the default workload.

Reviewed-by: Carlos O'Donell <carlos@redaht.com>
12 days agobenchtests: Add path-oriented workloads to cos
Adhemerval Zanella [Thu, 16 Jul 2026 21:21:17 +0000 (18:21 -0300)] 
benchtests: Add path-oriented workloads to cos

The cos input list spans the full binary64 range, so a single number mixes
the kernel, the reduce_sincos reduction , and the __branred reduction in one
average.  Add three named workloads that isolate the paths __cos actually
dispatches to, so each can be measured separately:

  - workload-fast.wrf: uniform random inputs in [0, 2*pi].

  - workload-moderate.wrf: |x| in [4, 6.7e7], log-uniform over binades.

  - workload-slow.wrf: |x| in [2^27, 2^1024), log-uniform over binades.

The existing full-range inputs are replaced as the default workload.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
12 days agosparc: Align THP tests to the 8MB huge-page size
Adhemerval Zanella [Wed, 15 Jul 2026 13:09:10 +0000 (10:09 -0300)] 
sparc: Align THP tests to the 8MB huge-page size

The sparc64 uses an 8KB base page and 8MB PMD transparent huge page.
It fixes the following regression on sparc:

FAIL: elf/tst-thp-1
FAIL: elf/tst-thp-1-no-s-code
FAIL: elf/tst-thp-1-no-s-code-pde
FAIL: elf/tst-thp-1-no-s-code-static
FAIL: elf/tst-thp-1-pde
FAIL: elf/tst-thp-1-static
FAIL: elf/tst-thp-align

Checked with the elf tests on qemu sparc64.

Tested-by: Andreas K. Hüttel <dilfridge@gentoo.org>
12 days agoelf: Defer arch PLT IFUNC relocations in the two-phase relocation split
Adhemerval Zanella [Tue, 14 Jul 2026 13:39:57 +0000 (10:39 -0300)] 
elf: Defer arch PLT IFUNC relocations in the two-phase relocation split

The split introduced by commit 63b31c05a8a does not handle sparc
and (R_SPARC_JMP_IREL) powerpc64 (ELFv1, R_PPC64_JMP_IREL), which
are emited in some constructions.  Handle such cases on
elf_dynamic_is_Rel_irelative.

It fixes elf/tst-ifunc-fault-bindnow and elf/tst-ifunc-fault-lazy on
sparc64 (powerpc64 emits R_PPC64_IRELATIVE in both cases,
R_PPC64_JMP_IREL is emitted only when the ifunc is called, not just
referenced).

Checked with the elf tests on qemu sparc64 and powerpc64.

Tested-by: Andreas K. Hüttel <dilfridge@gentoo.org>
12 days agosparc: Fix static IFUNC startup crash by redirecting __mempcpy (BZ #34396)
Adhemerval Zanella [Tue, 14 Jul 2026 12:07:27 +0000 (09:07 -0300)] 
sparc: Fix static IFUNC startup crash by redirecting __mempcpy (BZ #34396)

After commit b75ad99d45b, __libc_setup_tls -> _dl_allocate_tls_init copies
the TLS init image with the IFUNC __mempcpy before ARCH_SETUP_IREL resolves
it, so on a multi-arch sparcv9/sparc64 static build the call jumps through an
unrelocated PLT slot and the process dies with SIGILL.

The sparc dl-symbol-redir-ifunc.h only redirected memset.  Redirect
memcpy, memmove, mempcpy and __mempcpy to the ultra1 routines as well,
and merge the identical sparc64 and sparc32/sparcv9 copies into a single
sysdeps/sparc file.  The redirection is guarded by __sparc_v9__ &&
USE_MULTIARCH so that sparcv8 (leon) and --disable-multi-arch builds,
which have no __*_ultra1 routines, are left untouched.

Checked with elf tests for sparc32 and sparc64 on qemu system.

Tested-by: Andreas K. Hüttel <dilfridge@gentoo.org>
13 days agoRevert "strace-tst-thp.sh: Allow unsupported THP tests"
H.J. Lu [Wed, 15 Jul 2026 22:15:44 +0000 (06:15 +0800)] 
Revert "strace-tst-thp.sh: Allow unsupported THP tests"

This reverts commit ea50bcc538f3e161dd589b4a855d80ef8a35fce8.

2 weeks agostrace-tst-thp.sh: Allow unsupported THP tests
H.J. Lu [Fri, 3 Jul 2026 02:17:20 +0000 (10:17 +0800)] 
strace-tst-thp.sh: Allow unsupported THP tests

Change strace-tst-thp.sh to

output=${test_prog}.$$
...
/bin/sh -c \
  "timeout -k 4 $((3*$TIMEOUTFACTOR)) ${cmd} --direct 2>&1" > "${output}"
if grep -E "madvise\(0x[0-9a-f]+, [0-9]+, 0xe)" "${output}"; then
...

so that unsupported THP tests exit with status 77.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agothp: Disable THP if THP isn't supported by kernel
H.J. Lu [Sat, 4 Jul 2026 00:17:05 +0000 (08:17 +0800)] 
thp: Disable THP if THP isn't supported by kernel

Since DL_MAP_DEFAULT_THP_PAGESIZE is defined for x86-64, THP control
is to set to madvise by default.  If THP is disabled in x86-64 kernel,
madvise (..., MADV_HUGEPAGE) returns -EINVAL to indicate that THP isn't
supported.  Add _dl_thp_madvise to disable THP in this case.  This
fixes BZ #34348.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agothp: Link THP PDE tests with $(LOAD-THP-ADDRESS-LDFLAGS)
H.J. Lu [Sat, 4 Jul 2026 05:32:10 +0000 (13:32 +0800)] 
thp: Link THP PDE tests with $(LOAD-THP-ADDRESS-LDFLAGS)

LOAD-THP-ADDRESS-LDFLAGS was added to work around:

https://sourceware.org/bugzilla/show_bug.cgi?id=34184

which is needed for THP PDE tests.  Add $(LOAD-THP-ADDRESS-LDFLAGS) to
LDFLAGS-tst-thp-1 and LDFLAGS-tst-thp-1-no-s-code if PIE isn't built
by default so that they are linked with $(LOAD-THP-ADDRESS-LDFLAGS).
This fixes BZ #34314.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2 weeks agoAdd advisory text for CVE-2026-6368
Adhemerval Zanella [Wed, 1 Jul 2026 18:24:34 +0000 (15:24 -0300)] 
Add advisory text for CVE-2026-6368

2 weeks agoposix: Fix wordexp WRDE_APPEND to preserve state on non-NOSPACE errors (BZ 34090...
Adhemerval Zanella [Mon, 13 Apr 2026 19:33:30 +0000 (16:33 -0300)] 
posix: Fix wordexp WRDE_APPEND to preserve state on non-NOSPACE errors (BZ 34090, CVE-2026-6368)

The previous implementation saved a copy of the wordexp_t struct at
entry and blindly restored it on error via (*pwordexp = old_word).
This is incorrect when WRDE_APPEND is set because w_addword may have
called realloc on we_wordv during partial processing before the error
was detected.  If realloc relocated the buffer, the saved we_wordv
pointer is dangling; restoring it causes a use-after-free in the
caller (e.g. via wordfree), and the relocated buffer is leaked.

Fix this by duplicating the we_wordv pointer array at entry when
WRDE_APPEND is set, so that all subsequent realloc calls inside
w_addword operate on the copy.

This change also fixes a POSIX conformance issue: if the WRDE_APPEND
flag is specified, pwordexp->we_wordc and pwordexp->we_wordv shall
not be modified.

Also fix two pre-existing error return paths in the '"' and '\'' cases
that returned directly from w_addword failures instead of going through
do_error, which would leak the saved array (and previously would also
skip the word cleanup).

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 weeks agoldconfig: add --install option
DJ Delorie [Tue, 30 Jun 2026 21:26:34 +0000 (17:26 -0400)] 
ldconfig: add --install option

Add --install option, which copies a pre-built ld.so.cache into place,
honoring the cache and root options and defaults.  This gives the user
a canonical "correct" way to install a pre-built cache without risk
of a program trying to load a partially-written file.

Co-authored-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agopo: Integrate translations
Andreas K. Hüttel [Tue, 14 Jul 2026 13:04:19 +0000 (22:04 +0900)] 
po: Integrate translations

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agos390: Use 64bit branch relative on count instruction in strncpy-z900.S [BZ #34398]
Stefan Liebler [Tue, 14 Jul 2026 08:56:49 +0000 (10:56 +0200)] 
s390: Use 64bit branch relative on count instruction in strncpy-z900.S [BZ #34398]

At the time the s390-32 strncpy implementation was adjusted for the
s390-64 port, the brct (branch relative on count) instruction was
not adjusted from 32bit to 64bit instruction.

If n contains a value >32bit, the number of 8 byte chunks is computed
with srlg (64bit shift right). The processing of 8 byte chunks is then
processed by looping with brct (32bit branch relative on count) instruction.

This patch just uses the brctg (64bit branch relative on count) instruciton.

Note 1: There is a second loop copying the remaining seven bytes.  The usage
of 32bit brct for looping is fine here.

Note 2: If glibc is build with architecture level set >=z13, the z900 variant
of strncpy is not build at all.

Note 3: If glibc is build for <z13, the z900 ifunc variant is only chosen if
not run on >=z13 or if called via __GI_strncpy.

2 weeks agoUse correct type for glibc.malloc.perturb in tst-tunconf1.c
Stefan Liebler [Mon, 13 Jul 2026 08:31:53 +0000 (10:31 +0200)] 
Use correct type for glibc.malloc.perturb in tst-tunconf1.c

On s390x the test elf/tunconf1 fails with:
tst-tunconf1.c:41: numeric comparison failure (widths 64 and 32)
   left: 180388626436 (0x2a00000004); from: (long)perturb
  right: 42 (0x2a); from: 42

According to elf/dl-tunables.list, glibc.malloc.perturb is of type int32_t (4byte)
and not size_t (8byte) which was used for TUNABLE_GET_FULL inside the testcase.
Therefore the correct 32bit value 0x2a=42 is written to the to the wrong place
and leads to the comparison failure.

The printf format specifiers for size_t were also adjusted.
Reviewed-by: DJ Delorie <dj@redhat.com>
2 weeks agobenchtests: Build benchmarks in parallel
Adhemerval Zanella [Tue, 7 Jul 2026 18:30:12 +0000 (15:30 -0300)] 
benchtests: Build benchmarks in parallel

The unconditional '.NOTPARALLEL' in benchtests/Makefile forced the whole
subdirectory to build serially, even though its only purpose is to keep
the benchmark *runs* from perturbing each other's timing.

Replace it with ordering that serializes only the benchmark runs, and
only when more than one benchmark group will actually run.  The combined
'bench' goal builds every benchmark program in parallel (through
bench-build) and then runs the bench-set, bench-func and bench-malloc
groups strictly one after another.

Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agosparc: Fix static (non-PIE) executables when PIE is enabled by default
Adhemerval Zanella [Sat, 11 Jul 2026 16:33:12 +0000 (13:33 -0300)] 
sparc: Fix static (non-PIE) executables when PIE is enabled by default

For the default --enable-default-pie, $(pic-default) adds -DPIC to
CPPFLAGS-.o so.  However, -fPIE ($(pie-default)) is only added to
CFLAGS-.o, which does not affect assembler (.S) sources

On SPARC the GOT register setup in SETUP_PIC_REG references
_GLOBAL_OFFSET_TABLE_ through %hi/%lo, and the assembler only rewrite
those into the required PC-relative relocations (R_SPARC_PC22 and
R_SPARC_PC10) when it is in *PIC* mode; otherwise it emits absolute
R_SPARC_HI22/R_SPARC_LO10.  With the absolute relocations the
__sparc_get_pc_thunk sequence adds the run-time PC to an already-absolute
GOT address, so the computed GOT register is wrong.  In _start this makes
the address of main come out bogus, and __libc_start_main jumps to an
unmapped address.

This removes the requirement of the --disable-default-pie for sparc
to build static binaries correctly.

Checked some tests (mainly the elf/ one) on a sparc64-linux-gnu
qemu system.

Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agoelf: Remove unused tunable_seclevel_t
Adhemerval Zanella [Mon, 6 Jul 2026 19:56:35 +0000 (16:56 -0300)] 
elf: Remove unused tunable_seclevel_t

The per-tunable security level is no longer part of struct _tunable and
no tunable in dl-tunables.list declares one.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 weeks agoelf: Remove _dl_unload_cache
Adhemerval Zanella [Mon, 6 Jul 2026 19:36:49 +0000 (16:36 -0300)] 
elf: Remove _dl_unload_cache

It is a no-op since b9957a70b82.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 weeks agomanual: Document default AT_SECURE handling for system-wide tunables
Adhemerval Zanella [Mon, 6 Jul 2026 14:48:23 +0000 (11:48 -0300)] 
manual: Document default AT_SECURE handling for system-wide tunables

A system-wide tunable without an onlysecure/nonsecure/anysecure prefix
defaults to "nonsecure", i.e. it is not applied to AT_SECURE processes.
This is a deliberate, conservative default but was not documented.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 weeks agoelf: Let environment aliases override overridable system-wide tunables
Adhemerval Zanella [Mon, 6 Jul 2026 16:35:15 +0000 (13:35 -0300)] 
elf: Let environment aliases override overridable system-wide tunables

The environment-variable alias loop in __tunables_init skipped every tunable
whose "initialized" flag was set, which was originally meant only to give
the canonical GLIBC_TUNABLES form precedence over the legacy MALLOC_*
aliases.

Now that the cache also sets "initialized", a legacy alias could no longer
override an *overridable* cache default, even though the canonical
GLIBC_TUNABLES form still could.

Track separately the tunables that were set from GLIBC_TUNABLES during this
call and skip only those in the alias loop

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 weeks agoelf: Avoid redundant ld.so.cache reload after first load
Adhemerval Zanella [Mon, 6 Jul 2026 14:48:23 +0000 (11:48 -0300)] 
elf: Avoid redundant ld.so.cache reload after first load

_dl_check_ldsocache_needs_loading only stored the stat fields it
compares (mtime, ino, size, dev) on the path where a cache was already
loaded.  On the very first call CACHE is NULL and the function returned
"needs loading" without recording those fields, leaving
new_cache_file_time zero.  The next call then copied that zero value
into cache_file_time and compared it against the freshly stat'd values,
which always differed, forcing a second, unnecessary load (munmap +
mmap + re-parse) of an unchanged cache at every startup.

It can be shown with repro:

  $ cat << EOF > repro.c
  #include <dlfcn.h>
  int main (void) { dlopen ("does-not-exist-xyz.so.99", RTLD_NOW); return 0; }
  EOF
  $ gcc repro.c -o repro
  $ strace -f -e trace=openat elf/ld.so --library-path . ./repro 2>&1 | grep -c "/etc/ld.so.cache"

The result should be 1, instead of 2.

Record the stat fields as soon as the stat succeeds, before the
CACHE == NULL early return, so the following call has an accurate
baseline and does not spuriously reload.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 weeks agoelf: Verify the tunable cache header signature and version
Adhemerval Zanella [Mon, 6 Jul 2026 19:56:27 +0000 (16:56 -0300)] 
elf: Verify the tunable cache header signature and version

The tunable header signature and version are written by ldconfig but
never checked them on read, so the version field was inert.  Reject
the section unless both match.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 weeks agoelf: Bound the tunable cache string table against the mapping size
Adhemerval Zanella [Mon, 6 Jul 2026 19:56:12 +0000 (16:56 -0300)] 
elf: Bound the tunable cache string table against the mapping size

_dl_load_cache_tunables bounds each entry's string offsets against
[s_start, start + cache_new->len_strings], but len_strings is an
unvalidated 32-bit field from ld.so.cache and s_start/s_end were int.  A
corrupt cache with an oversized len_strings could make s_end exceed the
mapping (or overflow), letting an offset point outside the mmap; the
following strcmp/__strdup would then read unmapped memory.

Compute the offsets as size_t and clamp s_end to cachesize, matching how
the regular library lookup bounds string offsets against the mapping size.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 weeks agolocaledata: Use libc-alpha ML as the canonical contact
Siddhesh Poyarekar [Thu, 9 Jul 2026 13:52:39 +0000 (09:52 -0400)] 
localedata: Use libc-alpha ML as the canonical contact

Replace instances of "bug-glibc@gnu.org", "libc-locales@sourceware.org"
and "bug-glibc-locales@gnu.org" with libc-alpha@sourceware.org as the
single touchpoint for the community.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2 weeks agoposix: Use unique PID file in tst-spawn3 and tst-spawn3-pidfd
Florian Weimer [Thu, 9 Jul 2026 15:09:32 +0000 (17:09 +0200)] 
posix: Use unique PID file in tst-spawn3 and tst-spawn3-pidfd

The test sources are built twice and the two tests may run in parallel.
They cannot use the same PID file.

Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agolocaledata: Avoid concurrently written locales in gen-locale.sh
Florian Weimer [Wed, 8 Jul 2026 15:38:42 +0000 (17:38 +0200)] 
localedata: Avoid concurrently written locales in gen-locale.sh

There is no cross-directory exclusion of concurrent $(gen-locales)
usage.  Parallel localedef calls can clobber locale data as it is
being loaded by tests.

With the separate staging areas, there are no peer directories,
so hard-linking no longer happens.  The touch command is therefore
unnecessary.

Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agoAdd system-wide tunables: implement overridability
DJ Delorie [Tue, 7 Jul 2026 03:27:44 +0000 (23:27 -0400)] 
Add system-wide tunables: implement overridability

Implement the overridability/nonoverridability flags
for tunables.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 weeks agolibc.pot: regenerate
Andreas K. Hüttel [Tue, 7 Jul 2026 01:39:18 +0000 (10:39 +0900)] 
libc.pot: regenerate

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
3 weeks agoRevert "malloc: aarch64: Add ifuncs for malloc functions"
Yury Khrustalev [Wed, 1 Jul 2026 12:45:40 +0000 (13:45 +0100)] 
Revert "malloc: aarch64: Add ifuncs for malloc functions"

Due to issue in GDB and Valgrind that incorrectly call malloc
ifunc resolver as the malloc function, we have to revert this
change.

GDB BZ: https://sourceware.org/bugzilla/show_bug.cgi?id=34330
Valgrind bug: https://bugs.kde.org/show_bug.cgi?id=522497

This reverts commit 9ed3576e61f7a87eb83d512531566f5e5d6bb032.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 weeks agonetinet/tcp.h: Sync with Linux 6.15 and fix struct tcp_info tail (BZ 34347)
Adhemerval Zanella [Fri, 3 Jul 2026 13:33:48 +0000 (10:33 -0300)] 
netinet/tcp.h: Sync with Linux 6.15 and fix struct tcp_info tail (BZ 34347)

Add the TCP_RTO_MAX_MS and TCP_RTO_MIN_US socket options (commit
54a378f43425085d0684679d99735696b69165bc, Linux 6.15) and TCP_DELACK_MAX_US
(commit 9552f90835ef3552d0af327e48dc360717777d62, Linux 6.15).

Commit 7e46c2aae47d3284d4eb0845ddcc3951e987d681 synced the accurate ECN
additions but encoded the trailing bitfield word of struct tcp_info
incorrectly as two uint16_t fields (tcpi_accecn_fail_mode and
tcpi_accecn_opt_seen), omitting tcpi_ecn_mode and tcpi_options2.  Restore
the kernel layout:

  uint32_t tcpi_ecn_mode:2,
   tcpi_accecn_opt_seen:2,
   tcpi_accecn_fail_mode:4,
   tcpi_options2:24;

The overall structure size is unchanged.  Also add the TCPI_ECN_MODE_*
and TCP_ACCECN_* value constants for these fields, introduced together
with them by Linux commit 4fa4ac5e5848 (Linux 7.0).

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoAdd OPEN_TREE_NAMESPACE and FSMOUNT_NAMESPACE to sys/mount.h
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:33 +0000 (11:46 -0300)] 
Add OPEN_TREE_NAMESPACE and FSMOUNT_NAMESPACE to sys/mount.h

Add OPEN_TREE_NAMESPACE (commit 9b8a0ba68246a61d903ce62c35c303b1501df28b,
Linux 7.0) and FSMOUNT_NAMESPACE (commit
5e8969bd192712419aae511dd5ba26855c2c78db, Linux 7.1).

3 weeks agos390: Prevent hoisting the thread-pointer read in THREAD_SET_STACK_GUARD (BZ 34297)
Adhemerval Zanella [Wed, 17 Jun 2026 14:25:47 +0000 (11:25 -0300)] 
s390: Prevent hoisting the thread-pointer read in THREAD_SET_STACK_GUARD (BZ 34297)

THREAD_SET_STACK_GUARD reads the thread pointer via THREAD_SELF
(__builtin_thread_pointer), which the compiler treats as invariant.  In the
static startup path the thread pointer is installed by the __libc_setup_tls
call that immediately precedes the guard store, so the read must stay below
it.  The existing barrier only clobbered the access registers a0/a1, which
creates no dependency on the call, so the compiler could move the whole
barrier and read above __libc_setup_tls.

This is sensitive to instruction scheduling and recent TLS startup
changes exposed it on s390x.

Add a "memory" clobber to the barrier so it is tied to the call's memory
effects and cannot be hoisted above it.  The macro is shared with the
dynamic loader, so both startup paths are covered.

I checked on s390x-linux-gnu build for arch5, arch8, arch9, and arch11
by running the elf tests on qemu system (kernel 6.1.0).

Reviewed-by: Stefan Liebler <stli@linux.ibm.com>
3 weeks agoAdd new AArch64 HWCAP definitions from Linux 6.14, 6.18 and 7.0 to bits/hwcap.h
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:29 +0000 (11:46 -0300)] 
Add new AArch64 HWCAP definitions from Linux 6.14, 6.18 and 7.0 to bits/hwcap.h

Add the 2024 dpISA HWCAP bits HWCAP_CMPBR, HWCAP_FPRCVT, HWCAP_F8MM8,
HWCAP_F8MM4, HWCAP_SVE_F16MM, HWCAP_SVE_ELTPERM, HWCAP_SVE_AES2,
HWCAP_SVE_BFSCALE, HWCAP_SVE2P2, HWCAP_SME2P2, HWCAP_SME_SBITPERM,
HWCAP_SME_AES, HWCAP_SME_SFEXPA, HWCAP_SME_STMOP and HWCAP_SME_SMOP4
(commit 819935464cb2f72fff8dfbbf95cf2726d4a66388, Linux 6.14), HWCAP3_LSFE
(commit 220928e52cb03d223b3acad3888baf0687486d21, Linux 6.18) and
HWCAP3_LS64 (commit 58ce78667a641f93afa0c152c700a1673383d323, Linux 7.0).

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
3 weeks agoMakefile: Depend on elf/subdir_lib only if $(subdirs) has elf
H.J. Lu [Mon, 6 Jul 2026 00:51:10 +0000 (08:51 +0800)] 
Makefile: Depend on elf/subdir_lib only if $(subdirs) has elf

commit 7cac99621e9601f916121bcaa9b7734a2e4c2529
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Jun 10 16:26:15 2026 -0300

    Makefile: Run the subdirectory recursion in parallel

added:

$(elf-objpfx)ld.so $(elf-objpfx)sofini.os $(elf-objpfx)interp.os: \
  | elf/subdir_lib ;

which doesn't work with

$ make check -jN subdirs=DIR

where DIR doesn't have elf.  Add such rule only if $(subdirs) has elf.
This fixes BZ #34355.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 weeks agosysdeps/x86: don't spuriously mark tests as xfail
Andreas Schwab [Thu, 2 Jul 2026 11:14:19 +0000 (13:14 +0200)] 
sysdeps/x86: don't spuriously mark tests as xfail

Properly set xfail marker, $(with-lld) is always non-empty.

3 weeks agoriscv: Add RVV strncpy for both multiarch and non-multiarch builds
Yao Zihong [Fri, 3 Jul 2026 21:59:53 +0000 (21:59 +0000)] 
riscv: Add RVV strncpy for both multiarch and non-multiarch builds

This patch adds an RVV-optimized implementation of strncpy for RISC-V and
enables it for both multiarch (IFUNC) and non-multiarch builds.

The implementation integrates Hau Hsu's 2023 RVV work under a unified
ifunc-based framework. A vectorized version (__strncpy_vector) is added
alongside the generic fallback (__strncpy_generic). The runtime resolver
selects the RVV variant when RISCV_HWPROBE_KEY_IMA_EXT_0 reports vector
support (RVV).

Currently, the resolver still selects the RVV variant even when the RVV
extension is disabled via prctl(). As a consequence, any process that
has RVV disabled via prctl() will receive SIGILL when calling strncpy().

Co-authored-by: Hau Hsu <hau.hsu@sifive.com>
Co-authored-by: Jerry Shih <jerry.shih@sifive.com>
Signed-off-by: Yao Zihong <zihong.plct@isrc.iscas.ac.cn>
Reviewed-by: Peter Bergner <bergner@tenstorrent.com>
3 weeks agoriscv: Add RVV stpncpy for both multiarch and non-multiarch builds
Yao Zihong [Thu, 2 Jul 2026 03:45:24 +0000 (03:45 +0000)] 
riscv: Add RVV stpncpy for both multiarch and non-multiarch builds

This patch adds an RVV-optimized implementation of stpncpy for RISC-V and
enables it for both multiarch (IFUNC) and non-multiarch builds.

The implementation integrates Hau Hsu's 2023 RVV work under a unified
ifunc-based framework. A vectorized version (__stpncpy_vector) is added
alongside the generic fallback (__stpncpy_generic). The runtime resolver
selects the RVV variant when RISCV_HWPROBE_KEY_IMA_EXT_0 reports vector
support (RVV).

Currently, the resolver still selects the RVV variant even when the RVV
extension is disabled via prctl(). As a consequence, any process that
has RVV disabled via prctl() will receive SIGILL when calling stpncpy().

Co-authored-by: Hau Hsu <hau.hsu@sifive.com>
Co-authored-by: Jerry Shih <jerry.shih@sifive.com>
Signed-off-by: Yao Zihong <zihong.plct@isrc.iscas.ac.cn>
Reviewed-by: Peter Bergner <bergner@tenstorrent.com>
3 weeks agoAdd tst-thp-size-mod.so dependency to strace THP tests
H.J. Lu [Sun, 5 Jul 2026 07:59:43 +0000 (15:59 +0800)] 
Add tst-thp-size-mod.so dependency to strace THP tests

After

7cac99621e Makefile: Run the subdirectory recursion in parallel

tests under elf may run in parallel. "make check -jN" reports

FAIL: elf/strace-tst-thp-align-default
FAIL: elf/strace-tst-thp-align-disabled
FAIL: elf/strace-tst-thp-align-enabled

at random since they use tst-thp-align which dlopens tst-thp-size-mod.so,
but tst-thp-size-mod.so dependency is missing.  Add the missing dependency
to fix BZ #34351.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 weeks agobuild-many-glibcs.py: Update Linux kernel version to 7.1
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:39 +0000 (11:46 -0300)] 
build-many-glibcs.py: Update Linux kernel version to 7.1

Use the 7.1 release as the default Linux kernel version for building test
compilers and headers.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoUpdate kernel version to 7.1 in header constant tests
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:38 +0000 (11:46 -0300)] 
Update kernel version to 7.1 in header constant tests

There are no new constants covered by tst-mman-consts.py or
tst-openat2-consts.py in Linux 6.18, 6.19, 7.0, or 7.1.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoUpdate syscall lists for Linux 7.1
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:37 +0000 (11:46 -0300)] 
Update syscall lists for Linux 7.1

Linux 6.18 adds the uprobe syscall (x86_64 only), Linux 6.19 adds listns,
and Linux 7.0 adds rseq_slice_yield.  Linux 7.0 also wires up clone3 on
sparc and memfd_secret on loongarch.  Update syscall-names.list and
regenerate the arch-syscall.h headers with build-many-glibcs.py
update-syscalls.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoAdd NT_RISCV_USER_CFI from Linux 7.0 to elf.h
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:36 +0000 (11:46 -0300)] 
Add NT_RISCV_USER_CFI from Linux 7.0 to elf.h

It was added by commit 2af7c9cf021c5dabe880b68e5cc22c618060d954.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoAdd IPPROTO_AGGFRAG from Linux 6.14 to netinet/in.h (BZ 34347)
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:34 +0000 (11:46 -0300)] 
Add IPPROTO_AGGFRAG from Linux 6.14 to netinet/in.h (BZ 34347)

It was added by commit 64e844505bc08cde3f346f193cbbbab0096fef54.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoAdd SCHED_GETATTR_FLAG_DL_DYNAMIC from Linux 7.1 to bits/sched.h
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:32 +0000 (11:46 -0300)] 
Add SCHED_GETATTR_FLAG_DL_DYNAMIC from Linux 7.1 to bits/sched.h

It was added by commit 2e7af192697ef2a71c76fd57860b0fcd02754e14, which
introduced the flags argument for sched_getattr.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoUpdate PIDFD_* constants for Linux 7.1
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:31 +0000 (11:46 -0300)] 
Update PIDFD_* constants for Linux 7.1

The pidfd_info interface was extended to report coredump information:

  * PIDFD_INFO_SUPPORTED_MASK, along with the supported_mask field, so
    userspace can check which flags the running kernel supports (commit
    dfd78546c95330db2252e0d7e937a15ab5eddb4e, Linux 6.19).

  * PIDFD_INFO_COREDUMP_SIGNAL, along with the coredump_signal field
    (commit 036375522be8425874e9e0f907c7127e315c7a52, Linux 6.19).

  * PIDFD_INFO_COREDUMP_CODE, along with the coredump_code field (commit
    701f7f4fbabbf4989ba6fbf033b160dd943221d5, Linux 7.1).

The struct pidfd_info is extended accordingly and PIDFD_INFO_SIZE_VER1,
PIDFD_INFO_SIZE_VER2, and PIDFD_INFO_SIZE_VER3 are added to reflect the
new struct sizes.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoAdd new LoongArch HWCAP definitions from Linux 7.0 and 7.1 to bits/hwcap.h
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:30 +0000 (11:46 -0300)] 
Add new LoongArch HWCAP definitions from Linux 7.0 and 7.1 to bits/hwcap.h

Add HWCAP_LOONGARCH_SCQ (commit 48543c4283e76d561d11b9955222b1a3054abdb9,
Linux 7.0) and HWCAP_LOONGARCH_LAM_BH (commit
1dd3e8a8eeb4059fb34b07578362380cf35b7ed5, Linux 7.1).

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoAdd new constants from Linux 6.12, 6.18 and 6.19 to bits/fcntl-linux.h
Adhemerval Zanella [Fri, 3 Jul 2026 14:46:27 +0000 (11:46 -0300)] 
Add new constants from Linux 6.12, 6.18 and 6.19 to bits/fcntl-linux.h

Add the FD_NSFS_ROOT (commit e83f0b5d10dcf62833008327cb661c7d118bca85,
Linux 6.18), and F_GETDELEG and F_SETDELEG (commit
1602bad16d7df82faca6d7c70821117684a66f49, Linux 6.19).

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agox86: Remove unused VZEROUPPER_SHORT_RETURN macro from memset
RyotaSaito [Wed, 1 Jul 2026 07:20:34 +0000 (16:20 +0900)] 
x86: Remove unused VZEROUPPER_SHORT_RETURN macro from memset

The VZEROUPPER_SHORT_RETURN macro in memset-vec-unaligned-erms.S has had
no users since commit e59ced238482 ("x86: Optimize
memset-vec-unaligned-erms.S") removed its last invocation, leaving both
the VEC_SIZE > 16 definition and the "rep; ret" fallback definition in
place.  Remove the two now-dead definitions.

Signed-off-by: RyotaSaito <saito.ryota.23@shizuoka.ac.jp>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 weeks agostring: Fix memory leak in argz-addsep.c
Samuel Balazi [Fri, 19 Jun 2026 13:11:39 +0000 (15:11 +0200)] 
string: Fix memory leak in argz-addsep.c

Assign the realloc result to a temporary variable, so the original
memory block is not lost if the allocation fails.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 weeks agoMakerules: run test-container helper through the built loader
Adhemerval Zanella [Wed, 1 Jul 2026 13:40:04 +0000 (10:40 -0300)] 
Makerules: run test-container helper through the built loader

The tests-container rule launches support/test-container, which is always
dynamically linked, through $(test-via-rtld-prefix).  That prefix is empty
for tests listed in tests-static/xtests-static, so for a static container
test the helper ran under the system loader/libc instead of the newly
built one.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 weeks agoMakerules: add 'make check-parallel' to run tests without serialization
Adhemerval Zanella [Mon, 15 Jun 2026 17:22:38 +0000 (14:22 -0300)] 
Makerules: add 'make check-parallel' to run tests without serialization

The default 'make check' serializes the timing-sensitive test runs: the
threading (nptl, or htl on Hurd) and realtime (rt) subdirectories run
with .NOTPARALLEL and are ordered after the rest of the test run, so they
are not perturbed by competing machine load.

Add a check-parallel (and xcheck-parallel) variant for when that is not
wanted -- an idle machine, or a run where the extra throughput is worth
the risk of flakiness in the timing-sensitive tests (check the
libc-alpha discussion [1] for more context why this approach was proposed).

A new serialize-tests flag (default yes, defined in Makeconfig) gates both
the per-subdirectory .NOTPARALLEL and the top-level run-time ordering;
check-parallel just runs the suite with serialize-tests=no, so every test
program builds and runs at full concurrency in a single pass.

'make check' and its default behavior are unchanged.

[1] https://inbox.sourceware.org/libc-alpha/lhutsr3khz7.fsf@oldenburg.str.redhat.com/

Reviewed-by: Sam James <sam@gentoo.org>
3 weeks agoRun check-installed-headers concurrently for each header
Adhemerval Zanella [Wed, 10 Jun 2026 21:45:39 +0000 (18:45 -0300)] 
Run check-installed-headers concurrently for each header

The check-installed-headers-c/-cxx tests ran one script invocation per
subdirectory over all of its installed headers, performing about 80
compiler invocations per header serially.

Give each header its own intermediate target so the compiler
invocations parallelize under the make jobserver, recording the
per-header script exit status next to the output.  The .out target
concatenates the per-header outputs in the original $(headers) order
and fails if any recorded status is non-zero, so both the .out contents
(verified byte-identical for all 76 files) and the tests.sum results
are unchanged.

Results on a x86_64 machine [1] from a make check with run-built-tests=no
show neutral results, and on aarch64 machine [2] it improves from 241.574s
to 182.405.

[1] Ryzen 5900x, 12c/24t, gcc 16.1.1, binutils 2.26, and GNU make 4.3
[2] N1, 80c, gcc 15.1.1, binutils 2.25, GNU make 4.3

Reviewed-by: Sam James <sam@gentoo.org>
3 weeks agoMakefile: Do not install the container testroot if not running tests
Adhemerval Zanella [Wed, 10 Jun 2026 21:25:56 +0000 (18:25 -0300)] 
Makefile: Do not install the container testroot if not running tests

Every subdirectory tests target depends on
$(objpfx)testroot.pristine/install.stamp, whose recipe performs a full
DESTDIR installation (about 12s and 154MB on x86_64).  The testroot is
only consumed by the container tests, which do not run when
run-built-tests is no, so skip it entirely in that case.

This saves about 10s on x86_64 [1] and 30s on aarch64 [2].

[1] Ryzen 5900x, 12c/24t, gcc 16.1.1, binutils 2.26, and GNU make 4.3
[2] N1, 80c, gcc 15.1.1, binutils 2.25, GNU make 4.3

Reviewed-by: Sam James <sam@gentoo.org>
3 weeks agoMakefile: Do not force elf last for the others and tests passes
Adhemerval Zanella [Wed, 10 Jun 2026 19:56:44 +0000 (16:56 -0300)] 
Makefile: Do not force elf last for the others and tests passes

The requirement that the elf subdirectory comes last in the
subdirectory ordering stems from its lib pass: the rtld link consumes
$(common-objpfx)libc_pic.a, which aggregates every other
subdirectory's objects.

The others, tests, and xtests classes have no such dependency: everything
they consume from other subdirectories is provided by the pass barriers
(others after lib, tests after others).  Keep elf last only for the
object-building classes and let its others and tests sub-makes run
concurrently with the other subdirectories.

With elf no longer forced last for those classes, the Depend edges
pointing to elf (e.g. support/Depend) no longer create a cycle there,
so honor them instead of dropping them.

This improves the make check with run-built-tests=no, specially on
machine with many cores.  Results on a x86_64 machine [1] it improves
from 190s to 181s, while on a aarch64 machine [2] it improves from
298.726s to 243.098s.

Build results remain bit-identical and the tests.sum failure sets are
unchanged.

[1] Ryzen 5900x, 12c/24t, gcc 16.1.1, binutils 2.26, and GNU make 4.3
[2] N1, 80c, gcc 15.1.1, binutils 2.25, GNU make 4.3

Reviewed-by: Sam James <sam@gentoo.org>
3 weeks agoMakefile: Run the subdirectory recursion in parallel
Adhemerval Zanella [Wed, 10 Jun 2026 19:26:15 +0000 (16:26 -0300)] 
Makefile: Run the subdirectory recursion in parallel

The top-level makefile was marked .NOTPARALLEL and ran the
per-subdirectory sub-makes strictly one at a time in the topological
order computed by scripts/gen-sorted.awk.  Only the compilations inside
a single subdirectory could run in parallel, so on wide machines every
subdirectory's compile tail and link steps left most cores idle, once
per subdirectory per pass.

Drop .NOTPARALLEL and encode the ordering the serial recursion relied
on as explicit dependencies between the per-subdirectory targets:

  * The subdirectories that generate shared files in $(common-objpfx)
    consumed by the rest of the build without explicit dependencies run
    serially, in their sorted order, before the rest fan out: csu
    provides the tree-wide gen-as-const headers, and on Hurd the mach
    and hurd directories generate the MiG RPC headers (every other
    subdirectory otherwise runs a nested make in hurd/ to create them,
    racing under parallel recursion; see sysdeps/mach/hurd/Makefile).
    The first of them also materializes the other shared generated files
    (abi-versions.h, sysd-syscalls, before-compile headers).

  * The edges requested by the Depend files (now emitted by
    gen-sorted.awk as subdir-deps-*) are preserved.  Edges pointing to
    elf are dropped, as the sorted list already overrides them by
    forcing elf last.

  * The tests and xtests classes only run the per-directory test
    programs, which are mutually independent once the others pass has
    built the tree.  They therefore carry only the others pass barrier
    below and none of the csu-first or Depend edges (+ordered_parallel_-
    subdir_targets excludes them); otherwise "make subdir/tests" would
    also run the tests of every subdirectory reachable through those
    edges, rather than just the requested one.

  * elf stays last: its rtld link consumes $(common-objpfx)libc_pic.a,
    which aggregates every other subdirectory's objects, and its
    rtld-Rules recursion compiles into the other subdirectories' object
    directories.

  * Pass barriers replace the implicit pass ordering: others after lib
    (a subdirectory others sub-make would otherwise race to link
    libc.so itself), tests/xtests after others, and the testroot
    install behind others.

  * The threading (nptl, or htl on Hurd) and realtime (rt) tests are
    timing-sensitive and were previously shielded from system load by
    the global .NOTPARALLEL.  With the recursion now parallel, a full
    test run ('make check'/'tests', run-built-tests=yes) orders them
    after the rest of the test run and one group at a time -- the
    threading subdirectory, then rt -- and each serializes its own run
    via a .NOTPARALLEL in its Makefile.  A targeted 'make subdir/tests'
    is not ordered.

    The serialization (the per-subdirectory .NOTPARALLEL and the ordering
    above) constrains only the test run, not the build of the test
    programs; but building and running a subdirectory's tests are fused
    in its sub-make, so under run-built-tests=yes the serialized
    subdirectories would also build their test programs serially.  To
    avoid that, the top-level 'make check' (in Makerules) now runs two
    passes: it builds every test program with run-built-tests=no, where
    the recursion is fully parallel and none of the serialization
    applies, and then runs the tests with run-built-tests=yes.  'make
    tests' and a subdirectory's own 'check' stay single pass.

  * The subdirectory-built files that the top-level libc.so and
    linkobj/libc_pic.a rules list as prerequisites (elf/ld.so,
    interp.os, sofini.os, sunrpc/librpc_compat_pic.a, and on Hurd
    mach/libmachuser_pic.a and hurd/libhurduser_pic.a, from which the
    lib*user-link.so inputs of libc.so are built) get order-only edges
    on the corresponding sub-make with an explicit empty recipe.  A
    prerequisite-only rule would trigger an implicit rule search and
    this level would compile them itself in the wrong context.

  * The install, clean, abi, and stubs target classes keep the
    previous total order via a serial dependency chain.

  * The elf DSO sorting test recipes, run when make remakes the
    included generated makefiles at parse time, create the elf object
    directory before writing into it; the serial recursion no longer
    guarantees another rule created it first.

  * catgets builds locale-specific message catalogs (and tst-catgets
    reads one) by running gencat under de_DE.ISO-8859-1, hr_HR.ISO-8859-2
    and ja_JP.SJIS, but never declared those locales as prerequisites: it
    relied on localedata running before it in the serial order.  Under
    the parallel recursion gencat could run before localedata generated
    the locale, fall back to C, and fail.  catgets/Makefile now pulls the
    locales in via gen-locales.mk, like the other subdirectories that use
    locales in their tests.

Results on a x86_64 machine [1] with default configuration [3]: a
from-scratch build improves from 78.728s to 61s, and check with
run-built-tests=no from 374s to 190s.

On a 80-core aarch64 machine [2] with default configuration [3]: a
from-scratch build improves from 105.251s to 56.703s, and check with
run-built-tests=no from 886.183s to 298.726s.

Build results are unchanged: all 8919 built objects, archives, and
shared objects are bit-identical to the serial build across 7 clean
parallel builds, the installed tree layout is identical, and the
tests.sum failure sets are identical.  i686-gnu was verified with
repeated from-scratch builds.

[1] Ryzen 5900x, 12c/24t, gcc 16.1.1, binutils 2.26, and GNU make 4.3
[2] N1, 80c, gcc 15.1.1, binutils 2.25, GNU make 4.3
[3] --enable-stack-protector=all --enable-bind-now=yes --enable-profile=yes
    --enable-fortify-source=2 --enable-hardcoded-path-in-tests

Reviewed-by: Sam James <sam@gentoo.org>
3 weeks agoscripts/gen-sorted.awk: Also emit the subdirectory dependency edges
Adhemerval Zanella [Wed, 10 Jun 2026 19:25:50 +0000 (16:25 -0300)] 
scripts/gen-sorted.awk: Also emit the subdirectory dependency edges

gen-sorted.awk collects the inter-subdirectory dependencies from the
Depend files and the sysdeps Subdirs 'first' directives, but only uses
them to compute the flattened sorted-subdirs list.

This change also emit the raw edges as subdir-deps-<dir> make variables
so the parent makefile can express the same ordering as explicit
dependencies between the per-subdirectory recursion targets and run
independent subdirectories in parallel.

For instance, on x86_64-linux-gnu build the 'sysd-sorted' now shows:

  [...]
  subdir-deps-assert += iconvdata
  subdir-deps-assert += localedata
  subdir-deps-catgets += intl
  subdir-deps-debug += localedata
  subdir-deps-iconvdata += iconv
  subdir-deps-iconvdata += localedata
  subdir-deps-intl += iconvdata
  subdir-deps-intl += localedata
  subdir-deps-libio += localedata
  subdir-deps-localedata += locale
  [...]

Reviewed-by: Sam James <sam@gentoo.org>
3 weeks agointl: create correct directory in tst-translit.sh
Sam James [Thu, 2 Jul 2026 23:33:33 +0000 (00:33 +0100)] 
intl: create correct directory in tst-translit.sh

Depending on parallelism, it's possible for domaindir/existing-locale/LC_MESSAGES
to have not been created yet:
```
msgfmt: error while opening "build/intl/domaindir/existing-locale/LC_MESSAGES/translit.mo" for writing: No such file or directory
make[2]: Leaving directory 'src/intl'
FAIL: intl/tst-translit
original exit status 1
cat: build/intl/tst-translit.out: No such file or directory
make[1]: *** [Makefile:944: test] Error 1
```

If so, the following msgfmt call will fail. Fix the typo in the mkdir call.

Arguably we should split these test preparations to avoid producing binaries
we know won't PASS because their support data is missing.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
4 weeks agopo/*.po: integrate current state of translations
Andreas K. Hüttel [Wed, 1 Jul 2026 02:14:06 +0000 (11:14 +0900)] 
po/*.po: integrate current state of translations

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
4 weeks agopo/libc.pot: regenerate
Andreas K. Hüttel [Wed, 1 Jul 2026 01:53:46 +0000 (10:53 +0900)] 
po/libc.pot: regenerate

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
4 weeks agoAdd system-wide tunables: manual
DJ Delorie [Fri, 26 Jun 2026 03:30:39 +0000 (23:30 -0400)] 
Add system-wide tunables: manual

Document the syntax and operation.

Reviewed-by: Arjun Shankar <arjun@redhat.com>
4 weeks agoAdd system-wide tunables: Filters
DJ Delorie [Fri, 26 Jun 2026 03:30:39 +0000 (23:30 -0400)] 
Add system-wide tunables: Filters

Add support for [proc:*] syntax where * matches /proc/self/exe
(fallback: argv[0] unless AT_SECURE).  Tunables after such a
line are limited to matching processes.

Note that this filter is reset when including a file or at
end of file.

If the filename starts with a slash (example: [proc:/bin/foo]) the
full path must match.  If not (example: [proc:foo]) the basename is
matched.

Add support for filtering out AT_SECURE or non-AT_SECURE binaries:

  $glibc.only-for.nonsecure-binaries=1
  @glibc.only-for.secure-binaries=1

Reviewed-by: Arjun Shankar <arjun@redhat.com>
4 weeks agoAdd system-wide tunables: Apply tunables part
DJ Delorie [Fri, 26 Jun 2026 03:30:39 +0000 (23:30 -0400)] 
Add system-wide tunables: Apply tunables part

Load ld.so.cache and fetch the tunables extension.  Apply
those tunables to the current program.  We do not yet apply
security policies.

Reviewed-by: Arjun Shankar <arjun@redhat.com>
4 weeks agoAdd system-wide tunables: cache ld.so.cache
DJ Delorie [Tue, 30 Jun 2026 20:49:42 +0000 (16:49 -0400)] 
Add system-wide tunables: cache ld.so.cache

The purpose of this change is twofold:

1. The ld.so.cache is cached in memory and only re-read if/when
   it changes on disk.  This allows us to have much more intensive
   security checks in the future, without impacting performance as
   much.  It also allows for cases where the cache is corrupted -
   we continue using the last valid one.

2. We break out the load/check logic so that the cache can be
   loaded independently of the library lookup, such as for
   code that only needs to look at the extensions.

Reviewed-by: Arjun Shankar <arjun@redhat.com>
4 weeks agoAdd system-wide tunables: ldconfig part
DJ Delorie [Fri, 26 Jun 2026 03:30:39 +0000 (23:30 -0400)] 
Add system-wide tunables: ldconfig part

Adds support for reading /etc/tunables.conf

The file contains one line per tunable, like this:

glibc.foo.bar=14
glibc.malloc.more=0

Additionally, each line can be prefixed with a single word or character
that controls overridability by the GLIBC_TUNABLES env var:

overridable glibc.foo=0
+glibc.foo=0
   ^ May be overridden (the default)
nonoverridable glibc.foo=0
-glibc.foo=0
   ^ May not be overridden

The tunable cache format allows for a filter to be assigned to
each tunable, to be used at program start to decide if a tunable
applies to that program.  No such filters have yet been specified.

The cache format also stores a pre-parsed value for the tunable, and
the ID of the tunable, to improve load-time performance.

Reviewed-by: Arjun Shankar <arjun@redhat.com>
4 weeks agomalloc: Don't call __get_thp_mode/__get_thp_size twice
H.J. Lu [Sat, 18 Apr 2026 03:36:41 +0000 (11:36 +0800)] 
malloc: Don't call __get_thp_mode/__get_thp_size twice

Both ld.so and malloc track kernel THP mode and THP page size when THP
in ld.so is enabled by

GLIBC_TUNABLES=glibc.elf.thp=1

and THP in malloc is enabled by

GLIBC_TUNABLES=glibc.malloc.hugetlb=1

But DL_MAP_DEFAULT_THP_PAGESIZE and MALLOC_DEFAULT_THP_PAGESIZE may be
different when they are defined in <hugepages.h>.

If THP in ld.so is enabled, change malloc to use kernel THP mode from
ld.so, instead of calling __get_thp_mode, and use THP page size from
ld.so if it came from __get_thp_size.  This avoids calling __get_thp_mode
and __get_thp_size again, which are quite expensive:

1. Initialize mp_.thp_mode and GL(dl_thp_mode) to thp_mode_unknown.
2. Set mp_.thp_mode to GL(dl_thp_mode) if GL(dl_thp_mode) isn't
thp_mode_unknown.  Otherwise call __get_thp_mode to set mp_.thp_mode.
3. GL(dl_elf_thp_pagesize) is set to DL_MAP_DEFAULT_THP_PAGESIZE without
calling __get_thp_size and THP page size for malloc may be different from
THP page size for ld.so.  Set mp_.thp_pagesize to GL(dl_elf_thp_pagesize)
if DL_MAP_DEFAULT_THP_PAGESIZE is defined.  Otherwise call __get_thp_size
to set mp_.thp_pagesize.
4. THP page size in malloc is capped to MAX_THP_PAGESIZE.  If THP page
size is above MAX_THP_PAGESIZE, THP in malloc is disabled.

These result in when glibc.elf.thp is set to 1, malloc uses the actual
kernel THP mode instead of defaulting to madvise mode and madvise_thp
will stop issuing MADV_HUGEPAGE if kernel THP mode is always.

This fixes BZ #34083.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
4 weeks agonis: Fix a memory leak in nis_creategroup when malloc fails
Jiri Stransky [Tue, 23 Jun 2026 14:15:25 +0000 (16:15 +0200)] 
nis: Fix a memory leak in nis_creategroup when malloc fails

The zo_domain field was missing from the list of fields to be freed.

Reviewed-by: DJ Delorie <dj@redhat.com>