mirror of https://gitlab.com/qemu-project/qemu
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
809 B
Bash
29 lines
809 B
Bash
#!/bin/bash -e
|
|
#
|
|
# Compile and check with oss-fuzz.
|
|
#
|
|
# Copyright (c) 2023 Linaro Ltd.
|
|
#
|
|
# Authors:
|
|
# Alex Bennée <alex.bennee@linaro.org>
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
. common.rc
|
|
|
|
requires_binary clang
|
|
|
|
# the build script runs out of $src so we need to copy across
|
|
cd "$BUILD_DIR"
|
|
cp -a $QEMU_SRC .
|
|
cd src
|
|
mkdir build-oss-fuzz
|
|
export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt
|
|
env CC="clang" CXX="clang++" CFLAGS="-fsanitize=address" ./scripts/oss-fuzz/build.sh
|
|
export ASAN_OPTIONS="fast_unwind_on_malloc=0"
|
|
for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f | grep -v slirp); do
|
|
grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
|
|
echo Testing ${fuzzer} ... ;
|
|
"${fuzzer}" -runs=1 -seed=1 || exit 1 ;
|
|
done
|