Hi James,> Yes - sorry I was unclear. I have pruned everything down to a pretty > minimal test: > - LLVM 2.6 compiled from source > - A slightly modified version of Duncan's example ll assembly posted earlier > - A minimal personality function (just a call to fprintf()) in a > separate C file compiled with gcc-llvm > - A single C++ function in a third file that simply does "throw 1;" > compiled with g++-llvm > - I can definitely see the personality function in the exception headers > and it's definitely not being called. > - If i replace "throw 1" with "result = _Unwind_RaiseException" then > result is 5 - i.e. END_OF_STACK.want to send us your testcase code? Then we can give it a whirl. Ciao, Duncan.
2010/1/22 Duncan Sands <baldrick at free.fr>> Hi James, > > > Yes - sorry I was unclear. I have pruned everything down to a pretty >> minimal test: >> - LLVM 2.6 compiled from source >> - A slightly modified version of Duncan's example ll assembly posted >> earlier >> - A minimal personality function (just a call to fprintf()) in a separate >> C file compiled with gcc-llvm >> - A single C++ function in a third file that simply does "throw 1;" >> compiled with g++-llvm >> - I can definitely see the personality function in the exception headers >> and it's definitely not being called. >> - If i replace "throw 1" with "result = _Unwind_RaiseException" then >> result is 5 - i.e. END_OF_STACK. >> > > want to send us your testcase code? Then we can give it a whirl. >Thanks, that would be really good - shall I upload it somewhere and mail a link? Bear in mind I'm still only targetting 2.6 though as haven't build head yet. -- James> > Ciao, > > Duncan. > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100122/37ae5d1c/attachment.html>
2010/1/22 Duncan Sands <baldrick at free.fr>> Hi James, > > > Yes - sorry I was unclear. I have pruned everything down to a pretty >> minimal test: >> - LLVM 2.6 compiled from source >> - A slightly modified version of Duncan's example ll assembly posted >> earlier >> - A minimal personality function (just a call to fprintf()) in a separate >> C file compiled with gcc-llvm >> - A single C++ function in a third file that simply does "throw 1;" >> compiled with g++-llvm >> - I can definitely see the personality function in the exception headers >> and it's definitely not being called. >> - If i replace "throw 1" with "result = _Unwind_RaiseException" then >> result is 5 - i.e. END_OF_STACK. >> > > want to send us your testcase code? Then we can give it a whirl. >Test code is at http://giantblob.com/ehtest.tar.gz Thanks for the help. I apologize in advance if it turns out I'm doing something stupid! -- James> > Ciao, > > Duncan. > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100122/ddea1687/attachment.html>
Hi James,> want to send us your testcase code? Then we can give it a whirl. > > > Test code is at http://giantblob.com/ehtest.tar.gz > > Thanks for the help. I apologize in advance if it turns out I'm doing > something stupid!I hope you realise that by running llvm-ld without -native you are actually executing your program from the JIT. I did a native compilation as follows: used llvm-link to link all of the bitcode into "total.bc"; ran llc on total.bc, producing "total.s"; did "g++ -o total total.s"; ran ./total. It seems to work: $ ./total __l_personality called$ Of course it is probably supposed to work from the JIT too (I don't know anything about the JIT), but it clearly doesn't: when I tried I got: lli: lib/ExecutionEngine/JIT/JIT.cpp:624: void llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, const llvm::MutexGuard&): Assertion `!isAlreadyCodeGenerating && "Error: Recursive compilation detected!"' failed. ... 6 lli 0x0000000000d3f5e2 llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard const&) + 62 7 lli 0x0000000000d3f9c6 llvm::JIT::getPointerToFunction(llvm::Function*) + 686 8 lli 0x0000000000d67c86 llvm::ExecutionEngine::getPointerToGlobal(llvm::GlobalValue const*) + 70 9 lli 0x0000000000d62805 llvm::JITDwarfEmitter::EmitCommonEHFrame(llvm::Function const*) const + 613 10 lli 0x0000000000d60ac3 llvm::JITDwarfEmitter::EmitDwarfTable(llvm::MachineFunction&, llvm::JITCodeEmitter&, unsigned char*, unsigned char*, unsigned char*&) + 335 ... Ciao, Duncan.