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

CPU: fix M2 family detection #14148

Merged
merged 2 commits into from Nov 16, 2022
Merged

Conversation

bayandin
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

On MacBook Air with M2 chip brew config return dunno family (while arm_blizzard_avalanche is expected):

$ brew config | grep CPU
CPU: octa-core 64-bit dunno

And here's the corresponding sysctl -A output:

% sysctl -A | grep hw.cpufamily
hw.cpufamily: -634136515

It looks like some signed int32 overflow happens somewhere for 0xda33d83d, which causes it to return a negative number.

These changes will also affect CPU family detection for ARMv8.2-A (Monsoon, Mistral) (https://en.wikipedia.org/wiki/Apple_A11) and for ARMv8.0-A (Twister) (https://en.wikipedia.org/wiki/Apple_A9 / https://en.wikipedia.org/wiki/Apple_A9X). They are used in iPhones only, so I don't think it will affect anything real.

@BrewTestBot
Copy link
Member

Review period will end on 2022-11-16 at 11:27:05 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Nov 15, 2022
Co-authored-by: Bo Anderson <mail@boanderson.me>
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Nov 16, 2022
@BrewTestBot
Copy link
Member

Review period ended.

@bayandin bayandin merged commit c013762 into Homebrew:master Nov 16, 2022
@bayandin bayandin deleted the fix-m2-detection branch November 16, 2022 12:10
@github-actions github-actions bot added the outdated PR was locked due to age label Dec 17, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants