Hi Eli, Thanks for your reply. If I add -force-interpreter to lli, then it seems that it can not run external function like printf or malloc. Is there any easy way to solve this problem? On Wed, Dec 30, 2009 at 11:26 PM, Eli Friedman <eli.friedman at gmail.com>wrote:> On Wed, Dec 30, 2009 at 7:53 PM, Heming Cui <heming at cs.columbia.edu> > wrote: > > Dear all, > > I hope you enjoy your christmas! Recently I started to play lli with > > bc. I found that the lli only calls the main() function in bc file and > then > > does nothing before the main() function returns, which means that the > > JIT::runFunction() function is involved only once with the main() > function > > in bc file. If this was true, then lli does not have any control > > to the execution of program. Is this the case? > > In JIT mode, yes. > > > What I was thinking lli would do is fetching each LLVM IR > instruction > > and "execute" it with some tricks. Is there any option for JIT/lli to > work > > like this? > > If you pass -force-interpreter to lli, you should get something closer > to what you're looking for. > > -Eli > >-- Regards, Heming Cui -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091231/93e4f6a8/attachment.html>
On Thu, Dec 31, 2009 at 2:26 AM, Heming Cui <heming at cs.columbia.edu> wrote:> Hi Eli, > Thanks for your reply. If I add -force-interpreter to lli, then it seems > that it can not run external function like printf or malloc. Is there any > easy way to solve this problem?Does the LLVM configure find libffi? -Eli
Hi Eli, I think the llvm configure has already configured with ffi. ../llvm-2.6/configure -help | grep ffi --enable-libffi Check for the presence of libffi (default is YES) In addition, the printf() can work in program, reflecting that libffi is working, right? How can I make Interpreter work with getpid(), fork(), and clone()? On Thu, Dec 31, 2009 at 2:33 AM, Eli Friedman <eli.friedman at gmail.com>wrote:> On Thu, Dec 31, 2009 at 2:26 AM, Heming Cui <heming at cs.columbia.edu> > wrote: > > Hi Eli, > > Thanks for your reply. If I add -force-interpreter to lli, then it > seems > > that it can not run external function like printf or malloc. Is there any > > easy way to solve this problem? > > Does the LLVM configure find libffi? > > -Eli > >-- Regards, Heming Cui -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091231/0e149b81/attachment.html>