Qt 4.8.5 cross compile for ARM help



  • This is what I have tried so far.. few days and don't succeed yet.

    I managed to install and verify a GCC toolchain in windows.
    gcc-linaro-arm-linux-gnueabihf-4.8-2013.11

    A working MinGW
    MinGW-gcc-4.4.0-2.7

    I used qt-everywhere-opensource-src-4.8.5 and actually, configure it's working
    ...
    Qt is now configured for building. To start the build run:mingw32-make.

    i used:
    ..\qt-everywhere-opensource-src-4.8.5\configure -fast -prefix C:\Qt-build\build -opensource -confirm-license -no-phonon -xplatform qws/linux-arm-gnueabi-g++ -arch arm -neon -no-mmx -no-3dnow -no-opengl -no-sse -no-sse2 -no-cups -no-accessibility -no-openssl -fast -little-endian -no-webkit -no-qt3support -no-vcproj -no-dsp -nomake examples -nomake demos -nomake docs -nomake translations

    But mingw32-make fails at core step:
    ...
    ...
    C:/Qt-build/build/bin/moc.exe -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DELF_INTERPRETER="" -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -I"....\include" -I"....\include\QtCore" -I"tmp\rcc\debug_shared" -I"global" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\tools\shared" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\zlib" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\harfbuzz\src" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\md5" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\md4" -I"tmp\moc\debug_shared" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\corelib" -I"." -I"....\mkspecs\qws\linux-arm-gnueabi-g++" c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\corelib\statemachine\qabstracttransition.h -o tmp\moc\debug_shared\moc_qabstracttransition.cpp
    C:/Qt-build/build/bin/moc.exe -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DELF_INTERPRETER="" -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -I"....\include" -I"....\include\QtCore" -I"tmp\rcc\debug_shared" -I"global" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\tools\shared" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\zlib" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\harfbuzz\src" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\md5" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\md4" -I"tmp\moc\debug_shared" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\corelib" -I"." -I"....\mkspecs\qws\linux-arm-gnueabi-g++" c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\corelib\statemachine\qsignaltransition.h -o tmp\moc\debug_shared\moc_qsignaltransition.cpp
    C:/Qt-build/build/bin/moc.exe -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DELF_INTERPRETER="" -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -I"....\include" -I"....\include\QtCore" -I"tmp\rcc\debug_shared" -I"global" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\tools\shared" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\zlib" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\harfbuzz\src" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\md5" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\3rdparty\md4" -I"tmp\moc\debug_shared" -I"c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\corelib" -I"." -I"....\mkspecs\qws\linux-arm-gnueabi-g++" c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\corelib\statemachine\qeventtransition.h -o tmp\moc\debug_shared\moc_qeventtransition.cpp
    arm-linux-gnueabihf-g++ -Wl,-rpath,C:/Qt-build/build/lib -Wl,--no-undefined -Wl,-e,qt_core_boilerplate -o ....\lib\libcorelib.a .libcorelib -L"c:\Qt-build\build\lib" -L"c:\Qt-build\build\lib" -lpthread -lm -ldl
    c:/program files/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.11/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find ./tmp\obj\debug_shared\qabstractanimation.obj
    c:/program files/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.11/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find ./tmp\obj\debug_shared\qvariantanimation.obj
    c:/program files/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.11/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find ./tmp\obj\debug_shared\qpropertyanimation.obj
    c:/program files/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.11/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find ./tmp\obj\debug_shared\qanimationgroup.obj
    c:/program files/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.11/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find ./tmp\obj\debug_shared\qsequentialanimationgroup.obj
    c:/p
    ...
    ...

    It looks like this folder is empty, no objs are created so linker fails:
    C:\Qt-build\build\src\corelib\tmp\obj\debug_shared

    But cpp are generated
    C:\Qt-build\build\src\corelib\tmp\moc\debug_shared

    I tried to make the corelib alone and (obvious) the same error
    /tmp\obj\debug_shared*.obj
    this objects are mising, so I suspect nobody compiles them.

    Please give a hint, thanks in advance.



  • Ok, my investigation so far revealed that in corelib's Makefile, there are no compile rules for any OBJ so obvious, the linker will fail:

    @ c:/Qt-build/qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qcontainerfwd.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/include/QtCore/qt_windows.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/src/corelib/global/qt_windows.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/include/QtCore/qmath.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qmath.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/include/QtCore/qthreadstorage.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/src/corelib/thread/qthreadstorage.h
    tmp/moc/debug_shared/moc_qabstractanimation.cpp

    HERE SHOULD BE THE COMPILE RULE for previous OBJ !

    tmp/obj/debug_shared/qvariantanimation.obj: c:/Qt-build/qt-everywhere-opensource-src-4.8.5/src/corelib/animation/qvariantanimation.cpp c:/Qt-build/qt-everywhere-opensource-src-4.8.5/src/corelib/animation/qvariantanimation.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/include/QtCore/qeasingcurve.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qeasingcurve.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/include/QtCore/qglobal.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/src/corelib/global/qglobal.h
    c:/Qt-build/qt-everywhere-opensource-src-4.8.5/include/QtCore/qconfig.h \ @

    What is happening ?
    This is part of corelib generated Makefile that should be compiled with make.



  • Hmm... missing QMAKE_RUN_CC and others from qmake.conf.

    How do I supposed to know what should be in this file ?!?
    Originally template contains 4 lines! Very useful would be some warnings... please define FOO and BAR :) it will save hours for brainstorming.

    However, now compilation pass corelib OBJ step, but failed gracefully with following errors:

    @c:/program files/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.11/bin/../arm-li
    nux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/crt1.o: In function _start': :(.text+0x28): undefined reference tomain'
    ./tmp\obj\debug_shared\qthread_unix.obj: In function QThreadPrivate::createEven tDispatcher(QThreadData*)': c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\corelib\thread/qthread_unix.c pp:271: undefined reference toQEventDispatcherGlib::versionSupported()'
    c:\Qt-build\qt-everywhere-opensource-src-4.8.5\src\corelib\thread/qthread_unix.c
    pp:272: undefined reference to `QEventDispatcherGlib::QEventDispatcherGlib(QObje
    ct*)'
    @

    Any thoughts? Thanks.


  • Lifetime Qt Champion

    Hi,

    Just a wild guess but since you will be using qws, you should use the -embedded option

    Hope it helps



  • I enabled :) and solved a lot of problems since yesterday...
    I think at next Christmas I will have a working CC toolchain on Windows...

    All CC objects were built as app as I suspected. The -fPIC flag just need to be added manually.

    Another problem now...

    undefined reference to QEventDispatcherGlib()

    and when I try to disable with -no-glib configure says "unknown option"... how come ?!

    BTW.
    The Qt library can be really cross compiled on Windows or I am the only lab rat I try?



  • Ok, the -no-glib option is not working and I had to add -DQT_NO_GLIB to CFLAGS.

    Now one more problem:
    @
    arm-linux-gnueabihf-g++ -Wl,-rpath,C:/Qt-build/build/lib -shared -Wl,--no-undefined -Wl,-e,qt_core_boilerplate -Wl,-O1 -o ....\lib\libcorelib.a .libcorelib -L"c:\Qt-build\build\lib" -L"c:\Qt-build\build\lib" -lrt -lpthread -ldl -lpthread -lm -ldl
    ./tmp\obj\release_shared\qbytearray.obj: In function qUncompress(unsigned char const*, int)': qbytearray.cpp:(.text+0x348): undefined reference touncompress'
    ./tmp\obj\release_shared\qbytearray.obj: In function qCompress(unsigned char const*, int, int)': qbytearray.cpp:(.text+0xbf2): undefined reference tocompress2'
    collect2.exe: error: ld returned 1 exit status@

    I downloaded zlib, passed to -L and add -lz but error persists. I noticed that -system-zlib is not working on windows (wasn't fixed ?) so I used -qt-zlib.

    It's not working either, like -qt-zlib is ignored or linker doesn't know about another shared object.

    Any idea? :)


  • Lifetime Qt Champion

    I don't know if you're the only one trying to cross-compile on Windows but the most popular way to that on this OS is to have a VM with linux installed for that :)

    Is the zlib you downloaded built for ARM ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.