0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00
libzmq/builds/fuzz/ci_build.sh
Luca Boccassi e95e57d385 Problem: fuzzer corpus file can be quite large
Solution: move all corpora to the zeromq/libzmq-fuzz-corpora repository
for easier handling, and to avoid inflating the size of zeromq/libzmq.
Clone it for the CI on the fly.
2020-07-04 17:50:35 +01:00

26 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# used by oss-fuzz https://github.com/google/oss-fuzz/tree/master/projects/libzmq
set -e
set -x
cd "${SRC}/libsodium"
DO_NOT_UPDATE_CONFIG_SCRIPTS=1 ./autogen.sh
./configure --disable-shared --prefix=/install_prefix --disable-asm
make -j$(nproc) V=1 install DESTDIR=/tmp/zmq_install_dir
cd "${SRC}/libzmq"
./autogen.sh
export LDFLAGS+=" $(PKG_CONFIG_PATH=/tmp/zmq_install_dir/install_prefix/lib/pkgconfig pkg-config --static --libs --define-prefix libsodium)"
export CXXFLAGS+=" $(PKG_CONFIG_PATH=/tmp/zmq_install_dir/install_prefix/lib/pkgconfig pkg-config --static --cflags --define-prefix libsodium)"
./configure --disable-shared --prefix=/install_prefix --disable-perf --disable-curve-keygen PKG_CONFIG_PATH=/tmp/zmq_install_dir/install_prefix/lib/pkgconfig --with-libsodium=yes --with-fuzzing-installdir=fuzzers --with-fuzzing-engine=$LIB_FUZZING_ENGINE
make -j$(nproc) V=1 install DESTDIR=/tmp/zmq_install_dir
cd "${SRC}/libzmq-fuzz-corpora"
cp dictionaries/* /tmp/zmq_install_dir/install_prefix/fuzzers/
for t in test_*_seed_corpus; do
zip -j --quiet /tmp/zmq_install_dir/install_prefix/fuzzers/${t}.zip ${t}/*
done
cp /tmp/zmq_install_dir/install_prefix/fuzzers/* "${OUT}"