[njs] Build pcre dependency manually and enable MSan (#2481). (#2484)

This commit is contained in:
Max Moroz 2019-06-03 09:06:53 -07:00 committed by GitHub
parent c9fd3f45db
commit 2317c8aacb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 5 deletions

View File

@ -16,8 +16,10 @@
FROM gcr.io/oss-fuzz-base/base-builder
MAINTAINER mmoroz@chromium.org
RUN apt-get update && apt-get install -y make autoconf automake libtool mercurial libpcre3-dev libreadline-dev
RUN apt-get update && apt-get install -y make autoconf automake libtool \
mercurial libpcre3-dev libreadline-dev subversion
RUN hg clone http://hg.nginx.org/njs
RUN svn co svn://vcs.exim.org/pcre/code/trunk pcre
WORKDIR njs
COPY build.sh njs_process_script_fuzzer.c $SRC/

View File

@ -15,6 +15,14 @@
#
################################################################################
# Build pcre dependency to be linked statically.
pushd $SRC/pcre
./autogen.sh
./configure
make -j$(nproc) clean
make -j$(nproc) all
popd
# build project
rm -rf build
@ -26,8 +34,10 @@ make njs
$CC $CFLAGS -Inxt -Ibuild -Injs -c \
$SRC/njs_process_script_fuzzer.c -o build/njs_process_script_fuzzer.o
$CXX $CXXFLAGS build/njs_process_script_fuzzer.o -o $OUT/njs_process_script_fuzzer \
$LIB_FUZZING_ENGINE build/libnxt.a build/libnjs.a -lm -lpcre -lreadline
$CXX $CXXFLAGS build/njs_process_script_fuzzer.o \
-o $OUT/njs_process_script_fuzzer \
$LIB_FUZZING_ENGINE build/libnxt.a build/libnjs.a \
$SRC/pcre/.libs/libpcre.a -lm -lreadline
SEED_CORPUS_PATH=$OUT/njs_process_script_fuzzer_seed_corpus
mkdir -p $SEED_CORPUS_PATH
@ -42,4 +52,3 @@ set -x
zip -q $SEED_CORPUS_PATH.zip $SEED_CORPUS_PATH
rm -rf $SEED_CORPUS_PATH

View File

@ -2,5 +2,5 @@ homepage: "https://nginx.org/en/docs/njs/"
primary_contact: "mmoroz@google.com"
sanitizers:
- address
- memory
- undefined