rust-fuzz / libfuzzer

Rust bindings and utilities for LLVM’s libFuzzer
Apache License 2.0
206 stars 44 forks source link

Make it possible to link to custom runtime in another dep #106

Closed addisoncrump closed 1 year ago

addisoncrump commented 1 year ago

We are implementing https://github.com/AFLplusplus/LibAFL/pull/981, but don't want to make too much impact on the downstream users of libfuzzer-sys. As a compromise, this PR adds a default feature, link, which, when enabled, links to the libfuzzer runtime or the CUSTOM_LIBFUZZER_RUNTIME. When not enabled, it does not link to the fuzzer runtime.

This allows us to link to a custom runtime in our own dependency while reusing the infrastructure already provided by libfuzzer-sys (namely, fuzz_target and custom_mutator). See an example of this use case here: https://github.com/AFLplusplus/LibAFL/blob/libfuzzer/libafl_libfuzzer/build.rs https://github.com/AFLplusplus/LibAFL/blob/libfuzzer/libafl_libfuzzer/Cargo.toml#L17

addisoncrump commented 1 year ago

I also added details in the README about CUSTOM_LIBFUZZER_PATH as it seemed relevant.

addisoncrump commented 11 months ago

Can a release be cut for this? We would like to publish a downstream crate that depends on this but cannot depend on the git revision.

fitzgen commented 11 months ago

Published 0.4.7

addisoncrump commented 11 months ago

Thank you!