From 2185d000c1529bdc21b8bc4f999f7195c43a4f32 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Tue, 13 Apr 2021 13:48:51 -0700 Subject: [PATCH 1/9] Enable compiling Asp.NET with crossgen2 --- eng/Dependencies.props | 9 ++- .../Microsoft.AspNetCore.App.Runtime.csproj | 55 +++++++++++++++++-- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/eng/Dependencies.props b/eng/Dependencies.props index 3c867b050851..e519a8e314cc 100644 --- a/eng/Dependencies.props +++ b/eng/Dependencies.props @@ -92,6 +92,13 @@ and are generated based on the last package release. + + + + + + + @@ -205,7 +212,7 @@ and are generated based on the last package release. --> $(MicrosoftNETCoreAppRuntimeVersion) + Condition=" $([System.String]::new('%(Identity)').StartsWith('Microsoft.NETCore.App.Runtime.')) or $([System.String]::new('%(Identity)').StartsWith('Microsoft.NETCore.App.Crossgen2.'))">$(MicrosoftNETCoreAppRuntimeVersion) diff --git a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj index b8cade10283c..ce7a7dfc0a5f 100644 --- a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj +++ b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj @@ -44,6 +44,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant true + true true @@ -100,6 +101,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant crossgen $(CrossgenToolFileName).exe + crossgen2 + $(Crossgen2ToolFileName).exe $(CrossgenToolFileName) @@ -107,6 +110,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier) + PkgMicrosoft_NETCore_App_Crossgen2_$(TargetOsName)-$(BuildArchitecture) $(AssetTargetFallback);native,Version=0.0 @@ -125,6 +129,11 @@ This package is an internal implementation of the .NET Core SDK and is not meant PrivateAssets="All" GeneratePathProperty="true" /> + + Platform=$(NativePlatform) @@ -349,10 +358,16 @@ This package is an internal implementation of the .NET Core SDK and is not meant $(%(Identity)) + + + $(%(Identity)) + @(RuntimePackageRootMapping->'%(RuntimePackageRoot)') $([MSBuild]::EnsureTrailingSlash('$(RuntimePackageRoot)')) + @(Crossgen2PackageRootMapping->'%(Crossgen2PackageRoot)') + $([MSBuild]::EnsureTrailingSlash('$(Crossgen2PackageRoot)')) @@ -375,10 +390,18 @@ This package is an internal implementation of the .NET Core SDK and is not meant + + <_DistinctPlatformAssemblyPaths Include="@(_PlatformAssemblyPaths->Distinct())"/> + <_DistinctPlatformAssemblyPaths> + -r:%(Identity)*.dll + + + - $([System.IO.Path]::Combine('$(RuntimePackageRoot)', 'tools', '$(CrossgenToolPackagePath)')) + $([System.IO.Path]::Combine('$(RuntimePackageRoot)', 'tools', '$(CrossgenToolPackagePath)')) + $([System.IO.Path]::Combine('$(Crossgen2PackageRoot)', 'tools', '$(Crossgen2ToolFileName)')) $(TargetDir) @(_PlatformAssemblyPaths->Distinct(), '$(PathSeparator)') @@ -392,6 +415,11 @@ This package is an internal implementation of the .NET Core SDK and is not meant File="$(CrossgenToolDir)PlatformAssembliesPaths.rsp" Overwrite="true" /> + + @@ -399,8 +427,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant - - + + + $(RuntimePackageRoot)runtimes\$(RuntimeIdentifier)\native\$(LibPrefix)clrjit$(LibExtension) $(RuntimePackageRoot)runtimes\$(CrossCompileDirectory)\native\$(LibPrefix)clrjit$(LibExtension) + + $(TargetOsName) + windows + --targetarch:$(TargetArchitecture) + $(Crossgen2Args) --targetos:$(Crossgen2TargetOs) + $(Crossgen2Args) -O + $(Crossgen2Args) @"$(CrossgenToolDir)PlatformAssembliesPathsCrossgen2.rsp" + $(Crossgen2Args) --pdb --pdb-path:"$(CrossgenSymbolsTargetDir)" + $(Crossgen2Args) --perfmap --perfmap-path:"$(CrossgenSymbolsTargetDir)" - - + + + PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier) - PkgMicrosoft_NETCore_App_Crossgen2_$(TargetOsName)-$(BuildArchitecture) + + $(TargetOsName) + linux + PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName)-$(BuildArchitecture) $(AssetTargetFallback);native,Version=0.0 $(TargetArchitecture) Win32 + @@ -129,7 +133,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant PrivateAssets="All" GeneratePathProperty="true" /> - From face96b3b0c7ba52dca8ecc104c1d668e7aca32f Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Mon, 19 Apr 2021 13:37:41 -0700 Subject: [PATCH 3/9] Attempt to make musl work --- eng/Dependencies.props | 1 + .../App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/Dependencies.props b/eng/Dependencies.props index e519a8e314cc..556b3c015ede 100644 --- a/eng/Dependencies.props +++ b/eng/Dependencies.props @@ -96,6 +96,7 @@ and are generated based on the last package release. + diff --git a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj index 7fbc8e959211..b612b7d2812f 100644 --- a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj +++ b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj @@ -112,7 +112,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier) $(TargetOsName) - linux + linux PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName)-$(BuildArchitecture) $(AssetTargetFallback);native,Version=0.0 @@ -449,6 +449,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant $(TargetOsName) windows + linux --targetarch:$(TargetArchitecture) $(Crossgen2Args) --targetos:$(Crossgen2TargetOs) $(Crossgen2Args) -O From 709f5323f9ea094d45515879b388d88209f409c4 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Mon, 19 Apr 2021 13:58:56 -0700 Subject: [PATCH 4/9] Fix typo --- .../App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj index b612b7d2812f..41793f29ba66 100644 --- a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj +++ b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj @@ -112,7 +112,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier) $(TargetOsName) - linux + linux PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName)-$(BuildArchitecture) $(AssetTargetFallback);native,Version=0.0 From 77ad058af7ed5f41a9c18322db1b8f8da0ac61ff Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Mon, 19 Apr 2021 16:58:00 -0700 Subject: [PATCH 5/9] Use correct bits to compile take #3 --- .../App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj index 41793f29ba66..9b83ca9c5bb3 100644 --- a/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj +++ b/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj @@ -112,14 +112,14 @@ This package is an internal implementation of the .NET Core SDK and is not meant PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier) $(TargetOsName) - linux + + linux PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName)-$(BuildArchitecture) $(AssetTargetFallback);native,Version=0.0 $(TargetArchitecture) Win32 - @@ -474,7 +474,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant Command=""$(CrossgenToolPath)" $(Crossgen2Args) -o:"$(TargetDir)%(FileName)%(Extension)" "%(IntermediateCrossgenAssembly.Identity)"" IgnoreStandardErrorWarningFormat="true" StandardOutputImportance="High" /> - $(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder);.map - + true - true - + true false @@ -81,38 +80,28 @@ This package is an internal implementation of the .NET Core SDK and is not meant false - + PerfMap PDB + lib - .so - .dll - .dylib - .exe - - : - %3B - - x64_arm - x64_arm64 - x86_arm - - - crossgen - $(CrossgenToolFileName).exe + + crossgen2 $(Crossgen2ToolFileName).exe - - $(CrossgenToolFileName) - - $(CrossCompileDirectory)\$(CrossgenToolPackagePath) PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier) + $(TargetOsName) - linux PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName)-$(BuildArchitecture) @@ -133,6 +122,10 @@ This package is an internal implementation of the .NET Core SDK and is not meant PrivateAssets="All" GeneratePathProperty="true" /> + - + @@ -354,8 +347,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant @@ -381,11 +374,11 @@ This package is an internal implementation of the .NET Core SDK and is not meant - + - + <_PlatformAssemblyPaths Include="$(CrossgenToolDir)" /> <_PlatformAssemblyPaths Include="@(ReferenceCopyLocalPaths->'%(RootDir)%(Directory)')" Condition="'%(ReferenceCopyLocalPaths.ProjectPath)' == ''"/> @@ -404,21 +397,13 @@ This package is an internal implementation of the .NET Core SDK and is not meant - $([System.IO.Path]::Combine('$(RuntimePackageRoot)', 'tools', '$(CrossgenToolPackagePath)')) - $([System.IO.Path]::Combine('$(Crossgen2PackageRoot)', 'tools', '$(Crossgen2ToolFileName)')) + $([System.IO.Path]::Combine('$(Crossgen2PackageRoot)', 'tools', '$(Crossgen2ToolFileName)')) $(TargetDir) - @(_PlatformAssemblyPaths->Distinct(), '$(PathSeparator)') $(TargetDir)\ - $(CrossgenPlatformAssemblyPaths)\ - - - + - + - - + - - $(RuntimePackageRoot)runtimes\$(RuntimeIdentifier)\native\$(LibPrefix)clrjit$(LibExtension) - $(RuntimePackageRoot)runtimes\$(CrossCompileDirectory)\native\$(LibPrefix)clrjit$(LibExtension) - + $(TargetOsName) windows linux + + --targetarch:$(TargetArchitecture) $(Crossgen2Args) --targetos:$(Crossgen2TargetOs) $(Crossgen2Args) -O @@ -459,20 +443,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant $(Crossgen2Args) --perfmap --perfmap-path:"$(CrossgenSymbolsTargetDir)" - - - - - +