thomax
thomax

Reputation: 9659

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!

Upvotes: 11

Views: 6280

Answers (2)

Jacques
Jacques

Reputation: 1083

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

Upvotes: 1

thomax
thomax

Reputation: 9659

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.

Upvotes: 14

Related Questions