pcre, pcre2: autodetect jit support, don't force-enable

PCRE JIT is not supported on most architectores: m68k, s390,
ia64 to name a few.

Example build failure is:

    $ nix build -f. pkgsCross.s390.pcre
    ...
    pcre_jit_compile.c:65:2: error: #error Unsupported architecture

The change shifts from --enable-jit[=yes] to --enable-jit=auto which
allows nixpkgs to enable jit automatically only on supported targets.
This commit is contained in:
Sergei Trofimovich 2022-04-13 18:03:51 +01:00
parent 7feda9ba09
commit ae34f37142
2 changed files with 2 additions and 4 deletions

View file

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
outputs = [ "bin" "dev" "out" "doc" "man" ];
# Disable jit on Apple Silicon, https://github.com/zherczeg/sljit/issues/51
configureFlags = optional (!stdenv.hostPlatform.isRiscV && !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) "--enable-jit" ++ [
configureFlags = optional (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) "--enable-jit=auto" ++ [
"--enable-unicode-properties"
"--disable-cpp"
]

View file

@ -15,9 +15,7 @@ stdenv.mkDerivation rec {
configureFlags = [
"--enable-pcre2-16"
"--enable-pcre2-32"
] ++ lib.optional (!stdenv.hostPlatform.isRiscV &&
!(stdenv.hostPlatform.isDarwin &&
stdenv.hostPlatform.isAarch64)) "--enable-jit";
] ++ lib.optional (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) "--enable-jit=auto";
outputs = [ "bin" "dev" "out" "doc" "man" "devdoc" ];