Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    Mobile and Embedded
    3
    7
    2135
    Loading More Posts
    • 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
      guruhb last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • G
          guruhb @SGaist last edited by

          @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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • G
              guruhb @SGaist last edited by

              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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • B
                  Brainite last edited by Brainite

                  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 Reply Quote 0
                  • First post
                    Last post