diff options
-rw-r--r-- | projects/tarantool/Dockerfile | 26 | ||||
-rwxr-xr-x | projects/tarantool/build.sh | 62 | ||||
-rw-r--r-- | projects/tarantool/project.yaml | 16 |
3 files changed, 104 insertions, 0 deletions
diff --git a/projects/tarantool/Dockerfile b/projects/tarantool/Dockerfile new file mode 100644 index 00000000..7a40b0f6 --- /dev/null +++ b/projects/tarantool/Dockerfile @@ -0,0 +1,26 @@ +# Copyright 2021 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. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder +RUN apt-get update && apt-get install -y \ + build-essential cmake make coreutils sed \ + autoconf automake libtool zlib1g-dev \ + libreadline-dev libncurses5-dev libssl-dev \ + libunwind-dev libicu-dev luajit +RUN git clone https://github.com/tarantool/tarantool +WORKDIR tarantool +RUN git submodule update --init --recursive +COPY build.sh $SRC/ diff --git a/projects/tarantool/build.sh b/projects/tarantool/build.sh new file mode 100755 index 00000000..940d88a2 --- /dev/null +++ b/projects/tarantool/build.sh @@ -0,0 +1,62 @@ +#!/bin/bash -eu +# Copyright 2021 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. +# +################################################################################ + +case $SANITIZER in + address) SANITIZERS_ARGS="-DENABLE_ASAN=ON" ;; + undefined) SANITIZERS_ARGS="-DENABLE_UB_SANITIZER=ON" ;; + *) SANITIZERS_ARGS="" ;; +esac + +: ${LD:="${CXX}"} +: ${LDFLAGS:="${CXXFLAGS}"} # to make sure we link with sanitizer runtime + +cmake_args=( + # Specific to Tarantool + -DENABLE_FUZZER=ON + -DOSS_FUZZ=ON + $SANITIZERS_ARGS + + # C compiler + -DCMAKE_C_COMPILER="${CC}" + -DCMAKE_C_FLAGS="${CFLAGS}" + + # C++ compiler + -DCMAKE_CXX_COMPILER="${CXX}" + -DCMAKE_CXX_FLAGS="${CXXFLAGS}" + + # Linker + -DCMAKE_LINKER="${LD}" + -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" + -DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}" + -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" +) + +# Build the project and fuzzers. +[[ -e build ]] && rm -rf build +cmake "${cmake_args[@]}" -S . -B build +make -j$(nproc) VERBOSE=1 -C build fuzzers + +# Archive and copy to $OUT seed corpus if the build succeeded. +for f in $(ls build/test/fuzz/*_fuzzer); +do + name=$(basename $f); + module=$(echo $name | sed 's/_fuzzer//') + corpus_dir="test/static/corpus/$module" + echo "Copying for $module"; + cp $f $OUT/ + [[ -e $corpus_dir ]] && zip -j $OUT/"$module"_fuzzer_seed_corpus.zip $corpus_dir/* +done diff --git a/projects/tarantool/project.yaml b/projects/tarantool/project.yaml new file mode 100644 index 00000000..c757a53c --- /dev/null +++ b/projects/tarantool/project.yaml @@ -0,0 +1,16 @@ +homepage: "https://www.tarantool.io/en/" +language: c +builds_per_day: 4 +primary_contact: "kirill.yukhin@gmail.com" +auto_ccs: + - "estetus@gmail.com" + - "totktonada.ru@gmail.com" +fuzzing_engines: + - libfuzzer + - honggfuzz +sanitizers: + - address + - undefined +architectures: + - x86_64 +main_repo: "https://github.com/tarantool/tarantool" |