1
0
mirror of https://gitlab.gnome.org/GNOME/glib.git synced 2026-10-24 00:49:00 +03:00

pcre2.wrap: Add a patch to fix the iOS build

Taken from upstream PR: https://github.com/zherczeg/sljit/pull/355
This commit is contained in:
Nirbheek Chauhan
2026-02-03 16:38:07 +05:30
parent 4a922e9ac5
commit 043c2144ea
3 changed files with 63 additions and 0 deletions

1
.gitignore vendored
View File

@@ -27,6 +27,7 @@ tags
/meson-build/
/subprojects/*/
/subprojects/.wraplock
!/subprojects/packagefiles
# Generated Meson cross-compilation files for CI
vs2019-arm64.txt

View File

@@ -0,0 +1,60 @@
From 464790d3fcfb8076c39efc452720046657d60ec3 Mon Sep 17 00:00:00 2001
From: Nirbheek Chauhan <nirbheek@centricular.com>
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 <nirbheek@centricular.com>
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 <TargetConditionals.h>
-#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)

View File

@@ -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