Skip to content

Various fixes to get -dynamiccodecompiled false to build on windows#126329

Merged
BrzVlad merged 4 commits intodotnet:mainfrom
BrzVlad:fix-win-dcc-false
Mar 31, 2026
Merged

Various fixes to get -dynamiccodecompiled false to build on windows#126329
BrzVlad merged 4 commits intodotnet:mainfrom
BrzVlad:fix-win-dcc-false

Conversation

@BrzVlad
Copy link
Copy Markdown
Member

@BrzVlad BrzVlad commented Mar 30, 2026

This option disables FEATURE_TIERED_COMPILATION, FEATURE_VIRTUAL_STUB_DISPATCH and enables FEATURE_STATICALLY_LINKED. This configuration was running into some build failures on windows.

BrzVlad added 4 commits March 30, 2026 22:42
It depends on FEATURE_VIRTUAL_STUB_DISPATCH
It depends on FEATURE_TIERED_COMPILATION
Include the Native.rc source only in the shared library
Constructor creating a NativeCodeVersion from a ptr (or null) exists only if FEATURE_CODE_VERSIONING is defined (which depends on tiered compilation)
@BrzVlad BrzVlad requested review from janvorli and kg as code owners March 30, 2026 20:16
Copilot AI review requested due to automatic review settings March 30, 2026 20:16
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes CoreCLR build issues on Windows when -dynamiccodecompiled false disables tiered compilation and virtual stub dispatch while enabling static linking. The changes ensure feature-gated code/resources are only compiled/linked when the corresponding features are enabled.

Changes:

  • Pass an explicit “null” NativeCodeVersion value to DoGcStress to match its current signature.
  • Guard the AMD64 call counting stub assembly template behind FEATURE_TIERED_COMPILATION.
  • Avoid linking Native.rc into interpreter object code used for static linking to prevent duplicate VERSION resources.
  • Only enable FEATURE_RESOLVE_HELPER_DISPATCH when FEATURE_VIRTUAL_STUB_DISPATCH is enabled.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/coreclr/vm/threadsuspend.cpp Fixes DoGcStress call to use a NativeCodeVersion value instead of NULL.
src/coreclr/vm/amd64/thunktemplates.asm Wraps CallCountingStubCode template in FEATURE_TIERED_COMPILATION to avoid assembling tiered stubs when disabled.
src/coreclr/interpreter/CMakeLists.txt Prevents Native.rc from flowing into statically-linked object code; adds it only to the shared library to avoid duplicate VERSION resources.
src/coreclr/inc/switches.h Makes FEATURE_RESOLVE_HELPER_DISPATCH conditional on FEATURE_VIRTUAL_STUB_DISPATCH to keep feature flags consistent.

Copy link
Copy Markdown
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants