glibc 2.42→2.43 + C23-const FTBFS fixes (make stack + gcc) - #238
Conversation
📝 WalkthroughWalkthroughBumps glibc from version 2.42 to 2.43 with an updated sha256, then applies compatibility fixes across the build system: Changesglibc 2.43 upgrade and downstream compatibility fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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>
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: 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): 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 |
🚧 Moved to draft — needs a team decision on the glibc-2.43 C23 waveSecond buildbot run got past gcc but then libxcrypt failed with the identical pattern: 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 harnessThe flags that land after each package's # 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: - CFLAGS = "-O2 -pipe -gno-record-gcc-switches",
+ CFLAGS = "-O2 -pipe -gno-record-gcc-switches -Wno-error=discarded-qualifiers",gcc has a custom Why this is safe (but is a band-aid)
Decision for the team
My recommendation: the global Refs: glibc 2.43 C23 const macros · GCC CFLAGS_FOR_TARGET docs · LFS GCC-16.1.0 |
…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>
…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>
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 returnconst char *for aconst char *argument. Pre-C23 code assigning the result to a plainchar *trips-Werror=discarded-qualifiersand FTBFS. This is an ecosystem-wide wave, and our fleet hits it in two distinct shapes:1. The make-stack lever —
stacks/make/stack.nclappends-Wno-error=discarded-qualifiersto the shared make-stack CFLAGS; it lands after a package's own-Werror(later flag wins), downgrading that one warning.2. Per-package
build.shfixes — for the hand-written-build.shpackages that also self-enable-Werror(their-Werrorlives in upstream configure, invisible to a grep), the same-Wno-error=discarded-qualifiersgoes into each package's own CFLAGS. It lands after their-Werroron 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 nativeonce_flag/call_onceinto SCIP's translation unit, so that macro corrupts glibc'stypedef __once_flag once_flag;into apthread_once_tredefinition → "conflicting types".-Wno-errorcan't fix a hard error. or-tools 9.15 is already the latest release and hard-FORCEs SCIPTPI=tnyin its bundled cmake (so a-DTPI=...is overridden), so we sed that toTPI=ompbefore cmake — SCIP uses its OpenMP task interface instead of tinycthread, staying parallel + THREADSAFE (libgomp is present from our gcc build). Agrepguard fails the build loudly if upstream renames the line.Changes
packages/glibc/build.nclstacks/make/stack.ncl-Wno-error=discarded-qualifierspackages/gcc/build.shCFLAGS_FOR_TARGET(libgomp)packages/libxcrypt/build.sh-Wno-error=discarded-qualifiersin CFLAGS (crypt-{gost,sm3}-yescrypt.c)packages/elfutils/build.sh-Wno-error=discarded-qualifiersin CFLAGS (libcpu/riscv_disasm.c)packages/strace/build.sh-Wno-error=discarded-qualifiersin CFLAGS (src/ioctl.c)packages/or-tools/build.shTPItny → omp (drop tinycthread)For the reviewer (parked / notable)
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.-Wno-error=discarded-qualifiers(downgrade the one warning, used here) vs-std=gnu17(restores C17 prototypes sostrchrreturnschar *— no warning at all, but a broader language-standard change). This PR takes the surgical-Wno-errorroute; the-std=gnu17switch can replace all of these levers later if the team prefers it.TPI=omptradeoff: 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 isTPI=none(single-threaded SCIP).--disable-werrorin 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-errorvs-std=gnu17direction before merge.🤖 Generated with Claude Code