How can I get SITL to compile a native ARM executable on my M1 Mac?


I just noticed that SITL on my M1 Mac is being compiled as a x86-64 (i.e. Intel) architecture exe.

file /Users/tim/ArduPilot/master/build/sitl/bin/arduplane 
/Users/tim/ArduPilot/master/build/sitl/bin/arduplane: Mach-O 64-bit executable x86_64

It think this might be causing some problems with autotest, but in any case, I’d like to be able to compile and run a native ARM exe. waf seems like a big black box to me, but I do know how make works, so if someone could point me in the right direction, I’d like to try to get SITL to compile as a native M1 binary. Can someone tell me where to look?

file …/ardupilot/build/sitl/bin$ file arducopter
arducopter: Mach-O 64-bit executable arm64

In Homebrew gcc you will see that there is the Apple Silicon version.

Check with what you are compiling (if with Apple, it is strange if it produces x86_64 code; anyhow I think Rosetta works well).

1 Like

I’m using the Xcode tool chain under /Applications as far as I know. This is what is in my path. I’m trying to figure out why waf would use something different.

I was using Mac Ports. I switched to HomeBrew and now it’s working.