[mythtv] Win32 + QT4 segfault: resolved

Andrei Tanas andrei at tanas.ca
Tue Jul 1 01:51:48 UTC 2008


I have found what was causing segfaults in Win32 builds during load (before 
GDB was capable to do anything). I've got a working win32/qt4 mythfrontend 
with this.
The explanation is rather complicated and will go to either TrollTech, or 
GCC developers or to Microsoft when I will have time to analyze and put it 
in words.

Regards,
Andrei Tanas.


diff -ur qt-win-opensource-src-4.4.0.orig/src/corelib/kernel/qobjectdefs.h 
qt-win-opensource-src-4.4.0/src/corelib/kernel/qobjectdefs.h
--- qt-win-opensource-src-4.4.0.orig/src/corelib/kernel/qobjectdefs.h Mon 
Jun 30 20:25:04 2008
+++ qt-win-opensource-src-4.4.0/src/corelib/kernel/qobjectdefs.h Mon Jun 30 
16:25:50 2008
@@ -149,7 +149,7 @@
 #define Q_OBJECT \
 public: \
     Q_OBJECT_CHECK \
-    static const QMetaObject staticMetaObject; \
+    static QMetaObject staticMetaObject; \
     virtual const QMetaObject *metaObject() const; \
     virtual void *qt_metacast(const char *); \
     QT_TR_FUNCTIONS \
@@ -160,7 +160,7 @@
 /* tmake ignore Q_GADGET */
 #define Q_GADGET \
 public: \
-    static const QMetaObject staticMetaObject; \
+    static QMetaObject staticMetaObject; \
 private:
 #else // Q_MOC_RUN
 #define slots slots
diff -ur qt-win-opensource-src-4.4.0.orig/src/tools/moc/generator.cpp 
qt-win-opensource-src-4.4.0/src/tools/moc/generator.cpp
--- qt-win-opensource-src-4.4.0.orig/src/tools/moc/generator.cpp Mon Jun 30 
20:25:24 2008
+++ qt-win-opensource-src-4.4.0/src/tools/moc/generator.cpp Mon Jun 30 
16:16:08 2008
@@ -319,7 +319,7 @@
     if (isQt)
         fprintf(out, "const QMetaObject QObject::staticQtMetaObject = 
{\n");
     else
-        fprintf(out, "const QMetaObject %s::staticMetaObject = {\n", 
cdef->qualified.constData());
+        fprintf(out, "QMetaObject %s::staticMetaObject = {\n", 
cdef->qualified.constData());

     if (isQObject)
         fprintf(out, "    { 0, ");
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: qt4.patch
Url: http://mythtv.org/pipermail/mythtv-dev/attachments/20080630/05dffe78/attachment.diff 


More information about the mythtv-dev mailing list