Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 278247

Summary: dev-java/qtjambi: fails to build with gcc-4.4
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: New packagesAssignee: Qt Bug Alias <qt>
Status: RESOLVED FIXED    
Severity: normal CC: ayoy, esigra, java
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 249226    
Attachments: Build log
Patch solving a part of the compilation errors.
Patch solving the compilation errors for qtjambi-4.4.3

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2009-07-18 08:47:50 UTC
As per summary, check attached build log.

And _please_ try not to fix it in the wrong way: http://blog.flameeyes.eu/2009/07/02/how-_not_-to-fix-gcc-4-4-bugs
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-07-18 08:48:14 UTC
Created attachment 198393 [details]
Build log
Comment 2 Dominik Kapusta (RETIRED) gentoo-dev 2009-07-19 21:03:48 UTC
So far a patch for qtjambi-4.5.0_p1 was added to qting-edge overlay.

http://github.com/gentoo-qt/qting-edge/commit/748a906090a746621b5875898a8fe748b173fe7e

It's not compatible with qtjambi-4.4.3, though...
Comment 3 Alistair Bush (RETIRED) gentoo-dev 2009-07-20 11:50:06 UTC
Ive had a look at this and have made some progress.  Now I have a completely new error :D

Will continue tomorrow....

[make] x86_64-pc-linux-gnu-g++ -c -pipe -march=k8 -O2 -pipe -Wall -W -Wno-unused-function -D_REENTRANT -fPIC -DQTJAMBI_EXPORT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I. -I../common -I/opt/sun-jdk-1.7.0.0_alpha64/include -I/opt/sun-jdk-1.7.0.0_alpha64/include/linux -I. -I. -o qtdynamicmetaobject.o qtdynamicmetaobject.cpp                                                                                                         
     [make] x86_64-pc-linux-gnu-g++ -c -pipe -march=k8 -O2 -pipe -Wall -W -Wno-unused-function -D_REENTRANT -fPIC -DQTJAMBI_EXPORT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I. -I../common -I/opt/sun-jdk-1.7.0.0_alpha64/include -I/opt/sun-jdk-1.7.0.0_alpha64/include/linux -I. -I. -o qtjambivariant.o qtjambivariant.cpp                                                                                                                   
     [make] qtdynamicmetaobject.cpp: In member function 'void QtDynamicMetaObjectPrivate::initialize(JNIEnv*, _jclass*, const QMetaObject*)':                                                                                                                     
     [make] qtdynamicmetaobject.cpp:187: warning: pointer of type 'void *' used in arithmetic                                    
     [make] qtdynamicmetaobject.cpp:187: error: 'const void*' is not a pointer-to-object type                                    
     [make] make[1]: *** [qtdynamicmetaobject.o] Error 1                                                                         
     [make] make[1]: *** Waiting for unfinished jobs....                                                                         
     [make] make[1]: Leaving directory `/var/tmp/portage/dev-java/qtjambi-4.4.3-r1/work/qtjambi-src-gpl-4.4.3_01/qtjambi'        
     [make] make: *** [sub-qtjambi-make_default-ordered] Error 2                                                                 

BUILD FAILED
/var/tmp/portage/dev-java/qtjambi-4.4.3-r1/work/qtjambi-src-gpl-4.4.3_01/build.xml:104: Running: make -j3  failed with exit code: 2
Comment 4 Dominik Kapusta (RETIRED) gentoo-dev 2009-07-20 15:49:58 UTC
Created attachment 198621 [details, diff]
Patch solving a part of the compilation errors.

I'm attaching what I managed to do yesterday about qtjambi-4.4.3. This solves the problem with const void* (the solution is taken from 4.5.0 code :P). But then again there is an issue about Qt Jambi generator generating wrong (too much of?) code:

     [make] ../cpp/com_trolltech_qt_core/qtjambishell_QRegExp.cpp: In function '_jobject* Java_com_trolltech_qt_core_QRegExp__1_1qt_1cap_1int__JI(JNIEnv*, _jobject*, jlong, jint)':                                                  
     [make] ../cpp/com_trolltech_qt_core/qtjambishell_QRegExp.cpp:120: error: redefinition of '_jobject* Java_com_trolltech_qt_core_QRegExp__1_1qt_1cap_1int__JI(JNIEnv*, _jobject*, jlong, jint)'                                    
     [make] ../cpp/com_trolltech_qt_core/qtjambishell_QRegExp.cpp:99: error: '_jobject* Java_com_trolltech_qt_core_QRegExp__1_1qt_1cap_1int__JI(JNIEnv*, _jobject*, jlong, jint)' previously defined here


When you take a look at cpp/com_trolltech_qt_core/qtjambishell_QRegExp.cpp, there really is a redefinition of '_jobject* Java_com_trolltech_qt_core_QRegExp__1_1qt_1cap_1int__JI(JNIEnv*, _jobject*, jlong, jint)', because the file contains this method 2 times, first commented as 'QRegExp::cap(int nth)' and second as 'QRegExp::cap(int nth) const'. I don't know if it's a Gentoo-related issue or not, anyway, qtjambi-4.5.0_p1 generates the first one method of these two.
Comment 5 Dominik Kapusta (RETIRED) gentoo-dev 2009-07-20 17:36:38 UTC
Created attachment 198626 [details, diff]
Patch solving the compilation errors for qtjambi-4.4.3

By doing some fine tuning of typesystem*.xml files I managed to get qtjambi-4.4.3 compiling with gcc-4.4 and qt-4.5.2. I was basing on qtjambi-4.5.0_p1 code, but please someone review this patch as I'm not 100% sure that the manipulation of the Java stuff is done the proper way :)
Comment 6 Davide Pesavento (RETIRED) gentoo-dev 2009-07-20 19:10:03 UTC
Wouldn't it be better to just bump qtjambi to 4.5.0_p1 (now in qting-edge) which already has a (very simple) patch?
Comment 7 Dominik Kapusta (RETIRED) gentoo-dev 2009-07-20 19:19:45 UTC
Seems a nice idea, since qt-*-4.5.1 is already marked stable, and people are going to have Qt 4.5.1 rather than 4.4.*. And I may be wrong, but I guess that I needed such a tricky patch for qtjambi-4.4.3 because it linked against Qt 4.5.2 libs (and not 4.4.*) on my system.

Moreover, I'm pretty sure that qtjambi-4.5.0_p1 patch doesn't break stuff ;) which I can't say about the 4.4.3 one.
Comment 8 Alistair Bush (RETIRED) gentoo-dev 2009-07-22 11:09:05 UTC
bumped to 4.5.0_p1