Skip to content

fix: honor exact Clang linker overrides on the MSVC route - #1060

Draft
dreamyloong2005 wants to merge 1 commit into
mcpp-community:mainfrom
dreamyloong2005:codex/fix-explicit-linker
Draft

dreamyloong2005 wants to merge 1 commit into
mcpp-community:mainfrom
dreamyloong2005:codex/fix-explicit-linker

Conversation

@dreamyloong2005

Copy link
Copy Markdown

Summary

The Clang/MSVC route uses the exact supplied linker executable through -fuse-ld plus a preserved empty -B argument. Project C/C++ links, build-contract links and host argv share the policy. Other Clang ABIs retain --ld-path. Selecting only a basename is avoided so a disappeared override cannot silently select another same-named linker.

Closes #1053.

Criteria

  • The actual production leaf is split/compiled and executed: 6 focused conditions pass. Registered package-level and root tests check exact C/C++ selection, host argv and build-contract parity.
  • Native LLVM driver controls invoke a uniquely named executable in a directory containing spaces and preserve its exit 37. The old --ld-path control does not invoke it. Both cmd.exe and Ninja preserve the empty argument; missing and removed executables fail rather than silently use the default linker (5 probe groups pass).
  • A Windows CLI regression builds the marker executable, requires its output and failure status from project build and a build-program link observed by its actual /out:build-program.exe argument, then checks a missing override refusal. It uses an isolated home and clears inherited MCPP_TOOLCHAIN for the manifest-owned calls.
  • Focused structure tests pass (3/3).

Fresh integration

  • The six-fix Windows integration self-build succeeds with Clang 23.1.3, the system MSVC/Windows SDK and profile ci.
  • Fresh integration: 4 isolated package cases, 3 root flag/contract cases and 1 Windows CLI marker case pass with no failures or skips. The complete selected root/CLI run is 30/30; the isolated toolchain-model package run is 14/14. The 15 structural checks also pass.
  • Independent standards and specification reviews completed. The implementation-only import placement findings were corrected before validation.
  • An isolated full-tree build of this single branch and native LPAC/cross-platform/full-suite acceptance remain for hosted CI and follow-up validation.

The native Windows product build and focused CLI checks use a local integration of #1048, #1049, #1050, #1051, #1052 and #1053 on b30e9bc0218730f7ef3b8a9c163ecc31d97aa88e. That is combined validation, not six isolated full-tree builds. The prior 2026.12.4.1 LPAC candidate is separate evidence and is not treated as acceptance of this branch. Linux/macOS and full hosted checks remain pending.

Intersections

New rule or feature Invariant it crosses Test at the crossing
Exact explicit linker selection Space/empty-argument serialization, missing-file refusal, C/C++ and build-program parity ClangLinkerOverride / ClangLinkerOverrideFlags, native marker controls and e2e/windows/explicit_linker

Compatibility

The documented tools.ld contract is retained. No wrapper program, global serializer change, fallback to a different linker, permission grant or external dependency patch is introduced. Non-MSVC Clang routes retain --ld-path; GCC’s existing override refusal is unchanged.

Checks before merging

  • Focused structure checks, git diff --check and check_workflow_assertions.py pass locally.
  • The remaining full required documentation/pin gates are checked by hosted CI before merge.
  • The branch contains no attribution trailers.
  • Required hosted checks and full applicable platform suites pass before merging.
  • Any eventual squash merge uses an explicit English subject and body.

This pull request is a draft. No merge is requested.

These engine fixes require the applicable full CI gates before merge. The contributor cannot assign upstream labels; a maintainer can apply ci:full before the next push according to the contributing workflow. No separate duplicate workflow dispatch is requested.

This branch has not been deployed

No deployments
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.

[Windows/Clang] Documented tools.ld override is ineffective on the MSVC linker route

1 participant