构建smplayer到LLVM IR并由lli运行

[英]Build smplayer to LLVM IR and run by lli


In ubuntu-14.10_amd64,I compiler smplayer-14.9.0.6690 by clang/llvm-3.4. I changed the Makefile in src, like:

在ubuntu-14.10_amd64中,我通过clang / llvm-3.4编译smplayer-14.9.0.6690。我在src中更改了Makefile,如:

CC=clang 
CXX=clang
CFLAGS = -emit-llvm ...
CXXFLAGS = -emit-llvm ...
LINK = llvm-link
TARGET = smplayer.bc

...

At last I got smplayer.bc. Then I used

最后我得到了smplayer.bc。然后我用了

$ llvm-dis smplayer.bc -o smplayer.ll 
$ lli -load=... -load=......  smplayer.ll 

But it got an error:

但它有一个错误:

LLVM ERROR: Program used external function '__dso_handle' which could not be resolved!

Then I used clang to build bc to native executable like this:

然后我使用clang将bc构建为本机可执行文件,如下所示:

$ clang smplayer.bc -v -o smplayer.na -m64 -L/usr/lib/x86_64-linux-gnu -lz -lQtDBus -lQtScript -lQtXml -lQtGui -lQtNetwork -lQtCore -lpthread

The error is:

错误是:

/usr/bin/ld: /tmp/smplayer-7c5fc5.o: undefined reference to symbol '__cxa_pure_virtual@@CXXABI_1.3'
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line

1 个解决方案

#1


Try using '-fno-use-cxa-atexit' with clang. That should get rid of the use of '__dso_handle'.

尝试使用'-fno-use-cxa-atexit'和clang。这应该摆脱'__dso_handle'的使用。

http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-January/058748.html

It is useful.

它是有益的。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2015/05/08/4cb0cf0a06c78d9c07d16bf7ea9e3f83.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告