Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NativeAOT] Enable dynamic linking of ucrt for release runtime #71182

Merged
merged 2 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

<Target Name="Build">
<Copy SourceFiles="@(Content)" DestinationFolder="$(OutputPath)" />

<!-- Create breadcrumb to disable dynamic linking of release crt for debug runtime -->
<WriteLinesToFile
File="$(RuntimeBinDir)/aotsdk/debugucrt.txt"
AaronRobinsonMSFT marked this conversation as resolved.
Show resolved Hide resolved
Condition="'$(TargetsWindows)'=='true' and '$(Configuration)' != 'Release'" />
</Target>

<Target Name="Restore" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ The .NET Foundation licenses this file to you under the MIT license.
<LinkerArg Condition="'$(ControlFlowGuard)' == 'Guard'" Include="/guard:cf" />
</ItemGroup>

<ItemGroup Condition="!Exists('$(IlcSdkPath)debugucrt.txt')">
AaronRobinsonMSFT marked this conversation as resolved.
Show resolved Hide resolved
<!-- Force ucrt to be dynamically linked for release runtime -->
jkotas marked this conversation as resolved.
Show resolved Hide resolved
<LinkerArg Include="/NODEFAULTLIB:libucrt.lib" />
<LinkerArg Include="/DEFAULTLIB:ucrt.lib" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'Debug'">
<LinkerArg Include="/OPT:REF" />
<LinkerArg Include="/OPT:ICF" />
Expand Down