Commit 791706d8 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Disable the PCRE JIT compiler by default

The JIT compiler is broken on some versions of PCRE, at least on i386,
so disable it by default.  It can be enabled using --enable-pcre-jit
to configure.

Fixes #1191
parent ac082ae9
......@@ -531,6 +531,17 @@ fi
AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code])
# --enable-pcre-jit
AC_ARG_ENABLE(pcre-jit,
AS_HELP_STRING([--enable-pcre-jit],
[use the PCRE JIT compiler (default is NO)]),
,
[enable_pcre_jit=no])
if test "$enable_pcre_jit" = yes; then
AC_DEFINE([USE_PCRE_JIT],[1],[use the PCRE JIT compiler])
fi
# Stupid automake needs this
VTC_TESTS="$(cd $srcdir/bin/varnishtest && echo tests/*.vtc)"
AC_SUBST(VTC_TESTS)
......
......@@ -37,8 +37,10 @@
#include "vre.h"
#ifndef PCRE_STUDY_JIT_COMPILE
#define PCRE_STUDY_JIT_COMPILE 0
#if USE_PCRE_JIT
#define VRE_STUDY_JIT_COMPILE PCRE_STUDY_JIT_COMPILE
#else
#define VRE_STUDY_JIT_COMPILE 0
#endif
#if PCRE_MAJOR < 8 || (PCRE_MAJOR == 8 && PCRE_MINOR < 20)
......@@ -78,7 +80,7 @@ VRE_compile(const char *pattern, int options,
VRE_free(&v);
return (NULL);
}
v->re_extra = pcre_study(v->re, PCRE_STUDY_JIT_COMPILE, errptr);
v->re_extra = pcre_study(v->re, VRE_STUDY_JIT_COMPILE, errptr);
if (*errptr != NULL) {
VRE_free(&v);
return (NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment