From 93d4c2097391b6a2df20f871b4019abded6a9258 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 21 Jun 2013 14:05:56 +0200 Subject: [PATCH] Fix build on Android Don't include execinfo.h and use open_memstream on Android Change-Id: I5b45dd4fc7f3b435b35e1951d6e722d4b52a6ea4 Reviewed-by: Lars Knoll --- src/qml/qml/v4/qv4engine.cpp | 5 +++-- src/qml/qml/v4/qv4isel_masm.cpp | 4 ++-- src/qml/qml/v4/qv4unwindhelper_p-arm.h | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/qml/qml/v4/qv4engine.cpp b/src/qml/qml/v4/qv4engine.cpp index d7064a1..1bec916 100644 --- a/src/qml/qml/v4/qv4engine.cpp +++ b/src/qml/qml/v4/qv4engine.cpp @@ -66,7 +66,8 @@ #include "qv4qobjectwrapper_p.h" #include "qv4qmlextensions_p.h" -#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) +#if (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) || defined(Q_OS_MAC) +#define HAVE_GNU_BACKTRACE #include #endif @@ -604,7 +605,7 @@ namespace { engine = context->engine; currentNativeFrame = 0; -#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) +#if defined(HAVE_GNU_BACKTRACE) UnwindHelper::prepareForUnwind(context); nativeFrameCount = backtrace(&trace[0], sizeof(trace) / sizeof(trace[0])); diff --git a/src/qml/qml/v4/qv4isel_masm.cpp b/src/qml/qml/v4/qv4isel_masm.cpp index 98d357a..0f4f08d 100644 --- a/src/qml/qml/v4/qv4isel_masm.cpp +++ b/src/qml/qml/v4/qv4isel_masm.cpp @@ -507,7 +507,7 @@ void Assembler::link(QV4::Function *vmFunc) static bool showCode = !qgetenv("SHOW_CODE").isNull(); if (showCode) { -#if OS(LINUX) +#if OS(LINUX) && !defined(Q_OS_ANDROID) char* disasmOutput = 0; size_t disasmLength = 0; FILE* disasmStream = open_memstream(&disasmOutput, &disasmLength); @@ -536,7 +536,7 @@ void Assembler::link(QV4::Function *vmFunc) vmFunc->codeRef = linkBuffer.finalizeCodeWithDisassembly("%s", name.data()); WTF::setDataFile(stderr); -#if OS(LINUX) || OS(MAC_OS_X) +#if (OS(LINUX) && !defined(Q_OS_ANDROID)) || OS(MAC_OS_X) # if OS(MAC_OS_X) char *disasmOutput = memStream.buf.data(); # endif diff --git a/src/qml/qml/v4/qv4unwindhelper_p-arm.h b/src/qml/qml/v4/qv4unwindhelper_p-arm.h index 88cf114..ff99a0a 100644 --- a/src/qml/qml/v4/qv4unwindhelper_p-arm.h +++ b/src/qml/qml/v4/qv4unwindhelper_p-arm.h @@ -3,6 +3,7 @@ #include "qv4unwindhelper_p.h" #include "qv4functionobject_p.h" +#include "qv4function_p.h" #include #include @@ -13,8 +14,8 @@ #if USE(LIBUNWIND_DEBUG) #include -#endif #include +#endif namespace QV4 { -- 2.7.4