Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Solved] Qt5 Beta cross compiling problem



  • Hi,
    I have a problem cross compiling the Qt5-Beta for an i.MX6 Board.
    The Host OS is a Fedora Linux, the target OS is an embedded Linux.

    Steps taken so far:

    • I set up LTIB and created a rootfs for the target.
    • I downloaded the Qt5 sourcecode and excluded svg and webkit by renaming the corresponding folders
    • I copied the following linux-imx6-makespec in the qtbase/mkspecs folder:

    # qmake configuration for building with arm-linux-gnueabi-g++

    MAKEFILE_GENERATOR = UNIX
    TARGET_PLATFORM = unix
    TEMPLATE = app
    CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
    QT += core gui
    QMAKE_INCREMENTAL_STYLE = sublib

    include(../common/linux.conf)
    include(../common/gcc-base-unix.conf)
    include(../common/g++-unix.conf)

    # define prefix for rootfs and compiler
    REQS_PREFIX=/home/local/CW01/uidv7014/IMX6/ltib/rootfs
    GCC_PREFIX=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi

    # includes and libs directories
    QMAKE_INCDIR = $${REQS_PREFIX}/usr/include $${REQS_PREFIX}/usr/include/glib-2.0
    $${REQS_PREFIX}/usr/lib/glib-2.0/include/
    $${REQS_PREFIX}/usr/include/gstreamer-0.10/
    $${REQS_PREFIX}/usr/include/libxml2/ $${REQS_PREFIX}/usr/include/freetype2
    $${REQS_PREFIX}/usr/include/dbus-1.0 $${REQS_PREFIX}/usr/include/dbus-1.0/dbus
    QMAKE_LIBDIR = $${REQS_PREFIX}/usr/lib
    QMAKE_INCDIR_OPENGL = $${REQS_PREFIX}/usr/include/GL
    QMAKE_LIBDIR_OPENGL = $${REQS_PREFIX}/usr/lib
    QMAKE_INCDIR_POWERVR = $${REQS_PREFIX}/usr/include
    QMAKE_INCDIR_OPENGL_ES1 = $${REQS_PREFIX}/usr/include/GLES
    QMAKE_LIBDIR_OPENGL_ES1 = $${REQS_PREFIX}/usr/lib
    QMAKE_INCDIR_OPENGL_ES1CL = $${REQS_PREFIX}/usr/include/GLES
    QMAKE_LIBDIR_OPENGL_ES1CL = $${REQS_PREFIX}/usr/lib
    QMAKE_INCDIR_OPENGL_ES2 = $${REQS_PREFIX}/usr/include/GLES2
    QMAKE_LIBDIR_OPENGL_ES2 = $${REQS_PREFIX}/usr/lib
    QMAKE_INCDIR_EGL = $${REQS_PREFIX}/usr/include/GL
    QMAKE_LIBDIR_EGL = $${REQS_PREFIX}/usr/lib
    QMAKE_INCDIR_OPENVG = $${REQS_PREFIX}/usr/include/VG
    QMAKE_LIBDIR_OPENVG = $${REQS_PREFIX}/usr/lib

    # libs
    QMAKE_LIBS = -lglib-2.0 -lgthread-2.0 -lgstreamer-0.10 -lxml2 -lz -lgmodule-2.0 -lgobject-2.0 -lts -lasound -lfreetype -lexpat -ljpeg -lfontconfig -lpng -lGLESv2 -lGLES_CM -lVDK -lGAL -lEGL -lOpenVG -lpthread
    QMAKE_LIBS_EGL= -lEGL
    QMAKE_LIBS_OPENGL_ES2= -lGLESv2 -lGLES_CM -lVDK -lGAL -lEGL -lOpenVG
    QMAKE_LIBS_OPENVG= -lOpenVG -lVDK -lGAL -lEGL
    QMAKE_LIBS_THREAD = -lpthread

    # compiler flags
    QMAKE_CFLAGS_RELEASE = -O2 -march=armv7-a -mfpu=neon -mfloat-abi=softfp -DLINUX=1 -DEGL_API_FB=1
    QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE

    # modifications to g++.conf
    QMAKE_CC = $${GCC_PREFIX}-gcc
    QMAKE_CXX = $${GCC_PREFIX}-g++
    QMAKE_LINK = $${QMAKE_CXX}
    QMAKE_LINK_SHLIB = $${QMAKE_CXX}

    # modifications to linux.conf
    QMAKE_AR = $${GCC_PREFIX}-ar cqs
    QMAKE_OBJCOPY = $${GCC_PREFIX}-objcopy
    QMAKE_STRIP = $${GCC_PREFIX}-strip
    load(qt_config)

    • I configured the build with the following command (runs without any errors):
      ./configure -prefix /home/local/CW01/uidv7014/Qt_for_target -developer-build -confirm-license -opensource -nomake tests -nomake docs -nomake demos -nomake examples -no-xcb -no-wayland -xplatform linux-imx6 -arch armv7 -opengl es2 -openvg -eglfs -release -v

    (more in the next post)



    • I tried to run make, but after a while, an error occurs:

    .obj/release-shared/qimage.o: In function qInitImageConversions()': qimage.cpp:(.text+0x17bc): undefined reference toconvert_RGB888_to_RGB32_neon(QImageData*, QImageData const*, QFlagsQt::ImageConversionFlag)'
    .obj/release-shared/qdrawhelper.o: In function qInitDrawhelperAsm()': qdrawhelper.cpp:(.text+0x12ff0): undefined reference toqt_blend_rgb32_on_rgb32_neon(unsigned char*, int, unsigned char const*, int, int, int, int)'
    qdrawhelper.cpp:(.text+0x12ff4): undefined reference to qt_blend_argb32_on_argb32_neon(unsigned char*, int, unsigned char const*, int, int, int, int)' qdrawhelper.cpp:(.text+0x12ff8): undefined reference toqt_blend_argb32_on_rgb16_neon(unsigned char*, int, unsigned char const*, int, int, int, int)'
    qdrawhelper.cpp:(.text+0x12ffc): undefined reference to qt_blend_rgb16_on_argb32_neon(unsigned char*, int, unsigned char const*, int, int, int, int)' qdrawhelper.cpp:(.text+0x13000): undefined reference toqt_blend_rgb16_on_rgb16_neon(unsigned char*, int, unsigned char const*, int, int, int, int)'
    qdrawhelper.cpp:(.text+0x1300c): undefined reference to qt_scale_image_argb32_on_rgb16_neon(unsigned char*, int, unsigned char const*, int, QRectF const&, QRectF const&, QRect const&, int)' qdrawhelper.cpp:(.text+0x13010): undefined reference toqt_scale_image_rgb16_on_rgb16_neon(unsigned char*, int, unsigned char const*, int, QRectF const&, QRectF const&, QRect const&, int)'
    qdrawhelper.cpp:(.text+0x1301c): undefined reference to qt_transform_image_argb32_on_rgb16_neon(unsigned char*, int, unsigned char const*, int, QRectF const&, QRectF const&, QRect const&, QTransform const&, int)' qdrawhelper.cpp:(.text+0x13020): undefined reference toqt_transform_image_rgb16_on_rgb16_neon(unsigned char*, int, unsigned char const*, int, QRectF const&, QRectF const&, QRect const&, QTransform const&, int)'
    qdrawhelper.cpp:(.text+0x13024): undefined reference to qt_alphamapblit_quint16_neon(QRasterBuffer*, int, int, unsigned int, unsigned char const*, int, int, int, QClipData const*)' qdrawhelper.cpp:(.text+0x13028): undefined reference toqt_memrotate90_16_neon(unsigned char const*, int, int, int, unsigned char*, int)'
    qdrawhelper.cpp:(.text+0x1302c): undefined reference to qt_blend_argb32_on_argb32_scanline_neon(unsigned int*, unsigned int const*, int, unsigned int)' qdrawhelper.cpp:(.text+0x13030): undefined reference tocomp_func_solid_SourceOver_neon(unsigned int*, int, unsigned int, unsigned int)'
    qdrawhelper.cpp:(.text+0x13034): undefined reference to comp_func_Plus_neon(unsigned int*, unsigned int const*, int, unsigned int)' qdrawhelper.cpp:(.text+0x13038): undefined reference toqt_destFetchRGB16_neon(unsigned int*, QRasterBuffer*, int, int, int)'
    qdrawhelper.cpp:(.text+0x1303c): undefined reference to qt_destStoreRGB16_neon(QRasterBuffer*, int, int, unsigned int const*, int)' qdrawhelper.cpp:(.text+0x13044): undefined reference toqt_memrotate270_16_neon(unsigned char const*, int, int, int, unsigned char*, int)'
    qdrawhelper.cpp:(.text+0x13048): undefined reference to qt_memfill32_neon(unsigned int*, unsigned int, int)' qdrawhelper.cpp:(.text+0x1304c): undefined reference toqt_fetch_radial_gradient_neon(unsigned int*, Operator const*, QSpanData const*, int, int, int)'
    collect2: ld returned 1 exit status
    make[2]: *** [../../lib/libQtGui.so.5.0.0] Error 1
    make[1]: *** [sub-gui-make_first] Error 2
    make[1]: *** Waiting for unfinished jobs....
    make: *** [sub-src-make_first] Error 2

    • As this error seems to occur in the neon-package, I tried to exclude it by using the -no-neon option in the configure-command. This seems to work, but then a very similar error occurs in the sqlite-package. Errors like this occur in the packages "accessibility", "linuxfb", and "libjpeg", too.

    Any ideas?

    #edit: I just compiled the Qt5 Alpha with the same specs successfully. So where is the difference?



  • Ok, I solved it. The folder where the imx6-mkspec was located did not follow the naming convention for these folders.


Log in to reply