Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. qt 5.10.12 cross compile for rk3399 (aarch64-linux-gnu-gcc) qmake "Exec format error"
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 3 Posters 3.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    guruhb
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      G 1 Reply Last reply
      0
      • SGaistS SGaist

        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.

        G Offline
        G Offline
        guruhb
        wrote on last edited by
        #3

        @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 ?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          G 1 Reply Last reply
          0
          • SGaistS SGaist

            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 ?

            G Offline
            G Offline
            guruhb
            wrote on last edited by
            #5

            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.
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • B Offline
                B Offline
                Brainite
                wrote on last edited by Brainite
                #7

                Thank you for these instructions and the list of flags for the configuration. For the correct usage which of these points (mentioned in the original post) need to be run where?

                • I executed make && make install on my Ubuntu host, obviously. Can I run make install after copying and unzipping on the target device (in this case: Rock Pi4) too?

                • The exports in (2) need to be executed on the target (only?), correct?

                • Is the qtchooser mentioned in (3) host-only? Target-only? Both?

                Using the mentioned steps, it should suffice to only install QtCreator on the host and - given correctly set-up kits, and compilers (linaro) - build binaries for the target, right?

                Thanks in advance.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved