Skip to content

glibc: 2.42 -> 2.43 - #502924

Closed
philiptaron wants to merge 4 commits into
NixOS:stagingfrom
philiptaron:glibc
Closed

philiptaron wants to merge 4 commits into
NixOS:stagingfrom
philiptaron:glibc

Conversation

@philiptaron

@philiptaron philiptaron commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Hey, it's a new glibc!

What's in glibc 2.43

  • C23 free_sized, free_aligned_sized, memset_explicit, memalignment
  • C23 const-preserving macros for strchr, strstr, memchr, bsearch, etc.
  • mseal and openat2 syscall wrappers
  • Experimental clang build support (why I'm here)
  • Updated math from CORE-MATH project
  • Unicode 17.0.0
  • AArch64: GCS (Guarded Control Stack), BTI enforcement, 2MB THP in malloc
  • x86: Intel Nova Lake / Wildcat Lake support

What I changed in nixpkgs

glibc patches:

  • Replaced 2.42-master.patch → 2.43-master.patch (14 commits from stable branch)
  • Rebased 3 patches: dont-use-system-ld-so-cache, 0001-Revert-BASH, aarch64-NVCC
  • Dropped fix-x64-abi.patch — upstream has the proper assembly fix since glibc 2.27
  • 11 other patches applied cleanly unchanged

GCC 15.2.0 libgomp fix (backport of upstream 9c9d3aef2f66):

  • char *q = strchr(...) → const char *q = strchr(...) in affinity-fmt.c
  • Applied in 3 places: minimal-bootstrap gcc, old stdenv gcc, ng gcc
  • Uses --replace-fail / grep guard so the build breaks when GCC ships the fix

Package fixes for C23 const-preserving macros (-Wno-error=discarded-qualifiers):

  • libfaketime, libtpms, krb5, dtc, librist, elfutils, grub, bpftools, pipewire (there are likely other ones that I haven't hit yet)

Proper upstream fixes backported:

  • sane-backends: 2 upstream patches removing unnecessary (const char *) casts from strchr
  • ldb: upstream samba commit 04e0fb9b2d fixing memset_explicit arg count (4→3)

Other fixes:

  • ml-dtypes: disabled testArange_float8_e4m3b11fnuz (NaN comparison with custom dtype)
    • Not clear how this is related to glibc but it passes before for me.

Test results

35+ NixOS tests pass including:

  • simple
  • login
  • openssh
  • firewall
  • docker
  • nginx
  • postgresql
  • gitea
  • gnome-session
  • plasma6
  • sway
  • k3s
  • wireguard
  • mariadb
  • redis
  • grafana
  • prometheus
  • nextcloud
  • matrix-synapse
  • zfs
  • hibernate

... and more.

30+ major packages pass including: linux, systemd, python3, postgresql, nginx, openssh, git, rustc, go, nodejs, clang, docker, qemu, vim, emacs, mesa, xorg, pipewire, pulseaudio, vlc, ffmpeg, libreoffice, gimp, samba, and more.

Known remaining failures

  • Firefox. Fails in glsl-optimizer, where a vendored c11/threads.h conflicts with glibc 2.43.
  • Chromium. bits/siginfo-consts.h:219: expected identifier in sandbox/seccomp code

Likely both of these will need something from upstream, but I expect that'll happen.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@philiptaron
philiptaron requested a review from Ma27 March 24, 2026 03:54
@philiptaron

Copy link
Copy Markdown
Contributor Author

The massive diff is the result of dropping pkgs/development/libraries/glibc/2.42-master.patch and picking up pkgs/development/libraries/glibc/2.43-master.patch.

@philiptaron

Copy link
Copy Markdown
Contributor Author

cc @trofi

@philiptaron
philiptaron requested a review from a team March 24, 2026 03:55
@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (update) This PR updates a package to a newer version 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: python Python is a high-level, general-purpose programming language. labels Mar 24, 2026
Comment thread pkgs/development/libraries/mesa/gbm.nix Resolved
@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 24, 2026
@philiptaron
philiptaron force-pushed the glibc branch 2 times, most recently from 2524602 to f4135bf Compare March 24, 2026 14:29
@nixpkgs-ci nixpkgs-ci Bot removed 2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: python Python is a high-level, general-purpose programming language. labels Mar 24, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Mar 24, 2026
@philiptaron

Copy link
Copy Markdown
Contributor Author

I asked @K900 what we did last time and they said set up a Hydra job building stuff. @vcunat maybe that's right to do here?

@vcunat

vcunat commented Mar 26, 2026

Copy link
Copy Markdown
Member

The "const" change may turn out annoying (from distro point of view), at least for packages which use -Werror setup inappropriate for distro side. It's actually a really nice improvement from C programmer's point of view (except for the usual hurdle that you often can only rely on features after several years have passed).

I created a jobset already:
https://hydra.nixos.org/jobset/nixpkgs/pr-502924-glibc-2.43
but I'll delay Hydra working on this until there's free capacity. Typically we get a couple days of *-linux idling at the end of each staging-next* cycle, estimated in about a week from now.

@vcunat

vcunat commented Mar 26, 2026 •

Copy link
Copy Markdown
Member

And before we get to Hydra working on this, I'd prefer if you didn't include master..staging stuff in the tested commit. Otherwise we'll be debugging unrelated breakages in that jobset as well.

@philiptaron

Copy link
Copy Markdown
Contributor Author

And before we get to Hydra working on this, I'd prefer if you didn't include master..staging stuff in the tested commit. Otherwise we'll be debugging unrelated breakages in that jobset as well.

Doing so will delay it then, since it relies on a couple package bumps that are in current staging. I'm on mobile but off the top of my head: gettext 1.0, mesa-libgbm 26.0.3, something from GNU that @trofi put up in January. Maybe one more that's escaping me.

@Ma27

Ma27 commented Mar 26, 2026

Copy link
Copy Markdown
Member

@philiptaron I recommend to base this on a merge-base of staging and staging-next and then use the "Compare to jobset" of Hydra to spot regressions.

If there are regressions to look at, I'm happy to help.

Thanks a lot for doing that!
I'll give it a review in the upcoming days.

For the future it would be nice if you could leave me a note as a maintainer of pkgs.glibc because doing the exact same work was also on my todo-list, just didn't get to it yet.

@vcunat

vcunat commented Mar 26, 2026 •

Copy link
Copy Markdown
Member

We have no staging-next right now, though. (doing staging-next-25.11)

@Ma27

Ma27 commented Mar 26, 2026

Copy link
Copy Markdown
Member

Right, in that case it's probably the easiest to base this on the last staging-next jobset eval, no?
You can pass jobset-eval ids into the compare-to parameter in the URL, comparing to arbitrary jobsets is just not exposed in the UI.

@vcunat

vcunat commented Mar 26, 2026

Copy link
Copy Markdown
Member

As for delaying, I think might be beneficial anyway.

The release is only two months old, so packages often haven't caught up yet in nixpkgs. Lots may get fixed "by itself" on nixpkgs level just by waiting, though I can only guess how this progression looks like. As an example, in my upstream CI we only found glibc-2.43 regressions this week, and release won't be immediate (even if bump in nixpkgs would follow immediately in this case).

@philiptaron

Copy link
Copy Markdown
Contributor Author

For the future it would be nice if you could leave me a note as a maintainer of pkgs.glibc because doing the exact same work was also on my todo-list, just didn't get to it yet.

I had hoped that by requesting your review -- which you can see I requested as the very first step -- I would do so. What's your preferred method of contact? Happy to oblige. As a first-time glibc package bumper, I know I'm likely to need some guidance.

@philiptaron

Copy link
Copy Markdown
Contributor Author

As for delaying, I think might be beneficial anyway.

I hear that. I'm a little impatient because I'd like to start to make real the "complete clang build" scenario -- and this is the very first glibc that's able to do that. But I will go with the team on this.

There is, as always, a bit of a chicken and egg situation -- the sooner a distro uses glibc, the sooner the repo authors start getting PRs and such.

@vcunat

vcunat commented Mar 26, 2026

Copy link
Copy Markdown
Member

the sooner a distro uses glibc, the sooner the repo authors start getting PRs and such

The CI I mentioned triggered on testing an Arch build.

@Ma27

Ma27 commented Mar 26, 2026

Copy link
Copy Markdown
Member

I had hoped that by requesting your review -- which you can see I requested as the very first step -- I would do so. What's your preferred method of contact? Happy to oblige. As a first-time glibc package bumper, I know I'm likely to need some guidance.

I assume there's a difference in when you started doing this vs. when you opened the PR given the amount of fixes you already had, no?

Btw just thought I might drop it here, we're considering to delay anyways so I'd really like to schedule the following security-update first: #503779

There is, as always, a bit of a chicken and egg situation -- the sooner a distro uses glibc, the sooner the repo authors start getting PRs and such.

This is always a slippery slope IMHO: whenever there are some notable changes in the actual API, fixing the critical mass of all regressions will take a while. That being said, I'm sure a lot of projects welcome these kinds of fixes ;-)

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 30, 2026
@vcunat

vcunat commented Apr 4, 2026

Copy link
Copy Markdown
Member

Hydra built ~40% of this, but I'm pausing it for now.

@philiptaron

This comment was marked as outdated.

Update the minimal-bootstrap glibc from 2.42 to 2.43.

glibc 2.43 introduces C23 const-preserving macros for strchr and
similar functions, which causes a -Werror=discarded-qualifiers failure
in libgomp when building GCC 15.2.0. Apply the upstream fix from
gcc commit 9c9d3aef2f66 via sed.
glibc 2.43 implements C23 const-preserving macros for strchr and
similar functions. This causes -Werror=discarded-qualifiers in
libgomp/affinity-fmt.c when building GCC 15.2.0.

Backport upstream fix from gcc commit 9c9d3aef2f66. Uses
--replace-fail so the build will fail when GCC ships the fix
(>= 15.3 or >= 16.1), prompting removal of this workaround.
Update the main glibc from 2.42 to 2.43.

Changes:
- Replace 2.42-master.patch with 2.43-master.patch (21 commits from
  the stable branch)
- Rebase dont-use-system-ld-so-cache.patch for elf/Makefile and
  elf/ldconfig.c changes
- Rebase 0001-Revert-...BASH...patch for copyright year and line
  number changes
- Rebase 0001-aarch64-math-vector.h-add-NVCC-include-guard.patch for
  restructured math-vector.h
- Drop fix-x64-abi.patch: upstream has had a proper assembly fix in
  sysdeps/x86_64/tls_get_addr.S since glibc 2.27, making this
  C-level workaround redundant

glibc 2.43 introduces C23 const-preserving macros for strchr, strstr,
memchr and similar functions. Combined with GCC 15's default -std=gnu23
mode, packages using -Werror will fail with -Wdiscarded-qualifiers when
assigning these return values to non-const pointers. libfaketime is
patched here as it's in the nixosTests.simple closure.

Includes two CVE fixes:
- CVE-2026-4437: resolv: Count records correctly
- CVE-2026-4438: resolv: Check hostname for validity
glibc 2.43 introduces C23 const-preserving macros for strchr, strstr,
memchr and similar functions. Combined with GCC 15's -Werror defaults,
several packages fail to build.

- libfaketime: add -Wno-error=discarded-qualifiers
- libtpms: add -Wno-error=discarded-qualifiers
- krb5: add -Wno-error=discarded-qualifiers
- dtc: add -Wno-error=discarded-qualifiers
- librist: add -Wno-error=discarded-qualifiers
- elfutils: add -Wno-error=discarded-qualifiers
- grub: add -Wno-error=discarded-qualifiers
- bpftools: add -Wno-error=discarded-qualifiers
- pipewire: add -Wno-error=discarded-qualifiers
- sane-backends: backport upstream patches removing unnecessary
  (const char *) casts from strchr calls
- ldb: backport upstream samba commit 04e0fb9b2d fixing
  memset_explicit arg count (C23 memset_explicit takes 3 args, not 4)
@philiptaron

philiptaron commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor Author

The patch set from upstream grew from -14 to -21:

  1. 2be6cf2e75d0: posix: Run tst-wordexp-reuse-mem test
  2. 5c6fca0c62ce: resolv: Count records correctly (CVE-2026-4437)
  3. dd9945c0ba40: resolv: Check hostname for validity (CVE-2026-4438)
  4. 26953143787b: elf: parse /proc/self/maps as the last resort to find the gap for tst-link-map-contiguous-ldso
  5. 02ffd413cf83: elf: Use dl-symbol-redir-ifunc.h instead _dl_strlen
  6. 60cabd0464c6: riscv: Resolve calls to memcpy using memcpy-generic in early startup
  7. ce1013a197eb: tests: fix tst-rseq with Linux 7.0

I successfully built and ran nixosTests.simple.

@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 4, 2026
@vcunat

vcunat commented Apr 6, 2026 •

Copy link
Copy Markdown
Member

Actually, will we be missing 26.05, as a glibc major upgrade would get restricted in about a week?

2026-04-13 Restrict breaking changes to Release Critical Packages

@Ma27

Ma27 commented Apr 6, 2026

Copy link
Copy Markdown
Member

Repeating what I said in the Staging matrix channel about sending this for 26.05:

NACK from me: this is a glibc release that has notable changes in its C headers meaning it will take a while until projects catch up, whenever this happened for the past few releases, it took me several rounds to get the amoutn of regressions down to a reasonable number. So far we have 1400 new fails on x86_64 (compared to current staging-next - I'm aware that the comparison isn't perfect since the glibc 2.43 branch isn't based of last staging-next, this is a rough estimate, but it's the only somewhat reasonable data point I have right now) with 40% of x86_64 built only. On that base I'd not merge it.

I know it's a bummer for Philip Taron (UTC-8) who wanted to see clang build support land, but I oppose rushing an update of such a core library (and honestly, minor glibc releases are rather major releases given the work I had to put into them in the past 6.5 years).

@philiptaron

Copy link
Copy Markdown
Contributor Author

I don't care too much about hitting or not hitting 26.05 -- I've lived off master for my entire NixOS journey. I'll go with the team. I just wish it weren't a two-month delay in practice due to the amount of stuff that accretes to staging.

@vcunat

vcunat commented Apr 7, 2026

Copy link
Copy Markdown
Member

Soon-ish after branch-off is the ideal time to get riskier changes into unstable/master 🙂

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 2, 2026
@lemonlambda

Copy link
Copy Markdown

Any update on this?

@Ma27

Ma27 commented Aug 22, 2026

Copy link
Copy Markdown
Member

I'm currently preparing 2.44.

@vcunat

vcunat commented Aug 23, 2026

Copy link
Copy Markdown
Member

So you think that we should skip 2.43?

@vcunat

vcunat commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

For reference, feel free to ask for a jobset for whatever is getting ready to merge. Since the queue-runner upgrade we tend to have a free day or two of x86_64-linux power on Hydra roughly weekly, so that's quite useful for similar projects.

@whispersofthedawn

Copy link
Copy Markdown
Contributor

closing due to the merge of #557451

@philiptaron
philiptaron deleted the glibc branch October 22, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 8.has: package (update) This PR updates a package to a newer version 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants