From 8b0111048879c37fff4f4ff47a0d9a3829950680 Mon Sep 17 00:00:00 2001 From: initializedd <119122691+initializedd@users.noreply.github.com> Date: Sat, 14 Dec 2024 17:35:19 +0000 Subject: [PATCH] yaml-cpp: initial integration --- projects/yaml-cpp/Dockerfile | 29 ++++++++++++++++++++++++++ projects/yaml-cpp/build.sh | 38 ++++++++++++++++++++++++++++++++++ projects/yaml-cpp/project.yaml | 5 +++++ 3 files changed, 72 insertions(+) create mode 100644 projects/yaml-cpp/Dockerfile create mode 100755 projects/yaml-cpp/build.sh create mode 100644 projects/yaml-cpp/project.yaml diff --git a/projects/yaml-cpp/Dockerfile b/projects/yaml-cpp/Dockerfile new file mode 100644 index 0000000000000..03dc3837a902d --- /dev/null +++ b/projects/yaml-cpp/Dockerfile @@ -0,0 +1,29 @@ +# 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 \ + make \ + cmake + +RUN git clone --depth 1 https://github.com/jbeder/yaml-cpp.git $SRC/yaml-cpp/ +RUN git clone --depth 1 https://github.com/initializedd/yaml-cpp-fuzzer.git $SRC/yaml-cpp-fuzzer/ + +COPY build.sh $SRC/ +WORKDIR $SRC/yaml-cpp/ + diff --git a/projects/yaml-cpp/build.sh b/projects/yaml-cpp/build.sh new file mode 100755 index 0000000000000..d49c0ede08fba --- /dev/null +++ b/projects/yaml-cpp/build.sh @@ -0,0 +1,38 @@ +#!/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. +# +################################################################################ + +mkdir -p build +cd build + +cmake -DUPDATE_DEPS=ON -DCMAKE_BUILD_TYPE=Release .. +make -j4 + +cp $SRC/yaml-cpp-fuzzer/*.dict $OUT/ +cp $SRC/yaml-cpp-fuzzer/*.options $OUT/ + +for fuzzer in $(find $SRC/yaml-cpp-fuzzer/ -name "*_fuzzer.cpp"); do + fuzzer_basename=$(basename -s .cpp $fuzzer) + $CXX $CXXFLAGS $LIB_FUZZING_ENGINE \ + -I$SRC/yaml-cpp/include \ + $fuzzer \ + -o $OUT/$fuzzer_basename \ + libyaml-cpp.a + + zip -q $OUT/${fuzzer_basename}_seed_corpus.zip $SRC/yaml-cpp-fuzzer/${fuzzer_basename}_seed_corpus/* +done + diff --git a/projects/yaml-cpp/project.yaml b/projects/yaml-cpp/project.yaml new file mode 100644 index 0000000000000..caac2f7eef944 --- /dev/null +++ b/projects/yaml-cpp/project.yaml @@ -0,0 +1,5 @@ +homepage: "https://codedocs.xyz/jbeder/yaml-cpp/index.html" +main_repo: "https://github.com/jbeder/yaml-cpp" +language: c++ +primary_contact: "jbeder+github@gmail.com" +