mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-02 22:02:25 +03:00
- fix compiler warnings.
- make it pass `checksrc`.
- fix shell `set -u` errors.
Follow-up to 5012442850
#901
- REUSE: tidy up ossfuzz files.
Cherry-picked from #1484
Closes #1526
36 lines
906 B
Bash
Executable File
36 lines
906 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright (C) The libssh2 project and its contributors.
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
set -eu
|
|
|
|
# This script is called by the oss-fuzz main project when compiling the fuzz
|
|
# targets. This script is regression tested by ci/ossfuzz.sh.
|
|
|
|
# Save off the current folder as the build root.
|
|
export BUILD_ROOT="$PWD"
|
|
|
|
echo "CC: ${CC:-}"
|
|
echo "CXX: ${CXX:-}"
|
|
echo "LIB_FUZZING_ENGINE: ${LIB_FUZZING_ENGINE:-}"
|
|
echo "CFLAGS: ${CFLAGS:-}"
|
|
echo "CXXFLAGS: ${CXXFLAGS:-}"
|
|
echo "OUT: ${OUT:-}"
|
|
|
|
MAKEFLAGS+="-j$(nproc)"
|
|
export MAKEFLAGS
|
|
|
|
# Install dependencies
|
|
apt-get -y install automake libtool libssl-dev zlib1g-dev
|
|
|
|
# Compile the fuzzer.
|
|
autoreconf -fi
|
|
./configure --disable-shared \
|
|
--enable-ossfuzzers \
|
|
--disable-examples-build \
|
|
--enable-debug
|
|
make V=1
|
|
|
|
# Copy the fuzzer to the output directory.
|
|
cp -v tests/ossfuzz/ssh2_client_fuzzer "$OUT/"
|