Problem Cross Compile Qt for PandaBoard



  • I have used the default omap4 image from ubuntu for mounting as rootfs. My problem now is as follow: (using Qt Verison 5.4.1)

    • if I try to run configure I get /bin/bash^M: bad interpreter: No such file or directory
      • I solve this by running find . -type f -print0 | xargs -0 dos2unix
    • Now configure runs fine (seems to)
    • I try to run make -j4 and get this
    /usr/bin/ld: /opt/qt-src/qtbase/lib/libQt5Bootstrap.a(compress.o): Relocations in generic ELF (EM: 40)
    /usr/bin/ld: /opt/qt-src/qtbase/lib/libQt5Bootstrap.a(compress.o): Relocations in generic ELF (EM: 40)
    /opt/qt-src/qtbase/lib/libQt5Bootstrap.a: error adding symbols: File in wrong format
    collect2: error: ld returned 1 exit status
    make[3]: *** [../../../bin/uic] Error 1
    make[3]: Leaving directory »/opt/qt-src/qtbase/src/tools/uic« 
    make[2]: *** [sub-uic-make_first] Error 2
    make[2]: Leaving directory »/opt/qt-src/qtbase/src« 
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory »/opt/qt-src/qtbase« 
    make: *** [module-qtbase-make_first] Error 2
    

    I have tried different Qt Versions and I'm getting the same error. I have not found any suggestions on the internet. I would be very glad if someone could help...

    My configure:

    ./configure -v -verbose -device linux-pandaboard-g++ -nomake tests -make libs -make examples -device-option CROSS_COMPILE=arm-linux-gnueabihf- -prefix /opt/qt-src -sysroot /mnt/pandaboard-ubuntu12.04-rootfs -confirm-license -opensource -force-pkg-config -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-xkbcommon -qt-freetype -qt-pcre -qt-harfbuzz -qpa eglfs
    

    32bit libs are present on host.
    I have also used this as source:
    http://stufffortechie.blogspot.de/2014/11/cross-compile-qt-v531-pandaboard-es.html

    UPDATE:

    I have followed the guide on GitHub based on the one from wiki.qt.io
    (http://wiki.qt.io/TIPandaBoard)
    (https://github.com/Myzhar/Qt-cross_compile-config/tree/master/Pandaboard_ES/Qt5.2.1-Ubuntu_Core_12.04.4)

    After experimenting a lot of time I got make to run quite long and there was a big hope that it will success... But now I get a new error:

    In file included from /mnt/rootfs/usr/include/arm-linux-gnueabihf/sys/select.h:44:0,
                     from /mnt/rootfs/usr/include/arm-linux-gnueabihf/sys/types.h:220,
                     from /usr/include/stdlib.h:314,
                     from /usr/include/c++/4.8/cstdlib:72,
                     from /usr/include/c++/4.8/bits/stl_algo.h:59,
                     from /usr/include/c++/4.8/algorithm:62,
                     from /opt/qt-src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:81,
                     from /opt/qt-src/qtbase/include/QtCore/qglobal.h:1,
                     from ../qml/parser/qqmljsgrammar_p.h:49,
                     from ../qml/parser/qqmljsgrammar.cpp:35:
    /usr/include/time.h:123:5: error: ‘__syscall_slong_t’ does not name a type
         __syscall_slong_t tv_nsec; /* Nanoseconds.  */
         ^
    In file included from /usr/include/c++/4.8/cstdlib:72:0,
                     from /usr/include/c++/4.8/bits/stl_algo.h:59,
                     from /usr/include/c++/4.8/algorithm:62,
                     from /opt/qt-src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:81,
                     from /opt/qt-src/qtbase/include/QtCore/qglobal.h:1,
                     from ../qml/parser/qqmljsgrammar_p.h:49,
                     from ../qml/parser/qqmljsgrammar.cpp:35:
    /usr/include/stdlib.h:510:35: error: expected initializer before ‘__attribute_alloc_size__’
          __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
                                       ^
    In file included from /mnt/rootfs/usr/include/arm-linux-gnueabihf/sys/select.h:44:0,
                     from /mnt/rootfs/usr/include/arm-linux-gnueabihf/sys/types.h:220,
                     from /usr/include/stdlib.h:314,
                     from /usr/include/c++/4.8/cstdlib:72,
                     from /usr/include/c++/4.8/bits/stl_algo.h:59,
                     from /usr/include/c++/4.8/algorithm:62,
                     from /opt/qt-src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:81,
                     from /opt/qt-src/qtbase/include/QtCore/qglobal.h:1,
                     from ../qml/parser/qqmljsglobal_p.h:36,
                     from ../qml/parser/qqmljsastfwd_p.h:37,
                     from ../qml/parser/qqmljsastvisitor_p.h:48,
                     from ../qml/parser/qqmljsastvisitor.cpp:34:
    /usr/include/time.h:123:5: error: ‘__syscall_slong_t’ does not name a type
         __syscall_slong_t tv_nsec; /* Nanoseconds.  */
         ^
    In file included from /usr/include/c++/4.8/cstdlib:72:0,
                     from /usr/include/c++/4.8/bits/stl_algo.h:59,
                     from /usr/include/c++/4.8/algorithm:62,
                     from /opt/qt-src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:81,
                     from /opt/qt-src/qtbase/include/QtCore/qglobal.h:1,
                     from ../qml/parser/qqmljsglobal_p.h:36,
                     from ../qml/parser/qqmljsastfwd_p.h:37,
                     from ../qml/parser/qqmljsastvisitor_p.h:48,
                     from ../qml/parser/qqmljsastvisitor.cpp:34:
    /usr/include/stdlib.h:510:35: error: expected initializer before ‘__attribute_alloc_size__’
          __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
                                       ^
    In file included from /mnt/rootfs/usr/include/arm-linux-gnueabihf/sys/select.h:44:0,
                     from /mnt/rootfs/usr/include/arm-linux-gnueabihf/sys/types.h:220,
                     from /usr/include/stdlib.h:314,
                     from /usr/include/c++/4.8/cstdlib:72,
                     from /usr/include/c++/4.8/bits/stl_algo.h:59,
                     from /usr/include/c++/4.8/algorithm:62,
                     from /opt/qt-src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:81,
                     from /opt/qt-src/qtbase/include/QtCore/qglobal.h:1,
                     from ../qml/parser/qqmljsglobal_p.h:36,
                     from ../qml/parser/qqmljsengine_p.h:48,
                     from ../qml/parser/qqmljsengine_p.cpp:34:
    /usr/include/time.h:123:5: error: ‘__syscall_slong_t’ does not name a type
         __syscall_slong_t tv_nsec; /* Nanoseconds.  */
         ^
    In file included from /usr/include/c++/4.8/cstdlib:72:0,
                     from /usr/include/c++/4.8/bits/stl_algo.h:59,
                     from /usr/include/c++/4.8/algorithm:62,
                     from /opt/qt-src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:81,
                     from /opt/qt-src/qtbase/include/QtCore/qglobal.h:1,
                     from ../qml/parser/qqmljsglobal_p.h:36,
                     from ../qml/parser/qqmljsengine_p.h:48,
                     from ../qml/parser/qqmljsengine_p.cpp:34:
    /usr/include/stdlib.h:510:35: error: expected initializer before ‘__attribute_alloc_size__’
          __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
                                       ^
    In file included from /mnt/rootfs/usr/include/arm-linux-gnueabihf/sys/select.h:44:0,
                     from /mnt/rootfs/usr/include/arm-linux-gnueabihf/sys/types.h:220,
                     from /usr/include/stdlib.h:314,
                     from /usr/include/c++/4.8/cstdlib:72,
                     from /usr/include/c++/4.8/bits/stl_algo.h:59,
                     from /usr/include/c++/4.8/algorithm:62,
                     from /opt/qt-src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:81,
                     from /opt/qt-src/qtbase/include/QtCore/qglobal.h:1,
                     from ../qml/parser/qqmljsglobal_p.h:36,
                     from ../qml/parser/qqmljsastfwd_p.h:37,
                     from ../qml/parser/qqmljsastvisitor_p.h:48,
                     from ../qml/parser/qqmljsast_p.h:48,
                     from ../qml/parser/qqmljsast.cpp:34:
    /usr/include/time.h:123:5: error: ‘__syscall_slong_t’ does not name a type
         __syscall_slong_t tv_nsec; /* Nanoseconds.  */
         ^
    In file included from /usr/include/c++/4.8/cstdlib:72:0,
                     from /usr/include/c++/4.8/bits/stl_algo.h:59,
                     from /usr/include/c++/4.8/algorithm:62,
                     from /opt/qt-src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:81,
                     from /opt/qt-src/qtbase/include/QtCore/qglobal.h:1,
                     from ../qml/parser/qqmljsglobal_p.h:36,
                     from ../qml/parser/qqmljsastfwd_p.h:37,
                     from ../qml/parser/qqmljsastvisitor_p.h:48,
                     from ../qml/parser/qqmljsast_p.h:48,
                     from ../qml/parser/qqmljsast.cpp:34:
    /usr/include/stdlib.h:510:35: error: expected initializer before ‘__attribute_alloc_size__’
          __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
    

    New configure query is as follow:

    ./configure -v -verbose -device linux-pandaboard-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf- -nomake tests -nomake examples -prefix /opt/qt-src -sysroot /mnt/rootfs -I/mnt/rootfs/usr/include/arm-linux-gnueabihf -I/mnt/rootfs/usr/include/gbm -I/mnt/rootfs/usr/include/drm -qt-xcb
    

    I tried to use more recent cross-toolchain, but same error (gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.bz2). I do really not know what to try next...

    UPDATE 2:

    On a vanilla ubuntu 12.04 I get following:

    ../../corelib/io/qfsfileengine.cpp:83:1: error: static assertion failed: "Unsupported: read/write return a type with different size as the len parameter"
    make[3]: *** [.obj/qfsfileengine.o] Error 1
    make[3]: *** Waiting for unfinished jobs....
    make[3]: Leaving directory `/opt/qt-src/qtbase/src/tools/bootstrap'
    make[2]: *** [sub-bootstrap-make_first] Error 2
    make[2]: Leaving directory `/opt/qt-src/qtbase/src'
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory `/opt/qt-src/qtbase'
    make: *** [module-qtbase-make_first] Error 2


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