eurecom-s3 / symcc

SymCC: efficient compiler-based symbolic execution
http://www.s3.eurecom.fr/tools/symbolic_execution/symcc.html
GNU General Public License v3.0
776 stars 135 forks source link

Error on compiling symcc #19

Closed cryptomadco closed 4 years ago

cryptomadco commented 4 years ago

Hello .

I have the following output after "ninja check"

/home/crypto/symcc/runtime/qsym_backend/qsym/qsym/pintool/solver.cpp: In member function ‘bool qsym::Solver::isInterestingJcc(qsym::ExprRef, bool, ADDRINT)’:
/home/crypto/symcc/runtime/qsym_backend/qsym/qsym/pintool/solver.cpp:511:39: warning: unused parameter ‘rel_expr’ [-Wunused-parameter]
 bool Solver::isInterestingJcc(ExprRef rel_expr, bool taken, ADDRINT pc) {
                                       ^~~~~~~~
[20/21] Building CXX object qsym_backend/CMakeFiles/SymRuntime.dir/expr_builder__gen.cpp.o
qsym_backend/expr_builder__gen.cpp: In member function ‘qsym::ExprRef qsym::SymbolicExprBuilder::createSub(qsym::NonConstantExprRef, qsym::NonConstantExprRef)’:
qsym_backend/expr_builder__gen.cpp:827:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
       if (l->getChild(0)->isConstant()) {
       ^~
qsym_backend/expr_builder__gen.cpp:832:5: note: here
     case Sub: {
     ^~~~
[21/21] Linking CXX shared library libSymRuntime.so
qsym_backend/CMakeFiles/SymRuntime.dir/Runtime.cpp.o: In function `_sym_initialize':
Runtime.cpp:(.text+0x402): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
[13/14] Testing the system...
/bin/sh: 1: lit: not found
FAILED: test/CMakeFiles/check 
cd /home/crypto/symcc/build/test && lit --verbose --path=/home/crypto/llvm-project-llvmorg-10.0.1/build/./bin /home/crypto/symcc/build/test
ninja: build stopped: subcommand failed.

So where the problem is ?

using llvm 10 as said in the documentation . ubuntu 18 x64

The command before ninja check is :

cmake -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -G Ninja ../ -DQSYM_BACKEND=ON -DZ3_DIR="$FUZZER/z3/build/symcc/z3/cmake_conf"

FUZZER variable is : /home/crypto/symcc (symcc root) .

Thanks

aurelf commented 4 years ago

Hi, thanks for the report. I think you are missing the tool "lit", can you install llvm-10-tools and let us know if that works?
Maybe we need to add a check or mention this in the documentation.

cryptomadco commented 4 years ago

Hey,

I just installed that, still I don't have it! So, the error still exists. seems installing llvm-10-tools do not results in installing lit .

sebastianpoeplau commented 4 years ago

@cryptomadco the easiest will be to get it from PyPI, e.g. via pip install lit. Getting it from distribution packages is a bit more challenging because some distributions package it while others put it in a separate tools package or don't ship it at all.

cryptomadco commented 4 years ago

@sebastianpoeplau Thanks, but here is the final problem after compilation :(

crypto@magma2:~/magma/fuzzers/symcc_afl/symcc/build$ ./symcc
/usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Do I missed to install or replace something ?

aurelf commented 4 years ago

You need to pass a program to compile. See the example in the readme.

cryptomadco commented 4 years ago

Yes, right!

So I assume this as a solved issue, thank you !