<div dir="ltr"><div><div>If you are using MCJIT, then I have found that sometimes external function symbols are not resolved properly. I have used the following call with some success<br><br></div>sys::DynamicLibrary::AddSymbol("foo",(void*)foo);<br><br></div>i.e., mapping the name "foo" to the variable foo.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 5, 2015 at 2:07 PM, Cheng Zhu <span dir="ltr"><<a href="mailto:chengzhu@gmail.com" target="_blank">chengzhu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, All<br>
<br>
I got a linkage error as indicated in the subject line. Any suggestion?<br>
<br>
I created a call builder.CreateCall2(foo, p1, p2) in a module. foo is<br>
a Function* generated by module->getOrInsertFunction("foo",<br>
prototype). foo is defined outside of this module, and in the dump of<br>
the module, I see "declare i64 @foo(xxx, xxx)". The error happens<br>
during link time, it seems like my jitted function couldn't find foo<br>
function defined outside of the module jitted function existed.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Best regards<br>
<br>
Cheng<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">Mahesh</div></div>
</div>