Discussion:
Compiling latest git
Quentin Stievenart
2014-10-07 13:53:18 UTC
Permalink
Hi all,

I am trying to setup the git version of klee on my machine (running a Linux
3.14.19, x86_64, GCC 4.9.1). I had some troubles running an older klee on the
coreutils binaries. I followed the tutorial at
http://klee.github.io/klee/GetStarted.html to install it. To minor changes were
needed:
1. Compiling LLVM 2.9 failed as an include of unistd.h was missing in one
file, due to changes in GCC
2. I used the git version of STP, as the version linked in the tutorial didn't
compile at all

Following the tutorial at http://klee.github.io/klee/TestingCoreutils.html, I
can get Steps 1 and 2 working, but on Step 3 I get the following error:

$ klee --libc=uclibc --posix-runtime ./cat.bc --version
klee: main.cpp:1104: llvm::Module* linkWithUclibc(llvm::Module*,
llvm::StringRef): Assertion `ft->getNumParams() == 7' failed.
0 klee 0x0000000000d0d0ef
1 klee 0x0000000000d0d664
2 libpthread.so.0 0x00007ffff7bcf200
3 libc.so.6 0x00007ffff689f967 gsignal + 55
4 libc.so.6 0x00007ffff68a0d3a abort + 362
5 libc.so.6 0x00007ffff68988ad
6 libc.so.6 0x00007ffff6898962
7 klee 0x000000000053c0bf main + 11695
8 libc.so.6 0x00007ffff688c040 __libc_start_main + 240
9 klee 0x0000000000548a42

I therefore tried to build latest git version of klee, with latest klee-uclib
and current LLVM (3.5), but I can't get klee to compile:

ModuleUtil.cpp:217:54: error: no member named 'begin_children' in
'llvm::object::Archive'
for (object::Archive::child_iterator AI = archive->begin_children(),
~~~~~~~ ^
ModuleUtil.cpp:218:22: error: no member named 'end_children' in
'llvm::object::Archive'
AE = archive->end_children(); AI != AE; ++AI)
~~~~~~~ ^
ModuleUtil.cpp:222:5: error: unknown type name 'error_code'; did you
mean 'std::error_code'?
error_code ec = AI->getName(memberName);
^~~~~~~~~~
std::error_code
/usr/sbin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/system_error:119:10:
note:
'std::error_code' declared here
struct error_code
^
ModuleUtil.cpp:222:25: error: too many arguments to function call,
expected 0, have 1; did
you mean 'llvm::Intrinsic::getName'?
error_code ec = AI->getName(memberName);
^~~~~~~
llvm::Intrinsic::getName
/home/quentin/llvm-3.5.0.src/include/llvm/IR/Intrinsics.h:48:15: note:
'llvm::Intrinsic::getName' declared here
std::string getName(ID id, ArrayRef<Type*> Tys = None);
^
[...]

However, I see that travis-ci reports that klee successfully builds. Any idea
why it fails here? Is there any up to date page summarizing with which version
of which software (llvm/gcc/stp/klee-uclibc) is klee working?

Thanks in advance,
Quentin
Emil Rakadjiev
2014-10-08 03:45:14 UTC
Permalink
Hi Quentin,

For LLVM 2.9 to compile, you need to make a small change:
https://www.mail-archive.com/klee-dev-AQ/***@public.gmane.org/msg01302.html
Also for STP r940 (if you don't want to use the upstream STP version):
https://github.com/stp/stp/commit/ece1a55fb367bd905078baca38476e35b4df06c3

Currently, LLVM 2.9 is supported and 3.4 has only experimental support.
So if you want to try a newer LLVM version, try 3.4 instead of 3.5.
There is a (bit hidden) guide about setting up KLEE with it:
http://klee.github.io/klee/Experimental.html

For me on 64-bit Ubuntu 14.04 (3.13.0) with GCC 4.8 all versions
mentioned in the setup tutorials worked. I used both upstream STP and
r940, and LLVM 2.9 and 3.4. I've just tried setting up everything with
GCC 4.9.1 and there were no problems, either.

Best regards,
Emil
Post by Quentin Stievenart
Hi all,
I am trying to setup the git version of klee on my machine (running a Linux
3.14.19, x86_64, GCC 4.9.1). I had some troubles running an older klee on the
coreutils binaries. I followed the tutorial at
http://klee.github.io/klee/GetStarted.html to install it. To minor changes were
1. Compiling LLVM 2.9 failed as an include of unistd.h was missing in one
file, due to changes in GCC
2. I used the git version of STP, as the version linked in the tutorial didn't
compile at all
Following the tutorial at http://klee.github.io/klee/TestingCoreutils.html, I
$ klee --libc=uclibc --posix-runtime ./cat.bc --version
klee: main.cpp:1104: llvm::Module* linkWithUclibc(llvm::Module*,
llvm::StringRef): Assertion `ft->getNumParams() == 7' failed.
0 klee 0x0000000000d0d0ef
1 klee 0x0000000000d0d664
2 libpthread.so.0 0x00007ffff7bcf200
3 libc.so.6 0x00007ffff689f967 gsignal + 55
4 libc.so.6 0x00007ffff68a0d3a abort + 362
5 libc.so.6 0x00007ffff68988ad
6 libc.so.6 0x00007ffff6898962
7 klee 0x000000000053c0bf main + 11695
8 libc.so.6 0x00007ffff688c040 __libc_start_main + 240
9 klee 0x0000000000548a42
I therefore tried to build latest git version of klee, with latest klee-uclib
ModuleUtil.cpp:217:54: error: no member named 'begin_children' in
'llvm::object::Archive'
for (object::Archive::child_iterator AI = archive->begin_children(),
~~~~~~~ ^
ModuleUtil.cpp:218:22: error: no member named 'end_children' in
'llvm::object::Archive'
AE = archive->end_children(); AI != AE; ++AI)
~~~~~~~ ^
ModuleUtil.cpp:222:5: error: unknown type name 'error_code'; did you
mean 'std::error_code'?
error_code ec = AI->getName(memberName);
^~~~~~~~~~
std::error_code
'std::error_code' declared here
struct error_code
^
ModuleUtil.cpp:222:25: error: too many arguments to function call,
expected 0, have 1; did
you mean 'llvm::Intrinsic::getName'?
error_code ec = AI->getName(memberName);
^~~~~~~
llvm::Intrinsic::getName
'llvm::Intrinsic::getName' declared here
std::string getName(ID id, ArrayRef<Type*> Tys = None);
^
[...]
However, I see that travis-ci reports that klee successfully builds. Any idea
why it fails here? Is there any up to date page summarizing with which version
of which software (llvm/gcc/stp/klee-uclibc) is klee working?
Thanks in advance,
Quentin
_______________________________________________
klee-dev mailing list
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev
.
Loading...