[LLVMdev] LLVM linkage error - Program used external function 'foo' which could not be resolved!

mahesh ravishankar mahesh.ravishankar at gmail.com
Tue Jan 6 13:00:51 PST 2015


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

sys::DynamicLibrary::AddSymbol("foo",(void*)foo);

i.e., mapping the name "foo" to the variable foo.

On Mon, Jan 5, 2015 at 2:07 PM, Cheng Zhu <chengzhu at gmail.com> wrote:

> Hi, All
>
> I got a linkage error as indicated in the subject line. Any suggestion?
>
> I created a call builder.CreateCall2(foo, p1, p2) in a module. foo is
> a Function* generated by module->getOrInsertFunction("foo",
> prototype). foo is defined outside of this module, and in the dump of
> the module, I see "declare i64 @foo(xxx, xxx)". The error happens
> during link time, it seems like my jitted function couldn't find foo
> function defined outside of the module jitted function existed.
>
> --
> Best regards
>
> Cheng
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
Mahesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150106/6df8cc04/attachment.html>


More information about the llvm-dev mailing list