rust-lang / rust-lang/rust

`target_arch` is wrong in `arm64ec-pc-windows-msvc`

Open
#131,172 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug O-AArch64 O-windows T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Rust's target_arch cfg is generally very generic, and does not include e.g. the sub-architecture.

For example, the arm64e-apple-darwin has target_arch = "aarch64". This is also true of all the ARM targets, these all have target_arch = "arm" even though the full target name is much longer.

arm64ec-pc-windows-msvc is the only target that differs here, and sets target_arch = "arm64ec". I am not familiar with the specifics of ARM64EC, but I think it should probably set target_arch = "aarch64" too? Or, if it really needs to be different, target_arch = "aarch64ec", since Rust prefers Aarch64 over ARM64? Or maybe target_arch = "aarch64", but with an extra target_feature to allow distinguishing them?

I would've filed a PR to fix it myself, but it's a bit of work since a lot of places in rustc check for target.arch == "arm64ec", so I wanted to make sure I was on the right path first.

CC target maintainer @dpaoliello.
@rustbot label O-windows O-AArch64

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by auditing the rustc locations that check target.arch == "arm64ec" and compare them with the existing ARM target configuration behavior described in the issue. Done means the intended target_arch and any distinguishing target_feature are agreed upon, with all affected compiler checks and relevant tests aligned.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.