aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2015-12-21 10:07:16 +0100
committerMemphiz <memphis@machzwo.de>2016-01-06 15:52:05 +0100
commit4d39eaee96fffaec1108c85aceaaa33603baeec9 (patch)
tree211e52f08486bb1cd4999063ddacfd2d05c676be
parent58047421a325f4fe756708246dbe77944512bc21 (diff)
[depends/fontconfig] - fix compilation for arm64
-rw-r--r--tools/depends/target/fontconfig/Makefile5
-rw-r--r--tools/depends/target/fontconfig/fix-aarch64_atomics.patch26
2 files changed, 29 insertions, 2 deletions
diff --git a/tools/depends/target/fontconfig/Makefile b/tools/depends/target/fontconfig/Makefile
index b97e51cd95..dba0ee536a 100644
--- a/tools/depends/target/fontconfig/Makefile
+++ b/tools/depends/target/fontconfig/Makefile
@@ -1,5 +1,5 @@
include ../../Makefile.include
-DEPS= ../../Makefile.include lconv.patch Makefile
+DEPS= ../../Makefile.include lconv.patch fix-aarch64_atomics.patch Makefile
# lib name, version
LIBNAME=fontconfig
@@ -24,7 +24,8 @@ $(TARBALLS_LOCATION)/$(ARCHIVE):
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
- cd $(PLATFORM); patch -p1 < ../lconv.patch
+ cd $(PLATFORM); patch -p1 < ../lconv.patch
+ cd $(PLATFORM); patch -p1 < ../fix-aarch64_atomics.patch
cd $(PLATFORM); $(AUTORECONF) -vif
cd $(PLATFORM); $(CONFIGURE)
diff --git a/tools/depends/target/fontconfig/fix-aarch64_atomics.patch b/tools/depends/target/fontconfig/fix-aarch64_atomics.patch
new file mode 100644
index 0000000000..1d95acda16
--- /dev/null
+++ b/tools/depends/target/fontconfig/fix-aarch64_atomics.patch
@@ -0,0 +1,26 @@
+--- a/src/fcatomic.h-org 2015-10-31 21:15:56.000000000 -0400
++++ b/src/fcatomic.h 2015-10-31 21:19:10.000000000 -0400
+@@ -70,18 +70,18 @@ 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 __aarch64__
++#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) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
++#endif
+ #else
+ #if __ppc64__ || __x86_64__
+ #define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P))
+