Skip to content

Commit

Permalink
Add native runtime components to Crossgen2 package. (#38600)
Browse files Browse the repository at this point in the history
For Windows, add clrcompression.dll to the package. For Linux, add { libSystem.IO.Compression.Native.so, libSystem.Native.so, libSystem.Net.Security.Native.so, libSystem.Security.Cryptography.Native.OpenSsl.so } to the package and also remove the corresponding static libraries with the .a extension from crossgen2.deps.json.
  • Loading branch information
AntonLapounov authored Jul 1, 2020
1 parent d07b37f commit 43f0034
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,17 @@

<Target Name="GenerateDepsJsonFile" Returns="$(ProjectDepsFilePath)" DependsOnTargets="GenerateBuildDependencyFile" />

<Target Name="RemoveLongNameDacFromDepsJson" AfterTargets="ResolveRuntimePackAssets" BeforeTargets="GenerateBuildDependencyFile" Condition="'$(RemoveLongNameDac)' == 'true'">
<Target Name="RemoveUnusedFilesFromDepsJson" AfterTargets="ResolveRuntimePackAssets" BeforeTargets="GenerateBuildDependencyFile">
<PropertyGroup>
<StaticLibraryFileExtension>.a</StaticLibraryFileExtension>
<StaticLibraryFileExtension Condition="'$(TargetOS)' == 'Windows_NT'">.lib</StaticLibraryFileExtension>
</PropertyGroup>

<ItemGroup>
<RuntimePackAsset Remove="@(RuntimePackAsset)" Condition="'%(Extension)' == '$(StaticLibraryFileExtension)'" />
</ItemGroup>

<ItemGroup Condition="'$(RemoveLongNameDac)' == 'true'">
<RuntimePackAsset Remove="@(RuntimePackAsset)" Condition="$([System.String]::new('%(FileName)').StartsWith('mscordaccore_'))" />
</ItemGroup>
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@
<!-- Include the native and managed files from the Microsoft.NETCore.App shared framework -->
<Crossgen2File Include="@(RuntimeFile)" Condition="'%(RuntimeFile.TargetPath)' == 'runtimes/$(PackageRID)/native'" />
<Crossgen2File Include="@(RuntimeFile)" Condition="'%(RuntimeFile.TargetPath)' == 'runtimes/$(PackageRID)/lib/$(NetCoreAppCurrent)'" />
<!-- Include the native hosting layer -->
<!-- Include the native hosting layer -->
<Crossgen2File Include="$(DotNetHostBinDir)/$(LibraryFilePrefix)hostfxr$(LibraryFileExtension)" />
<Crossgen2File Include="$(DotNetHostBinDir)/$(LibraryFilePrefix)hostpolicy$(LibraryFileExtension)" />
<!-- Include native runtime components -->
<Crossgen2File Include="$(LibrariesNativeArtifactsPath)$(LibraryFilePrefix)*$(LibraryFileExtension)"
Exclude="$(LibrariesNativeArtifactsPath)$(LibraryFilePrefix)System.IO.Ports.Native$(LibraryFileExtension)" />
</ItemGroup>

<MSBuild Projects="$(CoreClrProjectRoot)src/tools/aot/crossgen2/crossgen2.csproj"
Expand Down

0 comments on commit 43f0034

Please sign in to comment.