From ae220adbb22010f109c8e54bdb949416ec424df1 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Mon, 31 Jan 2022 00:08:34 +0000 Subject: [PATCH] ci: no longer remove elfutils while building the fuzzer Without it coverage reports can't be built ``` [2022-01-31 00:05:36,094 DEBUG] Generating file view html index file as: "/out/report/linux/file_view_index.html". Traceback (most recent call last): File "/opt/code_coverage/coverage_utils.py", line 829, in sys.exit(Main()) File "/opt/code_coverage/coverage_utils.py", line 823, in Main return _CmdPostProcess(args) File "/opt/code_coverage/coverage_utils.py", line 780, in _CmdPostProcess processor.PrepareHtmlReport() File "/opt/code_coverage/coverage_utils.py", line 577, in PrepareHtmlReport self.GenerateFileViewHtmlIndexFile(per_file_coverage_summary, File "/opt/code_coverage/coverage_utils.py", line 450, in GenerateFileViewHtmlIndexFile self.GetCoverageHtmlReportPathForFile(file_path), File "/opt/code_coverage/coverage_utils.py", line 422, in GetCoverageHtmlReportPathForFile assert os.path.isfile( AssertionError: "/tmp/tmp.UYax4l19Gh/lib/system.h" is not a file. ``` It's a follow-up to 393a058d061d49d Signed-off-by: Evgeny Vereshchagin --- scripts/build-fuzzers.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/build-fuzzers.sh b/scripts/build-fuzzers.sh index 0591451..22637ae 100755 --- a/scripts/build-fuzzers.sh +++ b/scripts/build-fuzzers.sh @@ -22,10 +22,10 @@ export LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer} # fail to compile (for example, elfutils-0.185 fails to compile with LDFLAGS enabled # due to https://bugs.gentoo.org/794601) so let's just point the script to # commits referring to versions of libelf that actually can be built -elfutils=$(mktemp -d) -git clone git://sourceware.org/git/elfutils.git "$elfutils" +rm -rf elfutils +git clone git://sourceware.org/git/elfutils.git ( -cd "$elfutils" +cd elfutils git checkout 983e86fd89e8bf02f2d27ba5dce5bf078af4ceda git log --oneline -1 @@ -50,11 +50,9 @@ make -C libelf -j$(nproc) V=1 ) make -C src BUILD_STATIC_ONLY=y V=1 clean -make -C src -j$(nproc) CFLAGS="-I$elfutils/libelf $CFLAGS" BUILD_STATIC_ONLY=y V=1 +make -C src -j$(nproc) CFLAGS="-I$(pwd)/elfutils/libelf $CFLAGS" BUILD_STATIC_ONLY=y V=1 $CC $CFLAGS -Isrc -Iinclude -Iinclude/uapi -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c fuzz/bpf-object-fuzzer.c -o bpf-object-fuzzer.o -$CXX $CXXFLAGS $LIB_FUZZING_ENGINE bpf-object-fuzzer.o src/libbpf.a "$elfutils/libelf/libelf.a" -l:libz.a -o "$OUT/bpf-object-fuzzer" +$CXX $CXXFLAGS $LIB_FUZZING_ENGINE bpf-object-fuzzer.o src/libbpf.a "$(pwd)/elfutils/libelf/libelf.a" -l:libz.a -o "$OUT/bpf-object-fuzzer" cp fuzz/bpf-object-fuzzer_seed_corpus.zip "$OUT" - -rm -rf "$elfutils"