aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Dmitry Volyntsev <xeioexception@gmail.com>2021-11-16 02:24:48 +0300
committerGravatar GitHub <noreply@github.com>2021-11-15 23:24:48 +0000
commit9fc819841ff23ef817790d424b4ff5963fb1c779 (patch)
tree880c87e46754172cbaf95f0d365993df2e3aadad
parent4978312d616e596b0575bc57e93edacce3f8c962 (diff)
[njs] Build pcre2 dependency manually and enable MSan. (#6830)
-rw-r--r--projects/njs/Dockerfile4
-rwxr-xr-xprojects/njs/build.sh7
-rw-r--r--projects/njs/project.yaml7
3 files changed, 10 insertions, 8 deletions
diff --git a/projects/njs/Dockerfile b/projects/njs/Dockerfile
index 0066c4a1..00d975b7 100644
--- a/projects/njs/Dockerfile
+++ b/projects/njs/Dockerfile
@@ -16,9 +16,9 @@
FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && apt-get install -y make autoconf automake libtool \
- mercurial libpcre3-dev subversion
+ mercurial git libpcre2-dev
RUN hg clone http://hg.nginx.org/njs
-RUN svn co svn://vcs.exim.org/pcre/code/trunk pcre
+RUN git clone --branch pcre2-10.39 https://github.com/PhilipHazel/pcre2 pcre2
WORKDIR njs
COPY build.sh $SRC/
diff --git a/projects/njs/build.sh b/projects/njs/build.sh
index 229a3538..166df14b 100755
--- a/projects/njs/build.sh
+++ b/projects/njs/build.sh
@@ -16,11 +16,14 @@
################################################################################
# Build pcre dependency to be linked statically.
-pushd $SRC/pcre
+pushd $SRC/pcre2
./autogen.sh
CFLAGS="$CFLAGS -fno-use-cxa-atexit" CXXFLAGS="$CXXFLAGS -fno-use-cxa-atexit" ./configure
make -j$(nproc) clean
make -j$(nproc) all
+make install
+sed -i "s/\$libS\$libR \(-lpcre2-8$\)/\$libS\$libR -Wl,-Bstatic \1 -Wl,-Bdynamic/" /usr/local/bin/pcre2-config
+#sed -i "s/libS=/libS=-L\${exec_prefix}\/lib/" /usr/local/bin/pcre2-config
popd
# build project
@@ -35,7 +38,7 @@ SEED_CORPUS_PATH=$OUT/njs_process_script_fuzzer_seed_corpus
mkdir -p $SEED_CORPUS_PATH
set +x
-cat src/test/njs_interactive_test.c src/test/njs_unit_test.c \
+cat src/test/njs_unit_test.c \
| egrep -o '".*"' | awk '{print substr($0,2,length($0)-2)}' | sort | uniq \
| while IFS= read -r line; do
echo $line > $SEED_CORPUS_PATH/$(echo $line | sha1sum | awk '{ print $1 }');
diff --git a/projects/njs/project.yaml b/projects/njs/project.yaml
index 65b2bf8e..d1d68133 100644
--- a/projects/njs/project.yaml
+++ b/projects/njs/project.yaml
@@ -6,8 +6,7 @@ auto_ccs:
- "devrep@nginx.com"
sanitizers:
- address
-# Disabled MSAN because of https://github.com/google/oss-fuzz/issues/6294
-# - memory
+ - memory
- undefined
-coverage_extra_args: -ignore-filename-regex=.*/pcre/.*
-main_repo: 'https://github.com/nginx/njs.git' \ No newline at end of file
+coverage_extra_args: -ignore-filename-regex=.*/pcre2/.*
+main_repo: 'https://github.com/nginx/njs.git'