Skip to content

Commit b6f2b12

Browse files
committed
cfl: enable coverage instrumentation
Inject the llvm profiling and coverage mapping flags when the coverage sanitizer is selected so ClusterFuzzLite builds emit compatible raw profiles. Assisted-by: GitHub Copilot Assisted-by: OpenAI GPT-5-Codex
1 parent f05bc32 commit b6f2b12

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.clusterfuzzlite/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ export CPPFLAGS="${CPPFLAGS:-} -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_D
2626

2727
FUZZ_LIBS_VALUE="$LIB_FUZZING_ENGINE"
2828

29+
if [ "$SANITIZER_CHOICE" = "coverage" ]; then
30+
export CFLAGS="${CFLAGS} -fprofile-instr-generate -fcoverage-mapping"
31+
export CXXFLAGS="${CXXFLAGS} -fprofile-instr-generate -fcoverage-mapping"
32+
export LDFLAGS="${LDFLAGS} -fprofile-instr-generate"
33+
fi
34+
2935
(
3036
cd depends
3137
sed -i --regexp-extended '/.*rm -rf .*extract_dir.*/d' ./funcs.mk || true

0 commit comments

Comments
 (0)