[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.
This commit is contained in:
Armin Hasitzka 2018-07-13 21:12:52 +02:00 committed by jonathanmetzman
parent c0661eefc4
commit bca1735143
3 changed files with 14 additions and 19 deletions

View File

@ -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/

View File

@ -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/"*

View File

@ -1,2 +0,0 @@
[libfuzzer]
max_len = 30000