Disable PCRE2 JIT for Darwin (#4329)

This commit is contained in:
Rot127 2024-03-05 09:07:07 +00:00 committed by GitHub
parent f0643cc1e3
commit de1b126b5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -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'
pcre2_jit_supported = target_machine.cpu_family() in cpu_jit_supported and cc.get_id() != 'tcc' and target_machine.system() != 'darwin'
if pcre2_jit_supported
add_project_arguments(['-DSUPPORTS_PCRE2_JIT'], language: 'c')
endif

View file

@ -58,13 +58,14 @@ pcre2_files = [
cpu_jit_supported = [ 'aarch64', 'arm', 'mips', 'mips64', 'ppc', 'ppc64', 'riscv32', 'riscv64', 's390x', 'x86', 'x86_64' ]
# 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
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' or target_machine.system() == 'darwin'
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'

View file

@ -62,13 +62,14 @@ pcre2_files = [
cpu_jit_supported = [ 'aarch64', 'arm', 'mips', 'mips64', 'ppc', 'ppc64', 'riscv32', 'riscv64', 's390x', 'x86', 'x86_64' ]
# 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
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' or target_machine.system() == 'darwin'
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'