[klee-dev] KLEE "make" errors with LLVM-3.4.2

Zhiyi Zhang xianlingzibiying at gmail.com
Fri Apr 14 13:16:14 BST 2017


Hi,

    Sorry for trouble you again.

    I have built LLVM 3.4 and KLEE using ./configure and make. The pictures
maybe too big to show in the previous email.

    My configure order is as following:

   *./configure --with-llvm=/home/loveling10/llvm
--with-stp=/home/loveling10/stp/stp
--with-uclibc=/home/loveling10/klee-uclibc --enable-posix-runtime*

    The errors are as following:

    "*llvm[2]: Linking Release+Asserts executable klee (without symbols)*
*/home/loveling10/klee/tools/klee/Release+Asserts/main.o: In function
`KleeHandler::getRunTimeLibraryPath[abi:cxx11](char const*)':*
*/home/loveling10/klee/tools/klee/main.cpp:599: undefined reference to
`llvm::sys::fs::getMainExecutable[abi:cxx11](char const*, void*)'*
*/home/loveling10/klee/tools/klee/Release+Asserts/main.o: In function
`KleeHandler::getKTestFilesInDir(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::vector<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >&)':*
*/home/loveling10/klee/tools/klee/main.cpp:583: undefined reference to
`llvm::error_code::message[abi:cxx11]() const'*
*/home/loveling10/klee/tools/klee/Release+Asserts/main.o: In function
`KleeHandler::KleeHandler(int, char**)':*
*/home/loveling10/klee/tools/klee/main.cpp:297: undefined reference to
`llvm::error_code::message[abi:cxx11]() const'*
*/home/loveling10/klee/tools/klee/Release+Asserts/main.o: In function
`main':*
*/home/loveling10/klee/tools/klee/main.cpp:1248: undefined reference to
`llvm::error_code::message[abi:cxx11]() const'*
*/home/loveling10/klee/tools/klee/main.cpp:1501: undefined reference to
`llvm::sys::StrError[abi:cxx11](int)'*
*/home/loveling10/klee/Release+Asserts/lib/libkleeCore.a(Executor.o): In
function `klee::Executor::terminateStateEarly(klee::ExecutionState&,
llvm::Twine const&)':*
*/home/loveling10/klee/lib/Core/Executor.cpp:2892: undefined reference to
`llvm::Twine::str[abi:cxx11]() const'*
*/home/loveling10/klee/Release+Asserts/lib/libkleeCore.a(Executor.o): In
function `klee::Executor::terminateStateOnError(klee::ExecutionState&,
llvm::Twine const&, klee::Executor::TerminateReason, char const*,
llvm::Twine const&)':*
*/home/loveling10/klee/lib/Core/Executor.cpp:2963: undefined reference to
`llvm::Twine::str[abi:cxx11]() const'*
*/home/loveling10/klee/lib/Core/Executor.cpp:2989: undefined reference to
`llvm::Twine::str[abi:cxx11]() const'*
*/home/loveling10/klee/Release+Asserts/lib/libkleeModule.a(ModuleUtil.o):
In function `klee::linkWithLibrary(llvm::Module*,
std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)':*
*/home/loveling10/klee/lib/Module/ModuleUtil.cpp:401: undefined reference
to `llvm::error_code::message[abi:cxx11]() const'*
*/home/loveling10/klee/Release+Asserts/lib/libkleeModule.a(ModuleUtil.o):
In function `linkBCA':*
*/home/loveling10/klee/lib/Module/ModuleUtil.cpp:243: undefined reference
to `llvm::error_code::message[abi:cxx11]() const'*
*/home/loveling10/klee/lib/Module/ModuleUtil.cpp:278: undefined reference
to `llvm::error_code::message[abi:cxx11]() const'*
*/home/loveling10/klee/Release+Asserts/lib/libkleeModule.a(RaiseAsm.o): In
function `klee::RaiseAsmPass::runOnModule(llvm::Module&)':*
*/home/loveling10/klee/lib/Module/RaiseAsm.cpp:91: undefined reference to
`llvm::sys::getDefaultTargetTriple[abi:cxx11]()'*
*/home/loveling10/klee/Release+Asserts/lib/libkleaverSolver.a(STPSolver.o):
In function `runAndGetCexForked':*
*/home/loveling10/klee/lib/Solver/STPSolver.cpp:235: undefined reference to
`llvm::sys::StrError[abi:cxx11](int)'*
*/home/loveling10/klee/Release+Asserts/lib/libkleaverExpr.a(Expr.o): In
function `klee::ConstantExpr::toString(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >&, unsigned int) const':*
*/home/loveling10/klee/lib/Expr/Expr.cpp:358: undefined reference to
`llvm::APInt::toString[abi:cxx11](unsigned int, bool) const'*
*/home/loveling10/klee/Release+Asserts/lib/libkleeSupport.a(CompressionStream.o):
In function `klee::compressed_fd_ostream::compressed_fd_ostream(char
const*, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >&)':*
*/home/loveling10/klee/lib/Support/CompressionStream.cpp:34: undefined
reference to `llvm::error_code::message[abi:cxx11]() const'*
*collect2: error: ld returned 1 exit status*
*/home/loveling10/klee/Makefile.rules:1389: recipe for target
'/home/loveling10/klee/Release+Asserts/bin/klee' failed*
*make[2]: *** [/home/loveling10/klee/Release+Asserts/bin/klee] Error 1*
*make[2]: Leaving directory '/home/loveling10/klee/tools/klee'*
*/home/loveling10/klee/Makefile.rules:806: recipe for target
'klee/.makeall' failed*
*make[1]: *** [klee/.makeall] Error 2*
*make[1]: Leaving directory '/home/loveling10/klee/tools'*
*/home/loveling10/klee/Makefile.rules:757: recipe for target 'all' failed*
*make: *** [all] Error 1*"

   It looks like that there are some linking errors between LLVM and KLEE,
but when I configure KLEE, it could found LLVM.

   "*checking llvm source dir... /home/loveling10/llvm*
*checking llvm obj dir... /home/loveling10/llvm*
*checking llvm package version... 3.4*
*checking llvm version major... 3*
*checking llvm version minor... 4*
*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... Found clang in LLVM Build*
*Using C llvm compiler : /home/loveling10/llvm/Release+Asserts/bin/clang*
*Using C++ llvm compiler :
/home/loveling10/llvm/Release+Asserts/bin/clang++*
*checking C LLVM Bitcode compiler works... Success*
*checking CXX LLVM Bitcode compiler works... Success*
*configure: Source timestamping disabled.*
*checking uclibc... /home/loveling10/klee-uclibc/lib/libc.a*"

   Also I have tested that LLVM is built successfully. So I am very
confused what is wrong during the building?

   Thanks.

   Best Wishes!
   Zhiyi Zhang


On Fri, Apr 14, 2017 at 6:30 AM, Dan Liew <dan at su-root.co.uk> wrote:

> On 13 April 2017 at 13:11, Zhiyi Zhang <xianlingzibiying at gmail.com> wrote:
> >
> > Hi,
> >
> > I tried building KLEE on Ubuntu 16.04 LTS. I have built LLVM-3.4.2 (put
> Clang into /llvm/tools,then cmake llvm )and STP-2.1.2. After I configured
> KLEE with "cmake",
> >
> > cmake -DENABLE_SOLVER_STP=ON  -DENABLE_POSIX_RUNTIME=ON
> -DENABLE_KLEE_UCLIBC=ON -DKLEE_UCLIBC_PATH=../klee-uclibc
> -DENABLE_SYSTEM_TESTS=ON  -DENABLE_UNIT_TESTS=OFF  ../klee
> >
> >
> >  I built KLEE with "make", but there were some errors about "kleaver".
> >
> > "Linking CXX executable ../../bin/kleaver
> >
> > ...............................
> >
> > ../../lib/libkleeSupport.a(CompressionStream.cpp.o):(.
> rodata._ZTIN4klee21compressed_fd_ostreamE[_ZTIN4klee21compressed_fd_ostreamE]+0x10):
> undefined reference to `typeinfo for llvm::raw_ostream'
> >
> > collect2: error: ld returned 1 exit status
> >
> > tools/kleaver/CMakeFiles/kleaver.dir/build.make:105: recipe for target
> 'bin/kleaver' failed
> >
> > make[2]: *** [bin/kleaver] Error 1
> >
> > CMakeFiles/Makefile2:688: recipe for target 'tools/kleaver/CMakeFiles/kleaver.dir/all'
> failed
> >
> > make[1]: *** [tools/kleaver/CMakeFiles/kleaver.dir/all] Error 2
> >
> > Makefile:127: recipe for target 'all' failed
> >
> > make: *** [all] Error 2"
> >
>
> The linking errors are related to RTTI (run time type information).
> This is because you built LLVM 3.4 CMake and the built `llvm-config`
> binary has a bug where it doesn't
> show the `-fno-rtti` flag.
>
> You have two options to fix this
>
> 1. Use the LLVM build that you produced using CMake but reconfigure
> KLEE by forcing the `-fno-rtti` flag. You will need to make a new
> build directory when you do this. Something like this
>
> ```
> CFLAGS="-fno-rtti" CXXFLAGS="-fno-rtti" cmake -DENABLE_SOLVER_STP=ON
> -DENABLE_POSIX_RUNTIME=ON -DENABLE_KLEE_UCLIBC=ON
> -DKLEE_UCLIBC_PATH=../klee-uclibc  -DENABLE_SYSTEM_TESTS=ON
> -DENABLE_UNIT_TESTS=OFF  ../klee
> ```
>
> 2. Rebuild LLVM using its autoconf/Makefile build system.
>
> This issue seem to keep appearing so we should improve our
> documentation to make it explicit that people should avoid building
> LLVM 3.4 using CMake.
>
> HTH,
> Dan.
>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the klee-dev mailing list