如何使用共享库运行LLVM解释器? [英] How to run LLVM interpreter with a shared library?
本文介绍了如何使用共享库运行LLVM解释器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有mylib.c
文件,该文件具有某些功能.我想将.c
文件中的那些函数用作已编译的llvm代码中的外部函数.我在玩LLVM解释器(lli-4.0
),不知道如何告诉lli
使用我的.c
文件中的函数?
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?
推荐答案
lli
具有-load
参数,因此您可以将C文件编译为动态库,然后只需
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 ....
这篇关于如何使用共享库运行LLVM解释器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文