On Thu, Feb 04, 2010 at 08:12:10PM +0100, jacob navia wrote: > Hi > > I have developed a JIT for linux 64 bits. It generates exception > handling information > according to DWARF under linux and it works with gcc 4.2.1. > > I have recompiled the same code under the Macintosh and something has > changed, > apparently, because now any throw that passes through my code crashes. > > Are there any differences bertween the exception info format between the > macintosh and linux? > > The st...@the moment of the throw looks like this: > > CPP code compiled with gcc 4.2.1 calls > JIT code generated on the fly by my JIT compiler that calls > CPP code compiled with gcc 4.2.1 that throws. The catch > is in the CPP code > The throw must go through the JIT code, so it needs the DWARF frame > descriptions > that I generate. Apparently there is a difference. > > Thanks in advance for any information. > > jacob > >
Jacob, Are you compiling on darwin10 and using the Apple or FSF gcc compilers? If you are using Apple's, this question should be on the darwin-devel mailing list instead. I would mention though that darwin10 is problematic in that the libgcc and its unwinder calls are now subsumed into libSystem. This means that regardless of how you try to link in libgcc, the new code in libSystem will always be used. For darwin10, Apple decided to default their linker over to compact unwind which causes problems with some of the java testcases on gcc 4.4.x. This is fixed for FSF gcc 4.5 by forcing the compiler to always link with the -no_compact_unwind option. Another complexity is that Apple decided to silently abort some of the libgcc calls (now in libSystem) that require access to FDEs like _Unwind_FindEnclosingFunction(). The reasoning was that the default behavior (compact unwind info) doesn't use FDEs. This is fixed for gcc 4.5 by http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00998.html. If you are using any other unwinder call that is now silently aborting, let me know as it may be another that we need to re-export under a different name from libgcc_ext. Alternatively, you may be able to work around this issue by using -mmacosx-version-min=10.5 under darwin10. Jack