Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

make build on ARM easier #34607

Merged
merged 4 commits into from
Jan 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<TargetGroup Condition="'$(TargetGroup)' == ''">netcoreapp</TargetGroup>
<OSGroup Condition="'$(OSGroup)' == ''">$(DefaultOSGroup)</OSGroup>
<ConfigurationGroup Condition="'$(ConfigurationGroup)' == ''">Debug</ConfigurationGroup>
<HostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)</HostArch>
<ArchGroup Condition="'$(ArchGroup)' == '' AND '$(HostArch)' == 'Arm'">arm</ArchGroup>
<ArchGroup Condition="'$(ArchGroup)' == '' AND '$(HostArch)' == 'Arm64'">arm64</ArchGroup>
<ArchGroup Condition="'$(ArchGroup)' == ''">x64</ArchGroup>

<!-- Initialize BuildConfiguration from the individual properties if it wasn't already explicitly set -->
Expand Down Expand Up @@ -285,6 +288,9 @@

<!-- Rhel 6 and FreeBSD doesn't support the source control git package so disable SourceLink -->
<EnableSourceLink Condition="$(RuntimeOS.StartsWith('rhel.6')) OR '$(_runtimeOSFamily)' == 'FreeBSD'">false</EnableSourceLink>
<!-- is is not supported on ARM platforms either. -->
<EnableSourceLink Condition="'$(HostArch)' == 'Arm' OR '$(HostArch)' == 'Arm64'">false</EnableSourceLink>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does sourcelink need a bug to enable this scenario?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why use HostArch here instead of ArchGroup? You already mapped HostArch to ArchGroup

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because SourceLink ( microsoft.build.tasks.git) drags in native dependencies. When you for example run on x64 and ArchGroup=arm everything works ok. But let say you target x64 and you build on arm, that it fails. So it is not about what you building for but what you building on.
As far as SourceLink: It may be nice if SourceLink supports ARM but there are other issues preventing full build on ARM @eerhardt . Asking them for ARM may complicate their build quite a bit and so far I did not find any limitations of setting this to false. For now, my primary use case is building single assembly using msbuild command and running tests.
Rest os my tasks, I can do easily elsewhere.

(and I added note about sourcelink on arm)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened dotnet/sourcelink#231 to have the discussion if enabling source link on ARM makes sense.


</PropertyGroup>

<!-- Set up Default symbol and optimization for Configuration -->
Expand Down