Congratulations to our 2022 Qt Champions!

Qt5.15 compilation for Raspberry Pi 4

  • Hello,

    I want to compile Qt application for arm from linux in order to use it on my RPI board. For this purpose,
    I'm using aarch64 to compile Qt with following command:

    ../qt-everywhere-src-5.15.0-rc/configure -release -opengl es2 -eglfs -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/home/tomek/Pulpit/qt-arm/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- -sysroot /home/tomek/sysroot -prefix /usr/local/qt5.15 -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -make libs -pkg-config -no-use-gold-linker -v -recheck

    but I'm getting an error:

    Using built-in specs.
    aarch64-linux-gnu-g++: error: unrecognized command line option '-mfpu=crypto-neon-fp-armv8'
    aarch64-linux-gnu-g++: error: unrecognized command line option '-mfloat-abi=hard'
    Target: aarch64-linux-gnu
    Configured with: '/home/tcwg-buildslave/workspace/tcwg-make-release_0/snapshots/gcc.git~linaro-7.5-2019.12/configure' SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared --without-included-gettext --enable-nls --with-system-zlib --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --with-arch=armv8-a --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/sysroots/aarch64-linux-gnu --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu/aarch64-linux-gnu/libc --enable-checking=release --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=aarch64-linux-gnu --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu
    Thread model: posix
    gcc version 7.5.0 (Linaro GCC 7.5-2019.12) 

    I have a Ubuntu 18.04.4 64-bit

  • Lifetime Qt Champion

    I just saw that you are using an RC, did you try with a recent released version ?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    AFAIK when there are such messages, it usually means that your version of GCC is too old.

  • Thank you for reply!
    Actually I've updated my gcc compiler (version 8.4) and downloaded newer version of aarch64 from: this one: gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz , and also tried with compiler: aarch64-linux-gnu-g++-8 installed via Synaptic.
    I'm getting an error:

    g++ -o "../bin/qmake" main.o meta.o option.o project.o property.o ioutils.o proitems.o qmakebuiltins.o qmakeevaluator.o qmakeglobals.o qmakeparser.o qmakevfs.o pbuilder_pbx.o makefile.o makefiledeps.o metamakefile.o projectgenerator.o unixmake2.o unixmake.o mingw_make.o msbuild_objectmodel.o msvc_nmake.o msvc_objectmodel.o msvc_vcproj.o msvc_vcxproj.o winmakefile.o xmloutput.o qutfcodec.o qendian.o qglobal.o qlogging.o qmalloc.o qnumeric.o qoperatingsystemversion.o qrandom.o qabstractfileengine.o qbuffer.o qdatastream.o qdebug.o qdir.o qdiriterator.o qfile.o qfiledevice.o qfileinfo.o qfilesystemengine.o qfilesystementry.o qfsfileengine.o qfsfileengine_iterator.o qiodevice.o qsettings.o qtemporaryfile.o qtextstream.o qcborstreamwriter.o qcborvalue.o qjsoncbor.o qjsonarray.o qjsondocument.o qjsonobject.o qjsonparser.o qjsonvalue.o qmetatype.o qsystemerror.o qvariant.o quuid.o qarraydata.o qbitarray.o qbytearray.o qbytearraylist.o qbytearraymatcher.o qcalendar.o qgregoriancalendar.o qromancalendar.o qcryptographichash.o qdatetime.o qhash.o qlist.o qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o qstringbuilder.o qstring.o qstringlist.o qversionnumber.o qvsnprintf.o qxmlstream.o qxmlutils.o qcore_unix.o qfilesystemengine_unix.o qfilesystemiterator_unix.o qfsfileengine_unix.o qlocale_unix.o  qlibraryinfo.o   -Wl,--gc-sections
    /home/tomek/Pulpit/qt-arm/qt-everywhere-src-5.15.0-rc/qtbase/configure: 856: /home/tomek/Pulpit/qt-arm/qt-everywhere-src-5.15.0-rc/qtbase/configure: /home/tomek/Pulpit/qt-arm/qt-build/qtbase/bin/qmake: Exec format error

    Does It seem like objects are not compiled by properd compiler?

  • Lifetime Qt Champion

    Did you restart the process from a clean state ?

  • Do you mean if I remove all files from previous configuration process? Yes, I did

  • Lifetime Qt Champion

    How did you do that ?

  • I've just used rm -I -r * command in build directory. It looks like I cannot run qmake built by configure file with arm compiler, because it is compiled for arm.
    I didn't have files from RP in sysroot path before but after adding it, nothing has changed. There is the same error: "Exec format error".

  • Lifetime Qt Champion

    So you did not delete the hidden files. That's why I recommend nuking the folder completely.

  • Again the same error (" Exec format error ") :/

  • Lifetime Qt Champion

    I just saw that you are using an RC, did you try with a recent released version ?

  • Sorry, I don't know what RC is.

  • Lifetime Qt Champion

    @Tom_PK RC: Release Candidate. Means: it is not official release.

  • Ok guys, thank you for your help, it works.
    I've downloaded Qt via github from and it is ok.

Log in to reply