[nativeaot] Fix native bits build when targeting "cross" architecture iOS platforms...
authorMilos Kotlar <kotlarmilos@gmail.com>
Tue, 27 Jun 2023 13:04:48 +0000 (15:04 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Jun 2023 13:04:48 +0000 (15:04 +0200)
* Build native bits for the host architecture when targeting iOS platforms with Native AOT

* Revert the crosscomponets condition

* Don't build ILCompiler_crossarch.csproj

eng/Subsets.props

index 25375fc..bfa808a 100644 (file)
   <!-- When targeting the iOS platforms with Native AOT, build the ClrAllJitsSubset and the Ilc for the host  -->
   <PropertyGroup>
     <IsNativeAOTHostBuildEnabled Condition="$(_subset.Contains('+clr.nativeaotruntime+')) and '$(NativeAotSupported)' == 'true' and '$(PrimaryRuntimeFlavor)' == 'CoreCLR' and '$(TargetsAppleMobile)' == 'true'">true</IsNativeAOTHostBuildEnabled>
-    <NativeAOTAdditionalProperties Condition="'$(IsNativeAOTHostBuildEnabled)' == 'true'">TargetOS=osx</NativeAOTAdditionalProperties>
+    <NativeAOTAdditionalProperties Condition="'$(IsNativeAOTHostBuildEnabled)' == 'true'">TargetOS=osx;TargetArchitecture=$(BuildArchitecture)</NativeAOTAdditionalProperties>
   </PropertyGroup>
   <ItemGroup Condition="'$(IsNativeAOTHostBuildEnabled)' == 'true'">
     <ProjectToBuild
       Include="$(CoreClrProjectRoot)runtime.proj"
-      AdditionalProperties="$(NativeAOTAdditionalProperties);
-                            ClrAllJitsSubset=true"
+      AdditionalProperties="%(AdditionalProperties);
+                            $(NativeAOTAdditionalProperties);
+                            ClrAllJitsSubset=true;
+                            ClrCrossComponentsSubset=true;
+                            PgoInstrument=false;
+                            NoPgoOptimize=true;
+                            CMakeArgs=$(CMakeArgs) -DCLR_CROSS_COMPONENTS_BUILD=1"
       Category="clr" />
     <ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" AdditionalProperties="$(NativeAOTAdditionalProperties)" />
     <ProjectToBuild Include="$(CoreClrProjectRoot)nativeaot\BuildIntegration\BuildIntegration.proj" Category="clr" AdditionalProperties="$(NativeAOTAdditionalProperties)" />
-    <ProjectToBuild Condition="'$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)'" Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_crossarch.csproj" Category="clr" AdditionalProperties="$(NativeAOTAdditionalProperties)" />
   </ItemGroup>
 
   <ItemGroup Condition="$(_subset.Contains('+crossdacpack+'))">