-
Notifications
You must be signed in to change notification settings - Fork 217
Conversation
3dc5d66
to
2b71679
Compare
9b7c172
to
b957d52
Compare
cc @dagood |
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 for this! I have a suggestion on how the JIT picking code might be able to be cleaner, looks good though.
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
b957d52
to
6a9b9ba
Compare
Even better. 😄 Thanks again. |
Thanks for the review and merging this! |
With this commit, I can build core-sdk on RHEL 8 on arm64 directly, without cross compilation. Bump the sourcelink version to pick up the ability to parse git info without depending on libgit2sharp. This allows sourcelink to work on arm64. The version is the same as the one recently added to core-setup: dotnet/core-setup#7696 Introduce a new 'HostArch' msbuild property that contains the host architecture (arm64, x64, etc). This is the architecture of the currently running machine, and may be different from the architecture we are targetting in the case of cross compilation. Use HostArch to determine whether _crossDir and LibCLRJitRid need to be special-cased for arm64 or or not.
@dagood It looks like this broke tests via VS in corefx: dotnet/corefx#40427 Do we want to revert it here in core-setup as well? |
That's a shame, I suppose we should. 😕 Thanks for pinging this thread about it. FYI @vitek-karas, @elinor-fung if you've had problems building tests in VS recently. |
With this commit, I can build core-sdk on RHEL 8 on arm64 directly, without cross compilation. Bump the sourcelink version to pick up the ability to parse git info without depending on libgit2sharp. This allows sourcelink to work on arm64. The version is the same as the one recently added to core-setup: dotnet/core-setup#7696 Introduce a new 'HostArch' msbuild property that contains the host architecture (arm64, x64, etc). This is the architecture of the currently running machine, and may be different from the architecture we are targetting in the case of cross compilation. There's a gotcha with HostArch: under Visual Studio (an x86) process, we generally want a x64 architecture. Use HostArch to determine whether _crossDir and LibCLRJitRid need to be special-cased for arm64 or or not.
Can we please revert this? Among other things this makes default command line build on Windows to produce x86 (unlike x64 which it did before) - this breaks all my links and so on, and it's not the default we want anyway. |
This reverts commit 4b82b1e. The changes break VS and may even change the default on Windows to x86 instead of x64.
I opened #7806 to revert this change |
With this commit, I can build core-sdk on RHEL 8 on arm64 directly, without cross compilation. Bump the sourcelink version to pick up the ability to parse git info without depending on libgit2sharp. This allows sourcelink to work on arm64. The version is the same as the one recently added to core-setup: dotnet/core-setup#7696 Introduce a new 'BuildArchitecture' msbuild property that contains the host architecture (arm64, x64, etc). This is the architecture of the currently running machine, and may be different from the architecture we are targetting in the case of cross compilation. There's a gotcha with BuildArchitecture: under Visual Studio (an x86) process, we generally want a x64 architecture. So try and restrict it to arm64 only. Use BuildArchitecture to determine whether _crossDir and LibCLRJitRid need to be special-cased for arm64 or or not.
With this commit, I can build core-sdk on RHEL 8 on arm64 directly, without cross compilation. Bump the sourcelink version to pick up the ability to parse git info without depending on libgit2sharp. This allows sourcelink to work on arm64. The version is the same as the one recently added to core-setup: dotnet/core-setup#7696 Introduce a new 'BuildArchitecture' msbuild property that contains the host architecture (arm64, x64, etc). This is the architecture of the currently running machine, and may be different from the architecture we are targetting in the case of cross compilation. There's a gotcha with BuildArchitecture: under Visual Studio (an x86) process, we generally want a x64 architecture. So try and restrict it to arm64 only. Use BuildArchitecture to determine whether _crossDir and LibCLRJitRid need to be special-cased for arm64 or or not.
With this commit, I can build core-sdk on RHEL 8 on arm64 directly, without cross compilation. Bump the sourcelink version to pick up the ability to parse git info without depending on libgit2sharp. This allows sourcelink to work on arm64. The version is the same as the one recently added to core-setup: dotnet/core-setup#7696 Introduce a new 'BuildArchitecture' msbuild property that contains the host architecture (arm64, x64, etc). This is the architecture of the currently running machine, and may be different from the architecture we are targetting in the case of cross compilation. There's a gotcha with BuildArchitecture: under Visual Studio (an x86) process, we generally want a x64 architecture. So try and restrict it to arm64 only. Use BuildArchitecture to determine whether _crossDir and LibCLRJitRid need to be special-cased for arm64 or or not.
With this commit, I can build core-sdk on RHEL 8 on arm64 directly, without cross compilation. Bump the sourcelink version to pick up the ability to parse git info without depending on libgit2sharp. This allows sourcelink to work on arm64. The version is the same as the one recently added to core-setup: dotnet/core-setup#7696 Introduce a new 'BuildArchitecture' msbuild property that contains the host architecture (arm64, x64, etc). This is the architecture of the currently running machine, and may be different from the architecture we are targetting in the case of cross compilation. There's a gotcha with BuildArchitecture: under Visual Studio (an x86) process, we generally want a x64 architecture. So try and restrict it to arm64 only. Use BuildArchitecture to determine whether _crossDir and LibCLRJitRid need to be special-cased for arm64 or or not.
With this commit, I can build core-sdk on RHEL 8 on arm64 directly, without cross compilation. Bump the sourcelink version to pick up the ability to parse git info without depending on libgit2sharp. This allows sourcelink to work on arm64. The version is the same as the one recently added to core-setup: dotnet/core-setup#7696 Introduce a new 'BuildArchitecture' msbuild property that contains the host architecture (arm64, x64, etc). This is the architecture of the currently running machine, and may be different from the architecture we are targetting in the case of cross compilation. There's a gotcha with BuildArchitecture: under Visual Studio (an x86) process, we generally want a x64 architecture. So try and restrict it to arm64 only. Use BuildArchitecture to determine whether _crossDir and LibCLRJitRid need to be special-cased for arm64 or or not.
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
…et/core-setup#7806) This reverts commit dotnet/core-setup@4b82b1e. The changes break VS and may even change the default on Windows to x86 instead of x64. Commit migrated from dotnet/core-setup@a307f0d
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 toarm64
whenTargetArchitecture
is not specifiedUse 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 foundlibclrjit.so
files to pick the normal-RID (eg,linux-arm64
)libclrjit.so
from the two:./.packages/transport.runtime.linux-arm64.microsoft.netcore.jit/5.0.0-alpha1.19403.2/runtimes/linux-arm64/native/libclrjit.so
./.packages/transport.runtime.linux-arm64.microsoft.netcore.jit/5.0.0-alpha1.19403.2/runtimes/x64_arm64/native/libclrjit.so
Use a version of SourceLink that supports arm64
We need to upgrade SourceLink to a version that contains Initial implementation of direct git repo data reading sourcelink#288. This commit just updates it to the latest version.
Fixes #7653