2020-06-23 17:17:15 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-08-26 09:37:40 +00:00
|
|
|
set -ex
|
2020-06-23 17:17:15 +00:00
|
|
|
|
2020-08-26 09:37:40 +00:00
|
|
|
ROOTDIR="/root/project"
|
2020-06-23 17:17:15 +00:00
|
|
|
BUILDDIR="${ROOTDIR}/build"
|
2020-08-26 09:37:40 +00:00
|
|
|
mkdir -p "${BUILDDIR}" && mkdir -p "$BUILDDIR/deps"
|
2020-06-23 17:17:15 +00:00
|
|
|
|
2021-10-28 09:58:47 +00:00
|
|
|
function generate_protobuf_bindings
|
2020-08-26 09:37:40 +00:00
|
|
|
{
|
|
|
|
cd "${ROOTDIR}"/test/tools/ossfuzz
|
|
|
|
# Generate protobuf C++ bindings
|
|
|
|
for protoName in yul abiV2 sol;
|
|
|
|
do
|
|
|
|
protoc "${protoName}"Proto.proto --cpp_out .
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-10-28 09:58:47 +00:00
|
|
|
function build_fuzzers
|
2020-08-26 09:37:40 +00:00
|
|
|
{
|
|
|
|
cd "${BUILDDIR}"
|
|
|
|
cmake .. -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE="${ROOTDIR}"/cmake/toolchains/libfuzzer.cmake
|
|
|
|
make ossfuzz ossfuzz_proto ossfuzz_abiv2 -j 4
|
|
|
|
}
|
|
|
|
|
|
|
|
generate_protobuf_bindings
|
2020-10-15 10:59:18 +00:00
|
|
|
build_fuzzers
|