Skip to content

Commit b6d25f8

Browse files
committed
fix(manifest): GCC 15 cross-link — anchor member instantiations in the types module
GCC 15 (aarch64-linux-musl cross) does not emit implicit std::map/... member instantiations of module-attached structs in importer objects; the old single-file mcpp.manifest provided them by accident (its parser code constructed every struct). A non-inline exported force_template_instantiations() in mcpp.manifest.types recreates that guarantee deliberately. Remove when the cross toolchain floor is GCC 16. Verified locally: mcpp build --target aarch64-linux-musl with the same xim gcc 15.1.0 toolchain links (static aarch64 ELF produced); native build + full unit suite green.
1 parent f23eaf3 commit b6d25f8

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

src/manifest/types.cppm

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,10 @@ std::filesystem::path resolve_lib_root_path(const Manifest& manifest);
399399
// Lib-root convention only applies when this returns true.
400400
bool has_lib_target(const Manifest& manifest);
401401

402+
403+
// GCC 15 cross-link workaround anchor — see definition below.
404+
void force_template_instantiations();
405+
402406
} // namespace mcpp::manifest
403407

404408
// ── helpers shared by the toml and xpkg parsers (exported: separate
@@ -511,4 +515,30 @@ std::filesystem::path resolve_lib_root_path(const Manifest& manifest) {
511515
}
512516

513517

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

0 commit comments

Comments
 (0)