fuzzing: Fix the oss-fuzz coverage build
authorAndrew Bartlett <abartlet@samba.org>
Wed, 21 Oct 2020 18:34:35 +0000 (07:34 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 21 Oct 2020 23:07:37 +0000 (23:07 +0000)
commitd031391bed0d3c23b602816d968417267535c746
treee17ef59ade744653a34f1ac047cfe47315ba278a
parenta01dfc29c1f5e7ebc34d5e0e5db725ab9c4a0393
fuzzing: Fix the oss-fuzz coverage build

It was long thought that the issue here was that no seed corpus was
provided, but actually the issue is that to obtain coverage output
just as we already know for gcc gcov, you must provide fuzzing flags
to both the compile and link phase.

Thankfully clang as a linker does not mind the strange non-linker options
from $COVERAGE_FLAGS.

REF: https://stackoverflow.com/questions/56112019/clang-does-not-generate-profraw-file-when-linking-manually
REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19495#c48

Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Oct 21 23:07:37 UTC 2020 on sn-devel-184
lib/fuzzing/oss-fuzz/build_samba.sh