Skip to content

fix: omit injected CRT defaults for explicit nostdlib projects - #1058

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

dreamyloong2005 wants to merge 1 commit into
mcpp-community:mainfrom
dreamyloong2005:codex/fix-nostdlib-crt

Conversation

@dreamyloong2005

Copy link
Copy Markdown

Summary

For parsed project link words containing the exact -nostdlib token on Clang/MSVC, compilation retains the runtime ABI choice and adds -fms-omit-default-lib. The omission applies to project compilation, not build contracts, host tools or standard-library module commands. It does not add a global /NODEFAULTLIB or rewrite third-party objects.

Closes #1051.

Criteria

  • A controlled prior production caller with current regression tests goes from 3 pass/3 fail to 9 pass/0 fail; this is explicitly not a fresh current-main caller build.
  • LLVM 22.1.8 and 23.1.3 code-generation/link controls pass 18 native cases / 48 commands, covering C/C++, DLL/static ABI macros, automatic CRT/oldnames directives, and an explicit third-party DEFAULTLIB directive that remains effective.
  • Package-level tests and root flag/standard-command tests are registered; 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: 3 isolated package cases and 6 root flag cases 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 project -nostdlib policy Runtime ABI macros, explicit third-party directives, host/contract/std isolation MsvcRuntimePolicy and MsvcRuntimePolicyFlags tests plus native COFF controls

Compatibility

Only the explicit project -nostdlib case on Clang/MSVC changes. Other flags, compilers, ABIs, host/build-contract commands and standard-library module compilation retain their defaults. Foreign object directives remain the link author’s responsibility.

Checks before merging

  • check_docs_style.sh, check_docs_structure.sh, check_version_pins.sh and check_workflow_assertions.py pass locally. On Windows the unchanged shell checks run from LF-normalized scratch copies with the original working directory; invalid/truncated shell-harness attempts are not counted.
  • 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.

[Clang/MSVC] An explicit -nostdlib project still receives mcpp-injected CRT DEFAULTLIB directives

1 participant