aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects
diff options
context:
space:
mode:
authorGravatar Armin Hasitzka <cherusker@users.noreply.github.com>2018-07-13 21:12:52 +0200
committerGravatar jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>2018-07-13 12:12:52 -0700
commitbca17351438535d0a172ab69c4e174ffb62fd1e1 (patch)
treed674c9e838c0257748f9dca96138dc336d9f9d36 /projects
parentc0661eefc43657b391666caf0bf2f91fda52245f (diff)
[Freetype] Update build process: (#1614)
- Build the known target `ftfuzzer' with FreeType's new, dedicated testing repository. - Move most of the build logic regarding the fuzz targets to FreeType's repository.
Diffstat (limited to 'projects')
-rw-r--r--projects/freetype2/Dockerfile8
-rwxr-xr-xprojects/freetype2/build.sh23
-rw-r--r--projects/freetype2/ftfuzzer.options2
3 files changed, 14 insertions, 19 deletions
diff --git a/projects/freetype2/Dockerfile b/projects/freetype2/Dockerfile
index 5248606c..ccce5b5d 100644
--- a/projects/freetype2/Dockerfile
+++ b/projects/freetype2/Dockerfile
@@ -16,13 +16,13 @@
FROM gcr.io/oss-fuzz-base/base-builder
MAINTAINER mike.aizatsky@gmail.com
-RUN apt-get update && apt-get install -y make autoconf libtool libarchive-dev
+RUN apt-get update && apt-get install -y autoconf cmake libarchive-dev libtool make
# Get some files for the seed corpus
ADD https://github.com/adobe-fonts/adobe-variable-font-prototype/releases/download/1.001/AdobeVFPrototype.otf $SRC/font-corpus/
RUN git clone https://github.com/unicode-org/text-rendering-tests.git && cp text-rendering-tests/fonts/* $SRC/font-corpus
-RUN git clone --depth 1 https://github.com/cherusker/freetype2-testing.git && find freetype2-testing/fuzzing/corpora/legacy -type f -exec cp {} $SRC/font-corpus \;
-RUN git clone --depth 1 git://git.sv.nongnu.org/freetype/freetype2.git
-WORKDIR freetype2
+RUN git clone --depth 1 https://github.com/cherusker/freetype2-testing.git
+WORKDIR freetype2-testing
+
COPY build.sh *.options $SRC/
diff --git a/projects/freetype2/build.sh b/projects/freetype2/build.sh
index df7b393f..6ed16410 100755
--- a/projects/freetype2/build.sh
+++ b/projects/freetype2/build.sh
@@ -16,18 +16,15 @@
#
################################################################################
-./autogen.sh
-sync
-./configure
-make -j$(nproc) clean
-make -j$(nproc) all
+# Tell CMake what fuzzing engine to link:
+export CMAKE_FUZZING_ENGINE="-lFuzzingEngine"
-$CXX $CXXFLAGS -std=c++11 \
- -I./include -I. \
- ./src/tools/ftfuzzer/ftfuzzer.cc -o $OUT/ftfuzzer \
- ./objs/*.o -lFuzzingEngine \
- /usr/lib/x86_64-linux-gnu/libarchive.a \
- ./objs/.libs/libfreetype.a
+bash "fuzzing/scripts/build-fuzzers.sh"
+bash "fuzzing/scripts/prepare-oss-fuzz.sh"
-zip -j $OUT/ftfuzzer_seed_corpus.zip $SRC/font-corpus/*
-cp $SRC/*.options $OUT/
+# Rename the `legacy' target to `ftfuzzer' for historical reasons:
+for f in "${OUT}/legacy"*; do
+ mv "${f}" "${f/legacy/ftfuzzer}"
+done
+
+zip -ju "${OUT}/ftfuzzer_seed_corpus.zip" "${SRC}/font-corpus/"*
diff --git a/projects/freetype2/ftfuzzer.options b/projects/freetype2/ftfuzzer.options
deleted file mode 100644
index dc40b73d..00000000
--- a/projects/freetype2/ftfuzzer.options
+++ /dev/null
@@ -1,2 +0,0 @@
-[libfuzzer]
-max_len = 30000