-1

我正在尝试按照以下步骤安装 KLEE:

http://klee.github.io/getting-started/

不幸的是,在步骤 06“配置 KLEE:从 KLEE 源目录,运行:

我收到以下错误:

xxx@xxx18:~/klee$ ./configure --with-llvm=/home/xxx/llvm-2.9 --with-stp=/home/xxx/stp-r940/install
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking type of operating system we're going to host on... 
checking llvm source dir... /home/xxx/llvm-2.9
checking llvm obj dir... /home/xxx/llvm-2.9
checking llvm package version... 2.9
checking llvm version major... 2
checking llvm version minor... 9
checking llvm is release version... 1
checking if LLVM needs C++11... no
checking llvm build mode... Release+Asserts
checking llvm has asserts enabled... 1
checking LLVM Bitcode compiler... 
checking for llvm-gcc... FOUND
checking for llvm-g++... FOUND
Using C llvm compiler : /usr/bin/llvm-gcc
Using C++ llvm compiler : /usr/bin/llvm-g++
checking C LLVM Bitcode compiler works... Potential incompatible plugin version. GCC: 4.6 (20120301). Expected: 4.6 (20120301)
Defines 'dragonegg_disable_version_check' as env variable to remove this warning
Please note that unexpected errors might occur.
/home/xxx/llvm-2.9/Release+Asserts/bin/llvm-dis: Invalid bitcode signature
configure: error: Failed converting LLVM Bitcode to LLVM assembly. Maybe your LLVM versions do not match?

有没有人有同样的问题?

谢谢

朱塞佩

4

2 回答 2

2

我编写了这个配置检查。它正在检查检测到的用于创建 LLVM 位代码的编译器是否可以创建与构建 KLEE 的 LLVM 版本一起使用的 LLVM 位代码。如果此检查不存在并且存在位码不兼容,则 KLEE 运行时的编译稍后会失败,因此它会尝试更早地检测到失败。

看起来/usr/bin/llvm-gcc没有生成适用于您正在编译的 LLVM 版本的 LLVM 位码。您需要自己调试。您可以查看该autoconf/configure.ac文件以了解检查是如何实现的。

正如已经建议的那样,我们的Docker 映像是一种无需麻烦即可开始的好方法

于 2015-09-04T15:09:05.160 回答
0

想必可以在官方文档中找到解决方案:
“此时忘记将 llvm-gcc 添加到您的 PATH 是迄今为止新用户报告的构建错误最常见的来源。” ( http://klee.github.io/getting-started/ )

我很久以前使用 KLEE 和 llvm-2.9,所以我不记得 LLVM-2.9 是否构建在 llvm-gcc 中。目前最好使用 llvm-3.2 或 llvm-3.4 支持的 KLEE(它们都不需要 llvm-gcc)。供您参考:(1)使用 llvm-3.2 构建 KLEE 的教程:http: //blog.trailofbits.com/2014/12/04/close-encounters-with-symbolic-execution-part-2/#comments(我用 32 位 ubuntu 和 64 位 ubuntu 尝试了本教程。两者都运行良好);(2) 使用 llvm-3.4 构建 KLEE 的教程:( http://klee.github.io/experimental/ )。或者您可以按照第一个教程中解释的步骤构建 KLEE(下载第二个教程中介绍的版本)(只需替换 llvm 和 clang 的版本)。

于 2015-09-29T19:08:32.180 回答