Learn how to combine libprotobuf-mutator with libfuzzer & AFL++
- Ubuntu Linux 18.04 64 bit
- Clang 9.0.0
- Follow the step in this article and add the toolchain's apt repository in Ubuntu.
sudo apt-get install clang-9 libfuzzer-9-dev
Follow the step in libprotobuf-mutator's readme
sudo apt-get update
sudo apt-get install protobuf-compiler libprotobuf-dev binutils cmake \
ninja-build liblzma-dev libz-dev pkg-config autoconf libtool
cd libprotobuf-mutator
mkdir build
cd build
cmake .. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON
ninja check # test
ninja # build
sudo ninja install # install
Notice
Use the following cmake command to buildlibprotobuf-mutator-libfuzzer.so.0
andlibprotobuf-mutator.so.0
shared library
cmake .. -GNinja -DCMAKE_C_COMPILER=clang-9 -DCMAKE_CXX_COMPILER=clang++-9 -DCMAKE_BUILD_TYPE=Debug -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DBUILD_SHARED_LIBS=ON