Fix build on iOS
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 10 Oct 2013 18:53:32 +0000 (20:53 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 10 Oct 2013 23:05:57 +0000 (01:05 +0200)
On 32-bit ARM, iOS uses SJLJ for exceptions, which is probably why
_Unwind_Backtrace is not available (it's hard to implement reliably without
unwind tables). Don't use it there, we don't need it (because we can't JIT).

Task-Number: QTBUG-33979

Change-Id: Ifafbb59a32fd23c9b2e93228779535b2324ac4a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
src/qml/jsruntime/qv4stacktrace.cpp

index 7b7060d..905111a 100644 (file)
 #include "qv4engine_p.h"
 #include "qv4unwindhelper_p.h"
 
-#if defined(V4_CXX_ABI_EXCEPTION) || defined(Q_OS_DARWIN)
+#if defined(V4_CXX_ABI_EXCEPTION) || (defined(Q_OS_DARWIN) && !defined(Q_PROCESSOR_ARM_32))
+#define USE_UNWIND_BACKTRACE
+#endif
+
+#if defined(USE_UNWIND_BACKTRACE)
 #include <unwind.h>
 
 struct BacktraceHelper
@@ -95,7 +99,7 @@ NativeStackTrace::NativeStackTrace(ExecutionContext *context)
     engine = context->engine;
     currentNativeFrame = 0;
 
-#if defined(V4_CXX_ABI_EXCEPTION) || defined(Q_OS_DARWIN)
+#if defined(USE_UNWIND_BACKTRACE)
     UnwindHelper::prepareForUnwind(context);
 
     nativeFrameCount = get_backtrace_from_libunwind(&trace[0], sizeof(trace) / sizeof(trace[0]));