【发布时间】:2015-05-08 08:16:58
【问题描述】:
在 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
...
最后我得到了smplayer.bc。然后我用了
$ llvm-dis smplayer.bc -o smplayer.ll
$ lli -load=... -load=...... smplayer.ll
但出现错误:
LLVM ERROR: Program used external function '__dso_handle' which could not be resolved!
然后我使用 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
错误是:
/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
【问题讨论】: