Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ pub struct BuildOptions {
#[arg(long)]
pub no_cfg_fuzzing: bool,

/// Do not instrument Rust code for fuzzing
#[arg(long)]
pub no_rust_fuzzing: bool,

#[arg(long)]
/// Don't build with the `sanitizer-coverage-trace-compares` LLVM argument
///
Expand Down
11 changes: 8 additions & 3 deletions src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,16 @@ impl FuzzProject {
cmd.arg("-Z").arg("build-std");
}

let mut rustflags: String = "-Cpasses=sancov-module \
let mut rustflags = String::new();

if !build.no_rust_fuzzing {
rustflags.push_str(
"-Cpasses=sancov-module \
-Cllvm-args=-sanitizer-coverage-level=4 \
-Cllvm-args=-sanitizer-coverage-inline-8bit-counters \
-Cllvm-args=-sanitizer-coverage-pc-table"
.to_owned();
-Cllvm-args=-sanitizer-coverage-pc-table",
);
}

if !build.no_trace_compares {
rustflags.push_str(" -Cllvm-args=-sanitizer-coverage-trace-compares");
Expand Down