From 2d075bf651e246d57d25a95219d7358946b9f785 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <torarnv@gmail.com>
Date: Tue, 4 Nov 2014 17:12:28 +0100
Subject: [PATCH] iOS: Update integrated event dispatcher to support 64-bit x86

Needed so that we can build simulator builds for x86_64 as well as
i386. The function call alignment is the same, but we need to use
the 64-bit versions of the instruction and operands.

Change-Id: I62cc78e23b5e0923382d19570ce18f558894e6a0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
---
 src/plugins/platforms/ios/qioseventdispatcher.mm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm
index 66fd9cd1e52..ffffc4cbc44 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.mm
+++ b/src/plugins/platforms/ios/qioseventdispatcher.mm
@@ -317,11 +317,16 @@ static bool rootLevelRunLoopIntegration()
 }
 
 #if defined(Q_PROCESSOR_X86)
-#  define SET_STACK_POINTER "mov %0, %%esp"
 #  define FUNCTION_CALL_ALIGNMENT 16
+#  if defined(Q_PROCESSOR_X86_32)
+#    define SET_STACK_POINTER "mov %0, %%esp"
+#  elif defined(Q_PROCESSOR_X86_64)
+#    define SET_STACK_POINTER "movq %0, %%rsp"
+#  endif
 #elif defined(Q_PROCESSOR_ARM)
-#  define SET_STACK_POINTER "mov sp, %0"
+#  // Valid for both 32 and 64-bit ARM
 #  define FUNCTION_CALL_ALIGNMENT 4
+#  define SET_STACK_POINTER "mov sp, %0"
 #else
 #  error "Unknown processor family"
 #endif
-- 
GitLab