Skip to content

Commit 2685186

Browse files
committed
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.
1 parent 9628b35 commit 2685186

3 files changed

Lines changed: 5 additions & 36 deletions

File tree

mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ windows = "llvm@20.1.7"
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)