Merge pull request #184634 from LeSuisse/php-fix-crash-pcre2-jit-sealloc

php8*: disable PCRE2 JIT SEAlloc to avoid crashes
This commit is contained in:
Elis Hirwing 2022-08-16 07:18:45 +02:00 committed by GitHub
commit 6c303b528e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchurl
, withJitSealloc ? true
}:
stdenv.mkDerivation rec {
@ -17,9 +18,9 @@ stdenv.mkDerivation rec {
"--enable-pcre2-32"
# only enable jit on supported platforms which excludes Apple Silicon, see https://github.com/zherczeg/sljit/issues/51
"--enable-jit=auto"
# fix pcre jit in systemd units that set MemoryDenyWriteExecute=true like gitea
"--enable-jit-sealloc"
];
]
# fix pcre jit in systemd units that set MemoryDenyWriteExecute=true like gitea
++ lib.optional withJitSealloc "--enable-jit-sealloc";
outputs = [ "bin" "dev" "out" "doc" "man" "devdoc" ];

View File

@ -14916,6 +14916,9 @@ with pkgs;
# Import PHP81 interpreter, extensions and packages
php81 = callPackage ../development/interpreters/php/8.1.nix {
stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv;
pcre2 = pcre2.override {
withJitSealloc = false; # Needed to avoid crashes, see https://bugs.php.net/bug.php?id=78630
};
};
php81Extensions = recurseIntoAttrs php81.extensions;
php81Packages = recurseIntoAttrs php81.packages;
@ -14923,6 +14926,9 @@ with pkgs;
# Import PHP80 interpreter, extensions and packages
php80 = callPackage ../development/interpreters/php/8.0.nix {
stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv;
pcre2 = pcre2.override {
withJitSealloc = false; # Needed to avoid crashes, see https://bugs.php.net/bug.php?id=78630
};
};
php80Extensions = recurseIntoAttrs php80.extensions;
php80Packages = recurseIntoAttrs php80.packages;