Raspberry Pi 4 cross compile
Solved
Mobile and Embedded
-
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 -
@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. -
Hi,
Then you have to update your compiler to a version that supports that mtune value.
-
Yes that one.