summaryrefslogtreecommitdiffstats
path: root/.qmake.conf
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-07-16 13:19:00 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-17 13:59:57 +0200
commit09454fe361ff757b0207f25b270389a8a60605f6 (patch)
tree5ac282e5ed379bb24067613314ed7792dd829b35 /.qmake.conf
parenta62e32cae6606db64632e418262ab01e7806480c (diff)
Fix JavaScript stack back trace generation in release builds on Windows
We need to be able to reliably generate stack back traces for JavaScript calls, and since we use the C stack we therefore need to be able to reliably walk the stack. On most platforms the stack back trace generation is tied to the same mechanism that's used to unwind the stack during exception handling, which uses compiler generated per-function tables that allow the run-time to unwind the stack even when no regular stack frame was created. Unfortunately on i386 on Windows there are no unwinding tables in use (as opposed to all other architectures Windows runs on), and therefore we have no reliable way of generating a stack back trace if functions can omit the generation of a stack frame. Therefore we have to disable this compiler optimization, using -Oy- for MSVC (see http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.71).aspx ) and -fno-omit-frame-pointer for gcc. Technically this change needs to be done only in places where we support throwing or catching V4 exception as well as code that is traversed during the unwinding. Due to the use of internal V4 api throughout the entire module, this patch is applied to .qmake.conf. This also fixes tst_qqmlvaluetypes Change-Id: I21a9e5522741446de25a5d0046f7e34f741f7722 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to '.qmake.conf')
-rw-r--r--.qmake.conf13
1 files changed, 13 insertions, 0 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 4baafa83df..f21f463f3c 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -2,3 +2,16 @@ load(qt_build_config)
CONFIG += qt_example_installs
MODULE_VERSION = 5.2.0
+
+# For the JS engine we need to be able to produce back traces,
+# and as we're using the C stack, we need the system to be able
+# to walk it properly. Unfortunately on Windows with i386 there
+# are no unwind tables, that can compensate for an omitted frame
+# pointer, so we have no choice but to disable the frame pointer
+# omission optimizations.
+# Only within the qtdeclarative module we support throwing V4
+# exceptions, hence the choice of applying this change here.
+win32:equals(QT_ARCH, "i386") {
+ *msvc*: QMAKE_CXXFLAGS += -Oy-
+ *g++*: QMAKE_CXXFLAGS += -fno-omit-frame-pointer
+}