Use internal linkage for __NoopCoro_ResumeDestroy #159407
Merged
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.
__NoopCoro_ResumeDestroy
currently has private linkage, which causes issues for Arm64EC. The Arm64EC lowering is trying to mangle and add thunks for__NoopCoro_ResumeDestroy
, since it sees that it's address is taken (and, therefore, might be called from x64 code via a function pointer). MSVC's linker requires that the function be placed in COMDAT (LNK1361: non COMDAT symbol '.L#__NoopCoro_ResumeDestroy' in hybrid binary
) which trips an assert in the verifier (comdat global value has private linkage
) and the subsequent linking step fails since the private symbol isn't in the symbol table.Since there is no reason to use private linkage for
__NoopCoro_ResumeDestroy
and other coro related functions have also been switched to internal linkage to improve debugging, this change switches to using internal linkage.Fixes #158341