Setup
Requirements
libFuzzer needs LLVM sanitizer support; this works on x86-64 Linux, x86-64 macOS and Apple-Silicon (aarch64) macOS, and Windows (thanks to the MSVC AddressSanitizer). Requires a C++ compiler with C++11 support. Rust provides multiple compilers. This project requires the nightly compiler since it uses the -Z
compiler flag to provide address sanitization. Assuming you used rustup to install Rust, you can check your default compiler with:
$ rustup default
stable-x86_64-unknown-linux-gnu (default) # Not the compiler we want.
To change to the nightly compiler:
$ rustup install nightly
$ rustup default nightly
nightly-x86_64-unknown-linux-gnu (default) # The correct compiler.
Installing
cargo install cargo-fuzz
Upgrading
cargo install --force cargo-fuzz