Various fixes to get -dynamiccodecompiled false to build on windows#126329
Merged
BrzVlad merged 4 commits intodotnet:mainfrom Mar 31, 2026
Merged
Various fixes to get -dynamiccodecompiled false to build on windows#126329BrzVlad merged 4 commits intodotnet:mainfrom
-dynamiccodecompiled false to build on windows#126329BrzVlad merged 4 commits intodotnet:mainfrom
Conversation
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)
Contributor
|
Tagging subscribers to this area: @agocke |
Contributor
There was a problem hiding this comment.
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”
NativeCodeVersionvalue toDoGcStressto match its current signature. - Guard the AMD64 call counting stub assembly template behind
FEATURE_TIERED_COMPILATION. - Avoid linking
Native.rcinto interpreter object code used for static linking to prevent duplicateVERSIONresources. - Only enable
FEATURE_RESOLVE_HELPER_DISPATCHwhenFEATURE_VIRTUAL_STUB_DISPATCHis 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. |
This was referenced Mar 31, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.