Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support native ARM64 MSVC toolchain #732

Closed
wants to merge 3 commits into from

Conversation

Alovchin91
Copy link
Contributor

In VS 17.3 a native ARM64 MSVC toolchain has appeared. Generally it should be chosen over the emulated one.

Open questions:

  • Did it actually appear in VS 17.2?
  • Does it contain all the tools?
  • If not, should we try several toolchains? Or is it okay if it's not complete in older, unsupported versions of VS 2022?

@thomcc thomcc added the O-windows Windows targets and toolchains label Oct 26, 2022
@ChrisDenton
Copy link
Member

This code will need formatting and the MSRV issues fixed.

More importantly this will need some testing. Ideally we should also have Windows ARM running in CI.

@briansmith
Copy link

@Alovchin91 Are you interested in rebasing this and pushing it so we can see the CI run results again?

@Alovchin91
Copy link
Contributor Author

@briansmith Sure, will be back at my laptop in a couple hours 👍

@Alovchin91 Alovchin91 force-pushed the alovchin91/msvc-arm64 branch from 063cd1a to a2b22b2 Compare October 3, 2023 19:53
@Alovchin91 Alovchin91 marked this pull request as ready for review October 3, 2023 20:14
@Alovchin91
Copy link
Contributor Author

@briansmith Done

@thomcc thomcc requested a review from ChrisDenton October 3, 2023 20:31
Copy link
Member

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me, just one nit that I've commented on.

Also I accept that falling back to x86 is the reasonable solution given that's the current behaviour. However, I'd definitely be interested in a followup PR that just errors for newer versions of VS.

// There is no natively hosted compiler on ARM64.
// Instead, use the x86 toolchain under emulation (there is no x64 emulation).
AARCH64 => "X86",
let hosts = match host_arch() {
Copy link
Member

Choose a reason for hiding this comment

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

If you annotate hosts with a type (i.e. &[&str]) you should be able to avoid creating Vecs.

@dpaoliello
Copy link
Contributor

@Alovchin91 are you still working on this, or would you like me to take over?

To answer your questions:

  • 17.4 is the first VS with support for ARM64: https://devblogs.microsoft.com/visualstudio/arm64-visual-studio-is-officially-here/
  • The "Desktop development with C++" and ".NET Desktop development" workloads are both supported, which includes cl.exe, link.exe, msbuild.exe and the Windows SDK.
  • For now, I don't believe that we should drop support for using x86 on ARM64, given that VS has no way to migrate across architectures other than re-installing.

One interesting thing we may want to do: on Windows 11 we should prefer the x64 host architecture to x86 since it should be faster.

@Alovchin91
Copy link
Contributor Author

Hi @dpaoliello, I don't currently actively work on it, so if you'd prefer to take it over, please go ahead ☺️ Otherwise I will pick it up at some point but without any concrete promises about the timeframe.

@NobodyXu
Copy link
Collaborator

Close as #957 supersedes this and is already merged

@NobodyXu NobodyXu closed this Feb 24, 2024
@Alovchin91 Alovchin91 deleted the alovchin91/msvc-arm64 branch September 27, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Windows targets and toolchains
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants