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

apple-m1 detected as the native CPU for rustc on apple-m2 #127448

Closed
betelgeuse opened this issue Jul 7, 2024 · 5 comments
Closed

apple-m1 detected as the native CPU for rustc on apple-m2 #127448

betelgeuse opened this issue Jul 7, 2024 · 5 comments
Labels
C-bug Category: This is a bug. llvm-fixed-upstream Issue expected to be fixed by the next major LLVM upgrade, or backported fixes O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@betelgeuse
Copy link
Contributor

I tried this command

$ rustc --print target-cpus | head -n 2
Available CPUs for this target:
    native          - Select the CPU of the current host (currently apple-m1).

I expected to see this happen: explanation

I ran the command on a apple-m2 Macbook Pro so that should be selected as the native cpu.

Instead, this happened: explanation

apple-m1 was selected

Meta

rustc --version --verbose:

rustc 1.81.0-nightly (ed7e35f34 2024-07-06)
binary: rustc
commit-hash: ed7e35f3494045fa1194be29085fa73e2d6dab40
commit-date: 2024-07-06
host: aarch64-apple-darwin
release: 1.81.0-nightly
LLVM version: 18.1.7

Linking tracker #73908

@betelgeuse betelgeuse added the C-bug Category: This is a bug. label Jul 7, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 7, 2024
@ehuss
Copy link
Contributor

ehuss commented Jul 7, 2024

Thanks for the report! I believe this will be fixed when we update to LLVM 19 via llvm/llvm-project#82100 (see schedule).

@veera-sivarajan
Copy link
Contributor

@rustbot label -needs-triage +O-apple +llvm-fixed-upstream +T-compiler

@rustbot rustbot added llvm-fixed-upstream Issue expected to be fixed by the next major LLVM upgrade, or backported fixes O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jul 7, 2024
@nikic
Copy link
Contributor

nikic commented Aug 1, 2024

Can somebody on M2 please confirm that this is indeed fixed on current nightly?

@lukaslueg
Copy link
Contributor

$ rustup run nightly rustc --version
rustc 1.82.0-nightly (28a58f2fa 2024-07-31)
$ sysctl -n machdep.cpu.brand_string
Apple M3 Pro
$ rustup run nightly rustc --print target-cpus | head -n2
Available CPUs for this target:
    native          - Select the CPU of the current host (currently apple-m3).

For comparison

$ rustup run stable rustc --print target-cpus | head -n2
Available CPUs for this target:
    native          - Select the CPU of the current host (currently apple-m1).

@nikic
Copy link
Contributor

nikic commented Aug 1, 2024

Awesome, thanks for the confirmation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. llvm-fixed-upstream Issue expected to be fixed by the next major LLVM upgrade, or backported fixes O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants