Files
wasmtime/fuzz/Cargo.toml
Alex Crichton 4376cf2609 Add differential fuzzing against V8 (#3264)
* Add differential fuzzing against V8

This commit adds a differential fuzzing target to Wasmtime along the
lines of the wasmi and spec interpreters we already have, but with V8
instead. The intention here is that wasmi is unlikely to receive updates
over time (e.g. for SIMD), and the spec interpreter is not suitable for
fuzzing against in general due to its performance characteristics. The
hope is that V8 is indeed appropriate to fuzz against because it's
naturally receiving updates and it also is expected to have good
performance.

Here the `rusty_v8` crate is used which provides bindings to V8 as well
as precompiled binaries by default. This matches exactly the use case we
need and at least for now I think the `rusty_v8` crate will be
maintained by the Deno folks as they continue to develop it. If it
becomes an issue though maintaining we can evaluate other options to
have differential fuzzing against.

For now this commit enables the SIMD and bulk-memory feature of
fuzz-target-generation which should enable them to get
differentially-fuzzed with V8 in addition to the compilation fuzzing
we're already getting.

* Use weak linkage for GDB jit helpers

This should help us deduplicate our symbol with other JIT runtimes, if
any. For now this leans on some C helpers to define the weak linkage
since Rust doesn't support that on stable yet.

* Don't use rusty_v8 on MinGW

They don't have precompiled libraries there.

* Fix msvc build

* Comment about execution
2021-08-31 09:34:55 -05:00

114 lines
2.3 KiB
TOML

[package]
name = "wasmtime-fuzz"
version = "0.0.0"
authors = ["The Wasmtime Project Developers"]
edition = "2018"
publish = false
[package.metadata]
cargo-fuzz = true
[dependencies]
cranelift-codegen = { path = "../cranelift/codegen" }
cranelift-reader = { path = "../cranelift/reader" }
cranelift-wasm = { path = "../cranelift/wasm" }
cranelift-filetests = { path = "../cranelift/filetests" }
cranelift-interpreter = { path = "../cranelift/interpreter" }
cranelift-fuzzgen = { path = "../cranelift/fuzzgen" }
libfuzzer-sys = "0.4.0"
target-lexicon = "0.12"
peepmatic-fuzzing = { path = "../cranelift/peepmatic/crates/fuzzing", optional = true }
wasmtime = { path = "../crates/wasmtime" }
wasmtime-fuzzing = { path = "../crates/fuzzing" }
wasm-smith = "0.7.0"
[features]
# Leave a stub feature with no side-effects in place for now: the OSS-Fuzz
# config builds fuzz targets with this feature enabled and we don't want to
# break the build.
experimental_x64 = []
[[bin]]
name = "compile"
path = "fuzz_targets/compile.rs"
test = false
doc = false
[[bin]]
name = "instantiate"
path = "fuzz_targets/instantiate.rs"
test = false
doc = false
[[bin]]
name = "api_calls"
path = "fuzz_targets/api_calls.rs"
test = false
doc = false
[[bin]]
name = "differential"
path = "fuzz_targets/differential.rs"
test = false
doc = false
[[bin]]
name = "differential_spec"
path = "fuzz_targets/differential_spec.rs"
test = false
doc = false
[[bin]]
name = "differential_wasmi"
path = "fuzz_targets/differential_wasmi.rs"
test = false
doc = false
[[bin]]
name = "differential_v8"
path = "fuzz_targets/differential_v8.rs"
test = false
doc = false
[[bin]]
name = "spectests"
path = "fuzz_targets/spectests.rs"
test = false
doc = false
[[bin]]
name = "table_ops"
path = "fuzz_targets/table_ops.rs"
test = false
doc = false
[[bin]]
name = "instantiate-wasm-smith"
path = "fuzz_targets/instantiate-wasm-smith.rs"
test = false
doc = false
[[bin]]
name = "instantiate-swarm"
path = "fuzz_targets/instantiate-swarm.rs"
test = false
doc = false
[[bin]]
name = "instantiate-maybe-invalid"
path = "fuzz_targets/instantiate-maybe-invalid.rs"
test = false
doc = false
[[bin]]
name = "cranelift-fuzzgen"
path = "fuzz_targets/cranelift-fuzzgen.rs"
test = false
doc = false
[[bin]]
name = "cranelift-fuzzgen-verify"
path = "fuzz_targets/cranelift-fuzzgen-verify.rs"
test = false
doc = false