Younwook Jang
2014-May-28 05:41 UTC
[LLVMdev] how to call the function in hosting code from JITted IR code..?
Dears, I'm trying to call the function that defined in the host application from IR code, but LLVM is saying that there is no such function... I've seen the tutorial of Kaleidoscope, and defined the function as extern "C" { void test1(void) { cout << "test function in the host application \n" ; } } ...in the host application. Would you please let me give any idea or comment for this topic...? thanks, regards... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140528/c7ce4103/attachment.html>
waxiadao@gmail.com
2014-May-28 15:00 UTC
[LLVMdev] how to call the function in hosting code from JITted IR code..?
Hello, 1.If you're on Windows,particularly x86 one,you have to check whether the function test1 is renamed to _test1 in your executable. 2.You have to append parameters like -fpic -rdynamic to make sure that your function is to be exported.And if you don't want to do so,you may have to call llvm::sys::DynamicLibrary::AddSymbol() or create your own MemoryManager. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140528/a83491c6/attachment.html>
Younwook Jang
2014-May-29 13:08 UTC
[LLVMdev] how to call the function in hosting code from JITted IR code..?
Hi, Waxiadao. thank you, it works...!! 2014-05-29 0:00 GMT+09:00 waxiadao at gmail.com <waxiadao at gmail.com>:> Hello, > 1.If you're on Windows,particularly x86 one,you have to check whether the > function test1 is renamed to _test1 in your executable. > 2.You have to append parameters like -fpic -rdynamic to make sure that > your function is to be exported.And if you don't want to do so,you may have > to call llvm::sys::DynamicLibrary::AddSymbol() or create your own > MemoryManager. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140529/5d9b31d1/attachment.html>