diff --git a/projects/njs/Dockerfile b/projects/njs/Dockerfile index defa36240..41f2940a4 100644 --- a/projects/njs/Dockerfile +++ b/projects/njs/Dockerfile @@ -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/ diff --git a/projects/njs/build.sh b/projects/njs/build.sh index a9539c97b..93f05790f 100755 --- a/projects/njs/build.sh +++ b/projects/njs/build.sh @@ -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 - diff --git a/projects/njs/project.yaml b/projects/njs/project.yaml index f2a083fda..8bb8e9f51 100644 --- a/projects/njs/project.yaml +++ b/projects/njs/project.yaml @@ -2,5 +2,5 @@ homepage: "https://nginx.org/en/docs/njs/" primary_contact: "mmoroz@google.com" sanitizers: - address + - memory - undefined -