Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to cross-compile qt5.9.5 to SDR board ?
Forum Updated to NodeBB v4.3 + New Features

How to cross-compile qt5.9.5 to SDR board ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
15 Posts 3 Posters 2.3k Views 1 Watching
  • 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.
  • MijazM Mijaz

    @jsulm

    root@ijaz-HP-ProDesk-400-G4-MT:~# /home/ijaz/myQT5Root/qt-everywhere-opensource-src-5.9.5/qtbase/configure -top-level -opensource -confirm-license -prefix /usr/local/Qt-5.9.5-arm -embedded arm -little-endian -no-pch -xplatform linux-arm-gnueabihf-g++
    You cannot make a shadow build from a source tree containing a previous build.
    Cannot proceed.
    

    I think for the latest version I need the latest toolchain which will not support my board OS.

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #6

    @Mijaz said in How to cross-compile qt5.9.5 to SDR board ?:

    You cannot make a shadow build from a source tree containing a previous build

    That's why I suggested to build OUTSIDE of the Qt source tree: to keep it clean.
    Now, checkout Qt source code again, create a build directory, go that directory and call configure from there.

    mkdir qt_build
    cd qt_build
    PATH_TO_YOUR_QT/qtbase/configure ...
    

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    MijazM 1 Reply Last reply
    3
    • jsulmJ jsulm

      @Mijaz said in How to cross-compile qt5.9.5 to SDR board ?:

      You cannot make a shadow build from a source tree containing a previous build

      That's why I suggested to build OUTSIDE of the Qt source tree: to keep it clean.
      Now, checkout Qt source code again, create a build directory, go that directory and call configure from there.

      mkdir qt_build
      cd qt_build
      PATH_TO_YOUR_QT/qtbase/configure ...
      
      MijazM Offline
      MijazM Offline
      Mijaz
      wrote on last edited by
      #7

      @jsulm
      Now I have installed the latest version qt-5.12.5. But ./Configuration error still not resolved.

       ./configure -debug-and-release -device linux-arm-generic- -device-option CROSS_COMPILE=~/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -sysroot ~/home/ijaz/myQT5Root/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt512 -no-use-gold-linker -v -no-gbm
      Creating qmake...
      make: Nothing to be done for 'first'.
      Command line: -debug-and-release -device linux-arm-generic- -device-option CROSS_COMPILE=/home/ijaz/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -sysroot /home/ijaz/home/ijaz/myQT5Root/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt512 -no-use-gold-linker -v -no-gbm
      Project ERROR: Cannot run target compiler '/home/ijaz/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++g++'. Output:
      ===================
      ===================
      Maybe you forgot to setup the environment?
      
      
      jsulmJ 1 Reply Last reply
      0
      • MijazM Mijaz

        @jsulm
        Now I have installed the latest version qt-5.12.5. But ./Configuration error still not resolved.

         ./configure -debug-and-release -device linux-arm-generic- -device-option CROSS_COMPILE=~/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -sysroot ~/home/ijaz/myQT5Root/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt512 -no-use-gold-linker -v -no-gbm
        Creating qmake...
        make: Nothing to be done for 'first'.
        Command line: -debug-and-release -device linux-arm-generic- -device-option CROSS_COMPILE=/home/ijaz/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -sysroot /home/ijaz/home/ijaz/myQT5Root/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt512 -no-use-gold-linker -v -no-gbm
        Project ERROR: Cannot run target compiler '/home/ijaz/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++g++'. Output:
        ===================
        ===================
        Maybe you forgot to setup the environment?
        
        
        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #8

        @Mijaz said in How to cross-compile qt5.9.5 to SDR board ?:

        ./configure

        You're again calling configure from the Qt source directory. Why?

        "installed the latest version qt-5.12.5" - do you mean you checked out Qt 5.12.5 from Git or downloaded its source code as tar.gz archive? So, what exactly did you download?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        MijazM 1 Reply Last reply
        2
        • jsulmJ jsulm

          @Mijaz said in How to cross-compile qt5.9.5 to SDR board ?:

          ./configure

          You're again calling configure from the Qt source directory. Why?

          "installed the latest version qt-5.12.5" - do you mean you checked out Qt 5.12.5 from Git or downloaded its source code as tar.gz archive? So, what exactly did you download?

          MijazM Offline
          MijazM Offline
          Mijaz
          wrote on last edited by Mijaz
          #9

          @jsulm
          I have maked directory by:
          cd mkdir qt_build
          cd qt_build

          ijaz@ijaz-HP-ProDesk-400-G4-MT:~/qt_build$  ./configure -debug-and-release -device linux-arm-generic- -device-option CROSS_COMPILE=~/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -sysroot ~/home/ijaz/myQT5Root/sysroot -opensource -confirm-license -make libs -prefix /media/ijaz/EA82822F8281FFF5/qt5_12/5.12.5/gcc_64 -no-use-gold-linker -v -no-gbm
          bash: ./configure: No such file or directory
          

          I have downloaded the "qt-opensource-linux-x64-5.12.5.run" and installed
          Now I have the Qt 5.12.5 version

          Selection_036.png

          jsulmJ 1 Reply Last reply
          0
          • MijazM Mijaz

            @jsulm
            I have maked directory by:
            cd mkdir qt_build
            cd qt_build

            ijaz@ijaz-HP-ProDesk-400-G4-MT:~/qt_build$  ./configure -debug-and-release -device linux-arm-generic- -device-option CROSS_COMPILE=~/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -sysroot ~/home/ijaz/myQT5Root/sysroot -opensource -confirm-license -make libs -prefix /media/ijaz/EA82822F8281FFF5/qt5_12/5.12.5/gcc_64 -no-use-gold-linker -v -no-gbm
            bash: ./configure: No such file or directory
            

            I have downloaded the "qt-opensource-linux-x64-5.12.5.run" and installed
            Now I have the Qt 5.12.5 version

            Selection_036.png

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by jsulm
            #10

            @Mijaz You should learn the basics: how to execute a command in terminal using an absolute ot relative path.
            And you should read what others write more carefully - I already provided an example how to do this. Here once more:

            mkdir qt_build
            cd qt_build
            PATH_TO_YOUR_QT/qtbase/configure ...
            

            "I have downloaded the "qt-opensource-linux-x64-5.12.5.run" and installed" - you installed Qt binaries I guess, if you want to compile Qt you need to install Qt source code of course.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            MijazM 1 Reply Last reply
            1
            • jsulmJ jsulm

              @Mijaz You should learn the basics: how to execute a command in terminal using an absolute ot relative path.
              And you should read what others write more carefully - I already provided an example how to do this. Here once more:

              mkdir qt_build
              cd qt_build
              PATH_TO_YOUR_QT/qtbase/configure ...
              

              "I have downloaded the "qt-opensource-linux-x64-5.12.5.run" and installed" - you installed Qt binaries I guess, if you want to compile Qt you need to install Qt source code of course.

              MijazM Offline
              MijazM Offline
              Mijaz
              wrote on last edited by
              #11

              @jsulm

              ijaz@ijaz-HP-ProDesk-400-G4-MT:~/myQT5Root/qt-everywhere-src-5.12.5$ ./configure+ cd qtbase
              + /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/configure -top-level 
              Creating qmake...
              ...........................................................................................Done.
              Info: creating super cache file /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/.qmake.super
              Info: creating cache file /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/.qmake.cache
              /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/mkspecs/features/qt_configure.prf:2300: Error parsing JSON at 1:1: illegal value
              Project ERROR: Invalid or non-existent file /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtdeclarative/configure.json.
              
              
              jsulmJ 1 Reply Last reply
              0
              • MijazM Mijaz

                @jsulm

                ijaz@ijaz-HP-ProDesk-400-G4-MT:~/myQT5Root/qt-everywhere-src-5.12.5$ ./configure+ cd qtbase
                + /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/configure -top-level 
                Creating qmake...
                ...........................................................................................Done.
                Info: creating super cache file /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/.qmake.super
                Info: creating cache file /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/.qmake.cache
                /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/mkspecs/features/qt_configure.prf:2300: Error parsing JSON at 1:1: illegal value
                Project ERROR: Invalid or non-existent file /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtdeclarative/configure.json.
                
                
                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #12

                @Mijaz Now you're again compiling inside Qt source code directory! WHY?!
                AGAIN:

                mkdir qt_build
                cd qt_build
                ~/myQT5Root/qt-everywhere-src-5.12.5/configure ...
                

                So, you go to your build directory and call configure from Qt source code directory using a whole path to it...

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                MijazM 1 Reply Last reply
                2
                • jsulmJ jsulm

                  @Mijaz Now you're again compiling inside Qt source code directory! WHY?!
                  AGAIN:

                  mkdir qt_build
                  cd qt_build
                  ~/myQT5Root/qt-everywhere-src-5.12.5/configure ...
                  

                  So, you go to your build directory and call configure from Qt source code directory using a whole path to it...

                  MijazM Offline
                  MijazM Offline
                  Mijaz
                  wrote on last edited by
                  #13

                  @jsulm

                  ijaz@ijaz-HP-ProDesk-400-G4-MT:~/qt_build$ ~/myQT5Root/qt-everywhere-src-5.12.5/configure -release -device linux-arm-generic-g++ -device-option CROSS_COMPILE=~/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -sysroot ~/myQT5Root/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5_12 -no-use-gold-linker -v -no-gbm
                  + cd qtbase
                  + /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/configure -top-level -release -device linux-arm-generic-g++ -device-option CROSS_COMPILE=/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -sysroot /home/ijaz/myQT5Root/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5_12 -no-use-gold-linker -v -no-gbm
                  Performing shadow build...
                  Preparing build tree...
                  Creating qmake...
                  make: Nothing to be done for 'first'.
                  Command line: -release -device linux-arm-generic-g++ -device-option CROSS_COMPILE=/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -sysroot /home/ijaz/myQT5Root/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5_12 -no-use-gold-linker -v -no-gbm
                  
                  This is the Qt Open Source Edition.
                  
                  You have already accepted the terms of the Open Source license.
                  
                  Running configuration tests...
                  
                  + /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -dumpmachine
                  > arm-linux-gnueabihf
                  Checking for valid makespec... 
                  + cd /home/ijaz/qt_build/config.tests/verifyspec && /home/ijaz/qt_build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/home/ijaz/myQT5Root/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/ijaz/myQT5Root/sysroot" "QMAKE_LFLAGS += --sysroot=/home/ijaz/myQT5Root/sysroot" -early "CONFIG += cross_compile" /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/config.tests/verifyspec
                  + cd /home/ijaz/qt_build/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                  > rm -f verifyspec.o
                  > rm -f *~ core *.core
                  > /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -mfloat-abi=softfp --sysroot=/home/ijaz/myQT5Root/sysroot -O2 -std=gnu++11 -w -fPIC  -I/home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/config.tests/verifyspec -I. -I/home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/mkspecs/devices/linux-arm-generic-g++ -o verifyspec.o /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/config.tests/verifyspec/verifyspec.cpp
                  > /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -mfloat-abi=softfp --sysroot=/home/ijaz/myQT5Root/sysroot -Wl,-O1 -o verifyspec verifyspec.o      
                  > /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: error: verifyspec uses VFP register arguments, verifyspec.o does not
                  > /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: failed to merge target specific data of file verifyspec.o
                  > collect2: error: ld returned 1 exit status
                  > Makefile:68: 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.
                  
                  

                  Note: Because I am using the SDR board and that board is not included in the device list so I have used Linux-arm-generic-g++.

                  jsulmJ 1 Reply Last reply
                  0
                  • MijazM Mijaz

                    @jsulm

                    ijaz@ijaz-HP-ProDesk-400-G4-MT:~/qt_build$ ~/myQT5Root/qt-everywhere-src-5.12.5/configure -release -device linux-arm-generic-g++ -device-option CROSS_COMPILE=~/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -sysroot ~/myQT5Root/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5_12 -no-use-gold-linker -v -no-gbm
                    + cd qtbase
                    + /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/configure -top-level -release -device linux-arm-generic-g++ -device-option CROSS_COMPILE=/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -sysroot /home/ijaz/myQT5Root/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5_12 -no-use-gold-linker -v -no-gbm
                    Performing shadow build...
                    Preparing build tree...
                    Creating qmake...
                    make: Nothing to be done for 'first'.
                    Command line: -release -device linux-arm-generic-g++ -device-option CROSS_COMPILE=/home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- -sysroot /home/ijaz/myQT5Root/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5_12 -no-use-gold-linker -v -no-gbm
                    
                    This is the Qt Open Source Edition.
                    
                    You have already accepted the terms of the Open Source license.
                    
                    Running configuration tests...
                    
                    + /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -dumpmachine
                    > arm-linux-gnueabihf
                    Checking for valid makespec... 
                    + cd /home/ijaz/qt_build/config.tests/verifyspec && /home/ijaz/qt_build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/home/ijaz/myQT5Root/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/ijaz/myQT5Root/sysroot" "QMAKE_LFLAGS += --sysroot=/home/ijaz/myQT5Root/sysroot" -early "CONFIG += cross_compile" /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/config.tests/verifyspec
                    + cd /home/ijaz/qt_build/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                    > rm -f verifyspec.o
                    > rm -f *~ core *.core
                    > /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -mfloat-abi=softfp --sysroot=/home/ijaz/myQT5Root/sysroot -O2 -std=gnu++11 -w -fPIC  -I/home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/config.tests/verifyspec -I. -I/home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/mkspecs/devices/linux-arm-generic-g++ -o verifyspec.o /home/ijaz/myQT5Root/qt-everywhere-src-5.12.5/qtbase/config.tests/verifyspec/verifyspec.cpp
                    > /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++ -mfloat-abi=softfp --sysroot=/home/ijaz/myQT5Root/sysroot -Wl,-O1 -o verifyspec verifyspec.o      
                    > /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: error: verifyspec uses VFP register arguments, verifyspec.o does not
                    > /home/ijaz/myQT5Root/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: failed to merge target specific data of file verifyspec.o
                    > collect2: error: ld returned 1 exit status
                    > Makefile:68: 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.
                    
                    

                    Note: Because I am using the SDR board and that board is not included in the device list so I have used Linux-arm-generic-g++.

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #14

                    @Mijaz said in How to cross-compile qt5.9.5 to SDR board ?:

                    Note: Because I am using the SDR board and that board is not included in the device list so I have used Linux-arm-generic-g++.

                    I'm not sure, but my guess is that you have to to adapt that mkspec for your device.
                    "error: verifyspec uses VFP register arguments, verifyspec.o does not" - it looks like different ABI is used.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

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

                      Hi,

                      Is there any mkspec that closely matches your board ?
                      If so copy it and customize it so it fits your device.

                      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

                      • Login

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