How to run LLVM interpreter with a shared library?

爱⌒轻易说出口 提交于 2019-12-13 14:34:23

问题


I have mylib.c file which has some functions. I want to use those functions from my .c file as external ones in compiled llvm code. I'm playing with LLVM interpreter (lli-4.0) and I wonder how can I tell lli to use functions from my .c file?


回答1:


lli has a -load argument so you compile your C file to a dynamic library and then just do

lli -load path-to-your-dynamic-library ....


来源:https://stackoverflow.com/questions/44189232/how-to-run-llvm-interpreter-with-a-shared-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!