Important: Please read the Qt Code of Conduct -

Cross compiled qt-app gives illegal instruction in target

  • I used the qt for user interface development for our application. I used buildroot for developed embedded linux for our application. I are planning to run the Qt-UI in target application. We cross compiled all gcc/g++, linkers and others carefully . With the crosscompiler toolchain We able to develop the executable. When I transfer the executable to target through scp (not through Qt kits SFTP) and run on target I am getting "Illegal Instruction". Before running qt-app i did LD_TRACE_LOADED_OBJECTS=1 ./test (test is qt-app)

    I am getting the following

    LD_TRACE_LOADED_OBJECTS=1 ./test (0xb7799000) => /usr/lib/ (0xb6ff4000) => /usr/lib/ (0xb696f000) => /usr/lib/ (0xb6495000) => /lib/ (0xb648c000) => /lib/ (0xb6487000) => /usr/lib/ (0xb642c000) => /lib/ (0xb640f000) => /lib/ (0xb6408000) => /usr/lib/ (0xb6348000) => /lib/ (0xb62f1000) => /lib/ (0xb62db000) => /lib/ (0xb6155000) => /usr/lib/ (0xb612b000) => /usr/lib/ (0xb6119000) => /usr/lib/ (0xb5f0a000) => /usr/lib/ (0xb5db0000) => /usr/lib/ (0xb4532000) => /usr/lib/ (0xb44fc000) => /usr/lib/ (0xb44fa000) => /usr/lib/ (0xb4413000)
    /lib/ (0xb779a000) => /usr/lib/ (0xb43f5000) => /usr/lib/ (0xb43cf000) => /usr/lib/ (0xb43cc000) => /usr/lib/ (0xb43c7000) => /usr/lib/ (0xb43c5000) => /usr/lib/ (0xb42b2000) => /usr/lib/ (0xb429a000) => /usr/lib/ (0xb4296000) => /usr/lib/ (0xb4272000) => /usr/lib/ (0xb426d000) => /usr/lib/ (0xb425d000) => /usr/lib/ (0xb425a000) => /usr/lib/ (0xb4255000) => /usr/lib/ (0xb4248000) => /usr/lib/ (0xb420b000)

    after executing the LD_TRACE_LOADED_OBJECTS, If I run the


    I am getting
    Illegal Instruction.

    How to fix it.

    My target system : ICOP VDX6354RD with 512MB RAM, 800MHz Processor

    Linux Kernel : 3.8.13

    GCC Version : 4.9.4

    Qt : 5.6.1

    Host System : 64bit, Fedora 24

    thanks & regards,
    servo gmrt

  • Lifetime Qt Champion


    Which version of Qt are you using to build your application ?

  • Hi,

    I am using qt5base-5.6.1-1cross compiled binaries in target board.

    For building qt-application cross compiled qmake I am using.

    My Qt creator version installed in Host System is 4.0.3 .

    But I configured the Kit in Qt creator with the cross compiled binaries.

  • Lifetime Qt Champion

    @gmrt What does "file YOUR_EXECUTABLE" say?

  • Lifetime Qt Champion

    You should check the processor type as well as the linux distribution you have running to ensure that you are building for the correct ARM processor type as well as ABI.

  • Hi,

    My file output as follows,

    test is my qt-app

    test: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/, for GNU/Linux 2.6.32, BuildID[sha1]=41e3e6d6fa1db29b9747d7334ee029f375829195, not stripped

    My target is i586 architecture CPU. Same I enabled in Linux kernel configuration.

    My Kit configuration variables are pointing to the cross compiled path.

  • Lifetime Qt Champion

    @gmrt Is any of the libs built for >i586?

  • @jsulm
    I checked in my build all the libraries build using i586.
    I found another interesting thing when I run the cross compiled qt executable in virtual machine. It is running without any error.
    When I try to run it in hardware i am getting "illegal instruction" error.
    Problem found is while running in actual hardware is shared libraries are not getting loaded.
    I tried with exporting LD_LIBRARY_PATH before running the qt application. but no change, same error is appearing.

  • Lifetime Qt Champion

    Did you deploy all dependencies ?

    What distribution are you running on your target ?

  • @SGaist
    Yes, I cross checked all my shared object files in /lib and /usr/lib.

    I am using the cross compiled iso images. Which is built using buildroot.

Log in to reply