AngoraFuzzer / Angora

Angora is a mutation-based fuzzer. The main goal of Angora is to increase branch coverage by solving path constraints without symbolic execution.
Apache License 2.0
916 stars 166 forks source link

Various errors when using vanilla Angora to build a target #32

Open RoelVdP opened 5 years ago

RoelVdP commented 5 years ago
cd ~
git clone https://github.com/AngoraFuzzer/Angora.git Angora-llvm4
cd Angora-llvm4
mkdir llvm4
PREFIX=${PWD}/llvm4 ./build/llvm.sh .
${PWD}/llvm4/clang+llvm/bin/clang --version  # 4.0.0
${PWD}/llvm4/clang+llvm/bin/llvm-config --version  # 4.0.0
export PATH=${PWD}/llvm4/clang+llvm/bin:$PATH
export LD_LIBRARY_PATH=${PWD}/llvm4/clang+llvm/lib:$LD_LIBRARY_PATH
./build/build.sh

Then follow steps on https://github.com/AngoraFuzzer/Angora/blob/master/docs/example.md i.e.

cd ~
mkdir angora-test && cd angora-test
wget https://github.com/file/file/archive/FILE5_32.tar.gz
tar -xvzf FILE5_32.tar.gz
cp -r file-FILE5_32 track
cd track
autoreconf -i
CC=~/Angora-llvm4/bin/angora-clang ./configure --prefix=`pwd`/install --disable-shared

Gives;

...
checking for gcc... /home/roel/Angora-llvm4/bin/angora-clang
checking whether the C compiler works... no
configure: error: in `/home/roel/angora-test/track':
configure: error: C compiler cannot create executables
See `config.log' for more details

Errors;

~/angora-test/track$ grep "error" config.log 
clang: error: unsupported option '-V -Xclang'
clang: error: unknown argument: '-qversion'
error: unable to load plugin '/home/roel/Angora-llvm4/bin/unfold-branch-pass.so': '/home/roel/Angora-llvm4/bin/unfold-branch-pass.so: undefined symbol: _ZTVN4llvm8CallInstE'
error: unable to load plugin '/home/roel/Angora-llvm4/bin/angora-llvm-pass.so': '/home/roel/Angora-llvm4/bin/angora-llvm-pass.so: undefined symbol: _ZTVN4llvm17GetElementPtrInstE'
configure:3855: error: in `/home/roel/angora-test/track':
configure:3857: error: C compiler cannot create executables
RoelVdP commented 5 years ago

More analysis

~/conftst$ cat conftest.c 
/* confdefs.h */
#define PACKAGE_NAME "shadow"
#define PACKAGE_TARNAME "shadow"
#define PACKAGE_VERSION "4.6"
#define PACKAGE_STRING "shadow 4.6"
#define PACKAGE_BUGREPORT "pkg-shadow-devel@lists.alioth.debian.org"
#define PACKAGE_URL "https://github.com/shadow-maint/shadow"
#define PACKAGE "shadow"
#define VERSION "4.6"
/* end confdefs.h.  */
int main () { return 0; }

The following is using llvm4 compiled using the instructions from the README and Angora build from the main Angora trunk;

~/conftst$ /home/roel/Angora-llvm4/bin/angora-clang ./conftest.c 
error: unable to load plugin '/home/roel/Angora-llvm4/bin/unfold-branch-pass.so':
      '/home/roel/Angora-llvm4/bin/unfold-branch-pass.so: undefined symbol: _ZTVN4llvm8CallInstE'
error: unable to load plugin '/home/roel/Angora-llvm4/bin/angora-llvm-pass.so':
      '/home/roel/Angora-llvm4/bin/angora-llvm-pass.so: undefined symbol: _ZTVN4llvm17GetElementPtrInstE'
clang (LLVM option parsing): Unknown command line argument '-angora-dfsan-abilist=/home/roel/Angora-llvm4/bin/angora_abilist.txt'.  Try: 'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Did you mean '-dfsan-abilist=/home/roel/Angora-llvm4/bin/angora_abilist.txt'?
clang (LLVM option parsing): Unknown command line argument '-angora-dfsan-abilist=/home/roel/Angora-llvm4/bin/dfsan_abilist.txt'.  Try: 'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Did you mean '-dfsan-abilist=/home/roel/Angora-llvm4/bin/dfsan_abilist.txt'?
clang (LLVM option parsing): Unknown command line argument '-angora-exploitation-list=/home/roel/Angora-llvm4/bin/exploitation_list.txt'.  Try: 'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Did you mean '-precise-rotation-cost=/home/roel/Angora-llvm4/bin/exploitation_list.txt'?
spinpx commented 5 years ago

Sorry for my late reply. I tried your commands, and can not reproduce this issue. Please try

cargo clean
cd llvm_mode && make clean

then recompile Angora.

Or tried the docker version we provide.