如何使用共享库运行LLVM解释器? [英] How to run LLVM interpreter with a shared library?

查看:222
本文介绍了如何使用共享库运行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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆