Skip to content

glibc 2.42→2.43 + C23-const FTBFS fixes (make stack + gcc) - #238

Merged
bryan-minimal merged 11 commits into
mainfrom
update-base-soup-2026-06-11
Jun 18, 2026
Merged

glibc 2.42→2.43 + C23-const FTBFS fixes (make stack + gcc)#238
bryan-minimal merged 11 commits into
mainfrom
update-base-soup-2026-06-11

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Jun 11, 2026

Copy link
Copy Markdown
Member

What

glibc 2.42 → 2.43, plus every FTBFS fix the full-fleet rebuild surfaced. Reshaped to glibc-only (binutils 2.46.1 already landed separately on main, so it's dropped here) and rebased onto current main (picks up the harnesses → stacks/ migration). Builds clean on amd64 + arm64.

Why

glibc 2.43 clears the glibc CVE backlog (CVE-2025-15281 + CVE-2026-5450 CRIT, etc.). Because glibc is libc, the bump rebuilds the entire fleet — which is what surfaced the FTBFS wave below.

The C23-const FTBFS wave

glibc 2.43 implements ISO C23 const-preserving string macros — strchr/strrchr/strstr/memchr/bsearch/etc. now return const char * for a const char * argument. Pre-C23 code assigning the result to a plain char * trips -Werror=discarded-qualifiers and FTBFS. This is an ecosystem-wide wave, and our fleet hits it in two distinct shapes:

1. The make-stack leverstacks/make/stack.ncl appends -Wno-error=discarded-qualifiers to the shared make-stack CFLAGS; it lands after a package's own -Werror (later flag wins), downgrading that one warning.

⚠️ Honest scope note: this lever only reaches packages that actually use the make stack. Most C packages here have a hand-written build.sh that assigns its own CFLAGS (an assignment, not an append), so they bypass the make-stack lever entirely. There's no in-repo universal interception point (the global -fno-plt etc. come from the build sandbox, not this repo). So the lever is correct + durable for make-stack packages, but the packages below needed individual fixes — surfaced one-at-a-time by the buildbot as it rebuilt the fleet.

2. Per-package build.sh fixes — for the hand-written-build.sh packages that also self-enable -Werror (their -Werror lives in upstream configure, invisible to a grep), the same -Wno-error=discarded-qualifiers goes into each package's own CFLAGS. It lands after their -Werror on the compile line (or after $(AM_CFLAGS) under automake), so the later flag wins.

3. or-tools — a different class entirely (not -Werror, a hard compile error). or-tools FetchContent's SCIP v10.0.0, which bundles tinycthread (a C11 <threads.h> shim doing #define once_flag pthread_once_t). glibc 2.43 surfaces its native once_flag/call_once into SCIP's translation unit, so that macro corrupts glibc's typedef __once_flag once_flag; into a pthread_once_t redefinition → "conflicting types". -Wno-error can't fix a hard error. or-tools 9.15 is already the latest release and hard-FORCEs SCIP TPI=tny in its bundled cmake (so a -DTPI=... is overridden), so we sed that to TPI=omp before cmake — SCIP uses its OpenMP task interface instead of tinycthread, staying parallel + THREADSAFE (libgomp is present from our gcc build). A grep guard fails the build loudly if upstream renames the line.

Changes

File Change Kind
packages/glibc/build.ncl 2.42 → 2.43 (+ sha256) the bump
stacks/make/stack.ncl fleet -Wno-error=discarded-qualifiers durable (make-stack pkgs)
packages/gcc/build.sh same downgrade via CFLAGS_FOR_TARGET (libgomp) interim (retired by gcc-16)
packages/libxcrypt/build.sh -Wno-error=discarded-qualifiers in CFLAGS (crypt-{gost,sm3}-yescrypt.c) per-package
packages/elfutils/build.sh -Wno-error=discarded-qualifiers in CFLAGS (libcpu/riscv_disasm.c) per-package
packages/strace/build.sh -Wno-error=discarded-qualifiers in CFLAGS (src/ioctl.c) per-package
packages/or-tools/build.sh SCIP TPI tny → omp (drop tinycthread) tinycthread collision

For the reviewer (parked / notable)

  • gcc's fix is interim. A gcc-16 bump retires packages/gcc/build.sh (gcc-16 patched its own libgomp upstream) but does not retire the fleet/per-package fixes — every other C program still trips the same break under any gcc against glibc 2.43, because the language semantics are unchanged.
  • The real toolchain-policy call is -Wno-error=discarded-qualifiers (downgrade the one warning, used here) vs -std=gnu17 (restores C17 prototypes so strchr returns char * — no warning at all, but a broader language-standard change). This PR takes the surgical -Wno-error route; the -std=gnu17 switch can replace all of these levers later if the team prefers it.
  • or-tools TPI=omp tradeoff: SCIP keeps parallelism via OpenMP instead of tinycthread. If OpenMP were ever unavailable it fails fast at configure (not after the long compile), and the fallback is TPI=none (single-threaded SCIP).
  • elfutils gotcha (for anyone touching it later): its configure has no --disable-werror in this version — the CFLAGS flag is the reliable knob.

Status

Draft — builds clean on both arches, but it's a toolchain-policy change (touches the C-build warning posture fleet-wide), so leaving it for explicit sign-off on the -Wno-error vs -std=gnu17 direction before merge.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Bumps glibc from version 2.42 to 2.43 with an updated sha256, then applies compatibility fixes across the build system: -Wno-error=discarded-qualifiers is added fleet-wide to the make stack's CFLAGS and individually to gcc, elfutils, libxcrypt, and strace build scripts. The or-tools build script gains a sed-based patch forcing SCIP's TPI setting to "omp".

Changes

glibc 2.43 upgrade and downstream compatibility fixes

Layer / File(s) Summary
glibc version and checksum bump
packages/glibc/build.ncl
Updates the version field from 2.42 to 2.43 and replaces the sha256 for the downloaded tarball.
Fleet-wide CFLAGS fix in make stack
stacks/make/stack.ncl
Appends -Wno-error=discarded-qualifiers to build_env_vars.CFLAGS with an explanatory comment block, applying the warning downgrade to all autotools builds in the make stack.
Per-package CFLAGS workarounds
packages/gcc/build.sh, packages/elfutils/build.sh, packages/libxcrypt/build.sh, packages/strace/build.sh
Adds -Wno-error=discarded-qualifiers to CFLAGS in each package's build script; gcc additionally propagates the flag into CXXFLAGS, CFLAGS_FOR_TARGET, and CXXFLAGS_FOR_TARGET.
or-tools SCIP TPI CMake patch
packages/or-tools/build.sh
Patches cmake/dependencies/CMakeLists.txt via sed to force SCIP's TPI from "tny" to "omp", followed by a grep verification that exits with an error if the replacement did not apply.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop hop, glibc leapt to two-four-three,
Its C23 macros changed qualifiers with glee.
-Wno-error flags were sprinkled all around,
And SCIP's TPI got patched to stay sound.
The rabbit nods — the build stack holds its ground! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main changes: glibc version bump from 2.42 to 2.43 and C23-const related FTBFS (Fails To Build From Source) fixes targeting the make stack and gcc components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-base-soup-2026-06-11

Comment @coderabbitai help to get the list of available commands and usage tips.

The base-soup rebuild recompiles gcc-15.2.0 against the new glibc 2.43
headers, which implement ISO C23 const-preserving string macros (strchr
et al. now return `const char *` for a `const char *` input). gcc-15.2.0
predates this, so libgomp/affinity-fmt.c (`char *q = strchr(p+1,'}')`)
discards const and fails -Werror=discarded-qualifiers — the FTBFS the
buildbot hit. The pointer is only used for `q - p`, never written, so
it's a source-pedantry mismatch, not a runtime bug.

Downgrade only that single warning (everything else stays -Werror) via
CFLAGS_FOR_TARGET (the documented knob for target libs like libgomp) +
CFLAGS, for gcc's own build only — the shipped compiler is byte-identical.

Interim escape hatch; gcc-16.1.0 fixes this upstream and builds cleanly
against glibc 2.43 (LFS pairs them with no workaround), so the clean
follow-up is bumping gcc to 16. This is the same C23 wave hitting the
whole ecosystem (openssl, grub, libevent, ...). Refs in build.sh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bryan-minimal

Copy link
Copy Markdown
Member Author

Added: gcc glibc-2.43 build fix (commit 4cf505f)

The first buildbot run failed building gcc-15.2.0 against the new glibc 2.43 headers — not glibc/binutils themselves. glibc 2.43 implements ISO C23 const-preserving string macros: strchr/strrchr/strstr/memchr/… now return const char * for a const char * input. gcc-15.2.0 predates this, so libgomp/affinity-fmt.c (char *q = strchr(p+1,'}')) discards const-Werror=discarded-qualifiers → FTBFS.

This is the same C23 wave hitting the whole ecosystem right now (openssl, grub, libevent, criu, …) — a known, documented event, not anything specific to us.

Fix here (interim, surgical): -Wno-error=discarded-qualifiers via CFLAGS_FOR_TARGET (the documented knob for target libs like libgomp) for gcc's own build only. It downgrades exactly that one warning — everything else stays -Werror — and the shipped compiler is byte-identical. The pointer is only used for q - p, never written, so it's source-pedantry, not a runtime bug.

Clean follow-up: bump gcc → 16.1.0, which fixes this upstream and builds against glibc 2.43 with no workaround (LFS pairs them directly). That retires the band-aid; tracked separately as it's a major-version migration.

Refs are also inline in packages/gcc/build.sh.

@bryan-minimal
bryan-minimal marked this pull request as draft June 11, 2026 03:03
@bryan-minimal

Copy link
Copy Markdown
Member Author

🚧 Moved to draft — needs a team decision on the glibc-2.43 C23 wave

Second buildbot run got past gcc but then libxcrypt failed with the identical pattern:

lib/crypt-gost-yescrypt.c:134: error: initialization discards 'const' qualifier ... [-Werror=discarded-qualifiers]
  char *hptr = strchr ((const char *) intbuf->retval + 3, '$');

So this is confirmed fleet-wide, not a gcc one-off (see the previous comment for root cause: glibc 2.43's ISO C23 const-preserving string macros). Patching package-by-package is whack-a-mole, and gcc 16.1.0 would not help — it only fixes gcc's own source, not libxcrypt/openssl/grub/etc.

The systematic fix: one line in the shared make harness

The flags that land after each package's -Werror come from harnesses/make/harness.ncl:

# harnesses/make/harness.ncl:9
CFLAGS = "-O2 -pipe -gno-record-gcc-switches",

Because these are appended last on every compile (confirmed in libxcrypt's command line: … -Werror -fno-plt -march=… -O2 -pipe -gno-record-gcc-switches …), adding the override here downgrades the one warning fleet-wide for every make/autotools package, in a single line:

-    CFLAGS = "-O2 -pipe -gno-record-gcc-switches",
+    CFLAGS = "-O2 -pipe -gno-record-gcc-switches -Wno-error=discarded-qualifiers",

gcc has a custom build.sh, so it's handled separately (the commit already in this PR). A handful of CMake/meson packages have their own harnesses — if any of those break, the same one-line override applies to harnesses/cmake / harnesses/meson.

Why this is safe (but is a band-aid)

  • Downgrades exactly one warning (discarded-qualifiers) error→warning; every other -Werror stays.
  • The flagged code is runtime-safe — it's the old C17 char *q = strchr(const…) pattern where the pointer isn't written; byte-identical output.
  • It does not change the language standard or any ABI.
  • Tech debt: it masks the not-yet-const-correct code rather than fixing it. We unwind it when we adopt C23 properly.

Decision for the team

Option Effect Cost
Global -Wno-error=discarded-qualifiers in harness (proposed) Whole wave gone, glibc 2.43 + CVEs land now Band-aid / tech debt
-std=gnu17 in harness Broader — turns off all C23, not just this warning Bigger hammer; also masks future C23 issues
Per-package const patches (what distros/upstreams do) "Correct" C23-forward Whack-a-mole across N packages
Hold glibc 2.43 Safe, no churn glibc CVEs stay unpatched
Bump gcc → 16.1.0 Fixes gcc only — does NOT address libxcrypt/others Major-version migration, doesn't solve the wave

My recommendation: the global -Wno-error=discarded-qualifiers harness override is the pragmatic way to land glibc 2.43 (and clear the CVEs) now without whack-a-mole, then do the const-correct per-package fixes (or a gcc-16 bump) as deliberate follow-up. But this touches every C build, so it's a deliberate toolchain-policy call — hence draft + this writeup for discussion.

Refs: glibc 2.43 C23 const macros · GCC CFLAGS_FOR_TARGET docs · LFS GCC-16.1.0

bryan-minimal and others added 2 commits June 16, 2026 12:57
…2.43 C23 rebuild

glibc 2.43's ISO C23 const-preserving string macros (strchr/strstr/memchr/...
return `const char *` for const input) cause an ecosystem-wide
-Werror=discarded-qualifiers FTBFS wave. The make stack's shared CFLAGS land
after each package's own -Werror on the compile line, so appending the
downgrade here fixes the whole make/autotools fleet in one place. Interim
until a gcc-16 bump (which fixes it upstream).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bryan-minimal bryan-minimal changed the title Update base-soup: 2 packages glibc 2.42→2.43 + C23-const FTBFS fixes (make stack + gcc) Jun 16, 2026
bryan-minimal and others added 6 commits June 16, 2026 13:00
…ires gcc/build.sh

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…TBFS

libxcrypt has a hand-written build.sh that *assigns* CFLAGS (not the make
stack), so the stacks/make/stack.ncl fleet lever from this PR can't reach it.
Its crypt-{gost,sm3}-yescrypt.c assign const-qualified strchr() results to a
plain char*, tripping libxcrypt's own configure-enabled -Werror under glibc
2.43's ISO C23 const-preserving string macros. Downgrade only that one warning,
appended after -Werror so the later flag wins.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
elfutils hardcodes CFLAGS in its build.sh (bypasses the make stack) and
defaults -Werror on. glibc 2.43's ISO C23 const-preserving bsearch/strchr-family
lookups discard const into plain pointers (libcpu/riscv_disasm.c known_csrs
bsearch), tripping -Werror=discarded-qualifiers. elfutils is notorious for
multiple distinct -Werror trips across toolchain bumps, so use its own
--disable-werror off-switch rather than chase warnings one flag at a time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…disable-werror unrecognized)

elfutils' configure has no --disable-werror in this version (it warned
'unrecognized options: --disable-werror' and kept -Werror on, so the C23
discarded-qualifiers trip in libcpu/riscv_disasm.c persisted). Use the same
surgical CFLAGS flag as libxcrypt instead: automake emits $(AM_CFLAGS)
$(CFLAGS), and elfutils' -Werror lives in AM_CFLAGS, so a -Wno-error in CFLAGS
lands after it on the compile line and wins. The whole libelf tree compiled
clean before the single trip, so the one warning is the only break.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
strace hardcodes CFLAGS in build.sh (bypasses make stack) and self-enables
-Werror. glibc 2.43's ISO C23 const-preserving bsearch returns const for a
const arg; src/ioctl.c assigns it to a plain pointer (iop = bsearch(...,
ioctlent, ...)). Downgrade only that warning, appended after strace's -Werror
on the compile line so the later flag wins. Same glibc-2.43 C23 class as #238.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…reads collision

or-tools FetchContent's SCIP v10.0.0, which bundles tinycthread (a C11
<threads.h> shim doing `#define once_flag pthread_once_t`). glibc 2.43 surfaces
its native once_flag/call_once into SCIP's TU, so that macro corrupts glibc's
`typedef __once_flag once_flag;` into a pthread_once_t redefinition -> hard
"conflicting types" FTBFS (not the -Werror class; -Wno-error can't help).

or-tools 9.15 is already the latest release and pins current SCIP, so no version
bump escapes it. or-tools hard-FORCEs SCIP TPI=tny in its bundled cmake, so a
-DTPI=... is overridden. sed the forced TPI to omp before cmake: SCIP uses its
OpenMP task interface (no tinycthread), staying parallel + THREADSAFE (SCIP
auto-forces THREADSAFE on for non-none TPI). libgomp is present from gcc. A grep
guard fails the build loudly if upstream renames the line. Leaf package (nothing
depends on it) but in the glibc closure, so it must build. glibc-2.43 class, #238.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal marked this pull request as ready for review June 17, 2026 15:04

@msample msample left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bryan-minimal
bryan-minimal added this pull request to the merge queue Jun 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jun 17, 2026
@bryan-minimal
bryan-minimal added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit 724c7ad Jun 18, 2026
4 checks passed
@bryan-minimal
bryan-minimal deleted the update-base-soup-2026-06-11 branch June 18, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants