LLVM JIT : matching structure member alignment with gcc

192 Views Asked by At

I'm using the LLVM C++ API in a program compiled with gcc, and I'm also using the 'ExecutionEngine' JIT in the same process. I'm using boost::fusion to automatically lift C++ structs into this JIT, and I've noticed that when I produce struct definitions in this way, LLVM calculates different offsets for the fields of the struct than gcc does.

Does anyone know what I have to do to get LLVM's determination "in alignment" with gcc's? Could it be a problem that I'm casting "opaque" classes to byte arrays in the LLVM struct definition (e.g.: if a struct has an std::string I translate it to a byte array of length sizeof(std::string))?

0

There are 0 best solutions below