It seems llvm interpreter only supports a limited number of external functions. fmod, in particular is not supported. any reason why it is not supported ? "lli -force-interpreter test.bc LLVM ERROR: Tried to execute an unknown external function: double (double, double)* fmod " -- Kind Regards Xin Tong -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110614/2805605b/attachment.html>
Hi,> It seems llvm interpreter only supports a limited number of external > functions. fmod, in particular is not supported. any reason why it is not > supported ? > > "lli -force-interpreter test.bc > LLVM ERROR: Tried to execute an unknown external function: double (double, > double)* fmod > "You can check out the comments in lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp to see how LLVM interpreter handle external functions. "... If such a wrapper does not exist, and libffi is available, then the Interpreter will attempt to invoke the function using libffi, after finding its address." I guess you have to configure LLVM with "--enable-libffi" option. HTH. Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667
On Jun 14, 2011, at 7:57 PM, 陳韋任 wrote:> Hi, > >> It seems llvm interpreter only supports a limited number of external >> functions. fmod, in particular is not supported. any reason why it is not >> supported ? >> >> "lli -force-interpreter test.bc >> LLVM ERROR: Tried to execute an unknown external function: double (double, >> double)* fmod >> " > > You can check out the comments in lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp > to see how LLVM interpreter handle external functions. > > "... If such a wrapper does not exist, and libffi is available, then the Interpreter will > attempt to invoke the function using libffi, after finding its address." > > I guess you have to configure LLVM with "--enable-libffi" option.Also note that the interpreter has a ton of limitations, this is just the tip of the iceberg. It is far from being production quality. -Chris
Reasonably Related Threads
- [LLVMdev] LLVM interpreter does not support fmod
- [LLVMdev] LLVM interpreter does not support fmod
- [LLVMdev] llvm interpreter cannot execute llvm-gcc generated bitcode
- [LLVMdev] (Newbie) Using lli with clang++?
- [LLVMdev] llvm interpreter cannot execute llvm-gcc generated bitcode