From 5710ec13d40e0d86c9f41122c775ca9a69f300bb Mon Sep 17 00:00:00 2001 From: Paul Dreik Date: Sun, 12 Apr 2020 20:02:45 +0200 Subject: [PATCH] switch to clang 9 in the github action (#695) The upstream convenience script from llvm does not support installing clang 8 anymore. --- .github/workflows/fuzzers.yml | 12 ++++++------ fuzz/build_fuzzer_variants.sh | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/fuzzers.yml b/.github/workflows/fuzzers.yml index 71ec8ba1..3cc0a701 100644 --- a/.github/workflows/fuzzers.yml +++ b/.github/workflows/fuzzers.yml @@ -23,7 +23,7 @@ jobs: sudo apt-get install --quiet ninja-build valgrind zip unzip wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 8 + sudo ./llvm.sh 9 - uses: actions/checkout@v1 - name: Create and prepare the initial seed corpus @@ -55,7 +55,7 @@ jobs: run: | for fuzzer in $allfuzzers; do mkdir -p out/$fuzzer # in case this is a new fuzzer, or corpus.tar is broken - build-ossfuzz-fast8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=30 $artifactsprefix || touch failed + build-ossfuzz-fast9/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=30 $artifactsprefix || touch failed # make sure the failing output is visible in the log if [ -e failed ] ; then ls fuzzfailure/* |xargs -n1 base64 @@ -68,22 +68,22 @@ jobs: for fuzzer in $allfuzzers; do build-ossfuzz-withavx/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=20 $artifactsprefix || touch failed build-ossfuzz-noavx/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 $artifactsprefix || touch failed - build-ossfuzz-noavx8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 $artifactsprefix || touch failed + build-ossfuzz-noavx9/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 $artifactsprefix || touch failed if [ -e failed ] ; then # make sure the failing output is visible in the log ls fuzzfailure/* |xargs -n1 base64 exit 1 fi echo disable msan runs, it fails inside the fuzzing engine and not the fuzzed code! - echo build-ossfuzz-msan-noavx8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 -reload=0 $artifactsprefix - echo build-ossfuzz-msan-withavx8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 -reload=0 $artifactsprefix + echo build-ossfuzz-msan-noavx9/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 -reload=0 $artifactsprefix + echo build-ossfuzz-msan-withavx9/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 -reload=0 $artifactsprefix echo now have $(ls out/$fuzzer |wc -l) files in corpus done - name: Minimize the corpus with the fast fuzzer run: | for fuzzer in $allfuzzers; do mkdir -p out/cmin/$fuzzer - build-ossfuzz-fast8/fuzz/fuzz_$fuzzer -merge=1 out/cmin/$fuzzer out/$fuzzer + build-ossfuzz-fast9/fuzz/fuzz_$fuzzer -merge=1 out/cmin/$fuzzer out/$fuzzer rm -rf out/$fuzzer mv out/cmin/$fuzzer out/$fuzzer done diff --git a/fuzz/build_fuzzer_variants.sh b/fuzz/build_fuzzer_variants.sh index 75bc39fb..ef173a07 100755 --- a/fuzz/build_fuzzer_variants.sh +++ b/fuzz/build_fuzzer_variants.sh @@ -77,12 +77,12 @@ fi # a fuzzer with sanitizers, built with avx disabled. -variant=ossfuzz-noavx8 -if which clang++-8 >/dev/null 2>&1 ; then +variant=ossfuzz-noavx9 +if which clang++-9 >/dev/null 2>&1 ; then if [ ! -d build-$variant ] ; then - export CC=clang-8 - export CXX="clang++-8" + export CC=clang-9 + export CXX="clang++-9" export CFLAGS="-fsanitize=fuzzer-no-link,address,undefined -fno-sanitize-recover=undefined -mno-avx2 -mno-avx " export CXXFLAGS="-fsanitize=fuzzer-no-link,address,undefined -fno-sanitize-recover=undefined -mno-avx2 -mno-avx" export LIB_FUZZING_ENGINE="-fsanitize=fuzzer" @@ -103,7 +103,7 @@ if which clang++-8 >/dev/null 2>&1 ; then cd .. fi else - echo "$me: WARNING clang++-8 not found, please install it to build $variant" + echo "$me: WARNING clang++-9 not found, please install it to build $variant" fi # a fuzzer with sanitizers, default built @@ -132,11 +132,11 @@ if [ ! -d build-$variant ] ; then fi # a fast fuzzer, for fast exploration -variant=ossfuzz-fast8 -if which clang++-8 >/dev/null 2>&1 ; then +variant=ossfuzz-fast9 +if which clang++-9 >/dev/null 2>&1 ; then if [ ! -d build-$variant ] ; then - export CC=clang-8 - export CXX="clang++-8" + export CC=clang-9 + export CXX="clang++-9" export CFLAGS="-fsanitize=fuzzer-no-link -O3 -g" export CXXFLAGS="-fsanitize=fuzzer-no-link -O3 -g" export LIB_FUZZING_ENGINE="-fsanitize=fuzzer" @@ -157,6 +157,6 @@ if which clang++-8 >/dev/null 2>&1 ; then cd .. fi else - echo "$me: WARNING clang++-8 not found, please install it to build $variant" + echo "$me: WARNING clang++-9 not found, please install it to build $variant" fi