Skip to content

2026.10.5.2: shared-library link lines, native MSVC LTO and export discovery, std.compat on every Default row - #774

Merged
Sunrisepeak merged 2 commits into
mainfrom
release/2026.10.5.2
Oct 5, 2026
Merged

Sunrisepeak merged 2 commits into
mainfrom
release/2026.10.5.2

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

This pull request releases 2026.10.5.2. It closes #771 and #770 and the follow-ups of #768, fixes the Windows quoting of an argument that ends in a backslash, and makes a workspace's [profile.*] and its own package behave as members do. The design record is .agents/docs/2026-10-05-std-module-pair-msvc-lto-and-export-discovery-design.md (revision 6 records where the implementation departs from the reviewed revision 5). The measurements behind it are in the job summaries of the probe pull request #772.

Item Change
D7 #771 A shared library that is not the root's links with the graph's flags (graphLdflags: the profile's ldflags, the ABI words) and the ldflags of the packages its owner reaches, in every plan. One helper builds that link group; member programs and artifact programs start from the same graph flags. The root package's private ldflags no longer reach a dependency's image; when they hold a search path or a library and the plan has a dependency's shared library, the build notes it (link/root-flags).
D8 quote_windows doubles the backslashes before a quote and at the end of an argument (the CommandLineToArgvW rules). WindowsSdkDir is read without its trailing separator. In a developer environment the llvm row's import std failed before.
D3 The COFF reader reads /bigobj objects (56-byte header, 32-bit counts, 20-byte symbols) and names /GL objects, import objects and unknown anonymous objects by their version and class GUID (measured headers).
D4/D9 lto = true on cl.exe: /GL, /LTCG on links, lib /LTCG; the summary says + lto only for what is applied.
D5 windows_auto_export keeps whether it was stated. Under cl.exe LTO, an omitted key compiles the packages linked into the DLL with /GL- and reports it once; a stated true, and /GL written into those packages' flags, are refused with the new code lto-export-discovery.
D6 mcpp pack builds the packed static libraries without LTO intermediate code (-fno-lto / /GL-).
D1/D2 Toolchain::set_std_modules / clear_std_modules are the only writers of the std / std.compat pair. std.compat is built only when a unit imports it, is provided on the GCC row (bits/std.compat.cc), and an import of it from a library without one is refused before any compile. One helper decides the .ixx source language for both std builders.
D10 [profile.<name>] is a root-position key inherited by name; a workspace root with [package] gives its own package [workspace.package] and [workspace.build] once.
D11 / O6 Glob.EscapedSpellingIsUtf8WhateverTheName no longer builds a Windows path from bytes only code page 1252 converts. [test] windows_code_page is added, and mcpp's own tests use utf-8.

src/build/prepare/plan.cpp crossed the 2500-line limit and is split at step boundaries: windows_resources.cpp and link_scope.cpp.

Closes #771. Closes #770.

Test plan

  • Unit tests: argv round trip (test_windows_command_line), bigobj / /GL / import objects (test_coff_exports), the three-state key and [test] windows_code_page (test_manifest), profile and root-package inheritance (test_workspace_plan), the corrected test_modgraph.
  • E2E 884 (shared-library link lines, read from RUNPATH; fails against 2026.10.5.1), 885 (workspace profiles and the root package; fails against 2026.10.5.1), 886 (std.compat on GCC and on demand; fails against 2026.10.5.1). E2E 887 (cl.exe LTO and export discovery) and 888 (the llvm row with a developer environment's WindowsSdkDir) run on the Windows shards.
  • Local Linux x86_64 / gcc 16.1: full mcpp test passes (146 test programs).
  • check_docs_style, check_docs_structure, check_modules_wiring, check_narrow_conversions, check_version_pins, check_file_lengths, check_workflow_assertions and git diff --check pass.
  • All CI checks pass (54 checks on 29c92b5; the iOS runner probe is skipped by design).
  • Self-review: the dependency-cache key now includes the /GL- or -fno-lto that scope_lto adds (29c92b5).

…scovery, std.compat on every Default row

- A shared library that is not the root's links with the graph's flags and its
  owner's closure (#771); the root's private ldflags no longer reach it.
- Windows argv quoting doubles the backslashes before a closing quote;
  WindowsSdkDir is read without its trailing separator.
- The COFF reader reads /bigobj objects and names /GL and import objects.
- lto = true on cl.exe compiles with /GL and links and archives with /LTCG;
  export discovery and /GL meet as SPEC-004 §11 states (#770).
- std.compat is built only when imported, on the GCC row too; the std and
  std.compat sources are set as one.
- A workspace's [profile.*] is a root-position key, and its own package
  receives [workspace.package] and [workspace.build].
- [test] windows_code_page; mcpp's unit tests run in UTF-8.

Design: .agents/docs/2026-10-05-std-module-pair-msvc-lto-and-export-discovery-design.md
…ndency-cache key

scope_lto appends /GL- or -fno-lto to a package's units, and the cache key
read the package's inputs, not its units, so the same package compiled with
and without LTO shared one global cache entry.
@Sunrisepeak
Sunrisepeak merged commit 5d6e065 into main Oct 5, 2026
55 checks passed
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.

fix: preserve package link flags on shared-library link units fix: define native MSVC LTO behavior and its interaction with windows_auto_export

1 participant