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

Qt 5.9 cross compile for iMx6



  • Hi All

    I am trying to cross compile the Qt 5.9 version for my target platform imx6. I have tried to set the sysroot and compilers specific to my platform with below command

    sudo ./configure -v -opensource -confirm-license -no-pch -no-xcb -no-opengl -gcc-sysroot -opengl es2 -make libs -device-option CROSS_COMPILE=/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/bin/arm-none-linux-gnueabi-gcc-5.2.0- -sysroot /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc --prefix=~/samba/workspace/source/qtbuild -device imx6

    But I find, by default a suffix off g++ gets added to the cross-compiler I set in the above path. I want my compiler gcc-5.2.0 to be used which is available at the path /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/bin/arm-none-linux-gnueabi-gcc-5.2.0. But using this gives me a below error:

    Running configuration tests...
    Checking for valid makespec...

    • cd /home/workspace/source/qt-everywhere-opensource-src-5.9.5/config.tests/verifyspec && home/workspace/source/qt-everywhere-opensource-src-5.9.5/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc" "QMAKE_CXXFLAGS += --sysroot=/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc" "QMAKE_LFLAGS += --sysroot=/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc" -early "CONFIG += cross_compile" /home/viu1cob/samba/workspace/source/qt-everywhere-opensource-src-5.9.5/qtbase/config.tests/verifyspec

    Project ERROR: Compiler /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/bin/arm-none-linux-gnueabi-gcc-5.2.0-g++ not found. Check the value of CROSS_COMPILE -device-option
    Note: Also available for Linux: linux-clang linux-icc

    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

    On removing -device imx6 [ which I understand is required for eglfs functionality] from configure option, a different set of error is seen:

    ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' 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.

    Tried adding these macros in qmake.conf of imx6 device path as well. Still this issue is reported.
    Any help would be appreciated.



  • Why not use something like Yocto Project or Buildroot? To generate a custom OS, toolchain and all control of what will be compiled, versions and more. To keep in the long run is more organized.


    Cleiton Bueno

    Blog | Linkedin | B2Open


Log in to reply