# Using pcre\_jit

**URL:** <https://www.ruby-forum.com/t/using-pcre-jit/244078>\
**Category:** NGINX\
**Created:** [February 16, 2016, 5:30pm UTC](https://www.ruby-forum.com/t/using-pcre-jit/244078 "2016-02-16T17:30:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [February 16, 2016, 5:30pm UTC](https://www.ruby-forum.com/t/using-pcre-jit/244078/1 "2016-02-16T17:30:08Z")

</div>

Hello,

To use pcre\_jit ( [Core functionality](http://nginx.org/r/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:  
[https://bugs.freebsd.org/bugzilla/show\_bug.cgi?id=200793](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200793)  
mention “–with-pcre-jit” isn’t needed.

Best Regards

Posted at Nginx Forum:

> **[Using pcre\_jit](https://forum.nginx.org/read.php?2,264554,264554#msg-264554)**
>
> Hello, To use pcre\_jit ( http://nginx.org/r/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...

---

<div class="post-metadata">

**Author:** ![Alt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@Alt](https://www.ruby-forum.com/u/Alt)\
**Post date:** [February 16, 2016, 5:44pm UTC](https://www.ruby-forum.com/t/using-pcre-jit/244078/2 "2016-02-16T17:44:44Z")

</div>

On Tuesday 16 February 2016 11:29:32 Alt wrote:

> Hello,
> 
> To use pcre\_jit ( [Core functionality](http://nginx.org/r/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?

If there’s no warning in error log about JIT, then it is used.

> This bug report: [Making sure you're not a bot!](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200793)  
> mention “–with-pcre-jit” isn’t needed.

[..]

As it’s written in the documentation, the flag is needed only if the  
PCRE  
library is built with nginx (i.e. the --with-pcre=… parameter is  
used).

wbr, Valentin V. Bartenev

---

<div class="post-metadata">

**Author:** ![Alt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@Alt](https://www.ruby-forum.com/u/Alt)\
**Post date:** [February 16, 2016, 6:01pm UTC](https://www.ruby-forum.com/t/using-pcre-jit/244078/3 "2016-02-16T18:01:06Z")

</div>

Hello!

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

> Hello,
> 
> To use pcre\_jit ( [Core functionality](http://nginx.org/r/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: [Making sure you're not a bot!](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200793)  
> 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= …). 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 D.

> **[nginx](http://nginx.org/)**

---

<div class="post-metadata">

**Author:** ![Alt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@Alt](https://www.ruby-forum.com/u/Alt)\
**Post date:** [February 16, 2016, 6:10pm UTC](https://www.ruby-forum.com/t/using-pcre-jit/244078/4 "2016-02-16T18:10:27Z")

</div>

Hello,

Thanks Valentin for your answer!

Best Regards

Posted at Nginx Forum:

> **[Re: Using pcre\_jit](https://forum.nginx.org/read.php?2,264554,264558#msg-264558)**
>
> Hello, To use pcre\_jit ( http://nginx.org/r/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...

---

<div class="post-metadata">

**Author:** ![Alt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@Alt](https://www.ruby-forum.com/u/Alt)\
**Post date:** [February 16, 2016, 6:12pm UTC](https://www.ruby-forum.com/t/using-pcre-jit/244078/5 "2016-02-16T18:12:12Z")

</div>

Hello,

Thanks also Maxim for your answer!

Best Regards

Posted at Nginx Forum:

> **[Re: Using pcre\_jit](https://forum.nginx.org/read.php?2,264554,264559#msg-264559)**
>
> Hello, To use pcre\_jit ( http://nginx.org/r/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...
