FuzzGen
FuzzGen copied to clipboard
Clarification on Build Instructions
Thanks a lot for the project. Next to closed-source FUDGE: Fuzz Driver Generation at Scale, this seems to be the only project for creating Fuzzing Drivers out of a library today. However, the build instructions seem a bit unclear and in reversed order to me. I try to provide a step-by-step solution. Please correct me where I'm wrong.
Clone Fuzzgen
-
git clone https://github.com/HexHive/FuzzGen
Build LLVM-6.0.0 (Taken from #19 and modified)
-
git clone https://github.com/llvm/llvm-project
-
cd llvm-project
-
git checkout llvmorg-6.0.0
-
cp -r FuzzGen/src/preprocessor/ llvm-project/clang/tools/fuzzgen/
(The Readme said$LLVM_SRC/tools/clang/tools
but there is no tools directory inllvm-project/
) - Open
llvm-project/clang/tools/CMakeLists.txt
and addadd_clang_subdirectory(fuzzgen)
(anywhere in the code or preferably at the end?) -
mkdir build
-
cd build
-
cmake -DLLVM_ENABLE_PROJECTS=clang -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_USE_LINKER=gold -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm
(setting parallel link jobs to 1 and using the gold linker are optional but supposedly easier for the RAM and shouldn't use as much swap memory) -
cmake --build .
(may take several hours to complete - 5-6 h in my case; setting the build type to Release should speed up the process a bit, though)
Build FuzzGen (Taken from the Readme and modified)
(1. FuzzGen has already been cloned beforehand)
2. sudo apt-get install libboost-all-dev
3. export LLVM_DIR=/llvm-project/build
(not really optional, right?; targeting other versions will fail later on; is it necessary to specify the exact build directory, that had been created while building LLVM-6.0.0?)
4. cd FuzzGen
5. mkdir build
6. cd build
7. cmake ..
8. make -j$(nproc)
Is adjusting the MACROS in src/compose.h
even necessary when only planning to work with the Debian-mode?
FWIW, I tried with the above but ran into a compilation error while compiling the fuzzgen clang tool on 6.0.0. Instead, I used git tag llvmorg-6.0.1
.
The AOSP portion of the README.md is also outdated. It mentions using showcommand
to find where the clang and clang++ python wrapper scripts are located. After Android7.0, I think, you want to use:
for VERBOSELOG in $(ls -1 ./out/verbose*.gz); do \
gzip -cd $VERBOSELOG | grep clang;
done
Can fuzzgen be used for c/c++ programs on linux systems? Because I saw that there are Generage Fuzzers for Debian but there is no specific operation description.