aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ponyc/fix-aarch64.patch
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-05-05 22:31:41 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-05-05 22:38:55 +0200
commit923cd1e69850a8eea66d422e7682f90d6ee684e2 (patch)
tree20f1329136c7f209df6d36e5cb1ea9c513e1569b /testing/ponyc/fix-aarch64.patch
parent396eb82cd185d7c76fb301e1db85558d2099471b (diff)
downloadaports-923cd1e69850a8eea66d422e7682f90d6ee684e2.tar.bz2
aports-923cd1e69850a8eea66d422e7682f90d6ee684e2.tar.xz
testing/ponyc: fix on aarch64
Diffstat (limited to 'testing/ponyc/fix-aarch64.patch')
-rw-r--r--testing/ponyc/fix-aarch64.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/ponyc/fix-aarch64.patch b/testing/ponyc/fix-aarch64.patch
new file mode 100644
index 0000000000..e8680cba09
--- /dev/null
+++ b/testing/ponyc/fix-aarch64.patch
@@ -0,0 +1,56 @@
+From 62dee527de27d0899331ebeb0362b60cd39cfcdd Mon Sep 17 00:00:00 2001
+From: Vassil Kovatchev <vkovatchev@deloitte.com>
+Date: Thu, 3 May 2018 09:48:52 -0400
+Subject: [PATCH] Fix failing aarch64 (ARM64) build
+
+ARM64 systems do not use ARM Exception Handling ABI (EHABI), but rather the DWARF exception handling standard.
+The fix turns off special ARM handling of exceptions when the target platform is ARM64.
+This enables builds of the codebase on ARM64 systems with standard implementation of libunwind as shipped with gcc 5+.
+
+Patch-Source: https://github.com/ponylang/ponyc/pull/2688
+
+--- a/src/common/platform.h
++++ b/src/common/platform.h
+@@ -170,6 +170,11 @@
+ */
+ #if defined(ARMV2) || defined(__arm__) || defined(__aarch64__)
+ # define PLATFORM_IS_ARM
++# if defined(__aarch64__)
++# define PLATFORM_IS_ARM64
++# else
++# define PLATFORM_IS_ARM32
++# endif
+ #elif defined(__i386__) || defined(_M_IX86) || defined(_X86_) || \
+ defined(__amd64__) || defined(__x86_64__) || defined(_M_X64) || \
+ defined(_M_AMD64)
+--- a/src/libponyrt/lang/posix_except.c
++++ b/src/libponyrt/lang/posix_except.c
+@@ -9,7 +9,7 @@
+
+ PONY_EXTERN_C_BEGIN
+
+-#ifdef PLATFORM_IS_ARM
++#ifdef PLATFORM_IS_ARM32
+ #include <string.h>
+ #include <stdio.h>
+ #endif
+@@ -26,7 +26,7 @@
+
+ PONY_API void pony_error()
+ {
+-#ifdef PLATFORM_IS_ARM
++#ifdef PLATFORM_IS_ARM32
+ memcpy(exception.exception_class, "Pony\0\0\0\0", 8);
+ #else
+ exception.exception_class = 0x506F6E7900000000; // "Pony"
+@@ -46,7 +46,9 @@
+ _Unwind_SetIP(context, landing_pad);
+ }
+
+-#ifdef PLATFORM_IS_ARM
++// Switch to ARM EHABI for ARM32 devices.
++// Note that this does not apply to ARM64 devices which use DWARF Exception Handling.
++#ifdef PLATFORM_IS_ARM32
+
+ _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*, _Unwind_Context*);
+