3

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?

arrowd
  • 33,231
  • 8
  • 79
  • 110
srossross
  • 1,353
  • 11
  • 16

1 Answers1

0

I've found a simple solution in case anyone is wondering. The --enable-shared option (disabled by default) on the configure script creates a LLVM-3.X shared library. Linking to this rather than the output of the llvm-config --libs core solved it.

srossross
  • 1,353
  • 11
  • 16