switch to clang 9 in the github action (#695)

The upstream convenience script from llvm does not support installing clang 8 anymore.
This commit is contained in:
Paul Dreik 2020-04-12 20:02:45 +02:00 committed by GitHub
parent fa637fcecb
commit 5710ec13d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View File

@ -23,7 +23,7 @@ jobs:
sudo apt-get install --quiet ninja-build valgrind zip unzip sudo apt-get install --quiet ninja-build valgrind zip unzip
wget https://apt.llvm.org/llvm.sh wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh chmod +x llvm.sh
sudo ./llvm.sh 8 sudo ./llvm.sh 9
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Create and prepare the initial seed corpus - name: Create and prepare the initial seed corpus
@ -55,7 +55,7 @@ jobs:
run: | run: |
for fuzzer in $allfuzzers; do for fuzzer in $allfuzzers; do
mkdir -p out/$fuzzer # in case this is a new fuzzer, or corpus.tar is broken 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 # make sure the failing output is visible in the log
if [ -e failed ] ; then if [ -e failed ] ; then
ls fuzzfailure/* |xargs -n1 base64 ls fuzzfailure/* |xargs -n1 base64
@ -68,22 +68,22 @@ jobs:
for fuzzer in $allfuzzers; do for fuzzer in $allfuzzers; do
build-ossfuzz-withavx/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=20 $artifactsprefix || touch failed 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-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 if [ -e failed ] ; then
# make sure the failing output is visible in the log # make sure the failing output is visible in the log
ls fuzzfailure/* |xargs -n1 base64 ls fuzzfailure/* |xargs -n1 base64
exit 1 exit 1
fi fi
echo disable msan runs, it fails inside the fuzzing engine and not the fuzzed code! 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-noavx9/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-withavx9/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 -reload=0 $artifactsprefix
echo now have $(ls out/$fuzzer |wc -l) files in corpus echo now have $(ls out/$fuzzer |wc -l) files in corpus
done done
- name: Minimize the corpus with the fast fuzzer - name: Minimize the corpus with the fast fuzzer
run: | run: |
for fuzzer in $allfuzzers; do for fuzzer in $allfuzzers; do
mkdir -p out/cmin/$fuzzer 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 rm -rf out/$fuzzer
mv out/cmin/$fuzzer out/$fuzzer mv out/cmin/$fuzzer out/$fuzzer
done done

View File

@ -77,12 +77,12 @@ fi
# a fuzzer with sanitizers, built with avx disabled. # a fuzzer with sanitizers, built with avx disabled.
variant=ossfuzz-noavx8 variant=ossfuzz-noavx9
if which clang++-8 >/dev/null 2>&1 ; then if which clang++-9 >/dev/null 2>&1 ; then
if [ ! -d build-$variant ] ; then if [ ! -d build-$variant ] ; then
export CC=clang-8 export CC=clang-9
export CXX="clang++-8" export CXX="clang++-9"
export CFLAGS="-fsanitize=fuzzer-no-link,address,undefined -fno-sanitize-recover=undefined -mno-avx2 -mno-avx " 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 CXXFLAGS="-fsanitize=fuzzer-no-link,address,undefined -fno-sanitize-recover=undefined -mno-avx2 -mno-avx"
export LIB_FUZZING_ENGINE="-fsanitize=fuzzer" export LIB_FUZZING_ENGINE="-fsanitize=fuzzer"
@ -103,7 +103,7 @@ if which clang++-8 >/dev/null 2>&1 ; then
cd .. cd ..
fi fi
else 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 fi
# a fuzzer with sanitizers, default built # a fuzzer with sanitizers, default built
@ -132,11 +132,11 @@ if [ ! -d build-$variant ] ; then
fi fi
# a fast fuzzer, for fast exploration # a fast fuzzer, for fast exploration
variant=ossfuzz-fast8 variant=ossfuzz-fast9
if which clang++-8 >/dev/null 2>&1 ; then if which clang++-9 >/dev/null 2>&1 ; then
if [ ! -d build-$variant ] ; then if [ ! -d build-$variant ] ; then
export CC=clang-8 export CC=clang-9
export CXX="clang++-8" export CXX="clang++-9"
export CFLAGS="-fsanitize=fuzzer-no-link -O3 -g" export CFLAGS="-fsanitize=fuzzer-no-link -O3 -g"
export CXXFLAGS="-fsanitize=fuzzer-no-link -O3 -g" export CXXFLAGS="-fsanitize=fuzzer-no-link -O3 -g"
export LIB_FUZZING_ENGINE="-fsanitize=fuzzer" export LIB_FUZZING_ENGINE="-fsanitize=fuzzer"
@ -157,6 +157,6 @@ if which clang++-8 >/dev/null 2>&1 ; then
cd .. cd ..
fi fi
else 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 fi