Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 4b82b1e

Browse files
omajiddagood
authored andcommitted
Enable hosted builds on arm64 (#7696)
To enable building core-setup on arm64 (hosted, not cross compiled), we need to do a few things: - Set the right TargetArchitecture Use the currently running architecture to decide the HostArch. Use that as the default value of TargetArchitecture, unless another value was provided by the build configuration. - Use the right coreclr JIT If we are cross-compiling, we need to use the x86_arm64 libclrjit.so. But if we are building on an arm64 host, we need to pick the normal-RID (eg, linux-arm64) libclrjit.so from the two: ./.packages/transport.runtime.linux-arm64.microsoft.netcore.jit/###/runtimes/linux-arm64/native/libclrjit.so ./.packages/transport.runtime.linux-arm64.microsoft.netcore.jit/###/runtimes/x64_arm64/native/libclrjit.so - Use a version of SourceLink that supports arm64 We need to upgrade SourceLink to a version that contains dotnet/sourcelink#288. This commit just updates it to the latest version. Fixes #7653
1 parent aae3e31 commit 4b82b1e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@
9494
</PropertyGroup>
9595

9696
<PropertyGroup>
97-
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
97+
<HostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant())</HostArch>
98+
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">$(HostArch)</TargetArchitecture>
9899
<Platform Condition="'$(Platform)'==''">$(TargetArchitecture)</Platform>
99100
</PropertyGroup>
100101
<!--
@@ -398,4 +399,4 @@
398399
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
399400
</PropertyGroup>
400401

401-
</Project>
402+
</Project>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<MicrosoftTargetingPackPrivateWinRTPackageVersion>1.0.5</MicrosoftTargetingPackPrivateWinRTPackageVersion>
8888
<MicrosoftDiaSymReaderNativePackageVersion>1.7.0</MicrosoftDiaSymReaderNativePackageVersion>
8989
<!-- Infrastructure and test-only. -->
90-
<MicrosoftSourceLinkVersion>1.0.0-beta2-18618-05</MicrosoftSourceLinkVersion>
90+
<MicrosoftSourceLinkVersion>1.0.0-beta2-19367-01</MicrosoftSourceLinkVersion>
9191
</PropertyGroup>
9292
<!--Package names-->
9393
<PropertyGroup>

src/pkg/packaging-tools/framework.dependency.targets

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@
217217
<PropertyGroup>
218218
<_crossDir Condition="'$(TargetArchitecture)' == 'arm' AND '$(OS)' == 'Windows_NT'">/x86_arm</_crossDir>
219219
<_crossDir Condition="'$(TargetArchitecture)' == 'arm' AND '$(OS)' != 'Windows_NT'">/x64_arm</_crossDir>
220-
<_crossDir Condition="'$(TargetArchitecture)' == 'arm64'">/x64_arm64</_crossDir>
220+
<!-- Only use x64_arm64 when cross compiling. Use normal executible when compiling on arm64 itself. -->
221+
<_crossDir Condition="'$(TargetArchitecture)' == 'arm64' AND '$(HostArch)' != 'arm64'">/x64_arm64</_crossDir>
221222
</PropertyGroup>
222223

223224
<ItemGroup>
@@ -235,7 +236,6 @@
235236
<!-- Find crossgen tool assets in package cache to allow ExcludeAssets=All. -->
236237
<_runtimeCLR Include="$(_runtimePackageDir)**/$(LibraryFilePrefix)coreclr$(LibraryFileExtension)" />
237238
<_runtimeCoreLib Include="$(_runtimePackageDir)**/native/System.Private.CoreLib.dll" />
238-
<_runtimeJIT Include="$(_jitPackageDir)**/$(LibraryFilePrefix)clrjit$(LibraryFileExtension)" />
239239
<_fxSystemRuntime Include="$(_corefxPackageDir)**/System.Runtime.dll" />
240240
<_windowsWinMD Include="$(_winmdPackageDir)**/Windows.winmd" />
241241
<_diaSymReaderAssembly Include="$(_diaSymReaderPackageDir)**\Microsoft.DiaSymReader.Native.*.dll" />
@@ -250,8 +250,8 @@
250250
<_coreLibDirectory>%(_runtimeCoreLib.RootDir)%(_runtimeCoreLib.Directory)</_coreLibDirectory>
251251
</PropertyGroup>
252252

253-
<PropertyGroup Condition="'@(_runtimeJIT)' != ''">
254-
<_jitPath>%(_runtimeJIT.FullPath)</_jitPath>
253+
<PropertyGroup>
254+
<_jitPath Condition="'$(_crossDir)' == ''">$(_jitPackageDir)runtimes/$(PackageRID)/native/$(LibraryFilePrefix)clrjit$(LibraryFileExtension)</_jitPath>
255255
<_jitPath Condition="'$(_crossDir)' != ''">$(_jitPackageDir)runtimes$(_crossDir)/native/$(LibraryFilePrefix)clrjit$(LibraryFileExtension)</_jitPath>
256256
</PropertyGroup>
257257

0 commit comments

Comments
 (0)