I'm working on a build system for a fairly large MonoTouch application which is using a lot of cross-platform components. As a result, we often run into a situation where one of those cross-platform components does something that cannot be aot compiled. Should that something actually get executed, the device build will crash. At that point, we have to track down where the crash happened, find the offending method, and hack it up so that it won't try to JIT in the MonoTouch build.
My question is, is there a way to detect these things during the build process? At first, we had a regex that tried to detect generic virtual methods, but there are also issues with certain types of LINQ and lambdas that will try to JIT as well, and I'd rather not try to write my own parser to detect them all. I've tried using monodis AssemblyName.dll
, and it will give me a lot of missing method errors, but most of them seem to be innocuous - and even if they weren't, it doesn't tell me where the references to said method are so that I can see what needs to be done. On top of that, sometimes it will crash with Abort trap: 6
or Bus error: 10
before the end of the assembly, which is quite unhelpful. Is there a better way I can detect attempts to JIT in my build process?