Skip to content

Commit 434d664

Browse files
Switch to selfhosted NativeAOT compiler (#81205)
This will compile the NativeAOT compiler with the LKG build of the NativeAOT compiler that the repo is building with. At this point NativeAOT-compiled compiler is significantly better than the R2R+Trimmed+SingleFile-compiled combo we're shipping right now. ilc.exe size before: 31 MB. ilc.exe size after: 14 MB. Time to compile hello world before: 2.3 seconds. Time to compile hello world after: 1.3 seconds.
1 parent 3e73be1 commit 434d664

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
<!-- BEGIN: Workaround for https://github.com/dotnet/runtime/issues/67742 -->
1111
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
1212
<PublishDir>$(RuntimeBinDir)ilc-published/</PublishDir>
13-
<PublishTrimmed>true</PublishTrimmed>
14-
<!-- Don't R2R on ARM64 machines because ARM64 crossgen2 that comes with .NET SDK <= 7.0 Preview 7 crashes.-->
15-
<PublishReadyToRun Condition="'$(BuildArchitecture)' != 'arm64'">true</PublishReadyToRun>
16-
<PublishSingleFile>true</PublishSingleFile>
13+
<NativeAotSupported Condition="'$(TargetOS)' != 'windows' and '$(TargetOS)' != 'linux' and '$(TargetOS)' != 'osx'">false</NativeAotSupported>
14+
<NativeAotSupported Condition="'$(TargetArchitecture)' != 'x64'">false</NativeAotSupported>
15+
<PublishAot Condition="'$(NativeAotSupported)' == 'true'">true</PublishAot>
16+
<PublishReadyToRun Condition="'$(NativeAotSupported)' != 'true'">true</PublishReadyToRun>
17+
<PublishSingleFile Condition="'$(NativeAotSupported)' != 'true'">true</PublishSingleFile>
18+
<PublishTrimmed Condition="'$(NativeAotSupported)' != 'true'">true</PublishTrimmed>
1719
</PropertyGroup>
1820

1921
<Target Name="PublishCompiler"

0 commit comments

Comments
 (0)