From 043c2144eabec2124022159e41c375f6e67bbd42 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 3 Feb 2026 16:38:07 +0530 Subject: [PATCH] pcre2.wrap: Add a patch to fix the iOS build Taken from upstream PR: https://github.com/zherczeg/sljit/pull/355 --- .gitignore | 1 + .../pcre2/fix-build-on-apple-platforms.patch | 60 +++++++++++++++++++ subprojects/pcre2.wrap | 2 + 3 files changed, 63 insertions(+) create mode 100644 subprojects/packagefiles/pcre2/fix-build-on-apple-platforms.patch diff --git a/.gitignore b/.gitignore index d47e0aff1..5d0240762 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ tags /meson-build/ /subprojects/*/ /subprojects/.wraplock +!/subprojects/packagefiles # Generated Meson cross-compilation files for CI vs2019-arm64.txt diff --git a/subprojects/packagefiles/pcre2/fix-build-on-apple-platforms.patch b/subprojects/packagefiles/pcre2/fix-build-on-apple-platforms.patch new file mode 100644 index 000000000..e992b04a8 --- /dev/null +++ b/subprojects/packagefiles/pcre2/fix-build-on-apple-platforms.patch @@ -0,0 +1,60 @@ +From 464790d3fcfb8076c39efc452720046657d60ec3 Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan +Date: Tue, 3 Feb 2026 16:20:15 +0530 +Subject: [PATCH 1/2] Fix build on non-macOS platforms that do not support JIT + +Encountered while building pcre2: + +``` +../src/../deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c:127:2: error: call to undeclared function 'SLJIT_UPDATE_WX_FLAGS'; +ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] + 127 | SLJIT_UPDATE_WX_FLAGS(retval, (uint8_t *)retval + size, 0); + | ^ +``` +--- + deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c b/deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c +index 9bd2094..6f708a9 100644 +--- a/deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c ++++ b/deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c +@@ -108,6 +108,7 @@ static SLJIT_INLINE void apple_update_wx_flags(sljit_s32 enable_exec) + #else + #define SLJIT_MAP_JIT (0) + #endif ++#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec) + + #endif /* TARGET_OS_OSX */ + +-- +2.39.5 (Apple Git-154) + + +From 9d803b98c8233f5108e955861b029a36d086ea7d Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan +Date: Tue, 3 Feb 2026 16:22:09 +0530 +Subject: [PATCH 2/2] Fix build on non-iPhone/Mac Apple platforms such as tvOS + +When TARGET_OS_OSX is not defined, the Xcode SDK only supports Mac. +--- + deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c b/deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c +index 6f708a9..6e6ffd3 100644 +--- a/deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c ++++ b/deps/sljit/sljit_src/allocator_src/sljitExecAllocatorApple.c +@@ -34,7 +34,8 @@ + */ + #include + +-#if (defined(TARGET_OS_OSX) && TARGET_OS_OSX) || (TARGET_OS_MAC && !TARGET_OS_IPHONE) ++#if (defined (TARGET_OS_OSX) && TARGET_OS_OSX) || \ ++ (!defined (TARGET_OS_OSX) && defined (TARGET_OS_MAC) && TARGET_OS_MAC) + + #if defined(SLJIT_CONFIG_X86) && SLJIT_CONFIG_X86 + +-- +2.39.5 (Apple Git-154) + diff --git a/subprojects/pcre2.wrap b/subprojects/pcre2.wrap index 238d5a33a..a557600c9 100644 --- a/subprojects/pcre2.wrap +++ b/subprojects/pcre2.wrap @@ -8,6 +8,8 @@ patch_url = https://wrapdb.mesonbuild.com/v2/pcre2_10.46-1/get_patch patch_hash = 761d16c89b9c13812842916b7ee970650ee7c1810f83bc567351faf7365b66be source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/pcre2_10.46-1/pcre2-10.46.tar.bz2 wrapdb_version = 10.46-1 +# https://github.com/zherczeg/sljit/pull/355 +diff_files = pcre2/fix-build-on-apple-platforms.patch [provide] libpcre2-8 = libpcre2_8