iPlug2 Forum

Successfully compiled for ARM/M1 - I thought!

I was excited today when I successfully compiled one of my existing iPlug2 projects in Xcode 13.1 with the Architecture set to “Standard Apple (Silicon, Intel)”. I thought it translated the x86_64 build to include ARM64 as it compiled without error. I loaded the plugin in Logic (on Monterey) and it ran perfectly.

I don’t have an M1 so I checked the executable with “lipo -archs” and, to my disappointment, it says the file is x86_64 only - no ARM64.

So apparently there is more to porting to M1/ARM than simply re-building the plugin in Xcode with the Silicon + Intel architecture. What else is required? Massive changes or just some simple setting(s) somewhere? Apple info isn’t much help. Basically says Xcode does this “automagically”.

Since Rosetta can translate x86 code on the fly it seems like Xcode should be able to do the same at compilation time - but apparently it’s not that simple.

Nevermind - I got it!

“Trick” is to add “arm64” to Valid_Archs under User Defined in the project compiler settings. This setting comes from one of the iPlug config files but I don’t know where. I added arm64 manually here. Once I did that the build Target showed up as “Any Mac (Apple Silicon, Intel)”.

I successfully built VST2, VST3 and AU - but AAX build fails with numerous “unknown type” errors in acfbasetypes.h which is a file from the AAX SDK. Will check if there is a more recent AAX SDK, otherwise maybe AAX just isn’t ready yet?

There is no Apple Silicon version of Pro Tools yet. I think you can hack the headers to get it to compile as arm64, but it’s useless to do so at the moment. Compile AAX only for Intel until Avid says it’s ready to go.

Yes, that’s true - no way to test it just yet, but soon.

There is, in fact, a new version of the AAX SDK (v2.4.0) and it includes arm64. I swapped out the old SDK (2.3.2) and replaced it with 2.4.0; built the libraries as “Apple Silicon, Intel” and then recompiled my AAX plugin. It built straight away without any errors. I checked the x86 version in Pro Tools on Monterey and it works. When Pro Tools for M1 comes out I will check it there as well but suspect it will also work. We’ll see. In the meantime I checked the plugin with “lipo -archs” and it shows the plugin contains both x86_64 and arm64 code.

Update to my “success” story above - only some of my IPlug2 AAX projects build as arm64. Others fail - all with same 20 errors in file “mmintrin.h” which is an Xcode header file. Not sure what is causing this or why some plugins build and others don’t.

As sstillwell said above, no need to spend too much time fussing over this just yet. Was just hoping to get ahead of the curve.

I found my problem here and it was due to the “denormalization” code I was using.

Also fixed the issue here: AU builds with "Legacy" build system but not "New" build system - why? - #2 by RexMartin2