ossfuzz.sh 896 B

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