When trying to build the popular library ICSharpCode.SharpZipLib.dll in debug mode for iPhone using Xamarin.iOS everything works fine. When I switch to Release mode, I get this error:
error MT3001: Could not AOT the assembly
When I turn on verbose output, here is what I get:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -miphoneos-version-min=4.3 -arch armv7 -std=c99 -I/Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -c /var/folders/kn/1j5jxvv131zcyqmgy3yj_xfw0000gn/T/tmp13a8fd89.tmp/System.Data.dll.armv7.s -o /var/folders/kn/1j5jxvv131zcyqmgy3yj_xfw0000gn/T/tmp13a8fd89.tmp/System.Data.dll.armv7.o
error MT3001: Could not AOT the assembly '.../bin/iPhone/Release/ICSharpCode.SharpZipLib.dll'
at MTouch.GetObjectFileForAssembly (System.String assemblyName, Abi abi) [0x00000] in <filename unknown>:0
at MTouch+<CompileAssemblies>c__AnonStoreyB.<>m__E (System.String s) [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey36`1[System.String].<>m__34 (System.String e, System.Threading.Tasks.ParallelLoopState s, System.Object l) [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey35`2[System.String,System.Object].<>m__32 () [0x00000] in <filename unknown>:0
at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0
This is with LLVM turned on and SGen turned on. When I turn off SGen as suggested in this (Mono ARMv7 and LLVM) post, I get the exact same MT3001 error.
When I turn off LLVM, then it works again. The problem is that I need LLVM.
How can I get this common library to build in Monotouch/Xamarin.iOS without turning off LLVM? Any help is greatly appreciated.