Qt 5.6.1 aarch64-linux-gnu crosscompile



  • Preparation:

    packet: qt-everywhere-opensource-src-5.6.1.tar.gz (download from http://download.qt.io/official_releases/qt/5.6/)

    system: Ubuntu 140.4

    compiler: aarch64-linux-gnu-g++-4.9 ( install by "sudo apt-get aarch64-linux-gnu-g++-4.9" ,before that, I have change the ubuntu sourcelist to 163 ,see: http://mirrors.163.com/.help/ubuntu.html )

    mkspec:
    cp linux-arm-gnueabi-g++ linux-arm-g++ -r
    edit qmake.conf like this:

    
    MAKEFILE_GENERATOR      = UNIX
    CONFIG                 += incremental
    QMAKE_INCREMENTAL_STYLE = sublib
    
    include(../common/linux.conf)
    include(../common/gcc-base-unix.conf)
    include(../common/g++-unix.conf)
    
    # modifications to g++.conf
    QMAKE_CC                = aarch64-linux-gnu-gcc-4.9
    QMAKE_CXX               = aarch64-linux-gnu-g++-4.9
    QMAKE_LINK              = aarch64-linux-gnu-g++-4.9
    QMAKE_LINK_SHLIB        = aarch64-linux-gnu-g++-4.9
    
    # modifications to linux.conf
    QMAKE_AR                = aarch64-linux-gnu-ar cqs
    QMAKE_OBJCOPY           = aarch64-linux-gnu-objcopy
    QMAKE_NM                = aarch64-linux-gnu-nm -P
    QMAKE_STRIP             = aarch64-linux-gnu-strip
    load(qt_config)            
    

    CrossCompile
    ./configure -v -xplatform linux-arm-g++ -opensource -confirm-license -nomake tests
    make

    cd canvas3d/ && ( test -e Makefile || /home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/bin/qmake /home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtcanvas3d/examples/canvas3d/canvas3d.pro -o Makefile ) && make -f Makefile 
    make[3]: Entering directory `/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtcanvas3d/examples/canvas3d'
    cd textureandlight/ && ( test -e Makefile || /home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/bin/qmake /home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtcanvas3d/examples/canvas3d/textureandlight/textureandlight.pro -o Makefile ) && make -f Makefile 
    Project ERROR: Unknown module(s) in QT: quick
    make[3]: *** [sub-textureandlight-make_first] Error 3
    make[3]: Leaving directory `/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtcanvas3d/examples/canvas3d'
    make[2]: *** [sub-canvas3d-make_first] Error 2
    make[2]: Leaving directory `/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtcanvas3d/examples'
    make[1]: *** [sub-examples-make_first] Error 2
    make[1]: Leaving directory `/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtcanvas3d'
    make: *** [module-qtcanvas3d-make_first] Error 2
    
    

    I get this error when i run make;

    so I rewrite configure adding -skip canvas3d

    ./configure -v -xplatform linux-arm-g++ -opensource -confirm-license -skip canvas3d -nomake tests

    make

    this time it completes. so I input
    make install

    However
    there are still no libQt5Quick.so.* in /usr/local/Qt-5.6.1/lib ( I confirm this by run "locate Qt5Qquick", I have run "updatedb" before that)
    so this results that I compiling a project which using quick show a error:

    Project ERROR: Unknown module(s) in QT: quick
    

    any one can help me ?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Is your project using QtQuick1 ?

    If so, that module was removed from 5.6 but it still available in sources and you can build it by hand. Just go in the module folder and do the classic path/to/qmake && make && make install.

    Hope it helps



  • In all my qml files, I use "import QtQuick2" ,so I guess I am not using QtQuick1.

    The "Project ERROR: Unknown module(s) in QT: quick" also happens when I try to compile qt5.6.1 by source code.

    here is all the *.so lib after make install , I think I probably miss something.

     libQt5Bluetooth.so 
     libQt5CLucene.so 
     libQt5Concurrent.so 
     libQt5Core.so 
     libQt5DBus.so 
     libQt5Gui.so 
     libQt5Help.so 
     libQt5Multimedia.so 
     libQt5MultimediaWidgets.so 
     libQt5Network.so 
     libQt5Nfc.so 
     libQt5Positioning.so 
     libQt5PrintSupport.so 
     libQt5Qml.so 
     libQt5Script.so 
     libQt5ScriptTools.so 
     libQt5Sensors.so 
     libQt5SerialBus.so 
     libQt5SerialPort.so 
     libQt5Sql.so 
     libQt5Svg.so 
     libQt5Test.so 
     libQt5WebChannel.so 
     libQt5WebSockets.so 
     libQt5Widgets.so 
     libQt5XmlPatterns.so 
     libQt5Xml.so 
    
    

    here are the libs in my centos 6.8 which also install qt using qt-opensource-linux-x64-5.6.1.run.

     libqgsttools_p.so 
     libQt53DCore.so 
     libQt53DInput.so 
     libQt53DLogic.so 
     libQt53DQuickInput.so 
     libQt53DQuickRender.so 
     libQt53DQuick.so 
     libQt53DRender.so 
     libQt5Bluetooth.so 
     libQt5CLucene.so 
     libQt5Concurrent.so 
     libQt5Core.so 
     libQt5DBus.so 
     libQt5DesignerComponents.so 
     libQt5Designer.so 
     libQt5EglDeviceIntegration.so 
     libQt5Gui.so 
     libQt5Help.so 
     libQt5LabsTemplates.so 
     libQt5Location.so 
     libQt5MultimediaQuick_p.so 
     libQt5Multimedia.so 
     libQt5MultimediaWidgets.so 
     libQt5Network.so 
     libQt5Nfc.so 
     libQt5OpenGL.so 
     libQt5Positioning.so 
     libQt5PrintSupport.so 
     libQt5Qml.so 
     libQt5QuickParticles.so 
     libQt5Quick.so 
     libQt5QuickTest.so 
     libQt5QuickWidgets.so 
     libQt5Script.so 
     libQt5ScriptTools.so 
     libQt5Sensors.so 
     libQt5SerialBus.so 
     libQt5SerialPort.so 
     libQt5Sql.so 
     libQt5Svg.so 
     libQt5Test.so 
     libQt5WebChannel.so 
     libQt5WebEngineCore.so 
     libQt5WebEngine.so 
     libQt5WebEngineWidgets.so 
     libQt5WebSockets.so 
     libQt5WebView.so 
     libQt5Widgets.so 
     libQt5X11Extras.so 
     libQt5XcbQpa.so 
     libQt5XmlPatterns.so 
     libQt5Xml.so 
    
    

    Apparently , I lock of many lib after my compilation.

    I run .. again , and shows the message as follow:

    This is the Qt Open Source Edition.
    
    You are licensed to use this software under the terms of
    the Lesser GNU General Public License (LGPL) versions 2.1.
    You are also licensed to use this software under the terms of
    the GNU Lesser General Public License (LGPL) versions 3.
    
    You have already accepted the terms of the Open Source license.
    
    Running configuration tests (phase 1)...
    Done running configuration tests.
    Creating qmake...
    .Done.
    Running configuration tests (phase 2)...
    Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set and
    the host's .pc files would be used (even if you set PKG_CONFIG_PATH).
    Set this variable to the directory that contains target .pc files
    for pkg-config to function correctly when cross-compiling or
    use -pkg-config to override this test.
    Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.
    Set this variable to your sysroot for pkg-config to function correctly when
    cross-compiling or use -pkg-config to override this test.
    Done running configuration tests.
    
       Configure summary
    
    Building on:   linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for:  linux-arm-g++ (arm64, CPU features: neon)
    Platform notes:
    
                - Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx
            
    Build options:
      Configuration .......... accessibility audio-backend c++11 c++14 clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus enable_new_dtags evdev eventfd freetype full-config getaddrinfo getifaddrs harfbuzz iconv inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap neon nis no-pkg-config pcre png posix_fallocate precompile_header qpa qpa reduce_exports release rpath shared small-config threadsafe-cloexec use_gold_linker zlib 
      Build parts ............ libs examples
      Mode ................... release
      Using sanitizer(s)...... none
      Using C++ standard ..... c++14
      Using gold linker....... yes
      Using new DTAGS ........ yes
      Using PCH .............. yes
      Using LTCG ............. no
      Target compiler supports:
    
    Qt modules and options:
      Qt D-Bus ............... yes (loading dbus-1 at runtime)
      Qt Concurrent .......... yes
      Qt GUI ................. yes
      Qt Widgets ............. yes
      Large File ............. yes
      QML debugging .......... yes
      Use system proxies ..... no
    
    Support enabled for:
      Accessibility .......... yes
      ALSA ................... no
      CUPS ................... no
      Evdev .................. yes
      FontConfig ............. no
      FreeType ............... yes (bundled copy)
      Glib ................... no
      GStreamer .............. no
      GTK theme .............. no
      HarfBuzz ............... yes (bundled copy)
      Iconv .................. yes
      ICU .................... no
      Image formats: 
        GIF .................. yes (plugin, using bundled copy)
        JPEG ................. yes (plugin, using bundled copy)
        PNG .................. yes (in QtGui, using bundled copy)
      libinput................ no
      Logging backends: 
        journald ............... no
        syslog   ............... no
      mtdev .................. no
      Networking: 
        getaddrinfo .......... yes
        getifaddrs ........... yes
        IPv6 ifname .......... yes
        libproxy.............. no
        OpenSSL .............. no
      NIS .................... yes
      OpenGL / OpenVG: 
        EGL .................. no
        OpenGL ............... no
        OpenVG ............... no
      PCRE ................... yes (bundled copy)
      pkg-config ............. no 
      PulseAudio ............. no
      QPA backends: 
        DirectFB ............. no
        EGLFS ................ no
          EGLFS i.MX6 ........ no
          EGLFS i.MX6 Wayland. no
          EGLFS EGLDevice .... no
          EGLFS GBM .......... no
          EGLFS Mali ......... no
          EGLFS Raspberry Pi . no
          EGLFS X11 .......... no
        LinuxFB .............. yes
        Mir client............ no
        XCB .................. no
      Session management ..... yes
      SQL drivers: 
        DB2 .................. no
        InterBase ............ no
        MySQL ................ no
        OCI .................. no
        ODBC ................. no
        PostgreSQL ........... no
        SQLite 2 ............. no
        SQLite ............... yes (plugin, using bundled copy)
        TDS .................. no
      tslib .................. no
      udev ................... no
      xkbcommon-x11........... no
      xkbcommon-evdev......... no
      zlib ................... yes (bundled copy)
    
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, you must run 'make install'.
    Qt will be installed into /usr/local/Qt-5.6.1
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    this time I notice that there are two warning, But I still confused how to use pkg-config

    Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set and
    the host's .pc files would be used (even if you set PKG_CONFIG_PATH).
    Set this variable to the directory that contains target .pc files
    for pkg-config to function correctly when cross-compiling or
    use -pkg-config to override this test.
    Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.
    Set this variable to your sysroot for pkg-config to function correctly when
    cross-compiling or use -pkg-config to override this test.
    Done running configuration tests.
    

    I just add pkg-config and with no skip

    ./configure -v -xplatform linux-arm-g++ -opensource -confirm-license -pkg-config  -nomake tests
    

    but still get the same error when run make


  • Lifetime Qt Champion

    Seems you are missing the Qt declarative module.



  • qtdeclarative seems has been built but not completely

    I "mkdir" build
    do the configure thing in the build then make

    when the compile terminate

    cd qtdeclarative
    make 
    

    Nothing to be done for the first in each directory
    there are only libQt5Qml.so in the libs which I think libQt5Quick should appear here
    there are alse not quick directory in the src directory

    this is srcs in qt-everywhere-opensource-src-5.6.1/qtdeclarative/src

    3rdparty  imports  particles  plugins  qml  qmldevtools  qmltest  quick  quickwidgets  src.pro
    
    

    however this is srcs in qt-everywhere-opensource-src-5.6.1/build/qtdeclarative/

    imports  Makefile  plugins  qml  qmldevtools
    

  • Lifetime Qt Champion

    Strange, at that point I'd rather nuke the build folder completely and start from a fresh new.

    You should also do out of source builds, that will make things easier to handle.



  • what does " do out of source builds " mean?

    It seems no other way to get Arm Qt libs


  • Lifetime Qt Champion

    Based on what you posted, It means:

    cd ~/Desktop/
    mkdir build_Qt_arm
    cd build_Qt_arm
    ../qt-everywhere-opensource-src-5.6.1/configure -whatever_you_need
    make
    

    I'd recommend adding -nomake examples to your options.



  • Finally, I found the reason there are no quick module being compiled. -- lacking of OPENGL libs

    OpenGL / OpenVG: 
        EGL .................. no
        OpenGL ............... no
        OpenVG ............... no
    

    after copying some libs and setting some configure, Fianlly I made configure passed.

    The configure result showing this:
    OpenGl.........yes

    and this is part of my qmake.config

        PKG_CONFIG_LIBDIR       = /home/zyf/Desktop/gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/lib64/pkgconfig
        QMAKE_LIBDIR_OPENGL     = /home/zyf/Desktop/gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/usr/lib/aarch64-linux-gnu
        QMAKE_LIBS_OPENGL       = -Wl,-rpath-link,/home/zyf/Desktop/gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/usr/lib/aarch64-linux-gnu
    

    So I run make again, hoping that this time will make it.

    However, I error comes as usual

    /home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/plugins/imageformats/webp/qwebphandler_p.h:41:25: fatal error: webp/decode.h: No such file or directory
     #include "webp/decode.h"
    

    I remembered this moudle which has been compile when I use g++

    so I compare the inform between using g++ and using aarch64-linux-gnu-g++

    g++                   -c -pipe -O2 -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/plugins/imageformats/webp -I. -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/3rdparty/libwebp -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/3rdparty/libwebp/src -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/3rdparty/libwebp/src/dec -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/3rdparty/libwebp/src/enc -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/3rdparty/libwebp/src/dsp -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/3rdparty/libwebp/src/mux -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/3rdparty/libwebp/src/utils -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/3rdparty/libwebp/src/webp -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/include -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/include/QtGui -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/build/qtbase/include -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/build/qtbase/include/QtGui -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/include/QtCore -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/build/qtbase/include/QtCore -I.moc -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/mkspecs/linux-g++ -o .obj/qwebphandler.o /home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/plugins/imageformats/webp/qwebphandler.cpp
    
     aarch64-linux-gnu-g++ -c -pipe -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/plugins/imageformats/webp -I. -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/include -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/include/QtGui -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/build2/qtbase/include -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/build2/qtbase/include/QtGui -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/include/QtCore -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/build2/qtbase/include/QtCore -I.moc -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtbase/mkspecs/linux-arm-g++ -o .obj/qwebphandler.o /home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/plugins/imageformats/webp/qwebphandler.cpp
    
    

    The following include path appears in the "g++ line" , but not in the "aarch64-linux-gnu-g++ line" so the compiler could not find the missing file.

    -I/home/zyf/Desktop/qt-everywhere-opensource-src-5.6.1/qtimageformats/src/3rdparty/libwebp/src
    

    but why? what make it different?


  • Lifetime Qt Champion

    Did you reconfigure over your old build ? If so that might be a reason, you should either nuke the folder and start from fresh or do cleanup before calling configure again.

    I'd recommend an out of source build so you leave the sources clean and can easily restart from scratch.


Log in to reply
 

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