summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-02-22 04:02:15 +0530
committerTim-Philipp Müller <tim@centricular.com>2020-02-27 20:43:48 +0000
commit316f1b65baddcc6578cb1422c2fa00de72e8618f (patch)
treef3b2dd216f7c0e03955ad52f307a7942c26f3c22
parentdfd12e3078a176a82a09d7e28b757fa4739e6747 (diff)
fontconfig.recipe: Fix EXC_BAD_ACCESS crash on iOS ARM64
Found by Carsten Griffin on https://gitlab.freedesktop.org/gstreamer/cerbero/merge_requests/407 Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/648
-rw-r--r--recipes/fontconfig.recipe3
-rw-r--r--recipes/fontconfig/0001-fcatomic-Fix-EXC_BAD_ACCESS-on-iOS-ARM64.patch45
2 files changed, 47 insertions, 1 deletions
diff --git a/recipes/fontconfig.recipe b/recipes/fontconfig.recipe
index db368651..fe4ea161 100644
--- a/recipes/fontconfig.recipe
+++ b/recipes/fontconfig.recipe
@@ -15,7 +15,8 @@ class Recipe(recipe.Recipe):
patches = ['fontconfig/0003-configure-Allow-static-build.patch',
'fontconfig/0001-Do-not-build-tests-on-windows.patch',
'fontconfig/0001-Don-t-use-_mktemp_s-which-is-not-available-in-XP.patch',
- 'fontconfig/0004-Fix-cross-compilation-by-passing-CPPFLAGS-to-CPP.patch'
+ 'fontconfig/0004-Fix-cross-compilation-by-passing-CPPFLAGS-to-CPP.patch',
+ 'fontconfig/0001-fcatomic-Fix-EXC_BAD_ACCESS-on-iOS-ARM64.patch',
]
files_libs = ['libfontconfig']
diff --git a/recipes/fontconfig/0001-fcatomic-Fix-EXC_BAD_ACCESS-on-iOS-ARM64.patch b/recipes/fontconfig/0001-fcatomic-Fix-EXC_BAD_ACCESS-on-iOS-ARM64.patch
new file mode 100644
index 00000000..c06e8cfe
--- /dev/null
+++ b/recipes/fontconfig/0001-fcatomic-Fix-EXC_BAD_ACCESS-on-iOS-ARM64.patch
@@ -0,0 +1,45 @@
+From 1041fdf62bbcbd65ab85cf08836195b975c9dd85 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@centricular.com>
+Date: Sat, 22 Feb 2020 03:57:50 +0530
+Subject: [PATCH] fcatomic: Fix EXC_BAD_ACCESS on iOS ARM64
+
+iPhone 2.1 was released a long time ago, and the macro for checking
+the target iOS SDK version has changed. We can simplify everything and
+do a very basic check.
+---
+ src/fcatomic.h | 12 ++----------
+ 1 file changed, 2 insertions(+), 10 deletions(-)
+
+diff --git a/src/fcatomic.h b/src/fcatomic.h
+index cc28a88..657a5f5 100644
+--- a/src/fcatomic.h
++++ b/src/fcatomic.h
+@@ -70,24 +70,16 @@ typedef LONG fc_atomic_int_t;
+ #elif !defined(FC_NO_MT) && defined(__APPLE__)
+
+ #include <libkern/OSAtomic.h>
+-#ifdef __MAC_OS_X_MIN_REQUIRED
+ #include <AvailabilityMacros.h>
+-#elif defined(__IPHONE_OS_MIN_REQUIRED)
+-#include <Availability.h>
+-#endif
+
+ typedef int fc_atomic_int_t;
+ #define fc_atomic_int_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V))
+
+ #define fc_atomic_ptr_get(P) (OSMemoryBarrier (), (void *) *(P))
+-#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_VERSION_MIN_REQUIRED >= 20100)
++#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 20100)
+ #define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
+ #else
+-#if __ppc64__ || __x86_64__
+-#define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P))
+-#else
+-#define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwap32Barrier ((int32_t) (O), (int32_t) (N), (int32_t*) (P))
+-#endif
++#error "Your macOS / iOS targets are too old"
+ #endif
+
+ #elif !defined(FC_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)
+--
+2.21.1 (Apple Git-122.3)