[klee-dev] Compiling latest git

Quentin Stievenart quentin.stievenart at gmail.com
Tue Oct 7 14:53:18 BST 2014


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




More information about the klee-dev mailing list