Amit Prakash
2012-Dec-18 19:18 UTC
[LLVMdev] llvm-clang jit module running into unresolved functions
We are trying to adapt the clang-llvm interpreter code here<http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/clang-interpreter/> to run some c++ code that uses stl vector and c++ string among other things. This resulted in a number of unresolved symbols, and after eliminating a bunch of them, we are still stuck with __Unwind_resume and __assert_fail I would really appreciate any help on resolving this. Note: we were having problem with includes in the code that needed to be jitted so we ran clang++ to preprocess it and the output of that is a single c++ file with no dependency on local includes. Not sure if that has introduced some problems. Note2: This is on Ubuntu 12.01 and we tried compiling clang interpreter with both clang+llvm 3.1 and with gcc 4.6.3 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121218/3622cc7d/attachment.html>
Duncan Sands
2012-Dec-19 15:54 UTC
[LLVMdev] llvm-clang jit module running into unresolved functions
Hi Amit, On 18/12/12 20:18, Amit Prakash wrote:> We are trying to adapt the clang-llvm interpreter code here > <http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/clang-interpreter/> to > run some c++ code that uses stl vector and c++ string among other things. This > resulted in a number of unresolved symbols, and after eliminating a bunch of > them, we are still stuck with __Unwind_resume__Unwind_Resume is defined in libgcc and for doing exception handling. If your interpreter is statically linked with libgcc and doesn't use exception handling then maybe this symbol was discarded, which would explain why the JIT'd code can't find it. In general if the JIT'd code is using some library then either the program doing the JITing needs to have been linked with that library, or it needs to dynamically load the library on behalf of the JIT'd code. Ciao, Duncan. and __assert_fail> > I would really appreciate any help on resolving this. > > Note: we were having problem with includes in the code that needed to be jitted > so we ran clang++ to preprocess it and the output of that is a single c++ file > with no dependency on local includes. Not sure if that has introduced some problems. > > Note2: This is on Ubuntu 12.01 and we tried compiling clang interpreter with > both clang+llvm 3.1 and with gcc 4.6.3 > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >