This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To enable building core-setup on arm64 machines (not cross compiled), we need to do a few things: - Set the right TargetArchitecture When `TargetArchitecture` is not explicitly specified and when the currently running architecture is Arm64, use arm64 as the `TargetArchitecture`. Don't always use the currently running architecture as that doesn't play well with an x86 Visual Studio trying to create x64 builds. - 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 machine, 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/<version>/runtimes/linux-arm64/native/libclrjit.so ./.packages/transport.runtime.linux-arm64.microsoft.netcore.jit/<version>/runtimes/x64_arm64/native/libclrjit.so
omajid
force-pushed
the
enable-arm64-try-2
branch
from
October 7, 2019 14:59
c02027b
to
558f70f
Compare
Rebased to resolve conflicts with master branch. Testing on arm64 now. |
dagood
approved these changes
Oct 7, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks good and targeted.
@omajid Is this looking ok in your testing, good to merge? |
Yes! A build works. I have not done any extended testing |
omajid
added a commit
to omajid/dotnet-aspnetcore
that referenced
this pull request
Nov 11, 2019
This commit allows ASP.NET Core to be built on arm64 machines directly, without relying on cross-compilation. There's a few changes in here: 1. Ask msbuild to look into the BuildArchitecture By default, our build systems assums the machine is x64. This modifies the build configuration to check the architecture of the currently running build machine, and set BuildArchitecture to that. 2. Fix crossgen in Microsoft.AspNetCore.App.Runtime We run crossgen for supported architectures (including x64 and arm64). For that, we need a jit that we can point crossgen to. Generally, we can rely on the build scripts to find the right `libclrjit.so`. However, arm64 has multiple `libclirjit.so`, for different use-cases. There's one for arm64 (for running on arm64) and there's another one for cross-compiling for arm64 on x64. We need to figure out and use the right one explicitly rather than assuming the right one gets picked up. See dotnet/core-setup#8468 for similar changes made in core-setup. This also needs dotnet#14790 to fully work on arm64.
JunTaoLuo
pushed a commit
to dotnet/aspnetcore
that referenced
this pull request
Nov 11, 2019
This commit allows ASP.NET Core to be built on arm64 machines directly, without relying on cross-compilation. There's a few changes in here: 1. Ask msbuild to look into the BuildArchitecture By default, our build systems assums the machine is x64. This modifies the build configuration to check the architecture of the currently running build machine, and set BuildArchitecture to that. 2. Fix crossgen in Microsoft.AspNetCore.App.Runtime We run crossgen for supported architectures (including x64 and arm64). For that, we need a jit that we can point crossgen to. Generally, we can rely on the build scripts to find the right `libclrjit.so`. However, arm64 has multiple `libclirjit.so`, for different use-cases. There's one for arm64 (for running on arm64) and there's another one for cross-compiling for arm64 on x64. We need to figure out and use the right one explicitly rather than assuming the right one gets picked up. See dotnet/core-setup#8468 for similar changes made in core-setup. This also needs #14790 to fully work on arm64.
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 12, 2019
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 12, 2019
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 12, 2019
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 12, 2019
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 15, 2019
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 15, 2019
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 15, 2019
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 15, 2019
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 15, 2019
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 16, 2019
This chnage allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 To support using darc on arm64, this commit removes the customizations of LD_LIBRARY_PATH and instead forces darc to run again a .NET Core 3.0 runtime. This in-turn makes darc pick up the right libgit2sharp automatically for the right set of platforms and architectures. There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine.
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 20, 2019
This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine.
omajid
added a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 21, 2019
This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine.
crummel
pushed a commit
to omajid/dotnet-source-build
that referenced
this pull request
Nov 22, 2019
This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine.
crummel
pushed a commit
to dotnet/source-build
that referenced
this pull request
Nov 24, 2019
* Enable building on arm64 This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine. * Patch fixup.
omajid
added a commit
to omajid/dotnet-runtime
that referenced
this pull request
Jul 17, 2020
crossgen2 (and by extension, runtime) fails to build on an arm64 box. This is the error I see on Fedora 32 aarch64: ./build.sh ... crossgen2 -> artifacts/bin/coreclr/Linux.arm64.Debug/crossgen2/crossgen2.dll src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj(87,5): error MSB3030: Could not copy the file "artifacts/bin/coreclr/Linux.arm64.Debug//x64/libjitinterface.so" because it was not found. The file is there, just not under the `x64` directory: $ find -iname libjitinterface.so ./artifacts/bin/coreclr/Linux.arm64.Debug/libjitinterface.so ./artifacts/bin/coreclr/Linux.arm64.Debug/crossgen2/libjitinterface.so ./artifacts/obj/coreclr/Linux.arm64.Debug/src/tools/aot/jitinterface/libjitinterface.so The actual bug is that crossgen2 seems to assume that if the build is for an `arm64` RID, it's a cross-build, not a hosted build. Fix that by explicitly checking `BuildArchitecture` as well. Please see dotnet/corefx#40453 and dotnet/core-setup#8468 for related fixes enabling building for arm64 on an arm64 machine. I have *not* verified this change in Visual Studio.
MichaelSimons
pushed a commit
to dotnet/source-build-externals
that referenced
this pull request
Feb 8, 2022
* Enable building on arm64 This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine. * Patch fixup.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To enable building core-setup on arm64 machines (not cross compiled), we need
to do a few things:
Set the right TargetArchitecture
When
TargetArchitecture
is not explicitly specified and when the currentlyrunning architecture is Arm64, use arm64 as the
TargetArchitecture
. Don'talways use the currently running architecture as that doesn't play well with
an x86 Visual Studio trying to create x64 builds.
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 machine, we need to filter the list of found
libclrjit.so files to pick the normal-RID (eg, linux-arm64) libclrjit.so from
the two:
This is another attempt at #7696. It tries to be more conservative by only modifying
TargetArchitecture
/Platform
forarm64
.cc @dagood @vitek-karas