Tuesday, March 22, 2011

Be cautious about using Xcode 4.0 with LLVM 2.0 to deploy apps to iPhone 3G & below devices, apps crash

Update
Looks like this was resolved in Xcode 4.0.2 since I can't reproduce it anymore.

Original
On two separate iOS apps compiled with LLVM 2.0, user's whose iOS device could only run arm6 binaries crash at launch. Recompiling with LLVM 1.7 in Xcode 3.2.6 produces a fat binary that works for both armv6 & armv7 based devices.

It's certainly possible that there is some build setting I tweaked to expose a bug in LLVM 2.0. If that is true, I haven't found which one yet.

I filed a bug with Apple on this of course, # 9141747. If you are seeing the same issue, please dupe my bug.

Here are some build settings that might be relevant:

SettingSelection
ArchitecturesStandard (armv6 armv7)
Build Active Architectures OnlyNo
C/C++ Compiler VersionLLVM 2.0 or
LLVM 1.7
iOS Deployment TargetiOS 4.0 or
iOS 3.1.3
C Language DialectC99 [-std=c99]