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. filed to cross compile QT using arm-linux-gnueabihf-gcc
Forum Updated to NodeBB v4.3 + New Features

filed to cross compile QT using arm-linux-gnueabihf-gcc

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 419 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.
  • B Offline
    B Offline
    baklai
    wrote on 25 Aug 2023, 02:57 last edited by baklai
    #1

    My platform is windows, using mingw. When cross-compiling the arm version of qt, if configure does not add -sysroot, it will report "ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken". But after adding -sysroot, the result of Checking for host architecture is arm. The host architecture should be x86.

    not add -sysroot

    configure ^
    -release ^
    -opensource ^
    -confirm-license ^
    -prefix E:/arm32-gcc6.2.1-qt5.13.0 ^
    -nomake tests ^
    -nomake examples ^
    -no-opengl ^
    -skip qtvirtualkeyboard  ^
    -xplatform linux-arm32-gnu-g++ ^
    -prefix E:/arm32-gcc6.2.1-qt5.13.0 ^
    -recheck-all
    

    An error is reported: Checking for valid makespec... ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

    add -sysroot

    configure ^
    -release ^
    -opensource ^
    -confirm-license ^
    -prefix E:/arm32-gcc6.2.1-qt5.13.0 ^
    -nomake tests ^
    -nomake examples ^
    -no-opengl ^
    -skip qtvirtualkeyboard  ^
    -xplatform linux-arm32-gnu-g++ ^
    -sysroot E:/lccu3/sysroot ^
    -prefix E:/arm32-gcc6.2.1-qt5.13.0 ^
    -recheck-all
    

    After adding -sysroot , Running configuration will appear: "Running configuration tests... Checking for machine tuple... yes Checking for valid makespec... yes Checking for target architecture... arm Checking for host architecture... arm" I think that host architecture should be x86

    Hope someone can explain why

    S 1 Reply Last reply 25 Aug 2023, 05:45
    0
    • B baklai
      25 Aug 2023, 02:57

      My platform is windows, using mingw. When cross-compiling the arm version of qt, if configure does not add -sysroot, it will report "ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken". But after adding -sysroot, the result of Checking for host architecture is arm. The host architecture should be x86.

      not add -sysroot

      configure ^
      -release ^
      -opensource ^
      -confirm-license ^
      -prefix E:/arm32-gcc6.2.1-qt5.13.0 ^
      -nomake tests ^
      -nomake examples ^
      -no-opengl ^
      -skip qtvirtualkeyboard  ^
      -xplatform linux-arm32-gnu-g++ ^
      -prefix E:/arm32-gcc6.2.1-qt5.13.0 ^
      -recheck-all
      

      An error is reported: Checking for valid makespec... ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

      add -sysroot

      configure ^
      -release ^
      -opensource ^
      -confirm-license ^
      -prefix E:/arm32-gcc6.2.1-qt5.13.0 ^
      -nomake tests ^
      -nomake examples ^
      -no-opengl ^
      -skip qtvirtualkeyboard  ^
      -xplatform linux-arm32-gnu-g++ ^
      -sysroot E:/lccu3/sysroot ^
      -prefix E:/arm32-gcc6.2.1-qt5.13.0 ^
      -recheck-all
      

      After adding -sysroot , Running configuration will appear: "Running configuration tests... Checking for machine tuple... yes Checking for valid makespec... yes Checking for target architecture... arm Checking for host architecture... arm" I think that host architecture should be x86

      Hope someone can explain why

      S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 25 Aug 2023, 05:45 last edited by
      #2

      Cross-compilation works best and is most tested on Linux. I;d recommend you either switch to Linux or use WSL. Also, Qt 5.13 is very old and unsupported at this point. Can't you at least try with 5.15?

      Apart from that, some general points:

      • if your device (or a similar one) is in <qt source dir>/qtbase/mkspecs/devices then you should use -device option in configure - it will automatically set up some device-specific flags
      • -sysroot is definitely required, don't even try to cross-compile without it
      • on many arm platforms -no-use-gold-linker flag helps
      • you may want to add a device option and point it to your cross compilation toolchain, example: -device-option CROSS_COMPILE=/path/too/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-

      Good luck!

      (Z(:^

      B 1 Reply Last reply 28 Aug 2023, 07:59
      1
      • S sierdzio
        25 Aug 2023, 05:45

        Cross-compilation works best and is most tested on Linux. I;d recommend you either switch to Linux or use WSL. Also, Qt 5.13 is very old and unsupported at this point. Can't you at least try with 5.15?

        Apart from that, some general points:

        • if your device (or a similar one) is in <qt source dir>/qtbase/mkspecs/devices then you should use -device option in configure - it will automatically set up some device-specific flags
        • -sysroot is definitely required, don't even try to cross-compile without it
        • on many arm platforms -no-use-gold-linker flag helps
        • you may want to add a device option and point it to your cross compilation toolchain, example: -device-option CROSS_COMPILE=/path/too/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-

        Good luck!

        B Offline
        B Offline
        baklai
        wrote on 28 Aug 2023, 07:59 last edited by
        #3

        @sierdzio
        Thank you. I have tried it on Linux, and cross compilation works normally. The problem is that when running the same commands on Windows, I get different results.

        1 Reply Last reply
        0

        1/3

        25 Aug 2023, 02:57

        • Login

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