diff --git a/cargo-afl/src/main.rs b/cargo-afl/src/main.rs index ce5cd34f7..5d605bdca 100644 --- a/cargo-afl/src/main.rs +++ b/cargo-afl/src/main.rs @@ -241,13 +241,12 @@ where let binding = common::afl_llvm_dir(); let p = binding.display(); - let mut rustflags = format!( + let mut rustflags = String::from( "-C debug-assertions \ -C overflow_checks \ - -C passes={passes} \ -C codegen-units=1 \ -C opt-level=3 \ - -C target-cpu=native " + -C target-cpu=native ", ); let mut environment_variables = HashMap::<&str, String>::new(); environment_variables.insert("ASAN_OPTIONS", asan_options); @@ -271,13 +270,14 @@ where environment_variables.insert("AFL_QUIET", "1".to_string()); } else { - rustflags.push_str( - "-C llvm-args=-sanitizer-coverage-level=3 \ + rustflags.push_str(&format!( + "-C passes={passes} \ + -C llvm-args=-sanitizer-coverage-level=3 \ -C llvm-args=-sanitizer-coverage-trace-pc-guard \ -C llvm-args=-sanitizer-coverage-prune-blocks=0 \ -C llvm-args=-sanitizer-coverage-trace-compares ", - ); + )); } let no_cfg_fuzzing = env::var("AFL_NO_CFG_FUZZING").is_ok();