[dav1d] Enable ASM code for non-MSan build configurations. (#2109)

This commit is contained in:
Max Moroz 2019-01-24 13:27:15 -08:00 committed by GitHub
parent e43f9e186f
commit e2522df903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 3 deletions

View File

@ -16,10 +16,11 @@
FROM gcr.io/oss-fuzz-base/base-builder
MAINTAINER janne-vlc@jannau.net
RUN apt-get update && apt-get install -y curl python3-pip && \
RUN apt-get update && apt-get install -y curl python3-pip wget && \
pip3 install meson ninja
RUN wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.gz
RUN curl --silent -O https://storage.googleapis.com/aom-test-data/fuzzer/dec_fuzzer_seed_corpus.zip
RUN curl --silent -O https://jannau.net/dav1d_fuzzer_seed_corpus.zip
RUN git clone --depth 1 https://code.videolan.org/videolan/dav1d.git dav1d
WORKDIR dav1d
COPY build.sh $SRC/
COPY build.sh fuzzer.options $SRC/

View File

@ -23,7 +23,32 @@ rm -rf ${build}
mkdir -p ${build}
# build library
meson -Dbuild_asm=false -Dbuild_tools=false -Dfuzzing_engine=oss-fuzz \
BUILD_ASM="true"
# MemorySanitizer may report false positives if used with asm code.
if [[ $CFLAGS = *sanitize=memory* ]]
then
BUILD_ASM="false"
else
# Build the specific nasm version without memory instrumentation.
pushd $SRC
BUILD_DEPS="$SRC/build_deps"
mkdir -p $BUILD_DEPS
tar xzf nasm-*
cd nasm-*
CFLAGS="" CXXFLAGS="" ./configure --prefix="$BUILD_DEPS"
make clean
make -j$(nproc)
make install
export PATH="$BUILD_DEPS/bin:$PATH"
export LD_LIBRARY_PATH="$BUILD_DEPS/lib"
popd
fi
meson -Dbuild_asm=$BUILD_ASM -Dbuild_tools=false -Dfuzzing_engine=oss-fuzz \
-Db_lundef=false -Ddefault_library=static -Dbuildtype=debugoptimized \
${build}
ninja -j $(nproc) -C ${build}
@ -39,4 +64,5 @@ cp $SRC/dec_fuzzer_seed_corpus.zip ${WORK}/tmp/seed_corpus.zip
for fuzzer in $(find ${build} -name 'dav1d_fuzzer*'); do
cp "${fuzzer}" $OUT/
cp ${WORK}/tmp/seed_corpus.zip $OUT/$(basename "$fuzzer")_seed_corpus.zip
cp $SRC/fuzzer.options $OUT/$(basename "$fuzzer").options
done