embedded julia and llvm::TargetTriple

136 views
Skip to first unread message

Joosep Pata

unread,
Apr 24, 2015, 5:06:22 PM4/24/15
to juli...@googlegroups.com
I’m embedding julia along with another library (http://root.cern.ch) that relies on its own llvm, however, when I initialize the other library, the external llvm crashes due to an un-initialized TargetTriple that only appears when I link against julia.

I wanted to ask the julia devs if you know what could cause this - does julia do something clever with the internal llvm which could pollute the external llvm?

Here’s the stack trace
> * thread #1: tid = 0x3623a5, 0x0000000106fabd5b libCling.so`llvm::DenseMapBase<llvm::DenseMap<void const*, llvm::PassInfo const*, llvm::DenseMapInfo<void const*> >, void const*, llvm::PassInfo const*, llvm::DenseMapInfo<void const*> >::insert(std::__1::pair<void const*, llvm::PassInfo const*>&&) + 75, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1fd5bbfe)
> * frame #0: 0x0000000106fabd5b libCling.so`llvm::DenseMapBase<llvm::DenseMap<void const*, llvm::PassInfo const*, llvm::DenseMapInfo<void const*> >, void const*, llvm::PassInfo const*, llvm::DenseMapInfo<void const*> >::insert(std::__1::pair<void const*, llvm::PassInfo const*>&&) + 75
> frame #1: 0x0000000106fab5de libCling.so`llvm::PassRegistry::registerPass(llvm::PassInfo const&, bool) + 78
> frame #2: 0x0000000106e7dda1 libCling.so`llvm::initializeTargetLibraryInfoPass(llvm::PassRegistry&) + 161
> frame #3: 0x0000000106e7dee0 libCling.so`initialize(llvm::TargetLibraryInfo&, llvm::Triple const&, char const**) + 48
> frame #4: 0x0000000105ad3a0b libCling.so`cling::BackendPass::CreatePasses(this=0x0000000103027390, LangOpts=0x00000001032240a0, CodeGenOpts=0x0000000104028250) + 843 at BackendPass.cpp:420


And the uninitialized TargetTriple that gets passed to
> (llvm::Triple) TargetTriple = (Data = "", Arch = UnknownArch, SubArch = NoSubArch, Vendor = UnknownVendor, OS = UnknownOS, Environment = UnknownEnvironment, ObjectFormat = ELF)

in
> PMBuilder.LibraryInfo = new TargetLibraryInfo(TargetTriple);


I thought it’s worth a shot to ask here as this list is in general very knowledgeable and also very helpful.

Best
Joosep

Isaiah Norton

unread,
Apr 27, 2015, 10:14:30 AM4/27/15
to juli...@googlegroups.com
You could try passing RTLD_DEEPBIND to dlopen. (this is not available on Windows, but I guess that is probably not a problem for this use case).
Reply all
Reply to author
Forward
0 new messages