qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] fuzz: add oss-fuzz build.sh script


From: Stefan Hajnoczi
Subject: Re: [PATCH v2] fuzz: add oss-fuzz build.sh script
Date: Tue, 9 Jun 2020 11:27:08 +0100

On Fri, Jun 05, 2020 at 01:50:28PM -0400, Alexander Bulekov wrote:
> It is neater to keep this in the QEMU repo, since any change that
> requires an update to the oss-fuzz build configuration, can make the
> necessary changes in the same series.
> 
> Suggested-by: Philippe Mathieu-Daude <f4bug@amsat.org>
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> ---
> 
> v2 updates the script header comment.
> 
>  scripts/oss-fuzz/build.sh | 50 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100755 scripts/oss-fuzz/build.sh

Please add a MAINTAINERS file entry.

> diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh
> new file mode 100755
> index 0000000000..e93d6f2e03
> --- /dev/null
> +++ b/scripts/oss-fuzz/build.sh
> @@ -0,0 +1,50 @@
> +#!/bin/sh
> +#
> +# OSS-Fuzz build script. See:
> +# 
> https://google.github.io/oss-fuzz/getting-started/new-project-guide/#buildsh
> +#
> +# This code is licensed under the GPL version 2 or later.  See
> +# the COPYING file in the top-level directory.
> +#
> +
> +# build project
> +# e.g.
> +# ./autogen.sh
> +# ./configure
> +# make -j$(nproc) all
> +
> +# build fuzzers
> +# e.g.
> +# $CXX $CXXFLAGS -std=c++11 -Iinclude \
> +#     /path/to/name_of_fuzzer.cc -o $OUT/name_of_fuzzer \
> +#     $LIB_FUZZING_ENGINE /path/to/library.a
> +
> +mkdir -p $OUT/lib/              # Shared libraries
> +
> +# Build once to get the list of dynamic lib paths, and copy them over
> +./configure --datadir="./data/" --disable-werror --cc="$CC" --cxx="$CXX" \
> +    --extra-cflags="$CFLAGS -U __OPTIMIZE__ "

If you respin, please extract -U __OPTIMIZE__ into a separate variable
with a doc comment.

# Explanation for why __OPTIMIZE__ needs to be undefined goes here...
EXTRA_CFLAGS="$CFLAGS -U __OPTIMIZE__"

This will help others understand why this build flag is needed.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]