Skip to content

[CANARY — DO NOT MERGE] gcc 15.2.0 → 16.2.0 world build (pm#1182) - #1340

Draft
bryan-minimal wants to merge 32 commits into
mainfrom
canary/gcc-16.2
Draft

bryan-minimal wants to merge 32 commits into
mainfrom
canary/gcc-16.2

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Caution

CANARY. DO NOT MERGE, DO NOT APPROVE, NEVER ADD TO THE MERGE QUEUE.
This PR exists only so build-bot runs a full world build with gcc 16.2.0 as the default compiler. It is a draft on purpose and will be closed once the FTBFS list is collected. The real flip will be a separate, human-authored PR queued alone.

Update 2026-11-14: gcc-runtime merged in (gominimal/inbox#1261)

Bryan's plan: develop the gcc-runtime split stacked, take one combined world-build signal from this canary, then land gcc-runtime as separate commits inside the real gcc 16 PR, so the world rebuild is paid once. Branch gcc-runtime is merged into this canary (merged, not rebased, so there's no force push). This also brings pkgs main up to ca566dc.

The merge adds:

  • packages/gcc-runtime: gcc's shared runtime libraries (libgcc_s, libstdc++, libgomp, libatomic, amd64 libquadmath), repacked byte for byte from gcc under gcc's output names, with runtime_deps [glibc] and its own prebuilt breaker on the same gen-13 objects as gcc's.
  • packages/gcc-runtime-fortran: libgfortran, for openblas only.
  • 138 subsetOf gcc [...] runtime deps moved to subsetOf gcc-runtime [...], gmp, ncurses and binutils included. Seven whole-gcc runtime deps moved to library subsets; kani and verus-latest moved to toolchain.
  • .github/scripts/gcc_runtime_guard.py: rejects a runtime gcc subset, a whole gcc (toolchain excepted), or a whole gcc-runtime, and requires gcc-runtime's breaker pins to equal gcc's.

Why: a subset fetches the parent's whole artifact and inherits its runtime_deps. So every libgcc consumer downloaded all of gcc (anvil amd64: 341.6 MiB unpacked / 116 MiB zstd) for libraries now about 4 MiB.

What to look at in this run, beyond the gcc 16 FTBFS list:

  1. FTBFS or load failures that point at gcc-runtime rather than gcc 16, for example a missing DT_NEEDED library. The # TODO(readelf) edges are chromium-headless-shell-bin, openblas and stlink.
  2. Collision WARNs on libstdc++.so.6 / libgcc_s.so.1. Layers link first-wins in cache-path order, so a root holding real gcc 16 and the 15.2-object gcc-runtime breaker could load 15.2's libstdc++ (missing GLIBCXX versions). Any hit should be listed. See gominimal/inbox#1226.
  3. The bootstrap cycle (gcc → glibc → python → ncurses → gcc-runtime → gcc) resolved in a no-cache world plan on anvil. This run is its first build.

Purpose

Step 4 of gominimal/pkgmgr-rs#1182: collect the complete list of packages that fail to build (FTBFS) when the default compiler packages/gcc moves from 15.2.0 to 16.2.0. gcc is in every package's reverse import closure (616/616), so this PR rebuilds the whole world.

What changed

Only packages/gcc/:

  • build.ncl
    • version is now 16.2.0.
    • The source URL is https://mirrors.kernel.org/gnu/gcc/gcc-16.2.0/gcc-16.2.0.tar.xz, sha256 e6738e29597f733270731aa90600f37ffdc045079dfc27ec7e8192cc81085c3e.
  • build.sh
    • The gcc-16.2.0 directory names replace the hardcoded gcc-15.2.0.
    • The libgomp -Wno-error=discarded-qualifiers hatch is dropped (the CFLAGS/CXXFLAGS/*_FOR_TARGET exports and their comment). libgomp/affinity-fmt.c:330 is already const char *q in 16.2.0.
  • Unchanged:
    • The replace_on_cycle seeds (gcc-15.2.0) stay as they are. gcc 16 is compiled once by the 15.2 seed, and gcc 16 needs only a C++14 host.
    • Every configure flag the recipe passes still exists in 16.2.0.
    • The lib64 sed targets in t-linux64 / t-aarch64-linux are still present.

Source verification: the tarball's sha256 is identical from ftp.gnu.org and mirrors.kernel.org. Its gcc-16.2.0.tar.xz.sig verifies against GCC release key 13975A70E63C361C73AE69EF6EEB81F8981C74C7 (Richard Biener) from gnu-keyring.gpg.

  • That key has a DSA1024 primary and SHA-1 binding signatures. Current sq therefore only authenticates it with --policy-as-of 2014-01-01.
  • The signature is genuine, but under today's policy the key is weak. That is worth knowing if data/signing_policies.toml ever covers gcc.

⚠ Mirroring needed before any real flip. Every other gcc source lives at gs://minimal-staging-archives/gcc-%{version}.tar.xz. This canary points at upstream because the tarball could not be uploaded from here. The flip PR must mirror it first and restore the gs:// URL.

Deliberately left alone (track for the flip)

  • stacks/make/stack.ncl still applies -Wno-error=discarded-qualifiers fleet-wide. It is documented as durable because it is about glibc 2.43+ headers, not gcc.
  • The per-package copies of the same flag are also untouched: elfutils, libxcrypt, strace, virtio-linux-detonation (HOSTCFLAGS). This canary should show whether any of them are still needed. A copy is not proven removable just because it still builds with it in place.
  • The known breakers are not pre-fixed, so the canary measures them as they are:

Local sanity build: not done

I couldn't run a local min package build gcc first, so gcc 16.2.0 itself is unproven until this run. Activating a pkgbuild session on this worktree means rebuilding base's closure, because gcc changed. That rebuild needs the bedrock prebuilt seeds (gcc (prebuilt), zlib (prebuilt)) from gs://minimal-staging-archives. minvmd 0.7.3-rc1's node-plane egress baseline drops those connections (dropped a node-plane frame ... toward an address no baseline entry pinned), so session spawn failed with cannot connect to endpoint on storage.googleapis.com.

If the bot fails on gcc itself, it fails early and cheaply, and I'll fix it on this branch.

How results will be triaged

  1. Read the per-package failures from the build-bot run for this head sha and bucket them by the classes in pm#1182:
    • the C++ default moving gnu++17 → gnu++20 (char8_t, keywords, removed allocator members, operator!=)
    • missing transitive includes
    • new -Werror warnings
    • the autoconf AC_PROG_CXX downgrade probe
    • linker (-lgcc_s_asneeded)
    • kernel gcc-plugins
    • ICE / other
  2. Separate real gcc-16 failures from flakes and infra errors (artifact_fetch, timeouts, NAT) by re-checking any failure that has no compiler error.
  3. File the list on pm#1182. Each fix lands as its own small PR against main, using a gcc-16-compatible change (a source patch, a version bump, or a narrowly scoped -Wno-error= / -std= pin) that also builds under 15.2.
  4. Close this PR. The flip PR comes after the fixes land and is queued alone.

FTBFS log (running)

The bot stops an arch's whole run at the first failed package (the minimal orchestrator aborts on the first error and has no keep-going mode), so failures surface one per run. Each fix is one commit on this branch, so it can be cherry-picked into its own PR.

package arch error class fix commit
gcc-arm-none-eabi amd64 gnu++20 char8_t: libcody u8"" into std::string (gcc 14.2.0 source) bump to gcc 16.2.0 (same tarball as packages/gcc) + newlib 4.6.0.20260123 696e1a8
cbmc (pre-emptive, pm#1182) both gcc 16 -Wsfinae-incomplete / -Wunused-but-set-variable / -Warray-bounds under -Werror backport diffblue/cbmc#9024 (merged after 6.11.0, which Kani pins) fd8e41e

🤖 Generated with Claude Code

World-build canary to collect the gcc 16 FTBFS list.

- version 16.2.0; source from mirrors.kernel.org (not yet mirrored to
  gs://minimal-staging-archives). sha256 e6738e29... matches the
  ftp.gnu.org tarball whose .sig verifies against Richard Biener's key
  13975A70E63C361C73AE69EF6EEB81F8981C74C7 from the GNU keyring.
- build.sh: gcc-16.2.0 dir names; drop the libgomp
  -Wno-error=discarded-qualifiers hatch (affinity-fmt.c:330 is
  `const char *q` in 16.2.0).
- replace_on_cycle seeds unchanged (gcc 15.2.0 compiles gcc 16 once).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

bryan-minimal and others added 2 commits November 5, 2026 13:57
…6 FTBFS)

gcc 14.2.0's libcody does `words.emplace_back (u8"")`, which no longer
compiles once the host compiler defaults to C++20 (u8"" is
const char8_t[]). gcc 16.2.0's libcody casts it, so move the cross
compiler to the same gcc release as the native one (latest-version
policy) instead of pinning -std=gnu++17.

- gcc 16.2.0: same tarball/sha256 as packages/gcc (e6738e29..., .sig
  verified against 13975A70E63C361C73AE69EF6EEB81F8981C74C7).
- newlib 4.6.0.20260123: sha256 6ff27e3b...; its sha512 matches
  sourceware.org/pub/newlib/sha512.sum (newlib publishes no signature).
- t-rmprofile is unchanged between 14.2.0 and 16.2.0 except the
  copyright year, so the multilib sed still applies; every newlib
  configure option the recipe passes still exists in 4.6.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gcc 16 adds -Wsfinae-incomplete and new -Wunused-but-set-variable /
-Warray-bounds diagnostics that cbmc 6.11.0's -Werror build promotes to
errors. Upstream fixed them in #9024 (merge 4b26409c, 2026-10-02), after
6.11.0, which is still the latest release and what Kani 0.68.0 pins, so
carry that PR as a patch until the next release. It applies cleanly to
the 6.11.0 tag (git apply --check) and is behaviour-neutral (warning-path
cleanups and a dead counter), so it also builds under gcc 15.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bryan-minimal and others added 25 commits November 14, 2026 15:13
Repack libgcc_s, libstdc++, libgomp, libatomic, libgfortran and (amd64)
libquadmath from the gcc build dep, byte for byte, under gcc's output
names, with runtime_deps [glibc]. A subsetOf gcc dep fetches the whole
compiler and its runtime_deps; this does not. Own replace_on_cycle on the
gen-13 gcc objects. Consumers are not migrated yet (gominimal/inbox#1261).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every other package record ends `} | BuildSpec`. Without it the record
has no `ty = 'Builder`, so `subsetOf gcc-runtime [...]` fails minimal's
Subsettable contract ("Expected Input type").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A subset fetches the parent's whole build artifact and pulls in its
runtime_deps, so `subsetOf gcc ["libgcc"]` cost every consumer the whole
compiler plus gmp, mpc, mpfr, zlib and zstd.

- All 138 `subsetOf gcc` runtime sites (137 build.ncl files plus
  llvm/versioned.ncl, including boost's multi-line arch-match form) now
  take `subsetOf gcc-runtime` with the same outputs. That includes gmp,
  ncurses and binutils, which sit under base, coreutils and bash. The gcc
  import is dropped where nothing else uses it (123 files) and kept where
  build_deps or test_deps still do (15).
- openblas: `libs` -> ["libgcc", "libgfortran"] plus libquadmath on amd64.
  stlink: `libs` -> ["libgcc"]. Both are marked TODO(readelf).
- Whole-gcc runtime deps that only need the libraries:
  chromium-headless-shell-bin, helix, hex-patch, nushell, uv and zellij
  -> ["libgcc"], z3 -> ["libgcc", "libstdcpp"]. chromium is marked
  TODO(readelf both arches).
- kani and verus-latest run the compiler, so their runtime gcc + binutils
  become `toolchain`, which both already import for build_deps. Their
  redundant gcc subset line is dropped.

No `subsetOf gcc` remained in any build_deps, test_deps or
replace_on_cycle block, so none was left behind. gcc, toolchain and
gcc-arm-none-eabi are untouched. Each changed file is `nickel format`
clean and evaluates on amd64 and arm64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This guard is blocking. It reads every .ncl under packages/ and fails on
`subsetOf gcc` in any form, or on a whole `gcc`, inside a runtime_deps
field. Breaker runtime_deps are included. The `gcc` it means is whatever
identifier binds gcc/build.ncl, so a renamed binding or an inline import
is still caught. Comments and strings are ignored, and gcc-runtime and
gcc-arm-none-eabi don't match.

Only `toolchain` may take whole gcc. The allowlist fails on a stale
entry. Exit 2 (UNVERIFIED) means the tree is missing, or too few
runtime_deps fields were parsed to trust the result.

The unit tests include negative controls: every rejected form must be
caught. Mutating the guard (its matcher, comment stripping, or the
stale-entry check) turns them red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The subsets section said subsets exist "to avoid any user of a package
needing to download a whole gcc". That is false. The client fetches the
parent's whole artifact and cuts the subset out locally, and the closure
takes in the parent's runtime_deps. The section now says so, and points
to gcc-runtime and its guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
libgfortran.so.5 is 8.35 MB, 64% of gcc-runtime (anvil, amd64), and only
openblas (and numpy through it) loads it. A package is fetched whole, so
every C/C++/Rust closure would download it for nothing. gcc-runtime-fortran
repacks it from gcc and takes subsetOf gcc-runtime ["libgcc"] (+ libquadmath
on amd64, which boost also uses, so it stays in gcc-runtime). openblas takes
gcc-runtime ["libgcc"] and gcc-runtime-fortran ["libgfortran"]. Bryan
approved the split (inbox#1261).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…annot fail

Review on inbox#1261 (minimalboarding):
- gcc-runtime's replace_on_cycle repacks the same gominimal/bootstrap objects
  as gcc's. Two copies drift on the next repin, leaving an older gcc's
  libstdc++ in roots beside the real gcc's. gcc_runtime_guard.py now fails
  when the two breakers' (url, sha256) pins differ or can't be read
  (3 tests; a one-character drift on the real tree fails).
- cxx_exception_unwinds had gcc in test_deps, so gcc's own libstdc++ and
  libgcc_s answered it and it passed with gcc-runtime empty. Dropped;
  loads_without_gcc (bash-bootstrap only) is the test that proves the package.
- Comments: output names (not globs) match gcc's; why the breaker has no
  runtime_deps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bryan's plan: develop gcc-runtime stacked, get one combined world-build
signal from this canary, then land gcc-runtime as separate commits inside the
real gcc 16 PR so the world rebuild is paid once. Merged, not rebased, to keep
the canary's history without a force push. Brings pkgs main up to ca566dc
and the gcc-runtime branch at d3ceedc (gcc-runtime, gcc-runtime-fortran, 138
consumers moved, gcc_runtime_guard.py, AGENTS.md). Clean merge; the guard
passes and gcc, gcc-runtime(-fortran), openblas, gmp, ncurses, binutils,
zellij and cbmc evaluate on both arches (local nickel).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From minimalboarding's read of minimal main 9396210bb (inbox#1261):
- A pure prebuilt is extracted straight into its cache entry; output globs
  are not applied (crates/op/src/specs.rs materialize_prebuilt). So on a
  cycle edge gcc-runtime (prebuilt) is the whole gen-13 gcc tree, compiler
  included. A subset cuts only its globs (subsets.rs), but a whole
  gcc-runtime dep would link all of gcc 15.2 into that root. The guard now
  rejects a bare gcc-runtime in runtime_deps (whole-gcc-runtime rule, with a
  violation case and a multi-line subset clean case).
- subsets.rs unwraps the requested output, so asking the breaker for an
  output it does not declare panics. It now declares libquadmath on amd64,
  matching the real spec (the amd64 object ships it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 16 canary

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Published llvm 23.1.5 (amd64, pkgs ca566dc): libLLVM.so.23.1, lld and
llvm-config NEED libzstd.so.1, but llvm never declared zstd. It arrived only
because `subsetOf gcc` inherits gcc's runtime_deps (gmp, mpc, mpfr, zlib, zstd).
gcc-runtime does not, so after the migration clang, lld, rustc and anything
loading libLLVM would fail in a closure without zstd. Found by minimalboarding
from the artifact's ELF dynamic section. llvm/versioned.ncl (llvm-21/22/23)
gets the same dep. A fleet-wide audit of the same class is running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same class as llvm (inbox#1261), from minimalboarding's DT_NEEDED audit of the
ca566dc amd64 artifacts against the branch closures:
- python: lib-dynload/_zstd NEEDs libzstd.so.1. It arrived via bash ->
  ncurses -> subsetOf gcc -> gcc's runtime_deps; with ncurses on gcc-runtime,
  `import compression.zstd` would fail. zstd is already on the gcc bootstrap
  cycle (gcc depends on it; it has a prebuilt breaker).
- llvm-bootstrap: clang-21 and its tools NEED libzstd.so.1.
Build-closure tools audited clean: gawk(-bootstrap), coreutils, perl, cmake,
binutils, rust, rustc-1.98.1, make, tar, grep, sed, bash, ninja, meson,
pkgconf, toolchain, glibc and others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…16 canary

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
minimalboarding's DT_NEEDED audit of all 145 migrated packages (amd64,
ca566dc artifacts) found five more binaries that load a library their recipe
never declared, hidden by subsetOf gcc inheriting gcc's runtime_deps:
- usr/bin/lsd, usr/bin/tuicr, usr/bin/teamtype, usr/bin/nu: libz.so.1
- mesa usr/lib/libgallium-26.3.0.so: libzstd.so.1
These are latent bugs on main too; the declared dep is correct either way.
The other 137 audited packages are clean on the eight gcc-inherited sonames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…: zstd

Second audit pass (indirect gcc consumers, amd64 ca566dc artifacts):
- usr/bin/cabal NEEDs libz.so.1; it came via gmp -> subsetOf gcc. cabal is in
  the build closure of every Haskell package.
- gcc-arm-none-eabi's cc1/lto1/lto-dump NEED libgmp, libmpfr, libmpc and
  libzstd; a compiler that never declared a compiler's deps. They came via
  bash -> ncurses -> subsetOf gcc. zlib still comes through binutils-arm-none-eabi.
- mariadb usr/lib/plugin/zstd.so NEEDs libzstd.so.1 (optional plugin).
Latent on main as well (inbox#1261).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cc 16 canary

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
usr/bin/stack NEEDs libz.so.1; it came only through gmp -> subsetOf gcc,
like cabal. Last hit of minimalboarding's two-pass DT_NEEDED audit (301
packages with a published amd64 artifact; 12 recipes needed a declaration,
plus mariadb's optional plugin; 287 clean). inbox#1261.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gcc 16's libstdc++ no longer pulls <cstdint> in transitively, so
bindings/c c_workloads failed with "'uint64_t' does not name a type" on
both arches (canary run 2b69a34d). Fail closed if the include is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The import-line checker failed it in the lab run at 126686e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 34ab070b)

- libvpx, maki, hex-patch take libstdcpp; gn, ninja take libgcc. Each loaded
  the library it did not declare: subsetOf gcc fetched the whole compiler and
  hid the gap, gcc-runtime ships only the declared outputs.
- gcc-runtime ships libssp (stlink's binaries and libstlink NEED libssp.so.0).
- boost declares openssl (libboost_cobalt_io_ssl NEEDs libssl/libcrypto.so.4).
- import lines: canonical order for chromium-headless-shell-bin, nushell,
  hex-patch; kani and verus-latest no longer import an unused subsetOf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gcc 16 defaults to gnu++20, so abseil pinned ABSL_OPTION_USE_STD_ORDERING 1
into the installed options.h and -std=c++17 consumers failed on
std::partial_ordering (canary run 34ab070b). Pin C++17 (what gcc 15 built)
and fail closed unless options.h pins ORDERING 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bryan-minimal and others added 4 commits November 15, 2026 01:07
Run 7e4acbc4 built gcc-runtime twice (breaker pass, then real) and the
{libgcc, libstdcpp} subset stayed pinned to the gcc 15 breaker-pass repack
(minimal orchestrator state.rs:396-426, per minimalboarding), so
mathlib-oleans loaded a libstdc++ without GLIBCXX_3.4.35. With the real
gcc-runtime cached, this run should cut every subset from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gcc-runtime's build root also holds its own cycle breaker (a bootstrap
gcc, via gcc -> gmp -> gcc-runtime), and first-wins by spec-hash order
picks between the two gccs' usr/lib files. On arm64 the gcc 16 canary
(pkgs#1340 run 7e4acbc4) shipped the gen-13 gcc 15 libstdc++.so.6 and
libgcc_s.so.1, and lean failed on GLIBCXX_3.4.35.

- gcc stages its shared runtime libraries again under
  usr/lib/gcc-runtime-stage, a path no bootstrap object ships.
- gcc-runtime and gcc-runtime-fortran copy from there (stage.sh). With no
  stage, gcc is the breaker (first pass of the cycle) and they copy
  usr/lib as before.
- Either way each versioned library must have exactly one real file and
  its SONAME must link to it, so mixed gccs fail the build.
- The guard keeps the two stage.sh copies byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d168779c)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant