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

Qt cross compile for iMx - Cannot find crt1.o: No such file or directory



  • I am trying to cross-compile Qt 5.9.5 for iMX with below configure command

    ./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- -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

    I have given the correct lib path in my qmake.conf where crt1.o and crti.o are available and I find the given library paths are getting linked as well . But still i get the below error of cannot find crt1.o and crti.o

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

    • cd /home/viu1cob/samba/workspace/source/qt-everywhere-opensource-src-5.9.5/config.tests/verifyspec && /home/viu1cob/samba/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
    • cd /home/viu1cob/samba/workspace/source/qt-everywhere-opensource-src-5.9.5/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make

    rm -f /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc/usr/lib/verifyspec.o
    rm -f *~ core *.core
    /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/bin/arm-none-linux-gnueabi-g++ -c -pipe -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=softfp --sysroot=/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc --sysroot=/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc -O2 -std=gnu++11 -w -fPIC -I/home/viu1cob/samba/workspace/source/qt-everywhere-opensource-src-5.9.5/qtbase/config.tests/verifyspec -I. -isystem /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc/usr/include -I/home/viu1cob/samba/workspace/source/qt-everywhere-opensource-src-5.9.5/qtbase/mkspecs/devices/linux-imx6-g++ -o /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc/usr/lib/verifyspec.o /home/viu1cob/samba/workspace/source/qt-everywhere-opensource-src-5.9.5/qtbase/config.tests/verifyspec/verifyspec.cpp
    /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/bin/arm-none-linux-gnueabi-g++ -mfloat-abi=softfp --sysroot=/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc --sysroot=/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc -Wl,-O1 -o verifyspec /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc/usr/lib/verifyspec.o -L/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc/usr/lib/ -L/opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/arm-none-linux-gnueabi/libc/lib/
    /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/bin/../lib/gcc/arm-none-linux-gnueabi/5.2.0/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crt1.o: No such file or directory
    /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/bin/../lib/gcc/arm-none-linux-gnueabi/5.2.0/../../../../arm-none-linux-gnueabi/bin/ld: cannot find crti.o: No such file or directory
    collect2: error: ld returned 1 exit status
    Makefile:66: recipe for target 'verifyspec' failed
    make: *** [verifyspec] Error 1
    Note: Also available for Linux: linux-clang linux-icc

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

    Please share your inputs if anyone has come across a similar issue. It would really help and be appreciated.


  • Moderators

    Sounds like you don't have glibc installed (or compiled) for your target environment (the one you are cross compiling for). Install/fix that and you should be good to go.



  • glibc was installed.

    The problem was it expects a link of crt1.o to be available in the iprefix path of gcc
    I was able to find the path of iprefix with the below command:

    /opt/tooling/codesourcery/MGC-2015.12-138-arm-gcc-5.2.0/Sourcery_CodeBench_for_ARM_Embedded/bin/arm-none-linux-gnueabi-g++ -v --help

    This lists the iprefix path used . Just creating a link of crt1.o, crti.o and crtn.o to this path from the available crt*.o in my sysrootpath, helped to resolve this issue.


  • Moderators

    @Veepee said in Qt cross compile for iMx - Cannot find crt1.o: No such file or directory:

    just creating a link of crt1.o, crti.o and crtn.o to this path from the available crt*.o in my sysrootpath, helped to resolve this issue.

    That's what I was going to suggest next if you had glibc installed but sounds like you figured it out. :)

    Glad it's solved for you.



  • yes it did, but still am facing the below error:

    Note: Also available for Linux: linux-clang linux-icc

    Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.

    WARNING: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set and
    the host's .pc files would be used (even if you set PKG_CONFIG_PATH).
    Set this variable to the directory that contains target .pc files
    for pkg-config to function correctly when cross-compiling or
    use -pkg-config to override this test.

    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.

    Any idea of this issue ?


  • Moderators

    @Veepee This looks like you don't have EGL support cross compiled for your embedded device. Or if you do your configure is not finding it. It could have to do with that warning that is displayed.

    Since this is way off from your original issue I would start a new thread. You're more likely to get people that can help if the thread title matches the issue.



  • Ok sure. Thanks for your input.


Log in to reply