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

qt 5.10.12 cross compile for rk3399 (aarch64-linux-gnu-gcc) qmake "Exec format error"



  • Host : Debian 9 (Tried on Ubuntu 18.04 with same steps),
    Target : rk3399 running with Debian 9

    1. Fetch source, configure , make, make install
    $wget https://download.qt.io/official_releases/qt/5.12/5.12.10/single/qt-everywhere-src-5.12.10.tar.xz 
    $tar xf qt-everywhere-src-5.12.10.tar.xz && cd 
    // "aarch64-linux-gnu-gcc" used with  https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/aarch64-linux-gnu/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz
    $ ./configure \
    -prefix /home/guruhb/rk3399/qt5.10.12-aarch64 \
    -confirm-license \
    -opensource \
    -release \
    -make libs \
    -xplatform linux-aarch64-gnu-g++ \
    -pch \
    -qt-libjpeg \
    -qt-libpng \
    -qt-zlib \
    -no-opengl \
    -no-sse2 \
    -no-openssl \
    -no-cups \
    -no-glib \
    -no-dbus \
    -no-xcb \
    -no-separate-debug-info \
    -v \
    -recheck-all
    
    $ make && make install 
    $ file qmake 
    qmake: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32 
    
    
    1. Compressed "/home/guruhb/rk3399/qt5.10.12-aarc64" and extracted on the target (rk3399 running on Debian 9 desktop) and configured
    export QTDIR=/usr/local/qt5.10.12-aarch64 
    export LD_LIBRARY_PATH=/usr/local/qt5.10.12-aarch64/lib:$LD_LIBRARY_PATH
    export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins
    export QT_QPA_PLATFORM=linuxfb
    export QT_QPA_FONTDIR=/usr/share/fonts/truetype/ubuntu-font-family
    
    
    1. updated qtchooser with qt5.10.12.conf + QT_SELECT=qt5.10.12
    /usr/local/qt5.10.12-aarch64/bin
    /usr/local/qt5.10.12-aarch64/lib
    
    1. when i tried to compile a simple application got error :
    qmake: could not exec '/usr/local/qt5.10.12-aarch64/bin/qmake: Exec format error 
    

    while checking the file type of qmake :

    file qmake 
    qmake: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=17bacfee99d8cc5fd002c3de3213ce987e40dd3b, not stripped
    

    Could any one please suggest what's wrong with the ./configure steps ?
    Thanks in Adv.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Nothing is wrong. This is a cross-compiled Qt version that you can use on your desktop machine to build application for your target. qmake is a host tool not a target tool.



  • @SGaist said in qt 5.10.12 cross compile for rk3399 (aarch64-linux-gnu-gcc) qmake "Exec format error":

    Hi and welcome to devnet,

    Nothing is wrong. This is a cross-compiled Qt version that you can use on your desktop machine to build application for your target. qmake is a host tool not a target tool.

    Thank you, What 's the extra step or configure value required for me to generate Qt Build for arm 64 (i.e aarch64) from x86_64 machine ?


  • Lifetime Qt Champion

    That's the thing: there's no extra step. The host tools are meant to be compiled for the machine that will do the cross-compilation.

    What is your exact goal ?



  • Thanks a lot @SGaist, I have a development board which is running debian 9 build and it contains qt 5.7.1 (fetched from distro). I am trying to compile qt 5.12.10 or (any latest qt 5.9.x and above) for aarch64 (target board) so that i can use (install) on the rk3399 development board.

    target : aarch64 (rk3399 arm development board)
    host : laptop running ubuntu 20.xx (x86_64)

    1. Build Qt 5.9.x (or any latest so that i can develop UI on my Linux desktop with qt creator and deploy the application to the development target i.e rk3399) for target from my laptop (x86_64).
    2. Install the (1) on the target .
    3. Create a cross compilable Qt 5.9.x build (As you have pointed out and which i do have the build , which i can use for cross compile for target using my laptop).
    4. Using qtcreator + (3) run UI application from host to target.

  • Lifetime Qt Champion

    So you have the exact tools you wanted. There's no need to install the host tools on your target. You won't be compiling natively on it.


Log in to reply