File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,29 @@ And finally, run the fuzzer:
6161$ ./target/debug/fuzzed
6262```
6363
64+ ### Linking to a local libfuzzer
65+
66+ When using ` libfuzzer-sys ` , you can provide your own ` libfuzzer ` runtime in two ways.
67+
68+ If you are developing a fuzzer, you can set the ` CUSTOM_LIBFUZZER_PATH ` environment variable to the path of your local
69+ libfuzzer runtime, which will then be linked instead of building libfuzzer as part of the build stage of ` libfuzzer-sys ` .
70+ For an example, to link to a prebuilt LLVM 16 libfuzzer, you could use:
71+
72+ ``` bash
73+ $ export CUSTOM_LIBFUZZER_PATH=/usr/lib64/clang/16/lib/libclang_rt.fuzzer-x86_64.a
74+ $ cargo fuzz run ...
75+ ```
76+
77+ Alternatively, you may also disable the default ` link_libfuzzer ` feature:
78+
79+ In ` Cargo.toml ` :
80+ ``` toml
81+ [dependencies ]
82+ libfuzzer-sys = { path = " ../../libfuzzer" , default-features = false }
83+ ```
84+
85+ Then link to your own runtime in your ` build.rs ` .
86+
6487## Updating libfuzzer from upstream
6588
6689```
You can’t perform that action at this time.
0 commit comments