linuxubuntullvmklee

checking C LLVM Bitcode compiler works... /xxx/llvm-3.4/Release+Asserts/bin/llvm-dis: Invalid type for value


This error appears when I try to install LLVM 3.4 before installing Klee.

The sources code is downloaded from LLVM official website and decompressed to a separate file from Klee. Makefile in llvm-3.4 directory is used to build LLVM.

To build Klee, first:

./configure --with-llvm=/home/zhangysh1995/work/llvm-3.4/ --wi
th-stp=/home/zhangysh1995/work/stp/stp

And the error:

....
checking for clang... FOUND
checking for clang++... FOUND
Using C llvm compiler : /usr/bin/clang
Using C++ llvm compiler : /usr/bin/clang++
checking C LLVM Bitcode compiler works... 
/home/zhangysh1995/work/llvm-3.4/Release+Asserts/bin/llvm-dis: In
valid type for value
configure: error: Failed converting LLVM Bitcode to LLVM assembly. Maybe your LLVM versions do not match?

It seems this error is thrown from Klee but there is no problem with my LLVM version as Klee guide says.

Another similar problem was posted here and here, but not helpful.

I still have no idea where to start my debug. I appreciate any possible help.


Solution

  • The error means klee use /usr/bin/clang++ to compile example souce code to .bc . And then use /home/zhangysh1995/work/llvm-3.4/Release+Asserts/bin/llvm-dis to disassamble it.

    You can verify the version missmatch by comparing the output of $ /usr/bin/clang++ --version and $ /home/zhangysh1995/work/llvm-3.4/Release+Asserts/bin/clang++ --version.

    To solve this, please use:

     ./configure \
     --with-llvm=/home/zhangysh1995/work/llvm-3.4/ \
     --with-llvmcc=/home/zhangysh1995/work/llvm-3.4/Release+Asserts/bin/clang \
     --with-llvmcxx=/home/zhangysh1995/work/llvm-3.4/Release+Asserts/bin/clang++ \
     --with-stp=/home/zhangysh1995/work/stp/stp