Debian Codegraph @

ossfuzz/ossfuzz.sh

raw
1 #!/bin/bash -eu
2
3 # This script is called by the oss-fuzz main project when compiling the fuzz
4 # targets. This script is regression tested by ci_oss.sh.
5
6 # Save off the current folder as the build root.
7 export BUILD_ROOT=$PWD
8
9 echo "CC: ${CC:-}"
10 echo "CXX: ${CXX:-}"
11 echo "LIB_FUZZING_ENGINE: ${LIB_FUZZING_ENGINE:-}"
12 echo "CFLAGS: ${CFLAGS:-}"
13 echo "CXXFLAGS: ${CXXFLAGS:-}"
14 echo "OUT: ${OUT:-}"
15
16 export MAKEFLAGS+="-j$(nproc)"
17
18 # Install dependencies
19 apt-get -y install autoconf autogen automake libtool pkg-config python
20
21 # For now, do not install the following libraries (as they won't be in the
22 # final image):
23 # libasound2-dev libflac-dev libogg-dev libopus-dev libvorbis-dev
24
25 # Compile the fuzzer.
26 autoreconf -vif
27 ./configure --disable-shared --enable-ossfuzzers
28 make V=1
29
30 # Copy the fuzzer to the output directory.
31 cp -v ossfuzz/sndfile_fuzzer $OUT/
32 cp -v ossfuzz/sndfile_alt_fuzzer $OUT/