Whenever I create two separate libraries with LLVM 3.0 and link them together. I always get the following stack trace on exit.
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000001004b0000
#0 0x00007fff8a95cda2 in memmove$VARIANT$sse42 ()
#1 0x00000001006020a0 in llvm::PassRegistry::removeRegistrationListener ()
#2 0x00000001005fbe60 in llvm::cl::list<llvm::PassInfo const*, bool, llvm::PassNameParser>::~list ()
#3 0x00007fff8a9767c8 in __cxa_finalize ()
#4 0x00007fff8a976652 in exit ()
I am creating one shared library from the Core component and one from the Target component.
I have tried calling:
LLVMPassRegistryRef pass_registry = LLVMGetGlobalPassRegistry();
LLVMInitializeCore(pass_registry);
Any ideas on how proceed?