mirror of https://github.com/google/oss-fuzz.git
[dav1d] Enable ASM code for non-MSan build configurations. (#2109)
This commit is contained in:
parent
e43f9e186f
commit
e2522df903
|
@ -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/
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue