From c5b0fe9e05d2d189c3af23a52f4115c1b084fc51 Mon Sep 17 00:00:00 2001 From: "Shane F. Carr" Date: Fri, 11 Oct 2019 16:40:45 -0700 Subject: [PATCH] Add project myanmar-tools (#2929) * Add project myanmar-tools * Tweaks to myanmar tools build.sh * Fix travis build error * Fix Craig Cornelius email address * Set CMAKE_{C,CXX} flags * Write verbose output in cmake * Disable uninteresting UBSan sanitizer based on this target --- projects/myanmar-tools/Dockerfile | 23 +++++++++++++++++++++ projects/myanmar-tools/build.sh | 32 +++++++++++++++++++++++++++++ projects/myanmar-tools/project.yaml | 21 +++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 projects/myanmar-tools/Dockerfile create mode 100644 projects/myanmar-tools/build.sh create mode 100644 projects/myanmar-tools/project.yaml diff --git a/projects/myanmar-tools/Dockerfile b/projects/myanmar-tools/Dockerfile new file mode 100644 index 000000000..42d1adc5c --- /dev/null +++ b/projects/myanmar-tools/Dockerfile @@ -0,0 +1,23 @@ +# Copyright 2019 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 +# +# https://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 +MAINTAINER sffc@google.com + +RUN apt-get update && apt-get -y install \ + build-essential \ + cmake +RUN git clone https://github.com/google/myanmar-tools.git +WORKDIR $SRC/myanmar-tools/clients/cpp/ +COPY build.sh $SRC/ diff --git a/projects/myanmar-tools/build.sh b/projects/myanmar-tools/build.sh new file mode 100644 index 000000000..522608484 --- /dev/null +++ b/projects/myanmar-tools/build.sh @@ -0,0 +1,32 @@ +# Copyright 2019 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 +# +# https://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. + +cd $SRC/myanmar-tools/clients/cpp +mkdir build +cd build +cmake -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" \ + -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. +make all + +# Note: don't use the myanmartools_fuzz CMake target directly because we want +# to link with LIB_FUZZING_ENGINE instead of the default fuzzer. +# Copy the .so file to $OUT as well as the executable. +mkdir -p $OUT/lib +cp libmyanmartools.so $OUT/lib +$CXX $CXXFLAGS -std=c++11 -I../public -L$OUT/lib \ + -Wl,-rpath $OUT/lib -lmyanmartools \ + -o $OUT/zawgyi_detector_fuzz_target \ + ../zawgyi_detector_fuzz_target.cpp \ + $LIB_FUZZING_ENGINE diff --git a/projects/myanmar-tools/project.yaml b/projects/myanmar-tools/project.yaml new file mode 100644 index 000000000..9a8db308c --- /dev/null +++ b/projects/myanmar-tools/project.yaml @@ -0,0 +1,21 @@ +# Copyright 2019 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 +# +# https://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. + +homepage: "https://github.com/googlei18n/myanmar-tools/" +primary_contact: "sffc@google.com" +auto_ccs: + - "ccornelius@google.com" +sanitizers: + - address + - memory