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

Raspberry Pi 4 cross compile

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 3 Posters 2.0k 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.
  • C Offline
    C Offline
    Creatorczyk
    wrote on last edited by
    #1

    Hi,

    when I tried configure Qt for cross compile (RaspberryPi 4)

    ./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/home/jakub/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot /home/jakub/raspi/sysroot -opensource -confirm-license -skip qtwebengine -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5pi -extprefix /home/jakub/raspi/qt5pi -hostprefix /home/jakub/raspi/qt5 -no-use-gold-linker -v -no-gbm
    

    I got error like:

    Project ERROR: Cannot run target compiler '/home/jakub/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++'. Output:
    ===================
    arm-linux-gnueabihf-g++: error: unrecognized argument in option '-mtune=cortex-a72'
    arm-linux-gnueabihf-g++: note: valid arguments to '-mtune=' are: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a15 cortex-a5 cortex-a53 cortex-a7 cortex-a8 cortex-a9 cortex-m0 cortex-m0plus cortex-m1 cortex-m3 cortex-m4 cortex-r4 cortex-r4f cortex-r5 cortex-r7 ep9312 fa526 fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 marvell-pj4 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110 xscale
    Using built-in specs.
    

    My qmake.conf file:

    # qmake configuration for the Raspberry Pi 4 (32-bit) using the Mesa V3D
    # graphics stack. (not the Broadcom stack)
    #
    # This supports accelerated OpenGL both for X11 and DRM/KMS.  Perhaps
    # Wayland too.
    #
    # Tested with a sysroot created from Raspbian Buster and a gcc 7.4
    # toolchain from Linaro.
    #
    # Example configure command line, assuming installation to
    # /usr/local/qt5pi on device and ~/rpi/qt5 on the host:
    #
    # ./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=~/rpi/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- \
    #   -sysroot ~/rpi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/rpi/qt5 -v
    #
    # Check the configure output carefully. EGLFS, EGLFS GBM, and EGL on X11
    # should all be 'yes'. Otherwise something is wrong.
    #
    # If getting linker errors like "undefined reference to `_dl_stack_flags'" check the
    # symlinks in the sysroot, they were probably not adjusted
    # correctly. F.ex. sysroot/usr/lib/arm-linux-gnueabihf/libpthread.so must point to
    # sysroot/lib/arm-linux-gnueabihf/libpthread.so.0. If it is a broken link instead, bad
    # things will happen.
    
    include(../common/linux_device_pre.conf)
    
    QMAKE_LIBS_EGL         += -lEGL
    QMAKE_LIBS_OPENGL_ES2  += -lGLESv2 -lEGL
    
    QMAKE_CFLAGS            = -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8
    QMAKE_CXXFLAGS          = $$QMAKE_CFLAGS
    
    DISTRO_OPTS            += hard-float
    DISTRO_OPTS            += deb-multi-arch
    
    EGLFS_DEVICE_INTEGRATION = eglfs_kms
    
    include(../common/linux_arm_device_post.conf)
    
    load(qt_config)
    

    What should I do??
    I noticed that in qmake.conf file is a 32 bit configuration but in "./configure" commad I declared

    jsulmJ 1 Reply Last reply
    0
    • C Creatorczyk

      Hi,

      when I tried configure Qt for cross compile (RaspberryPi 4)

      ./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/home/jakub/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot /home/jakub/raspi/sysroot -opensource -confirm-license -skip qtwebengine -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5pi -extprefix /home/jakub/raspi/qt5pi -hostprefix /home/jakub/raspi/qt5 -no-use-gold-linker -v -no-gbm
      

      I got error like:

      Project ERROR: Cannot run target compiler '/home/jakub/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++'. Output:
      ===================
      arm-linux-gnueabihf-g++: error: unrecognized argument in option '-mtune=cortex-a72'
      arm-linux-gnueabihf-g++: note: valid arguments to '-mtune=' are: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a15 cortex-a5 cortex-a53 cortex-a7 cortex-a8 cortex-a9 cortex-m0 cortex-m0plus cortex-m1 cortex-m3 cortex-m4 cortex-r4 cortex-r4f cortex-r5 cortex-r7 ep9312 fa526 fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 marvell-pj4 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110 xscale
      Using built-in specs.
      

      My qmake.conf file:

      # qmake configuration for the Raspberry Pi 4 (32-bit) using the Mesa V3D
      # graphics stack. (not the Broadcom stack)
      #
      # This supports accelerated OpenGL both for X11 and DRM/KMS.  Perhaps
      # Wayland too.
      #
      # Tested with a sysroot created from Raspbian Buster and a gcc 7.4
      # toolchain from Linaro.
      #
      # Example configure command line, assuming installation to
      # /usr/local/qt5pi on device and ~/rpi/qt5 on the host:
      #
      # ./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=~/rpi/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- \
      #   -sysroot ~/rpi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/rpi/qt5 -v
      #
      # Check the configure output carefully. EGLFS, EGLFS GBM, and EGL on X11
      # should all be 'yes'. Otherwise something is wrong.
      #
      # If getting linker errors like "undefined reference to `_dl_stack_flags'" check the
      # symlinks in the sysroot, they were probably not adjusted
      # correctly. F.ex. sysroot/usr/lib/arm-linux-gnueabihf/libpthread.so must point to
      # sysroot/lib/arm-linux-gnueabihf/libpthread.so.0. If it is a broken link instead, bad
      # things will happen.
      
      include(../common/linux_device_pre.conf)
      
      QMAKE_LIBS_EGL         += -lEGL
      QMAKE_LIBS_OPENGL_ES2  += -lGLESv2 -lEGL
      
      QMAKE_CFLAGS            = -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8
      QMAKE_CXXFLAGS          = $$QMAKE_CFLAGS
      
      DISTRO_OPTS            += hard-float
      DISTRO_OPTS            += deb-multi-arch
      
      EGLFS_DEVICE_INTEGRATION = eglfs_kms
      
      include(../common/linux_arm_device_post.conf)
      
      load(qt_config)
      

      What should I do??
      I noticed that in qmake.conf file is a 32 bit configuration but in "./configure" commad I declared

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

      @Creatorczyk The compiler errors says that the compiler does not understand -mtune=cortex-a72, so remove -mtune=cortex-a72 from QMAKE_CFLAGS or change it to one understood by the compiler (it prints out what it understands).
      What compiler version do you use? Maybe you should use a newer compiler.

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

      C 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Creatorczyk The compiler errors says that the compiler does not understand -mtune=cortex-a72, so remove -mtune=cortex-a72 from QMAKE_CFLAGS or change it to one understood by the compiler (it prints out what it understands).
        What compiler version do you use? Maybe you should use a newer compiler.

        C Offline
        C Offline
        Creatorczyk
        wrote on last edited by
        #3

        @jsulm I think I shouldn't remove "-mtune = cortex-a72" from qmake.conf , because it's configuration dedicated for RaspberryPi 4.

        Which compiler do you mean about update? On ubuntu, on Rpi4 or from tool folder?

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

          Hi,

          Then you have to update your compiler to a version that supports that mtune value.

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

          C 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            Then you have to update your compiler to a version that supports that mtune value.

            C Offline
            C Offline
            Creatorczyk
            wrote on last edited by
            #5

            @SGaist Are you talking about the compiler I chose in "./configure"?

            CROSS_COMPILE=/home/jakub/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Yes that one.

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

              C 1 Reply Last reply
              0
              • SGaistS SGaist

                Yes that one.

                C Offline
                C Offline
                Creatorczyk
                wrote on last edited by
                #7

                @SGaist @jsulm After updating the compiler, it worked. Thanks!!!!

                1 Reply Last reply
                1

                • Login

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