2022-09-18 10:49:07 +00:00
|
|
|
#!/bin/bash -eu
|
|
|
|
# Copyright 2022 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2022-12-14 11:53:51 +00:00
|
|
|
mkdir my_build
|
2022-09-18 10:49:07 +00:00
|
|
|
|
2022-12-14 11:53:51 +00:00
|
|
|
pushd my_build/
|
2022-12-19 15:43:39 +00:00
|
|
|
cmake -DFUZZER=ON -DLIB_FUZZING_ENGINE="$LIB_FUZZING_ENGINE" \
|
|
|
|
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath,'\$ORIGIN/lib'" -DWITH_MYSQL=OFF -Wno-dev ../.
|
2022-12-14 11:53:51 +00:00
|
|
|
make -j$(nproc)
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd my_build/fuzzing/
|
2022-09-18 10:49:07 +00:00
|
|
|
cp FuzzStun $OUT/FuzzStun
|
|
|
|
cp FuzzStunClient $OUT/FuzzStunClient
|
2022-12-14 11:53:51 +00:00
|
|
|
popd
|
2022-09-18 10:49:07 +00:00
|
|
|
|
2022-12-14 11:53:51 +00:00
|
|
|
pushd fuzzing/input/
|
2022-09-18 10:49:07 +00:00
|
|
|
cp FuzzStun_seed_corpus.zip $OUT/FuzzStun_seed_corpus.zip
|
|
|
|
cp FuzzStunClient_seed_corpus.zip $OUT/FuzzStunClient_seed_corpus.zip
|
|
|
|
popd
|
2022-12-14 11:53:51 +00:00
|
|
|
|
|
|
|
pushd /lib/x86_64-linux-gnu/
|
2022-12-19 15:43:39 +00:00
|
|
|
mkdir $OUT/lib/
|
2022-12-14 11:53:51 +00:00
|
|
|
cp libevent* $OUT/lib/.
|
|
|
|
popd
|