Unable to cross compile Qt-5.8 for arm64 device



  • I am trying to cross compile Qt-5.8 for an arm64 embedded device but the cross-compilation terminates with the error as shown below

    cd corelib/ && ( test -e Makefile || /home/kamal/yocto_Projects/qt-everywhere-opensource-src-5.8.0/qtbase/bin/qmake -o Makefile /home/kamal/yocto_Projects/qt-everywhere-opensource-src-5.8.0/qtbase/src/corelib/corelib.pro -qtconf /home/kamal/yocto_Projects/qt-everywhere-opensource-src-5.8.0/qtbase/bin/qt.conf -- -L /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/lib:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/lib: -I /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/include: -device-option CROSS_COMPILE=aarch64-pdm3-linux- -no-gcc-sysroot -sysroot /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/aarch64-pdm3-linux -prefix /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/aarch64-pdm3-linux -hostprefix /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/aarch64-pdm3-linux -opensource -confirm-license -accessibility -shared -pkg-config -qt-zlib -no-mtdev -qt-xcb -qt-pcre -qt-freetype -no-libjpeg -no-libpng -no-gif -no-cups -no-gui -no-qml-debug -no-sql-mysql -no-sql-sqlite -no-opengl -no-openssl -no-xcb -no-icu -verbose -release -no-glib -no-iconv -silent -nomake examples -nomake tests -no-compile-examples -no-rpath -no-eglfs -no-alsa -no-xinput2 -no-libproxy -no-harfbuzz -no-evdev -no-tslib -no-fontconfig -no-strip -no-pch -no-dbus ) && make -f Makefile 
    make[3]: Entering directory '/home/kamal/yocto_Projects/qt-everywhere-opensource-src-5.8.0/qtbase/src/corelib'
    moc animation/qabstractanimation.h
    /home/kamal/yocto_Projects/qt-everywhere-opensource-src-5.8.0/qtbase/bin/moc: 1: /home/kamal/yocto_Projects/qt-everywhere-opensource-src-5.8.0/qtbase/bin/moc: Syntax error: Bad function name
    Makefile:1939: recipe for target '.moc/moc_qabstractanimation.cpp' failed
    make[3]: *** [.moc/moc_qabstractanimation.cpp] Error 2
    make[3]: Leaving directory '/home/kamal/yocto_Projects/qt-everywhere-opensource-src-5.8.0/qtbase/src/corelib'
    Makefile:181: recipe for target 'sub-corelib-make_first' failed
    make[2]: *** [sub-corelib-make_first] Error 2
    make[2]: Leaving directory '/home/kamal/yocto_Projects/qt-everywhere-opensource-src-5.8.0/qtbase/src'
    Makefile:46: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory '/home/kamal/yocto_Projects/qt-everywhere-opensource-src-5.8.0/qtbase'
    Makefile:79: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2
    
    

    the environment options are as follows:

    export SDKTARGETSYSROOT=/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/aarch64-pdm3-linux
    export PATH=/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/sbin:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/bin:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/sbin:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin/../x86_64-pdm3sdk-linux/bin:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin/aarch64-pdm3-linux:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin/aarch64-pdm3-linux-uclibc:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin/aarch64-pdm3-linux-musl:$PATH
    export CCACHE_PATH=/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin/../x86_64-pdm3sdk-linux/bin:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin/aarch64-pdm3-linux:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin/aarch64-pdm3-linux-uclibc:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/bin/aarch64-pdm3-linux-musl:$CCACHE_PATH
    export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT
    export PKG_CONFIG_PATH=$SDKTARGETSYSROOT/usr/lib/pkgconfig:$SDKTARGETSYSROOT/usr/share/pkgconfig
    export CONFIG_SITE=/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/site-config-aarch64-pdm3-linux
    export OECORE_NATIVE_SYSROOT="/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux"
    export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"
    export OECORE_ACLOCAL_OPTS="-I /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/share/aclocal"
    unset command_not_found_handle
    export CC="aarch64-pdm3-linux-gcc  --sysroot=$SDKTARGETSYSROOT"
    export CXX="aarch64-pdm3-linux-g++  --sysroot=$SDKTARGETSYSROOT"
    export CPP="aarch64-pdm3-linux-gcc -E  --sysroot=$SDKTARGETSYSROOT"
    export AS="aarch64-pdm3-linux-as "
    export LD="aarch64-pdm3-linux-ld  --sysroot=$SDKTARGETSYSROOT"
    export GDB=aarch64-pdm3-linux-gdb
    export STRIP=aarch64-pdm3-linux-strip
    export RANLIB=aarch64-pdm3-linux-ranlib
    export OBJCOPY=aarch64-pdm3-linux-objcopy
    export OBJDUMP=aarch64-pdm3-linux-objdump
    export AR=aarch64-pdm3-linux-ar
    export NM=aarch64-pdm3-linux-nm
    export M4=m4
    export TARGET_PREFIX=aarch64-pdm3-linux-
    export CONFIGURE_FLAGS="--target=aarch64-pdm3-linux --host=aarch64-pdm3-linux --build=x86_64-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"
    export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
    export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
    export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
    export CPPFLAGS=""
    export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"
    export OECORE_DISTRO_VERSION="0.1.0.0"
    export OECORE_SDK_VERSION="0.1.0.0"
    export ARCH=arm64
    export CROSS_COMPILE=aarch64-pdm3-linux-
    
    # Append environment subscripts
    if [ -d "$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then
        for envfile in $OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do
    	    . $envfile
        done
    fi
    if [ -d "$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
        for envfile in $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
    	    . $envfile
        done
    fi
    
    

    and the configuration options are as follows:

    export LIBRARY_PATH="/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/lib:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/lib:$LIBRARY_PATH"
    export INCLUDE_PATH="/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/include:$INCLUDE_PATH"
    
    ./configure -L ${LIBRARY_PATH} -I ${INCLUDE_PATH} -device-option CROSS_COMPILE=aarch64-pdm3-linux- -no-gcc-sysroot -sysroot ${SDKTARGETSYSROOT} -prefix ${SDKTARGETSYSROOT} -hostprefix ${SDKTARGETSYSROOT} -opensource -confirm-license -accessibility -shared -pkg-config -qt-zlib -no-mtdev -qt-xcb -qt-pcre -qt-freetype -no-libjpeg -no-libpng -no-gif -no-cups -no-gui -no-qml-debug -no-sql-mysql -no-sql-sqlite -no-opengl -no-openssl -no-xcb -no-icu -verbose -release -no-glib -no-iconv -silent -nomake examples -nomake tests -no-compile-examples -no-rpath -no-eglfs -no-alsa -no-xinput2 -no-libproxy -no-harfbuzz -no-evdev -no-tslib -no-fontconfig -no-strip -no-pch -no-dbus
    

    Please let me know if I am missing something.



  • adding the flag -no-feature-animation is still not helping and throwing the same error.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Out of curiosity, why use such an outdated version of Qt ? Current version is 5.11 with 5.9 being the LTS.



  • @SGaist while configuring 5.9 i got the following error:

    ./qt_crosscompile.sh

    + cd qtbase
    + /home/kamal/yocto_Projects/qt5/qtbase/configure -top-level -L /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/lib:/home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/lib: -I /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux/usr/include: -platform linux-g++ -xplatform linux-g++-64 -device-option CROSS_COMPILE=aarch64-pdm3-linux- -no-gcc-sysroot -sysroot /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/aarch64-pdm3-linux -prefix /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/aarch64-pdm3-linux -hostprefix /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/aarch64-pdm3-linux -opensource -confirm-license -accessibility -shared -no-pkg-config -no-feature-animation -no-feature-double-conversion -qt-zlib -no-mtdev -qt-xcb -qt-pcre -qt-freetype -no-libjpeg -no-libpng -no-gif -no-cups -no-gui -no-qml-debug -no-sql-mysql -no-sql-sqlite -no-opengl -no-openssl -no-xcb -no-icu -verbose -release -no-glib -no-iconv -silent -nomake examples -nomake tests -no-compile-examples -no-rpath -no-eglfs -no-alsa -no-xinput2 -no-libproxy -no-harfbuzz -no-evdev -no-tslib -no-fontconfig -no-strip -no-pch -no-dbus -skip wayland
    Cannot locate English.pm in @INC (you may need to install the English module) (@INC contains: /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux//usr/lib/perl/site_perl/5.22.1 /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux//usr/lib/perl/vendor_perl/5.22.1 /home/kamal/yocto_Projects/pdm3-sdk-64-bit-qt-5.8/sysroots/x86_64-pdm3sdk-linux//usr/lib/perl/5.22.1 /usr/local/oecore-x86_64/sysroots/x86_64-pdm3sdk-linux/usr/lib/perl/site_perl/5.22.1/ /usr/local/oecore-x86_64/sysroots/x86_64-pdm3sdk-linux/usr/lib/perl/site_perl/5.22.1 /usr/local/oecore-x86_64/sysroots/x86_64-pdm3sdk-linux/usr/lib/perl/vendor_perl/5.22.1/ /usr/local/oecore-x86_64/sysroots/x86_64-pdm3sdk-linux/usr/lib/perl/vendor_perl/5.22.1 /usr/local/oecore-x86_64/sysroots/x86_64-pdm3sdk-linux/usr/lib/perl/5.22.1/ /usr/local/oecore-x86_64/sysroots/x86_64-pdm3sdk-linux/usr/lib/perl/5.22.1 /usr/local/oecore-x86_64/sysroots/x86_64-pdm3sdk-linux/usr/lib/perl/5.22.1 .) at /home/kamal/yocto_Projects/qt5/qtbase/bin/syncqt.pl line 55.
    BEGIN failed--compilation aborted at /home/kamal/yocto_Projects/qt5/qtbase/bin/syncqt.pl line 55.
    

  • Lifetime Qt Champion

    Then why not install the suggested module ?



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.