Skip to content

Commit 68b5c3a

Browse files
ahuntgitster
authored andcommitted
Makefile: update 'make fuzz-all' docs to reflect modern clang
Clang no longer produces a libFuzzer.a. Instead, you can include libFuzzer by using -fsanitize=fuzzer. Therefore we should use that in the example command for building fuzzers. We also add -fsanitize=fuzzer-no-link to the CFLAGS to ensure that all the required instrumentation is added when compiling git [1], and remove -fsanitize-coverage=trace-pc-guard as it is deprecated. I happen to have tested with LLVM 11 - however -fsanitize=fuzzer appears to work in a wide range of reasonably modern clangs. (On my system: what used to be libFuzzer.a now lives under the following path, which is tricky albeit not impossible for a novice such as myself to find: /usr/lib64/clang/11.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a ) [1] https://releases.llvm.org/11.0.0/docs/LibFuzzer.html#fuzzer-usage Signed-off-by: Andrzej Hunt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent be7935e commit 68b5c3a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3299,11 +3299,11 @@ cover_db_html: cover_db
32993299
# are not necessarily appropriate for general builds, and that vary greatly
33003300
# depending on the compiler version used.
33013301
#
3302-
# An example command to build against libFuzzer from LLVM 4.0.0:
3302+
# An example command to build against libFuzzer from LLVM 11.0.0:
33033303
#
33043304
# make CC=clang CXX=clang++ \
3305-
# CFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address" \
3306-
# LIB_FUZZING_ENGINE=/usr/lib/llvm-4.0/lib/libFuzzer.a \
3305+
# CFLAGS="-fsanitize=fuzzer-no-link,address" \
3306+
# LIB_FUZZING_ENGINE="-fsanitize=fuzzer" \
33073307
# fuzz-all
33083308
#
33093309
FUZZ_CXXFLAGS ?= $(CFLAGS)

0 commit comments

Comments
 (0)