Skip to content

Commit a4cdae0

Browse files
authored
fix(build): all musl paths on gcc 16.1.0 — delete the GCC-15 instantiation anchor (A2 complete) (#204)
* fix(build): musl toolchains -> gcc 16.1.0; DELETE the GCC-15 instantiation anchor (A2 complete) musl-gcc 16.1.0 shipped (stripped, dual-arch, GitHub+GitCode; xim entry openxlings/xim-pkgindex#345, gated by the consumer smoke). With every musl path on GCC 16 — native x86_64 (release static build), native aarch64, and cross — the force_template_instantiations() anchor loses its last consumer and is deleted. This commit is the regression test: if any floor didn't take, the musl/cross links go red. * ci: musl toolchain references 15.1.0 -> 16.1.0 (assertions + installs) The anchor-removal build actually succeeded (Resolved gcc@16.1.0-musl); the red came from ci-linux's hardcoded 'Resolved gcc@15.1.0-musl' assertion. Update every musl 15.1.0 reference across workflows.
1 parent 9628b35 commit a4cdae0

6 files changed

Lines changed: 13 additions & 44 deletions

File tree

.github/workflows/ci-fresh-install.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ concurrency:
3333

3434
jobs:
3535
# ──────────────────────────────────────────────────────────────────
36-
# Linux: gcc@16.1.0, musl-gcc@15.1.0, llvm@20.1.7
36+
# Linux: gcc@16.1.0, musl-gcc@16.1.0, llvm@20.1.7
3737
# ──────────────────────────────────────────────────────────────────
3838
# A4: post-release runs race the xim-pkgindex bump (a PR a maintainer
3939
# merges asynchronously) — the 0.0.85 fresh-install failed with
@@ -120,16 +120,16 @@ jobs:
120120
121121
- name: "musl-gcc: mcpp new → run"
122122
run: |
123-
mcpp toolchain install gcc 15.1.0-musl
124-
mcpp toolchain default gcc@15.1.0-musl
123+
mcpp toolchain install gcc 16.1.0-musl
124+
mcpp toolchain default gcc@16.1.0-musl
125125
cd "$(mktemp -d)"
126126
mcpp new hello_musl
127127
cd hello_musl
128128
mcpp run
129129
130130
- name: "musl-gcc: build mcpp"
131131
run: |
132-
mcpp toolchain default gcc@15.1.0-musl
132+
mcpp toolchain default gcc@16.1.0-musl
133133
mcpp clean
134134
mcpp run
135135

.github/workflows/ci-linux-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
# deterministic GNU answer instead of an auto-install pick.
116116
"$MCPP" toolchain default gcc@16.1.0
117117
# Warm musl once so fresh-home e2e tests inherit the payload.
118-
"$MCPP" toolchain install gcc 15.1.0-musl
118+
"$MCPP" toolchain install gcc 16.1.0-musl
119119
bash tests/e2e/run_all.sh
120120
121121
# ──────────────────────────────────────────────────────────────────

.github/workflows/ci-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
# longer relies on e2e's toolchain warm-ups: the GCC build uses the
122122
# mcpp.toml-pinned default (gcc@16.1.0, already in the sandbox from the
123123
# self-host build above), and the musl `--target` build auto-installs
124-
# gcc@15.1.0-musl on demand (cached across runs).
124+
# gcc@16.1.0-musl on demand (cached across runs).
125125

126126
- name: Save freshly-built mcpp for toolchain tests
127127
run: |
@@ -138,7 +138,7 @@ jobs:
138138
- name: "Toolchain: musl-gcc — build mcpp (--target)"
139139
run: |
140140
"$MCPP" clean
141-
"$MCPP" build --target x86_64-linux-musl 2>&1 | tee build.log; grep -q "Resolved gcc@15.1.0-musl" build.log
141+
"$MCPP" build --target x86_64-linux-musl 2>&1 | tee build.log; grep -q "Resolved gcc@16.1.0-musl" build.log
142142
143143
- name: "Toolchain: LLVM — build mcpp"
144144
run: |

mcpp.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ macos = "llvm@22.1.8"
2222
windows = "llvm@20.1.7"
2323

2424
# Per-target overrides: `mcpp build --target x86_64-linux-musl` (or the
25-
# four-segment form `x86_64-unknown-linux-musl`) picks musl-gcc 15.1 + full
25+
# four-segment form `x86_64-unknown-linux-musl`) picks musl-gcc 16.1 + full
2626
# static linkage. Used by .github/workflows/release.yml to produce a
2727
# portable static binary that drops in anywhere with no ELF interp / RUNPATH
2828
# baggage.
2929
[target.x86_64-linux-musl]
30-
toolchain = "gcc@15.1.0-musl"
30+
toolchain = "gcc@16.1.0-musl"
3131
linkage = "static"
3232

3333
# aarch64 (ARM64) static target. No explicit toolchain: mcpp's host-aware

src/build/prepare.cppm

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -636,11 +636,9 @@ prepare_build(bool print_fingerprint,
636636
// - target arch != host arch → CROSS build, use the target-named
637637
// cross toolchain `<triple>-gcc@15.1.0` (→ xim:<triple>-gcc),
638638
// e.g. building aarch64 on an x86_64 host.
639-
// Versions: CROSS uses 16.1.0 (packaged 2026-07-08; GCC 15 drops
640-
// module template instantiations at link — remediation doc A2).
641-
// NATIVE musl stays 15.1.0 until xim ships an x86_64 musl gcc 16
642-
// (R5b); the manifest:types instantiation anchor covers it until
643-
// then.
639+
// Both native and cross musl default to gcc 16.1.0 — GCC 15 drops
640+
// module template instantiations at link (remediation doc A2;
641+
// packages shipped 2026-07-08/09, stripped, GitHub+GitCode).
644642
if (endswith(overrides.target_triple, "-musl")
645643
&& (it == m->targetOverrides.end() || it->second.toolchain.empty()))
646644
{
@@ -649,7 +647,7 @@ prepare_build(bool print_fingerprint,
649647
? overrides.target_triple
650648
: overrides.target_triple.substr(0, dash);
651649
if (targetArch.empty() || targetArch == mcpp::platform::host_arch)
652-
tcSpec = "gcc@15.1.0-musl"; // native
650+
tcSpec = "gcc@16.1.0-musl"; // native
653651
else
654652
tcSpec = overrides.target_triple + "-gcc@16.1.0"; // cross
655653
}

src/manifest/types.cppm

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,6 @@ std::filesystem::path resolve_lib_root_path(const Manifest& manifest);
400400
bool has_lib_target(const Manifest& manifest);
401401

402402

403-
// GCC 15 cross-link workaround anchor — see definition below.
404-
void force_template_instantiations();
405403

406404
} // namespace mcpp::manifest
407405

@@ -516,32 +514,5 @@ std::filesystem::path resolve_lib_root_path(const Manifest& manifest) {
516514

517515

518516

519-
// ── GCC 15 cross-link workaround ────────────────────────────────────
520-
// GCC 15 does not emit
521-
// (cross is on gcc 16 since 2026-07-08; this anchor stays for the
522-
// x86_64-linux-musl NATIVE release build, still on musl-gcc 15.1.0 —
523-
// remove when xim ships an x86_64 musl gcc 16, remediation doc R5b)
524-
// implicit template instantiations for std::map/... members of
525-
// module-attached structs in IMPORTER object files — it expects the
526-
// owning module to provide them. The old single-file mcpp.manifest
527-
// emitted them by accident (its parser code constructed every struct);
528-
// this non-inline, exported definition recreates that guarantee
529-
// deliberately. Remove once the cross toolchain floor is GCC 16.
530-
void force_template_instantiations() {
531-
Manifest m;
532-
WorkspaceConfig w;
533-
XlingsConfig x;
534-
Modules mo;
535-
BuildConfig bc;
536-
RuntimeConfig rc;
537-
TargetEntry te;
538-
ConditionalConfig cc;
539-
LibConfig lc;
540-
PackConfig pc;
541-
Profile pr;
542-
Toolchain tc;
543-
(void)m; (void)w; (void)x; (void)mo; (void)bc; (void)rc;
544-
(void)te; (void)cc; (void)lc; (void)pc; (void)pr; (void)tc;
545-
}
546517

547518
} // namespace mcpp::manifest

0 commit comments

Comments
 (0)