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

How to Cross-compile Qt App for I.MX8MQEVK(fsl-image-qt5-validation-imx)



  • Hi community.

    I'm trying to cross-compile qt app in QtCreator. But QtCreator doesn't have cross-compilation settings for IMX8M.

    So I'm trying to cross-compilation settings, but I can't build qmake for target board(IMX8MQEVK).
    The error msg occurred as follows. Do you know the solution?
    (opengles2 does not well? Include path is correct?)

    ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.
    
    ERROR: Feature 'egl' was enabled, but the pre-condition '(features.opengl || features.openvg) && (features.angle || libs.egl)' failed.
    
    ERROR: The OpenGL functionality tests failed!
    You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
    QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.
    

    I executed "configure" as follows.

    ./configure -prefix /home/tkashi/Qt/github/qt5/qtbase -device linux-imx8-g++ -device-option CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -sysroot $HOME/imx-yocto-bsp/build-xwayland/tmp/sysroots-components/aarch64-mx8m/imx-gpu-viv/usr/lib/ -opensource -confirm-license -nomake tests -nomake examples -egl -opengl es2 -v
    

    qmake.conf is as follows. (I modified qmake.conf from linux-imx6-g++)

    include(../common/linux_device_pre.conf)
    
    QMAKE_RPATHLINKDIR_POST += $$[QT_SYSROOT]
    
    QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]
    QMAKE_LIBDIR_EGL        = $$QMAKE_LIBDIR_OPENGL_ES2
    QMAKE_LIBDIR_OPENVG     = $$QMAKE_LIBDIR_OPENGL_ES2
    
    QMAKE_INCDIR_EGL        = $$[QT_SYSROOT]
    QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
    QMAKE_INCDIR_OPENVG     = $${QMAKE_INCDIR_EGL}
    
    QMAKE_LIBS_EGL         += -lEGL
    QMAKE_LIBS_OPENGL_ES2  += -lGLESv2 -lEGL -lGAL
    QMAKE_LIBS_OPENVG      += -lOpenVG -lEGL -lGAL
    
    IMX8_CFLAGS             = -march=armv8-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1
    QMAKE_CFLAGS           += $$IMX8_CFLAGS
    QMAKE_CXXFLAGS         += $$IMX8_CFLAGS
    
    DISTRO_OPTS += hard-float
    
    # Preferred eglfs backend
    EGLFS_DEVICE_INTEGRATION = eglfs_viv
    
    include(../common/linux_arm_device_post.conf)
    
    load(qt_config)
    

    My milestones are as follows.

    • Build linux for target board with Qt(fsl-image-qt5-validation-imx)
      • OK. I generated the image files by bitbake.
    • Run the Sample Qt App on Target Board.(IMX8MQEVK)
      • OK. I ran the sample application which is included by fsl-image-qt5-validation-imx.
    • Install QtCreator to the host PC (ubuntu 18.04 LTS).
      • OK. I installed Qtcreator to host PC.
    • Create the Setting for cross-compile(host:ubuntu 18.04 LTS [x86_x64], target:imx-linux[aarch64]).
      • NG. I can't build "qmake" for cross-compilation. I think that "arm - linux - gnueabihf - *" can be used as a compiler

    I understand that Qtcreator needs gcc, g ++, gdm, qmake for cross-compilation. Is this understanding correct?

    Best Regards,
    T.Kashiwagi



  • @tkashi said in How to Cross-compile Qt App for I.MX8MQEVK(fsl-image-qt5-validation-imx):

    Hi community.

    I solved it self so I will share it.

    When using "fsl-image-qt5-validation-imx", you can build QtCreator cross-compilation environment using "meta-toolchain-qt5".

    1. Create a setup of SDK using following bitbake command.
    $ bitbake meta-toolchain-qt5
    
    1. Install Qt5 SDK as follows.
    $ ./tmp/deploy/sdk/fsl-imx-xwayland-glibc-x86_64-meta-toolchain-qt5-aarch64-toolchain-4.14-sumo.sh
    
    1. Add gcc/g++/gdb/qmake Setting to QtCreator
      gcc/g++/gdb/qmake is located as follows.
    /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc
    /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++
    /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gdb
    /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake
    
    1. Add Sysroot to Kits
      Add Sysroot installed with SDK.
    /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux
    

    0_1552031725777_image.png

    In my environment, binaries for the target could be built with this.

    Best Regards,
    T.kashiwagi


Log in to reply