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. Raspberry Pi 4 cross compile trouble
QtWS25 Last Chance

Raspberry Pi 4 cross compile trouble

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 1 Posters 891 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.
  • I Offline
    I Offline
    IRBaboon
    wrote on last edited by aha_1980
    #1

    Greetings everyone!
    I have encountered a trouble while trying to create a cross-compile toolchain for my Raspberry Pi 4 with newest Raspbian x64 Bookworm.
    I have followed this instruction: Cross-Compile Qt 6 for Raspberry Pi, to get the whole thing work.
    I am using Debian 12 latest official release.
    The problem itself reveals when I am trying to build a project within Qt Creator. I am making a kit by the instruction - adding aarch64 compiler (12.2) that was used to build qt, qmake that I have got in qt-raspi catalog after the build of qt, but when I stepping to qmake of my project, I got the following error:

    Project ERROR: Cannot run target compiler 'g++'. Output:
    ===================
    Using built-in specs.
    COLLECT_GCC=g++
    OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
    OFFLOAD_TARGET_DEFAULT=1
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Debian 12.2.0-14' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    Thread model: posix
    Supported LTO compression algorithms: zlib zstd
    gcc version 12.2.0 (Debian 12.2.0-14) 
    COLLECT_GCC_OPTIONS='-pipe' '-pipe' '-march=armv8-a' '--sysroot=/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot' '-E' '-v' '-shared-libgcc'
     /usr/lib/gcc/x86_64-linux-gnu/12/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -isysroot /home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot -D_GNU_SOURCE - -march=armv8-a -fasynchronous-unwind-tables -dumpbase -
    ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/12"
    ignoring nonexistent directory "/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot/usr/local/include/x86_64-linux-gnu"
    ignoring nonexistent directory "/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot/usr/local/include"
    ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/12/include-fixed"
    ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
    ignoring nonexistent directory "/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot/usr/include/x86_64-linux-gnu"
    #include "..." search starts here:
    #include <...> search starts here:
     /usr/include/c++/12
     /usr/include/x86_64-linux-gnu/c++/12
     /usr/include/c++/12/backward
     /usr/lib/gcc/x86_64-linux-gnu/12/include
     /home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot/usr/include
    End of search list.
    cc1plus: error: bad value 'armv8-a' for '-march=' switch
    cc1plus: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 native
    ===================
    Maybe you forgot to setup the environment?
    13:32:01: The process "/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/qt-raspi/bin/qmake" exited with code 3.
    Error while building/deploying project GroupFlightModule (kit: RaspberryPi4x64_3111)
    When executing step "qmake"
    

    [Edit aha_1980: added code tags]

    I 1 Reply Last reply
    0
    • I Offline
      I Offline
      IRBaboon
      wrote on last edited by
      #4

      Re: Raspberry Pi 4 cross compile trouble

      The problem solved in another way - seems that we now have to use CMake instead of QMake for qt based crossplatform solutions for arm.
      So I just made CMakeLists.txt - configured my project again and everything get working.
      Of course that was painful for a bit (never used cmake before) but you always need to go further and to learn instantly.

      1 Reply Last reply
      0
      • I IRBaboon

        Greetings everyone!
        I have encountered a trouble while trying to create a cross-compile toolchain for my Raspberry Pi 4 with newest Raspbian x64 Bookworm.
        I have followed this instruction: Cross-Compile Qt 6 for Raspberry Pi, to get the whole thing work.
        I am using Debian 12 latest official release.
        The problem itself reveals when I am trying to build a project within Qt Creator. I am making a kit by the instruction - adding aarch64 compiler (12.2) that was used to build qt, qmake that I have got in qt-raspi catalog after the build of qt, but when I stepping to qmake of my project, I got the following error:

        Project ERROR: Cannot run target compiler 'g++'. Output:
        ===================
        Using built-in specs.
        COLLECT_GCC=g++
        OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
        OFFLOAD_TARGET_DEFAULT=1
        Target: x86_64-linux-gnu
        Configured with: ../src/configure -v --with-pkgversion='Debian 12.2.0-14' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
        Thread model: posix
        Supported LTO compression algorithms: zlib zstd
        gcc version 12.2.0 (Debian 12.2.0-14) 
        COLLECT_GCC_OPTIONS='-pipe' '-pipe' '-march=armv8-a' '--sysroot=/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot' '-E' '-v' '-shared-libgcc'
         /usr/lib/gcc/x86_64-linux-gnu/12/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -isysroot /home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot -D_GNU_SOURCE - -march=armv8-a -fasynchronous-unwind-tables -dumpbase -
        ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/12"
        ignoring nonexistent directory "/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot/usr/local/include/x86_64-linux-gnu"
        ignoring nonexistent directory "/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot/usr/local/include"
        ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/12/include-fixed"
        ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
        ignoring nonexistent directory "/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot/usr/include/x86_64-linux-gnu"
        #include "..." search starts here:
        #include <...> search starts here:
         /usr/include/c++/12
         /usr/include/x86_64-linux-gnu/c++/12
         /usr/include/c++/12/backward
         /usr/lib/gcc/x86_64-linux-gnu/12/include
         /home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/rpi-sysroot/usr/include
        End of search list.
        cc1plus: error: bad value 'armv8-a' for '-march=' switch
        cc1plus: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 native
        ===================
        Maybe you forgot to setup the environment?
        13:32:01: The process "/home/altair/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4_x64/qt-raspi/bin/qmake" exited with code 3.
        Error while building/deploying project GroupFlightModule (kit: RaspberryPi4x64_3111)
        When executing step "qmake"
        

        [Edit aha_1980: added code tags]

        I Offline
        I Offline
        IRBaboon
        wrote on last edited by
        #2

        @IRBaboon
        Trying to pass the instruction now with Ubuntu 22.04 (GCC11).

        I 1 Reply Last reply
        0
        • I IRBaboon

          @IRBaboon
          Trying to pass the instruction now with Ubuntu 22.04 (GCC11).

          I Offline
          I Offline
          IRBaboon
          wrote on last edited by
          #3

          @IRBaboon tried with Ubuntu 2204, tried different linaro tool chain aarch64 compilers. No effect. The same error everytime

          1 Reply Last reply
          0
          • I Offline
            I Offline
            IRBaboon
            wrote on last edited by
            #4

            Re: Raspberry Pi 4 cross compile trouble

            The problem solved in another way - seems that we now have to use CMake instead of QMake for qt based crossplatform solutions for arm.
            So I just made CMakeLists.txt - configured my project again and everything get working.
            Of course that was painful for a bit (never used cmake before) but you always need to go further and to learn instantly.

            1 Reply Last reply
            0
            • I IRBaboon has marked this topic as solved on

            • Login

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