From 3dc5d662b62cab243f3eea6c404ecb61578b19d7 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Tue, 13 Aug 2019 11:08:47 -0400 Subject: [PATCH] Enable hosted builds on arm64 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 whether to default to x64 or to switch to arm64 when TargetArchitecture is not specified - 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 filter the list of found libclrjit.so files 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 https://github.com/dotnet/sourcelink/pull/288. This commit just updates it to the latest version. Fixes #7653 --- Directory.Build.props | 6 ++++-- eng/Versions.props | 2 +- .../framework.dependency.targets | 20 +++++++++++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index a53af2f09f..1c44287295 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -94,7 +94,9 @@ - x64 + $([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture) + arm64 + x64 $(TargetArchitecture) - 1.0.0-beta2-18618-05 + 1.0.0-beta2-19367-01 diff --git a/src/pkg/packaging-tools/framework.dependency.targets b/src/pkg/packaging-tools/framework.dependency.targets index a77fd888df..bca8e6d7c5 100644 --- a/src/pkg/packaging-tools/framework.dependency.targets +++ b/src/pkg/packaging-tools/framework.dependency.targets @@ -217,7 +217,8 @@ <_crossDir Condition="'$(TargetArchitecture)' == 'arm' AND '$(OS)' == 'Windows_NT'">/x86_arm <_crossDir Condition="'$(TargetArchitecture)' == 'arm' AND '$(OS)' != 'Windows_NT'">/x64_arm - <_crossDir Condition="'$(TargetArchitecture)' == 'arm64'">/x64_arm64 + + <_crossDir Condition="'$(TargetArchitecture)' == 'arm64' AND '$(HostArch)' != 'Arm64'">/x64_arm64 @@ -251,10 +252,25 @@ - <_jitPath>%(_runtimeJIT.FullPath) + <_runtimeJITFilterDir>/$(PackageRID)/ + + + + + <_filteredRuntimeJIT Include="%(_runtimeJIT.Identity)" Condition="'@(_runtimeJIT->Contains($(_runtimeJITFilterDir)))' == 'True'" /> + + + + <_jitPath>%(_filteredRuntimeJIT.FullPath) <_jitPath Condition="'$(_crossDir)' != ''">$(_jitPackageDir)runtimes$(_crossDir)/native/$(LibraryFilePrefix)clrjit$(LibraryFileExtension) + + + + + <_fxLibDirectory>%(_fxSystemRuntime.RootDir)%(_fxSystemRuntime.Directory)