|
| 1 | +From c11fa2be22891658a849b9320664057a7c433487 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Filip Navara < [email protected]> |
| 3 | +Date: Tue, 9 May 2023 19:20:19 +0200 |
| 4 | +Subject: [PATCH] Update ILCompiler paths to handle |
| 5 | + PublishAotUsingRuntimePack=true |
| 6 | + |
| 7 | +--- |
| 8 | + .../Microsoft.NETCore.Native.Publish.targets | 4 +-- |
| 9 | + .../Microsoft.NETCore.Native.Unix.targets | 10 +++---- |
| 10 | + .../Microsoft.NETCore.Native.targets | 27 ++++++++++++++----- |
| 11 | + 3 files changed, 28 insertions(+), 13 deletions(-) |
| 12 | + |
| 13 | +diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets |
| 14 | +index 6f672918b33e0..be1fbde77efc9 100644 |
| 15 | +--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets |
| 16 | ++++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets |
| 17 | +@@ -70,8 +70,8 @@ |
| 18 | + Text="Add a PackageReference for '$(_hostPackageName)' to allow cross-compilation for $(_targetArchitecture)" /> |
| 19 | + |
| 20 | + <!-- NativeAOT runtime pack assemblies need to be defined to avoid the default CoreCLR implementations being set as compiler inputs --> |
| 21 | +- <Error Condition="'@(PrivateSdkAssemblies)' == ''" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" /> |
| 22 | +- <Error Condition="'@(FrameworkAssemblies)' == ''" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" /> |
| 23 | ++ <Error Condition="'@(PrivateSdkAssemblies)' == '' and '$(PublishAotUsingRuntimePack)' != 'true'" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" /> |
| 24 | ++ <Error Condition="'@(FrameworkAssemblies)' == '' and '$(PublishAotUsingRuntimePack)' != 'true'" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" /> |
| 25 | + |
| 26 | + <ComputeManagedAssembliesToCompileToNative |
| 27 | + Assemblies="@(_ResolvedCopyLocalPublishAssets)" |
| 28 | +diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets |
| 29 | +index bb457c8c166bc..6b6b59ab7967b 100644 |
| 30 | +--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets |
| 31 | ++++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets |
| 32 | +@@ -53,11 +53,11 @@ The .NET Foundation licenses this file to you under the MIT license. |
| 33 | + |
| 34 | + <ItemGroup> |
| 35 | + <NativeLibrary Condition="'$(IlcMultiModule)' == 'true'" Include="$(SharedLibrary)" /> |
| 36 | +- <NativeLibrary Condition="'$(NativeLib)' == '' and '$(CustomNativeMain)' != 'true'" Include="$(IlcSdkPath)libbootstrapper.a" /> |
| 37 | +- <NativeLibrary Condition="'$(NativeLib)' != '' or '$(CustomNativeMain)' == 'true'" Include="$(IlcSdkPath)libbootstrapperdll.a" /> |
| 38 | +- <NativeLibrary Include="$(IlcSdkPath)$(FullRuntimeName).a" /> |
| 39 | +- <NativeLibrary Include="$(IlcSdkPath)$(EventPipeName)$(LibFileExt)" /> |
| 40 | +- <NativeLibrary Condition="'$(LinkStandardCPlusPlusLibrary)' != 'true' and '$(StaticICULinking)' != 'true'" Include="$(IlcSdkPath)libstdc++compat.a" /> |
| 41 | ++ <NativeLibrary Condition="'$(NativeLib)' == '' and '$(CustomNativeMain)' != 'true'" Include="$(IlcFrameworkSdkPath)libbootstrapper.a" /> |
| 42 | ++ <NativeLibrary Condition="'$(NativeLib)' != '' or '$(CustomNativeMain)' == 'true'" Include="$(IlcFrameworkSdkPath)libbootstrapperdll.a" /> |
| 43 | ++ <NativeLibrary Include="$(IlcFrameworkSdkPath)$(FullRuntimeName).a" /> |
| 44 | ++ <NativeLibrary Include="$(IlcFrameworkSdkPath)$(EventPipeName)$(LibFileExt)" /> |
| 45 | ++ <NativeLibrary Condition="'$(LinkStandardCPlusPlusLibrary)' != 'true' and '$(StaticICULinking)' != 'true'" Include="$(IlcFrameworkSdkPath)libstdc++compat.a" /> |
| 46 | + </ItemGroup> |
| 47 | + |
| 48 | + <ItemGroup> |
| 49 | +diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets |
| 50 | +index fbcadcc71b597..afa1cc1a66b9f 100644 |
| 51 | +--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets |
| 52 | ++++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets |
| 53 | +@@ -126,26 +126,41 @@ The .NET Foundation licenses this file to you under the MIT license. |
| 54 | + |
| 55 | + <!-- The properties below need to be defined only after we've found the correct runtime package reference --> |
| 56 | + <Target Name="SetupProperties" DependsOnTargets="$(IlcSetupPropertiesDependsOn)" BeforeTargets="Publish"> |
| 57 | ++ <ItemGroup> |
| 58 | ++ <_NETCoreAppFrameworkReference Include="@(ResolvedFrameworkReference)" Condition="'%(ResolvedFrameworkReference.RuntimePackName)' == 'Microsoft.NETCore.App.Runtime.NativeAOT.$(RuntimeIdentifier)'" /> |
| 59 | ++ </ItemGroup> |
| 60 | ++ |
| 61 | + <PropertyGroup> |
| 62 | + <!-- Define paths used in build targets to point to the runtime-specific ILCompiler implementation --> |
| 63 | + <IlcToolsPath Condition="'$(IlcToolsPath)' == ''">$(IlcHostPackagePath)\tools\</IlcToolsPath> |
| 64 | + <IlcSdkPath Condition="'$(IlcSdkPath)' == ''">$(RuntimePackagePath)\sdk\</IlcSdkPath> |
| 65 | +- <IlcFrameworkPath Condition="'$(IlcFrameworkPath)' == ''">$(RuntimePackagePath)\framework\</IlcFrameworkPath> |
| 66 | +- <IlcFrameworkNativePath Condition="'$(IlcFrameworkNativePath)' == ''">$(RuntimePackagePath)\framework\</IlcFrameworkNativePath> |
| 67 | ++ <IlcFrameworkPath Condition="'$(IlcFrameworkPath)' == '' and '$(PublishAotUsingRuntimePack)' != 'true'">$(RuntimePackagePath)\framework\</IlcFrameworkPath> |
| 68 | ++ <_NETCoreAppRuntimePackPath>%(_NETCoreAppFrameworkReference.RuntimePackPath)/runtimes/$(RuntimeIdentifier)/</_NETCoreAppRuntimePackPath> |
| 69 | ++ <IlcFrameworkNativePath Condition="'$(IlcFrameworkNativePath)' == '' and '$(PublishAotUsingRuntimePack)' == 'true'">$(_NETCoreAppRuntimePackPath)\native\</IlcFrameworkNativePath> |
| 70 | ++ <IlcFrameworkNativePath Condition="'$(IlcFrameworkNativePath)' == '' and '$(PublishAotUsingRuntimePack)' != 'true'">$(RuntimePackagePath)\framework\</IlcFrameworkNativePath> |
| 71 | ++ <IlcFrameworkSdkPath Condition="'$(IlcFrameworkSdkPath)' == '' and '$(PublishAotUsingRuntimePack)' == 'true'">$(IlcFrameworkNativePath)</IlcFrameworkSdkPath> |
| 72 | ++ <IlcFrameworkSdkPath Condition="'$(IlcFrameworkSdkPath)' == '' and '$(PublishAotUsingRuntimePack)' != 'true'">$(IlcSdkPath)</IlcFrameworkSdkPath> |
| 73 | + <IlcMibcPath Condition="'$(IlcMibcPath)' == ''">$(RuntimePackagePath)\mibc\</IlcMibcPath> |
| 74 | + </PropertyGroup> |
| 75 | + |
| 76 | +- <ItemGroup> |
| 77 | +- <PrivateSdkAssemblies Include="$(IlcSdkPath)*.dll" /> |
| 78 | ++ <ItemGroup Condition="'$(PublishAotUsingRuntimePack)' == 'true'"> |
| 79 | ++ <PrivateSdkAssemblies Include="$(IlcFrameworkSdkPath)*.dll"/> |
| 80 | ++ <FrameworkAssemblies Include="@(RuntimePackAsset)" Condition="'%(Extension)' == '.dll'" /> |
| 81 | ++ <DefaultFrameworkAssemblies Include="@(FrameworkAssemblies)" /> |
| 82 | ++ </ItemGroup> |
| 83 | + |
| 84 | ++ <ItemGroup Condition="'$(PublishAotUsingRuntimePack)' != 'true'"> |
| 85 | ++ <PrivateSdkAssemblies Include="$(IlcFrameworkSdkPath)*.dll"/> |
| 86 | + <!-- Exclude unmanaged dlls --> |
| 87 | + <FrameworkAssemblies Include="$(IlcFrameworkPath)*.dll" Exclude="$(IlcFrameworkPath)*.Native.dll;$(IlcFrameworkPath)msquic.dll" /> |
| 88 | + |
| 89 | +- <MibcFile Include="$(IlcMibcPath)*.mibc" Condition="'$(IlcPgoOptimize)' == 'true'" /> |
| 90 | +- |
| 91 | + <DefaultFrameworkAssemblies Include="@(FrameworkAssemblies)" /> |
| 92 | + <DefaultFrameworkAssemblies Include="@(PrivateSdkAssemblies)" /> |
| 93 | + </ItemGroup> |
| 94 | ++ |
| 95 | ++ <ItemGroup> |
| 96 | ++ <MibcFile Include="$(IlcMibcPath)*.mibc" Condition="'$(IlcPgoOptimize)' == 'true'" /> |
| 97 | ++ </ItemGroup> |
| 98 | + </Target> |
| 99 | + |
| 100 | + <Target Name="ComputeIlcCompileInputs" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)" BeforeTargets="Publish"> |
0 commit comments