Using pcre_jit

Maxim Dounin mdounin at
Tue Feb 16 17:00:42 UTC 2016


On Tue, Feb 16, 2016 at 11:29:32AM -0500, Alt wrote:

> Hello,
> To use pcre_jit ( ), is it mandatory to compile
> nginx with "--with-pcre-jit"?
> On FreeBSD, nginx isn't compiled with "--with-pcre-jit", but I can still use
> "pcre_jit on;" without nginx throwing errors. So, does nginx really use PCRE
> JIT in this case?
> This bug report:
> mention "--with-pcre-jit" isn't needed.

Sergey Osokin's response is correct.

The "--with-pcre-jit" is only needed when you compile PCRE library 
using nginx configure (./configure --with-pcre=<path> ...).  When 
using a system PCRE library whether or not JIT is supported 
depends on how the library was compiled.

On FreeBSD PCRE is compiled with JIT enabled except on few archs 
where it's not available.

If you'll try to use "pcre_jit on" without JIT available, nginx 
will warn you during configuration parsing:

nginx: [warn] nginx was built without PCRE JIT support in ...

Or, if nginx was compiled with JIT available, but currently loaded 
PCRE library does not support JIT:

nginx: [warn] PCRE library does not support JIT in ...

If you don't see these messages - this means that JIT is used.

Maxim Dounin

More information about the nginx mailing list