Skip to content

Commit

Permalink
Enable hosted builds on arm64 (dotnet/core-setup#7696)
Browse files Browse the repository at this point in the history
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 dotnet/core-setup#7653

Commit migrated from dotnet/core-setup@4b82b1e
  • Loading branch information
omajid authored and dagood committed Aug 15, 2019
1 parent 3af7379 commit 4d6fbbb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@
<PropertyGroup>
<_crossDir Condition="'$(TargetArchitecture)' == 'arm' AND '$(OS)' == 'Windows_NT'">/x86_arm</_crossDir>
<_crossDir Condition="'$(TargetArchitecture)' == 'arm' AND '$(OS)' != 'Windows_NT'">/x64_arm</_crossDir>
<_crossDir Condition="'$(TargetArchitecture)' == 'arm64'">/x64_arm64</_crossDir>
<!-- Only use x64_arm64 when cross compiling. Use normal executible when compiling on arm64 itself. -->
<_crossDir Condition="'$(TargetArchitecture)' == 'arm64' AND '$(HostArch)' != 'arm64'">/x64_arm64</_crossDir>
</PropertyGroup>

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

<PropertyGroup Condition="'@(_runtimeJIT)' != ''">
<_jitPath>%(_runtimeJIT.FullPath)</_jitPath>
<PropertyGroup>
<_jitPath Condition="'$(_crossDir)' == ''">$(_jitPackageDir)runtimes/$(PackageRID)/native/$(LibraryFilePrefix)clrjit$(LibraryFileExtension)</_jitPath>
<_jitPath Condition="'$(_crossDir)' != ''">$(_jitPackageDir)runtimes$(_crossDir)/native/$(LibraryFilePrefix)clrjit$(LibraryFileExtension)</_jitPath>
</PropertyGroup>

Expand Down

0 comments on commit 4d6fbbb

Please sign in to comment.