Rizin/Cutter: Add patch to disable PCRE2 JIT. (#347699)

This commit is contained in:
7c6f434c 2024-10-18 21:25:31 +00:00 committed by GitHub
commit 00b51dac4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,36 @@
diff --git a/meson.build b/meson.build
index a8153a2ee5..787cbfae06 100644
--- a/meson.build
+++ b/meson.build
@@ -197,7 +197,7 @@ endif
# Handle PCRE2
cpu_jit_supported = [ 'aarch64', 'arm', 'mips', 'mips64', 'ppc', 'ppc64', 'riscv32', 'riscv64', 's390x', 'x86', 'x86_64' ]
-pcre2_jit_supported = target_machine.cpu_family() in cpu_jit_supported and cc.get_id() != 'tcc' and target_machine.system() != 'darwin'
+pcre2_jit_supported = false
if pcre2_jit_supported
add_project_arguments(['-DSUPPORTS_PCRE2_JIT'], language: 'c')
endif
diff --git a/subprojects/packagefiles/pcre2/meson.build b/subprojects/packagefiles/pcre2/meson.build
index b40ea85740..f3ee7a02ed 100644
--- a/subprojects/packagefiles/pcre2/meson.build
+++ b/subprojects/packagefiles/pcre2/meson.build
@@ -60,18 +60,6 @@ cpu_jit_supported = [ 'aarch64', 'arm', 'mips', 'mips64', 'ppc', 'ppc64', 'riscv
# tcc doesn't support the MSVC asm syntax PCRE2 uses (`__asm { ... }`).
# Darwin kernel not as well, because of forbidden wx memory.
# It is used in the JIT compiler code.
-if cc.get_id() != 'tcc' and target_machine.cpu_family() in cpu_jit_supported and target_machine.system() != 'darwin'
- libpcre2_c_args += ['-DSUPPORT_JIT']
- pcre2_files += ['src/pcre2_jit_compile.c']
-endif
-
-if target_machine.system() == 'openbsd'
- # jit compilation fails with "no more memory" if wx allocations are allowed.
- libpcre2_c_args += ['-DSLJIT_WX_EXECUTABLE_ALLOCATOR']
-elif target_machine.system() == 'netbsd'
- # jit compilation fails with "no more memory" if wx allocations are allowed.
- libpcre2_c_args += ['-DSLJIT_PROT_EXECUTABLE_ALLOCATOR']
-endif
pcre2_includes = [
include_directories('.'),

View File

@ -60,6 +60,8 @@ let rizin = stdenv.mkDerivation rec {
./librz-wrapper-support.patch
./0001-fix-compilation-with-clang.patch
# Can be dropped when upstream fixes this: https://github.com/NixOS/nixpkgs/issues/300056
./0002-disable-pcre2-jit.patch
];