Skip to content

Commit db51f4a

Browse files
author
Michael Rodler
committed
improve cargo fuzz compat and bump to newer libAFL version
* bumped libAFL version, which breaks sancov 8bit inline counters for some reason. => feature-guarded 8bit inline counters and use pcguard instead. * use the same paths for corpus/crashes as cargo fuzz => this should allow mixing `cargo fuzz` and `cargo libafl`. * feature-guard the Tui away and instead use `env_logger` by default.
1 parent 10a9a30 commit db51f4a

File tree

5 files changed

+161
-87
lines changed

5 files changed

+161
-87
lines changed

cargo-libafl/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cargo-libafl"
3-
version = "0.1.8"
3+
version = "0.1.9"
44
authors = ["Andrea Fioraldi <andreafioraldi@gmail.com>"]
55
license = "MIT OR Apache-2.0"
66
description = "A `cargo` wrapper to fuzz Rust code with `LibAFL`"
@@ -28,3 +28,7 @@ toml = "0.5.9"
2828
cargo-binutils = "0.3.6"
2929
rustc_version = "0.4"
3030
xdg = "2.4"
31+
32+
[features]
33+
sancov_8bit = []
34+
tui = []

cargo-libafl/build.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,15 @@ fn main() {
4747
fs::copy(rt_path.join("runtime.rs"), out_path.join("runtime.rs"))
4848
.expect("Couldn't copy runtime.rs");
4949

50-
assert!(Command::new("cargo")
51-
.current_dir(&out_path)
50+
let mut cmd = Command::new("cargo");
51+
cmd.current_dir(&out_path)
5252
.env("CARGO_TARGET_DIR", out_path.join("rt"))
53-
.arg("build")
53+
.arg("build");
54+
#[cfg(feature = "sancov_8bit")]
55+
cmd.arg("--features").arg("sancov_8bit");
56+
#[cfg(feature = "tui")]
57+
cmd.arg("--features").arg("tui");
58+
assert!(cmd
5459
.arg(&format!("--manifest-path={}/Cargo.toml", out_dir))
5560
.arg("--release")
5661
.status()

cargo-libafl/cargo-libafl-runtime/Cargo.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ edition = "2021"
1313
[workspace]
1414

1515
[dependencies]
16-
libafl = { git = "https://github.com/AFLplusplus/LibAFL.git", rev = "7ed1ac9" }
17-
libafl_targets = { git = "https://github.com/AFLplusplus/LibAFL.git", rev = "7ed1ac9", features = ["sancov_8bit", "sancov_cmplog"] }
16+
libafl = { git = "https://github.com/AFLplusplus/LibAFL.git", rev = "8ff8ae41f1ed2956bb1e906c5c7bd0505ca110c0" }
17+
libafl_targets = { git = "https://github.com/AFLplusplus/LibAFL.git", rev = "8ff8ae41f1ed2956bb1e906c5c7bd0505ca110c0", features = ["sancov_8bit", "sancov_pcguard",
18+
"sancov_cmplog", "pointer_maps"] }
19+
1820
mimalloc = { version = "*", default-features = false }
1921
portpicker = "0.1.1"
2022
clap = { version = "4.0", features = ["derive"] }
23+
env_logger = "0.10"
24+
log = "*"
2125

2226
[profile.release]
2327
lto = true
@@ -28,3 +32,7 @@ debug = true
2832
[lib]
2933
crate-type = ["staticlib", "rlib"]
3034
path = "runtime.rs"
35+
36+
[features]
37+
sancov_8bit = []
38+
tui = []

0 commit comments

Comments
 (0)