Random rants from a KDE user which also works on making KDE more Hebrew friendly.

Sunday, January 31, 2010

Bootstrapping Qt using clang - part 3

As thiago asked, I run ./configure -no-mmx -no-3dnow -no-sse -no-sse2 && make, here are the warnings/errors found. Ifind it interesting that the inotify code used gcc extensions - as it seems on linux, this is the "only" usable C++ compiler. Second error should be trivial to fix, more on that on the next post.

Still FAIL.


/home/elcuco/src/llvm/build-cmake/bin/clang++ -c -pipe -g -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -O2 -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DELF_INTERPRETER=\"/lib/ld-linux.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared -o .obj/release-shared/qfilesystemwatcher_inotify.o io/qfilesystemwatcher_inotify.cpp In file included from io/qfilesystemwatcher_inotify.cpp:43:                                                                                    
In file included from io/qfilesystemwatcher_inotify_p.h:56:                                                                                    
In file included from io/qfilesystemwatcher_p.h:60:                                                                                            
In file included from ../../include/QtCore/private/qobject_p.h:1:                                                                              
In file included from ../../include/QtCore/private/../../../src/corelib/kernel/qobject_p.h:62:                                                 
In file included from ../../include/QtCore/qvariant.h:1:                                                                                       
In file included from ../../include/QtCore/../../src/corelib/kernel/qvariant.h:49:                                                             
In file included from ../../include/QtCore/qmap.h:1:                                                                                           
../../include/QtCore/../../src/corelib/tools/qmap.h:127:7: warning: field 'value' with variable sized type 'struct inotify_event' not at the   
      end of a struct or class is a GNU extension                                                                                              
    T value;                                                                                                                                   
      ^                                                                                                                                        
../../include/QtCore/../../src/corelib/tools/qmap.h:626:25: note: in instantiation of template class                                           
      'struct QMapNode' requested here                                                                              
            concreteNode->key.~Key();                                                                                                          
                        ^                                                                                                                      
../../include/QtCore/../../src/corelib/tools/qmap.h:167:59: note: in instantiation of member function                                          
      'QMap::freeData' requested here                                                                               
    inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); }                                                                       
                                                          ^                                                                                    
io/qfilesystemwatcher_inotify.cpp:359:30: note: in instantiation of member function 'QMap::~QMap' requested here    
    QMap eventForId;                                                                                                       
                             ^                                                                                                                 
In file included from io/qfilesystemwatcher_inotify.cpp:43:                                                                                    
In file included from io/qfilesystemwatcher_inotify_p.h:56:                                                                                    
In file included from io/qfilesystemwatcher_p.h:60:                                                                                            
In file included from ../../include/QtCore/private/qobject_p.h:1:                                                                              
In file included from ../../include/QtCore/private/../../../src/corelib/kernel/qobject_p.h:62:                                                 
In file included from ../../include/QtCore/qvariant.h:1:                                                                                       
In file included from ../../include/QtCore/../../src/corelib/kernel/qvariant.h:49:                                                             
In file included from ../../include/QtCore/qmap.h:1:                                                                                           
../../include/QtCore/../../src/corelib/tools/qmap.h:136:7: warning: field 'value' with variable sized type 'struct inotify_event' not at the   
      end of a struct or class is a GNU extension                                                                                              
    T value;                                                                                                                                   
      ^                                                                                                                                        
../../include/QtCore/../../src/corelib/tools/qmap.h:151:42: note: in instantiation of template class 'struct QMapPayloadNode
      inotify_event>' requested here                                                                                                           
    static inline int payload() { return sizeof(PayloadNode) - sizeof(QMapData::Node *); }                                                     
                                         ^                                                                                                     
../../include/QtCore/../../src/corelib/tools/qmap.h:633:25: note: in instantiation of member function                                          
      'QMap::payload' requested here                                                                                
    x->continueFreeData(payload());                                                                                                            
                        ^                                                                                                                      
../../include/QtCore/../../src/corelib/tools/qmap.h:167:59: note: in instantiation of member function                                          
      'QMap::freeData' requested here                                                                               
    inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); }                                                                       
                                                          ^                                                                                    
io/qfilesystemwatcher_inotify.cpp:359:30: note: in instantiation of member function 'QMap::~QMap' requested here    
    QMap eventForId;                                                                                                       
                             ^                                                                                                                 
9 diagnostics generated.                                                                                                                       
/home/elcuco/src/gitorious/qt/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DELF_INTERPRETER=\"/lib/ld-linux.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared io/qfilesystemwatcher_dnotify.cpp -o .moc/release-shared/qfilesystemwatcher_dnotify.moc




/home/elcuco/src/llvm/build-cmake/bin/clang++ -c -pipe -g -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -O2 -Wall -W -D_REENTRANT -I/usr/include/freetype2 -fPIC -DQT_SHARED -DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_OPENTYPE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE -DQT_NO_STYLE_S60 -DQ_INTERNAL_QAPP_SRC -DQT_NO_DEBUG -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I.rcc/release-shared -I../3rdparty/xorg -I/usr/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs -I.moc/release-shared -I/usr/X11R6/include -I.uic/release-shared -o .obj/release-shared/qprintengine_ps.o painting/qprintengine_ps.cpp
painting/qprintengine_ps.cpp:686:37: error: allocation of incomplete type 'struct sigaction'
        users_sigpipe_handler = new struct sigaction;
                                    ^
painting/qprintengine_ps.cpp:686:44: note: forward declaration of 'struct sigaction'
        users_sigpipe_handler = new struct sigaction;
                                           ^
painting/qprintengine_ps.cpp:687:26: error: invalid use of incomplete type 'struct sigaction'
        struct sigaction tmp_sigpipe_handler;
                         ^
painting/qprintengine_ps.cpp:686:44: note: forward declaration of 'struct sigaction'
        users_sigpipe_handler = new struct sigaction;
                                           ^
painting/qprintengine_ps.cpp:687:26: warning: unused variable 'tmp_sigpipe_handler' [-Wunused-variable]
        struct sigaction tmp_sigpipe_handler;
                         ^
5 diagnostics generated.
make[1]: *** [.obj/release-shared/qprintengine_ps.o] Error 1
make[1]: Leaving directory `/home/elcuco/src/gitorious/qt/src/gui'
make: *** [sub-gui-make_default-ordered] Error 2
[elcuco@pinky ~/src/gitorious/qt]

Thursday, January 28, 2010

Bootstrapping Qt using clang - part 2

This week it actually compiled a working qmake, configure actually worked. The problem now is Qt


make[1]: Entering directory `/home/elcuco/src/gitorious/qt/src/gui'
/home/elcuco/src/llvm/build-cmake/bin/clang++ -c -Winline -m3dnow -mmmx -pipe -g -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -Wall -W -D_REENTRANT -I/usr/include/freetype2 -fPIC -DQT_SHARED -DQT_BUILD_GUI_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_NO_OPENTYPE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSVISTA -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_WINDOWSCE -DQT_NO_STYLE_WINDOWSMOBILE -DQT_NO_STYLE_S60 -DQ_INTERNAL_QAPP_SRC -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I.rcc/debug-shared -I../3rdparty/xorg -I/usr/include/freetype2 -I../3rdparty/harfbuzz/src -Idialogs -I.moc/debug-shared -I/usr/X11R6/include -I.uic/debug-shared painting/qdrawhelper_mmx3dnow.cpp -o .obj/debug-shared/qdrawhelper_mmx3dnow.o
painting/qdrawhelper_mmx3dnow.cpp:47:10: fatal error: 'mm3dnow.h' file not found

Again, nothing done to the code. Great job by the clang guys!

Monday, January 25, 2010

Bootstrapping Qt using clang

Step 1  - checkout LLVM/Clang
mkdir -p ~/src
cd ~/src
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ../../
mkdir build-cmake
cd build-cmake ../
make -j 334

Step 2 - checkout Qt, and configure it usig (the non installed) clang
cd ~/src
git clone http://git.gitorious.org/qt/qt.git 
cd qt
CC=/home/elcuco/src/llvm/build-cmake/bin/clang
CXX=/home/elcuco/src/llvm/build-cmake/bin/clang++
export CC
export CXX
./configure 

Step 3
[elcuco@pinky ~/src/gitorious/qt] gdb ./bin/qmake
GNU gdb (GDB) Fedora (7.0.1-29.fc12)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /home/elcuco/src/gitorious/qt/bin/qmake...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/elcuco/src/gitorious/qt/bin/qmake


Program received signal SIGSEGV, Segmentation fault.
0x08258211 in toLatin1_helper(QChar const*, int) ()
Missing separate debuginfos, use: debuginfo-install glibc-2.11.1-1.i686 libgcc-4.4.2-20.fc12.i686 libstdc++-4.4.2-20.fc12.i686
(gdb) bt
#0  0x08258211 in toLatin1_helper(QChar const*, int) ()
#1  0x08258168 in QString::toLatin1() const ()
#2  0x082582cc in QString::toLocal8Bit() const ()
#3  0x0827d12e in locale_encode(QString const&) ()
#4  0x0827e746 in QFile::encodeName(QString const&) ()
#5  0x0828170b in QFSFileEnginePrivate::nativeInitFileName() ()
#6  0x08288752 in QFSFileEngine::QFSFileEngine(QString const&) ()
#7  0x082c5d5e in QAbstractFileEngine::create(QString const&) ()
#8  0x082b5d4a in QFileInfoPrivate::initFileEngine(QString const&) ()
#9  0x082b68e9 in QFileInfo::QFileInfo(QString const&) ()
#10 0x08126851 in Option::init(int, char**) ()
#11 0x0807f994 in runQMake(int, char**) ()
#12 0x08080bab in main ()
(gdb)

FAIL. At least it compiled without any modification! yay configure!