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

Add support for ARM64EC when building with MSVC #910

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

dpaoliello
Copy link
Contributor

@dpaoliello dpaoliello commented Dec 6, 2023

  • Building for ARM64EC requires passing the -arm64EC flag to cl.exe and /machine:arm64ec to lib.exe: https://learn.microsoft.com/en-us/windows/arm/arm64ec-build#developer-command-prompt
  • Updated tool discovery to handle arm64ec as a target arch by using the aarch64 paths.
  • When targeting arm64ec the lib path must ALSO include the arm64ec VC libs BEFORE the aarch64 libs.
  • Added a new TargetArch wrapper type to avoid splitting the target string multiple times or calling contains when we could be using string comparison.

@dpaoliello dpaoliello marked this pull request as draft December 13, 2023 05:55
@dpaoliello dpaoliello marked this pull request as ready for review December 15, 2023 18:10
@dpaoliello
Copy link
Contributor Author

@ChrisDenton would you mind having a look at this PR? It's blocking adding ARM64EC as a new target, and also provides some cleanups to avoid splitting the target triple over-and-over again within windows_registry.

@ChrisDenton
Copy link
Contributor

For sure, I'm still catching up on review but I'll prioritize this.

Copy link
Contributor

@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.

Looks good to me. I have one observation but nothing that should block merging this.

I do think using TargetArch is a clear improvement even without the other changes in this PR.

instance_path: &Path,
) -> Option<(PathBuf, PathBuf, PathBuf, PathBuf, PathBuf)> {
) -> Option<(PathBuf, PathBuf, PathBuf, PathBuf, Option<PathBuf>, PathBuf)> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this return type is getting increasingly out of hand and should probably be a proper struct or otherwise rearchitectured. However, vs15plus_vc_paths is only called from one place and that immediately deconstructs it into named variables so I'm not minded to block this PR on that.

@ChrisDenton ChrisDenton merged commit f17047d into rust-lang:main Jan 5, 2024
18 checks passed
@dpaoliello dpaoliello deleted the arm64ec branch January 5, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants