What is the “Illegal Instruction: 4” error and why does “-mmacosx-version-min=10.x” fix it?

From the Apple Developer Forum (account required):

“The compiler and linker are capable of using features and performing optimizations that do not work on older OS versions. -mmacosx-version-min tells the tools what OS versions you need to work with, so the tools can disable optimizations that won’t run on those OS versions. If you need to run on older OS versions then you must use this flag.

“The downside to -mmacosx-version-min is that the app’s performance may be worse on newer OS versions then it could have been if it did not need to be backwards-compatible. In most cases the differences are small.”

Leave a Comment