Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct ARCHFLAGS value on Apple Silicon?

On my previous, Intel-based Mac, I used to include

export ARCHFLAGS="-arch x86_64"

in my shell resource file. What's the correct compilation flag on the new ARM-based Apple silicon? arm? arm64? arm-64? arm_64? There doesn't seem to be a lot of resources out there yet, any pointers greatly appreciated!

like image 813
thomax Avatar asked Mar 30 '26 20:03

thomax


2 Answers

There's a long discussion over here on this topic. Long story short, they're agreeing on trusting uname -m to provide the correct architecture name.

This returns arm64, and given lack of evidence to the contrary, is probably the correct value.

like image 165
thomax Avatar answered Apr 01 '26 09:04

thomax


On my Mac silicon with an M2 processor, uname -m yields aarch64 and not arm64. This is also reflected under Ubuntu installed as a VM in the filesystem structure with directories /usr/include/aarch64-linux-gnu and /usr/lib/aarch64-linux-gnu

Correction: this is under Ubuntu as a VM on a Mac with a M2 processor. ON Mac itself, it does yield arm64

like image 26
Jacques Avatar answered Apr 01 '26 10:04

Jacques