pcre2: backport jit auto-detection

Without the change `pcre2` build without `jit` support. This happens
because --wit-jit=auto was broken in this release. THe change backports
upstream fix.

Before the change ./configure log:

    pcre2>     Enable JIT compiling support ....... : no

After the change:

    pcre2>     Enable JIT compiling support ....... : yes

I initially observed the failures on `rizin` as a spam of failures to
JIT a trivial regex:

    $ rizin
    ERROR: Regex compilation for '\s+' failed at 0: bad JIT option
    ERROR: Regex compilation for '\s+' failed at 0: bad JIT option
    ...
    ERROR: Regex compilation for '\s+' failed at 0: bad JIT option
     -- Check your IO plugins with 'rizin -L'
    [0x00000000]>
This commit is contained in:
Sergei Trofimovich 2024-03-31 23:05:45 +01:00
parent 0a08741184
commit b5f1bca281
1 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,16 @@ stdenv.mkDerivation rec {
hash = "sha256-4qU5hP8LB9/bWuRIa7ubIcyo598kNAlsyb8bcow1C8s=";
};
postPatch = ''
# Fix jit autodetection:
# https://github.com/PCRE2Project/pcre2/pull/396
# Applying manually to avoid fetchpatch and autoreconfHook.
# TODO: remove once 10.44 is released
substituteInPlace configure --replace-fail \
'#include "src/sljit/sljitConfigInternal.h"' \
'#include "src/sljit/sljitConfigCPU.h"'
'';
configureFlags = [
"--enable-pcre2-16"
"--enable-pcre2-32"