Coding Chase - Projects

My 3D Hub

Thank You For Donating:

Ikeeki (linux-sunxi@irc.freenode.net)
Computer Troubleshooters Brasil

Wednesday 26 February 2014

Qt5 on Cubieboard (A10/A20)

Since last year, I've been working with the Cubieboard community in order to have Qt5 running on Cubie, using the sunxi mali libraries. I started off with Cubieboard A10, then moved on to Cubieboard 2 (A20) and finally Cubietruck (also A20).

My main goal was to be able to cross-compile Qt5 (because native compile takes forever on these embedded devices) and be able to control the entire process, from SD Card image generation to Qt5 App development.

Below is the complete guide to achieve this, it is quite extensive and I advise doing regular SD Card backups along the way:


Cubieboard (A20 Soc, should also work with A10)

Main objectives:

1) Produce a working SD Card image for cubieboard, supporting the latest Mali libraries from sunxi.
2) Cross-Compile Qt5 latest stable version using said libraries
3) Test performance using QuitCoding's Cinematic Experience Demo


Step 1, Building the STOCK SD Card Image


The Sunxi wiki supplies some steps on how to achieve this. You can always use a prebuilt image (cubian, cubiuntu, whatever) but my take on this is to have end-to-end control over the whole process.

This is the general guide to follow when wanting to build a custom image from scratch:

http://linux-sunxi.org/FirstSteps

This process can be quite cumbersome, so there is an alternative to this:

http://linux-sunxi.org/BSP

Using the Board Support Package alternative, generating the initial image is a lot easier. You'll just have to focus on three things:

1) the cross-compile gcc you'll be using
2) the rootfs you'll be using
3) an SD Card class 4 (but 10 would be better) 4GB or more (though 4GB would be ideal in my opinion)

So, use Linux as the dev host (I used Linux Mint x64) and install all the dependencies required in the guide.
Grab the gcc-linaro-arm-linux-gnueabihf-4.8-2013.09 gcc and make sure it's in your env PATH

Next up, clone the sunxi-bsp git repository and start working:

- use ./configure <board> to select your board (cubieboard2 for example)
- make

then to generate the SD Card, follow the guide:

./scripts/sunxi-media-create.sh [device] [hwpack] [rootfs]

[device] is the /dev/ device for the sd card (not the partitions)

[hwpack] is the reference hwpack that results from the make output

[rootfs] - for this one, I've used linaro rootfs:
either this one > linaro-precise-alip-20121124-519
or this newer one > linaro-raring-server-20130826-474

I've done some research for Qt5 on framebuffer mostly, so the server version (no X11) served me right, but choose whatever rocks your boat, considering your Qt5 needs later on.

Once that's done, you'll hopefully have a stock SD card image ready to work.

Things you can tweak at this level:

1) modify your script.bin file, to change output from HDMI to VGA, enable GPIO, etc.
2) modify the linux-sunxi stock kernel - enable functionalities, whatever you need.

After firing the SD Card on Cubie for the first time, you may want to set up a few things like ssh and fixed MAC Address so that you're able to assign static IPs over DHCP for example.

Once your stock card is ready, you may shutdown cubie and pop the card back on your linux host machine and to a sanity backup like so:

# dd bs=1M if=/dev/<card_device> of=/opt/sdcard.img;sync



Step 2, Building/Installing the Mali tweaked Kernel


SD card backup or not, mount the SD Card, specifically the root partition.

I'm not sure if but the time of this writing the stock 3.4 sunxi kernel already has the correct patches for the latest Mali libraries. I've followed ssvb's work on this and found best to just stick to his github repo and his kernels:

https://github.com/ssvb/linux-sunxi

Go for the mali branches and clone the latest:

https://github.com/ssvb/linux-sunxi/tree/20140116-mali-r3p2-01rel2

Once you have it, you'll be OK to build it manually, for the ARM arch on Cubie:

cd linux-sunxi
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun7i_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5 uImage modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install

You'll obtain an output directory with firmware and modules - copy those directories to the /lib/firmware and /lib/modules dirs on the sd card, and also the uImage file (the newly compiled kernel) somewhere around arch/arm/boot....

Unmount the card, fire it up again on cubie, run uname -a and make sure it's using the ssvb's kernel.
(at this point it's up to you to shutdown and do another sd card backup or not)


Step 3, Install the Mali libraries


http://linux-sunxi.org/Binary_drivers

Set the proper permissions and work your way to install the binary drivers. From git, you get the framebuffer and also X11 binary blobs, install whichever suits your needs and your chosen sd card rootfs type (server/desktop)

Just after the git submodule update, when getting to the make install step, instead do:

# make config VERSION=r3p2-01rel1 ABI=armhf EGL_TYPE=framebuffer
# make
# make install

/* for X11 */

EGL_TYPE=x11

/* for X11 */

NOTE:

at make install:

../../../Makefile.split:4: *** missing separator (did you mean TAB instead of 8 spaces?).  Stop.

If you get an error during make/make install about an incorrectly formed Makefile.split file, follow the message, edit the Makefile.split file and replace all 8 space indentations at the beginning of the lines, with 1 tab on each line.

Once the binary drivers are installed, there's a test example which you'll build and run. Getting a coloured triangle like in the video below will confirm that the libraries are working properly:

framebuffer > http://www.youtube.com/watch?v=45ry-PXneCU#t=125

sd card backup decision time!



Step 4, Cross-Compiling Qt5


Ok, so by now Qt5 is all we're missing.

This box.com link should set you up for this step. The Qt5 stable version in there is outdated, since then I've managed to successfully build version 5.2.0 as well, but you can go further.

- Grab the latest stable version from qt-project (by the time you read this, check if newer versions are available):

http://download.qt-project.org/archive/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.tar.xz

Cross-compiling Qt5 will require some dependencies being installed to the env host, as well as the mounted sd card image.

Prepare the host:

sudo apt-get install ia32-libs (consider installing these if your host OS is x64)

update 2014-10-11:
On Ubuntu 14.04 x64 this package doesn't exist anymore, so consider doing the following steps:

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 libstdc++6:i386


Next, prepare the sd card system (these are only needed if later on you'd like to also build QtWebkit. For that, Qt must be cross-compiled with these deps installed on the embedded OS)

sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby

Create an SD card image using dd on the cross compile host (I'm using Linux Mint) - check the paths!

dd bs=1M if=/dev/mmcblk0 of=/opt/qt5.cubieboard2A20.workbench/linaro.1211.ssvb.malifb.Qt511.QtWebkit.img;sync

Mount the SD Card image, just the OS partition (exclude the boot partition)
With linux you have "parted" to find the byte offset:
parted <sdcardimage>
> unit B
> p
this will show the partitions on the SD Card image, use the starting byte for the root partition, where de system lies
In my case:
mount -o loop,offset=68157440 /opt/qt5.cubieboard2A20.workbench/linaro.1211.ssvb.malifb.Qt511.QtWebkit.img /opt/qt5.cubieboard2A20.workbench/cubie2-rootfs/

git clone git://gitorious.org/cross-compile-tools/cross-compile-tools.git

Fix the library paths between the sd card image and the compiler - this should only have to be done once

./fixQualifiedLibraryPaths /opt/qt5.cubieboard2.workbench/cubie-rootfs /opt/qt5.cubieboard2/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf-g++

Uncompress the Qt5 archive as root and copy over the mkspec files for cubieboard:

cp -R linux-cubieboard2-g++ ./qt-everywhere-opensource-src-5.1.1/qtbase/mkspecs/devices/

(these mkspecs are based on the beagleboard files, included in the Qt5 sources)


/* For framebuffer */

(from the box.com archives)
cp -R qeglfshooks_stub.cpp ./qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp


NOTE: on later Qt5 sources, the qeglfshooks_stub I have may not cut it. You may need to manually edit the file and change it, if so, do it according to this:

Modified qeglfshooks_stub.cpp for 5.2.0, only needed to modify EGLNativeWindowType QEglFSHooks::createNativeWindow like in 5.1.1:

EGLNativeWindowType QEglFSHooks::createNativeWindow(QPlatformWindow *platformWindow,
                                                    const QSize &size,
                                                    const QSurfaceFormat &format)
{
    Q_UNUSED(platformWindow);
    Q_UNUSED(size);
    Q_UNUSED(format);
    //return 0;

    static struct mali_native_window native_window = {
        .width = (short unsigned int)size.width(),
        .height = (short unsigned int)size.height(),
    };
    return &native_window;
}




/* For framebuffer */


Get ready to compile Qt5 for framebuffer (adapt the configure line paths to your own)

cd qt-everywhere-opensource-src-5.1.1

Important: Check all your paths below

./configure \
-opengl es2 \
-device linux-cubieboard2-g++ \
-device-option CROSS_COMPILE=/opt/sdcard.cubieboard.workbench/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf- \
-sysroot /opt/qt5.cubieboard2A20.workbench/cubie2-rootfs \
-opensource \
-confirm-license \
-optimized-qmake \
-release \
-make libs \
-prefix /usr/local/qt5cb2 \
-no-pch \
-nomake examples \
-nomake tests \
-no-xcb \
-eglfs \
-v

Check the config.summary file, mine is below - again this is the framebuffer version:

cat qt-everywhere-opensource-src-5.1.1/qtbase/config.summary 

   Configure summary

Building on:   linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for:  devices/linux-cubieboard2-g++ (arm, CPU features: neon)
Platform notes:

            - Also available for Linux: linux-kcc linux-icc linux-cxx
        
qmake vars .......... styles += mac fusion windows QMAKE_CFLAGS_FONTCONFIG = -I/opt/qt5.cubieboard2A20.workbench/cubie2-rootfs/usr/include/freetype2   QMAKE_LIBS_FONTCONFIG = -L/opt/qt5.cubieboard2A20.workbench/cubie2-rootfs/usr/lib/arm-linux-gnueabihf -lfontconfig -lfreetype   DEFINES += QT_NO_LIBUDEV DEFINES += QT_NO_XCB DEFINES += QT_NO_XKBCOMMON PRECOMPILED_DIR = .pch/release-shared OBJECTS_DIR = .obj/release-shared MOC_DIR = .moc/release-shared RCC_DIR = .rcc/release-shared UI_DIR = .uic/release-shared sql-drivers =  sql-plugins =  sqlite qmake switches ......... 

Build options:
  Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile egl eglfs evdev eventfd fontconfig full-config getaddrinfo getifaddrs iconv icu inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap neon nis opengl opengles2 pcre png qpa qpa reduce_exports reduce_relocations release rpath shared small-config system-freetype system-zlib v8 xlib xrender 
  Build parts ............  libs
  Mode ................... release
  Using C++11 ............ yes
  Using PCH .............. no
  Target compiler supports:
    iWMMXt/Neon .......... no/yes

Qt modules and options:
  Qt D-Bus ............... no
  Qt Concurrent .......... yes
  Qt GUI ................. yes
  Qt Widgets ............. yes
  JavaScriptCore JIT ..... yes (To be decided by JavaScriptCore)
  QML debugging .......... yes
  Use system proxies ..... no

Support enabled for:
  Accessibility .......... yes
  ALSA ................... no
  CUPS ................... no
  FontConfig ............. yes
  Iconv .................. yes
  ICU .................... yes
  Image formats: 
    GIF .................. yes (plugin, using system library)
    JPEG ................. yes (plugin, using bundled copy)
    PNG .................. yes (in QtGui, using bundled copy)
  Glib ................... no
  GStreamer .............. no
  GTK theme .............. no
  Large File ............. yes
  libudev ................ no
  Networking: 
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    OpenSSL .............. no
  NIS .................... yes
  OpenGL ................. yes (OpenGL ES 2.x)
  OpenVG ................. no
  PCRE ................... yes (bundled copy)
  pkg-config ............. yes 
  PulseAudio ............. no
  QPA backends: 
    DirectFB ............. no
    EGLFS ................ yes
    KMS .................. no
    LinuxFB .............. yes
    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
  udev ................... no
  xkbcommon .............. no
  zlib ................... yes (system library)


Important bits:

  QPA backends: 
    DirectFB ............. no
    EGLFS ................ yes
    KMS .................. no
    LinuxFB .............. yes
    XCB .................. no


(For QtWebkit, as a side note, ICU must be available as well)


make -j 5 && make install


Once Qt5 builds:

the library files will be placed in /usr/local/qt5cb2 in the sd card rootfs
the qmake binary will be placed in /usr/local/qt5cb2 on the dev host

My host took less than 1h to build everything successfully, QtWebkit as well


Step 5, Cross-Compiling Qt5 Apps


Ok, by now you should have:

- a working SD Card image, with the latest mali libraries and installed Qt5 libraries
- a Qt5 development environment on your host

Make sure the SD Card image is unmounted and burn it on a card:

# dd bs=1M if=/path/cubie.img of=<sd device>; sync

Start cubieboard and make sure it's fully functional, and then get back to the development host.

On the host, you'll need to install and configure Qt Creator. Grab it from qtproject (http://qt-project.org/downloads)

To configure it, you will need to:

- set up the GCC compiler - use the linaro gcc
- set up the qmake binary - use the qmake binary from /usr/local/qt5cb2
- mount the SD card image you have, just the root partition
- set up the device, use cubie's ssh credentials

And that's it. Create an empty project, Qt Creator will generate a blank view with "Hello World" written on it, and build/deploy it to Cubie. If needed, check path permissions on Cubie to make sure that Qt Creator can deploy the files over ssh, and you're done!

Videos below show QuitCoding' Cinematic Experience running on mali libraries (framebuffer version) - pretty decent FPS!

http://www.youtube.com/watch?v=me5mHAKS1MA
http://www.youtube.com/watch?v=qedtjOUPDAw

59 comments :

  1. Hi! I tried to install mali driver and had a problem with making mali driver:
    make config VERSION=r3p2-01rel1 ABI=armhf EGL_TYPE=framebuffer
    rm -f config.mk
    make config.mk
    make[1]: Entering directory '/home/cubie/downloads/sunxi-mali'
    make -f Makefile.config
    make[2]: Entering directory '/home/cubie/downloads/sunxi-mali'
    ABI="armhf" (Provided)
    VERSION="r3p2-01rel1" (Provided)
    EGL_TYPE="framebuffer" (Provided)
    Makefile.config:96: *** Missing library dependencies: libUMP.so.3. Stop.

    Please help me with good advice.

    ReplyDelete
  2. Hi,

    It seems it's like the message says, you're missing libUMP.so.3

    make sure you've installed the libraries according to this sunxi wiki:

    http://linux-sunxi.org/Mali_binary_driver#Installing_the_UMP_.28Unified_Memory_Provider.29_userspace_library

    ReplyDelete
  3. Hey Wick, please help-me. I installed the Mali libraries, but how can I compile the test.c in the cubieboard? I don't have a gcc in this linaro in my cubieboard2.

    how can i install the gcc on the linaro in my cubieboard2?

    ReplyDelete
  4. Hi, depending on the distro you're using, you should be able to install gcc.
    On debian based distros like Cubian > sudo apt-get install build-essential

    ReplyDelete
  5. Wick, Thanks but I can't use eth0 with this linaro rootfs, they simple just not work. You have any problems with eth0, linaro and cubie?

    ReplyDelete
  6. Hello, nice work! I have to build a qt, QML project on a OLinuXino board (A20). Can this guide be suitable for me? Thx!!

    ReplyDelete
  7. Hi,

    Yes I believe so, given that it's an A20 as well. If you're using a debian based OS it would be easier to install dependencies, as for the kernel, I think you might even go for ssvb's sunxi kernel with mali-r3p2-01rel2 support, as well as the corresponding mali libs themselves (but on a first attempt, maybe just stick with a regular kernel with mali support and mali r3p0...)

    Just follow the guide and as you go along, report back and I'll see if I can help!

    ReplyDelete
    Replies
    1. Thank you for the answer! Ye i think i'll use Ubuntu 12.10 that is supported by the BSP guide. in some days i'll start testing this great article because now i have not the board yet. I'll be back here if i need some help!
      Thank you again!!

      Delete
  8. I'm Stuck on step number 4, every time I tryed to compile de Qt I have this error:

    qeglfshooks_stub.cpp:43:60: fatal error: QtPlatformSupport/private/qeglplatformcursor_p.h: No such file or directory.

    Anny ideas to fix?

    ReplyDelete
  9. Hi,

    Can you specify please:

    - which Qt version you're trying to build (and if it's from git or some downloaded archive)
    - which screen version (X11/FB)

    I checked my builds here and that file seems to exist mainly on Qt 5.3.x, can you also check if the file exists but isn't readable, for example?

    ReplyDelete
    Replies
    1. Thanks WIck. The versions 5.2.x and 5.1.x doesn't have this files. I builded the version 5.3.2 and everything was ok. I will test them now on the Cubie. :)

      I'm using Cubieboard 1 and FB version.

      Delete
  10. Wick, I'm here one more time.

    When I try to run my application on Cubie I got this erro:

    This application failed to start because it could not find or load the Qt platform plugin "xcb"

    Avaliables plataforms are: eglfs, linuxfb, minimal, minimalegl, offscreen

    What should I do?

    Thanks for your suport again

    ReplyDelete
    Replies
    1. update:

      I try with ./Qt5_CinematicExperience -platform eglfs so I got:

      Could not initialize egl display

      With -platform linuxfb don't show anything

      Delete
  11. Hi,

    Since you're on framebuffer, make sure you've installed mali binaries with EGL_TYPE=framebuffer and not x11, confirm that running the test.c example from mali on the command line, with framebuffer, gives you the triangle.

    The error you got regarding XCB (X protocol C-language Binding) is indicative of some mis-configuration in your setup, Qt is trying to use X11 bindings which won't work since you're on framebuffer - quite possibly you've installed the X11 mali libraries instead of the framebuffer ones.

    The second error may be resulting from the first, as you don't have eglfs properly set up.

    ReplyDelete
  12. When I run the test.c I got the triangle on the screen normally. Strange... :(

    I installed the Mali with EGL_TYPE=framebuffer .... =/


    Should I install the Mali again for test?

    ReplyDelete
  13. If you get the triangle properly displayed on framebuffer then the mali libraries are OK - perhaps now move towards the configure line you're using and making sure it has the correct parameters for framebuffer.

    Since the configure I'm using which is on the post uses -no-xcb specifically, it's strange that your system tries to use xcb for whatever it is doing - please post the QPA backends block section from your config.summary file, after running configure on Qt5 for your system

    ReplyDelete
  14. Here:

    root@rafael-linux:/home/rafael/qt-everywhere-opensource-src-5.3.2# cat qtbase/config.summary

    Configure summary

    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: devices/linux-cubieboard2-g++ (arm, CPU features: neon)
    Platform notes:

    - Also available for Linux: linux-kcc linux-icc linux-cxx

    qmake vars .......... styles += mac fusion windows DEFINES += QT_NO_MTDEV DEFINES += QT_NO_LIBUDEV sql-drivers = sql-plugins = qmake switches .........

    Build options:
    Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile egl eglfs evdev eventfd freetype full-config getaddrinfo getifaddrs iconv inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap nis no-harfbuzz opengl opengles2 pcre png posix_fallocate qpa qpa reduce_exports release rpath shared small-config zlib
    Build parts ............ libs
    Mode ................... release
    Using C++11 ............ yes
    Using PCH .............. no
    Target compiler supports:
    iWMMXt/Neon .......... no/auto

    Qt modules and options:
    Qt D-Bus ............... no
    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
    GTK theme .............. no
    HarfBuzz ............... no
    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)
    journald ............... no
    mtdev .................. no
    Networking:
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    OpenSSL .............. no
    NIS .................... yes
    OpenGL / OpenVG:
    EGL .................. yes
    OpenGL ............... yes (OpenGL ES 2.x)
    OpenVG ............... no
    PCRE ................... yes (bundled copy)
    pkg-config ............. yes
    PulseAudio ............. no
    QPA backends:
    DirectFB ............. no
    EGLFS ................ yes
    KMS .................. no
    LinuxFB .............. yes
    XCB .................. no
    Session management ..... yes
    SQL drivers:
    DB2 .................. no
    InterBase ............ no
    MySQL ................ no
    OCI .................. no
    ODBC ................. no
    PostgreSQL ........... no
    SQLite 2 ............. no
    SQLite ............... no
    TDS .................. no
    udev ................... no
    xkbcommon .............. no
    zlib ................... yes (bundled copy)

    NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1.
    Configure with '-qreal float' to create a build that is binary compatible with 5.1.

    ReplyDelete
  15. Seems to be fine there too - and it is correct, you should initialize the app with ./Qt5_CinematicExperience -platform eglfs

    Are you running the app using a usb keyboard directly on cubie or using Qt Creator to remotely compile and deploy the example?

    ReplyDelete
  16. I compiled with the Qt Creator, put the files on the sd card, then I used a usb keyboard directly on cubie...

    ReplyDelete
  17. Hi man! i have some problems with ./configure while compiling QT5
    I'm using QT 5.3.2, as toolchain i have gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux, i mounted the rootfs of my SD on /mnt/a20/ .
    Then i run this command
    ./configure \
    -opengl es2 \
    -device linux-a20olimex-g++ \
    -device-option CROSS_COMPILE=/home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- \
    -sysroot /mnt/a20\
    -opensource \
    -confirm-license \
    -optimized-qmake \
    -release \
    -make libs \
    -prefix /usr/local/qt5olim2 \
    -no-pch \
    -nomake examples \
    -nomake tests \
    -no-xcb \
    -eglfs \
    -v
    Obviously i changed all paths in the qmake file:
    #
    # qmake configuration for the BeagleBoard and BeagleBoard xM boards
    # http://beagleboard.org/

    MAKEFILE_GENERATOR = UNIX
    CONFIG += incremental gdb_dwarf_index
    QMAKE_INCREMENTAL_STYLE = sublib

    include(../../common/linux.conf)
    include(../../common/gcc-base-unix.conf)
    include(../../common/g++-unix.conf)

    load(device_config)

    #QT_QPA_DEFAULT_PLATFORM = eglfs

    # modifications to g++.conf
    QMAKE_CC = $${CROSS_COMPILE}gcc
    QMAKE_CXX = $${CROSS_COMPILE}g++
    QMAKE_LINK = $${QMAKE_CXX}
    QMAKE_LINK_SHLIB = $${QMAKE_CXX}

    # modifications to linux.conf
    QMAKE_AR = $${CROSS_COMPILE}ar cqs
    QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
    QMAKE_NM = $${CROSS_COMPILE}nm -P
    QMAKE_STRIP = $${CROSS_COMPILE}strip

    COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard

    #modifications to gcc-base.conf
    QMAKE_CFLAGS += $${COMPILER_FLAGS}
    QMAKE_CXXFLAGS += $${COMPILER_FLAGS}
    QMAKE_CXXFLAGS_RELEASE += -O3

    QMAKE_LIBS += -lrt -lpthread -ldl

    # Extra stuff (OpenGL, DirectFB, ...)
    QMAKE_INCDIR_EGL = /mnt/a20/usr/include/EGL
    QMAKE_LIBDIR_EGL = /mnt/a20/usr/lib
    QMAKE_INCDIR_OPENGL_ES2 = /mnt/a20/usr/include/GLES2
    QMAKE_LIBDIR_OPENGL_ES2 = /mnt/a20/usr/lib
    #QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL}
    #QMAKE_LIBDIR_OPENVG = $${QMAKE_LIBDIR_EGL}

    QMAKE_LIBS_EGL = -lEGL
    QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 $${QMAKE_LIBS_EGL}
    #QMAKE_LIBS_OPENVG = -lOpenVG $${QMAKE_LIBS_EGL}

    # Sanity check
    deviceSanityCheckCompiler()

    load(qt_config)

    ReplyDelete
  18. Hi, and the error message is?

    ReplyDelete
  19. Running configuration tests...
    Note: PKG_CONFIG_LIBDIR automatically set to /mnt/a20/usr/lib/pkgconfig:/mnt/a20/usr/share/pkgconfig:/mnt/a20/usr/lib/arm-linux-gnueabihf/pkgconfig
    Note: PKG_CONFIG_SYSROOT_DIR automatically set to /mnt/a20
    Determining architecture... ()
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard --sysroot=/mnt/a20 -g -Wall -W -fPIE -I../../mkspecs/devices/linux-a20olimex-g++ -I. -o arch.o arch.cpp
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -o arch arch.o -lrt -lpthread -ldl --sysroot=/mnt/a20
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17'
    collect2: error: ld returned 1 exit status
    make: *** [arch] Errore 1
    Unable to determine architecture!

    Could not determine the target architecture!
    Turn on verbose messaging (-v) to see the final report.
    Determining architecture... ()
    g++ -c -pipe -g -Wall -W -fPIE -I../../mkspecs/linux-g++ -I. -o arch.o arch.cpp
    g++ -o arch arch.o
    Found architecture in binary
    CFG_HOST_ARCH="x86_64"
    CFG_HOST_CPUFEATURES=" mmx sse sse2"
    System architecture: 'unknown'
    Host architecture: 'x86_64'
    C++11 auto-detection... ()
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard --sysroot=/mnt/a20 -O2 -O3 -std=c++0x -Wall -W -fPIE -I../../../mkspecs/devices/linux-a20olimex-g++ -I. -o c++11.o c++11.cpp
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -Wl,-O1 -o c++11 c++11.o -lrt -lpthread -ldl --sysroot=/mnt/a20
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17'
    collect2: error: ld returned 1 exit status
    make: *** [c++11] Errore 1
    C++11 disabled.
    floatmath auto-detection... ()
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard --sysroot=/mnt/a20 -O2 -O3 -Wall -W -fPIE -I../../../mkspecs/devices/linux-a20olimex-g++ -I. -o floatmath.o floatmath.cpp
    floatmath.cpp:44:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
    int main(int argc, char **argv)
    ^

    ReplyDelete
  20. and a bunch of other errors..
    The end is this:
    compilation terminated.
    make: *** [pulseaudio.o] Errore 1
    PulseAudio disabled.
    OpenGL ES 2.x auto-detection... ()
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard --sysroot=/mnt/a20 -O2 -O3 -Wall -W -fPIE -I../../../mkspecs/devices/linux-a20olimex-g++ -I. -I/mnt/a20/usr/include/GLES2 -o opengles2.o opengles2.cpp
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -Wl,-O1 -o opengles2 opengles2.o -lrt -lpthread -ldl --sysroot=/mnt/a20 -L/mnt/a20/usr/lib -lGLESv2 -lEGL
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17'
    collect2: error: ld returned 1 exit status
    make: *** [opengles2] Errore 1
    OpenGL ES 2.x disabled.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/devices/linux-a20olimex-g++.

    Also if my paths are all right i think

    ReplyDelete
  21. If can helps, on my sd i have a Debian destribution by Olimex (coz i have an olinuxino board) with ssvb kernel for mali libraries. Mali installed with no problems and working

    ReplyDelete
  22. There are also many fatal errors:
    arch.cpp:45:19: fatal error: stdio.h: File o directory non esistente
    ...
    floatmath.cpp:42:18: fatal error: math.h: File o directory non esistente
    ...
    zlib.cpp:42:18: fatal error: zlib.h: File o directory non esistente
    ..
    libjpeg.cpp:42:23: fatal error: sys/types.h: File o directory non esistente

    and so on..

    ReplyDelete
    Replies
    1. Have you tried reverting back to the gcc 4.8 linaro toolchain I used in my builds?

      http://releases.linaro.org/13.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux.tar.bz2

      Delete
    2. Hi, ye i thought the same thing and i tryed just after i wrote to you here..Same result...i noticed that on the output it speaks about:
      libudev disabled
      XLib disabled
      Xrender disabled
      and other things. After a short search i figured out that those things are all related to QT dependencies.. then i found this discussion on olimex forum:
      https://www.olimex.com/forum/index.php?topic=2666.15
      In the section "prepare target" it lists a large number of dependencies to install on the SD card. Can be that the problem? Following Your guid i've only installed these "sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby"

      Delete
    3. Hi,

      Although the boards share the same SoC, the official distros don't exactly follow. There may be specific packages and/or configurations which aren't included in your Olimex distro, so my suggestion would be to value the olimex specific steps for sdcard preparation.

      The libs you've already installed are meant to enable QtWebkit support, not having them installed should not break configure, simply not acknowledge QtWebkit support as an additional module.

      Delete
    4. Thank for your reply!! Asap i'll give it a try!!
      Thank you again!! I'll make you know the result with the new sdcard!

      Delete
  23. Wick, finally I finished the process with success! :D thx for all help. Can I translate your tutorial and make some of changes for Portuguese?

    One question:

    How I can increase my fps like you did with the x11 version? You said in your video about change a script.bin file to increase the numbers of framebuffers. How can I do this?

    ReplyDelete
  24. Hi, sure go ahead and translate - for X11 FPS increase, you'll have to use ssvb's https://github.com/ssvb/xf86-video-fbturbo > branch mali-r3p2-support and adjust the fex file, the fb0_framebuffer_num parameter to 4, I think...

    ReplyDelete
  25. Hi! Im here again with my Olinuxino!
    I finally did with the configure command (libraries were the key and a parameter into the qmake file "QMAKE_LIBS_EGL= -lEGL -lGLESv2")

    But now i have some problems (again...) with the make command:

    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf-g++ --sysroot=/mnt/a20 -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,/usr/local/qt5olim2/lib -shared -o libqnmbearer.so .obj/main.o .obj/qnmdbushelper.o .obj/qnetworkmanagerservice.o .obj/qnetworkmanagerengine.o .obj/qnetworksession_impl.o .obj/moc_qnmdbushelper.o .obj/moc_qnetworkmanagerservice.o .obj/moc_qnetworkmanagerengine.o .obj/moc_qnetworksession_impl.o .obj/moc_qbearerengine_impl.o -L/home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.2.1/qtbase/lib -lQt5DBus -lQt5Network -lQt5Core -lrt -ldl -lpthread
    mv -f libqnmbearer.so ../../../../plugins/bearer/
    make[5]: uscita dalla directory "/home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/bearer/networkmanager"
    make[4]: uscita dalla directory "/home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/bearer"
    rm -f libqsqlite.so
    /home/claudio/TirocinioSort/Toolchain/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf-g++ --sysroot=/mnt/a20 -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,/usr/local/qt5olim2/lib -shared -o libqsqlite.so .obj/smain.o .obj/qsql_sqlite.o .obj/sqlite3.o .obj/moc_qsql_sqlite_p.o -L/home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.2.1/qtbase/lib -lQt5Sql -lQt5Core -lrt -ldl -lpthread
    mv -f libqsqlite.so ../../../../plugins/sqldrivers/
    make[5]: uscita dalla directory "/home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/sqlite"
    make[4]: uscita dalla directory "/home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers"
    make[3]: uscita dalla directory "/home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins"
    make[2]: *** [sub-plugins-make_first] Errore 2
    make[2]: uscita dalla directory "/home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.2.1/qtbase/src"
    make[1]: *** [sub-src-make_first] Errore 2
    make[1]: uscita dalla directory "/home/claudio/TirocinioSort/QTSource/qt-everywhere-opensource-src-5.2.1/qtbase"
    make: *** [module-qtbase-make_first] Errore 2

    I've also tryed to swap from QT 5.3.1 to 5.2.1 but nothing changed.

    Any suggestions? Thank you for your help!!

    ReplyDelete
    Replies
    1. Hi claudio,
      You wrote "I finally did with the configure command (libraries were the key and a parameter into the qmake file "QMAKE_LIBS_EGL= -lEGL -lGLESv2")" Can You tell a little bit more?

      I have almost the same errors with my banana pi. I think that this is problem with rootfs, because there are not stdio.h, EGL, EGLS etc, am i right?
      Headers like stdio.h i probably should copyt from toolchain to rootfs but what with EGL and EGLS? From where i can take this includes and libraries?

      Delete
    2. try this cutted rootfs, i have build with it successfuly https://dl.dropboxusercontent.com/u/10252748/device.zip

      Delete
    3. Hi, thanks for your rootfs, with it i was able to configure QT, but have error on compilation:
      /home/LINUX/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.8.2/../../../../arm-linux-gnueabihf/bin/ld: /opt/qt5.bananian.workbench/bananian/usr/lib/arm-linux-gnueabihf/libz.a(compress.o): relocation R_ARM_THM_MOVW_ABS_NC against `__stack_chk_guard' can not be used when making a shared object; recompile with -fPIC
      /opt/qt5.bananian.workbench/bananian/usr/lib/arm-linux-gnueabihf/libz.a: could not read symbols: Bad value
      collect2: error: ld returned 1 exit status
      make[3]: *** [../../lib/libQt5Core.so.5.2.1] BÅ‚Ä…d 1
      make[3]: Opuszczenie katalogu `/home/LINUX/qt-everywhere-opensource-src-5.2.1/qtbase/src/corelib'
      make[2]: *** [sub-corelib-make_first] BÅ‚Ä…d 2
      make[2]: Opuszczenie katalogu `/home/LINUX/qt-everywhere-opensource-src-5.2.1/qtbase/src'
      make[1]: *** [sub-src-make_first] BÅ‚Ä…d 2
      make[1]: Opuszczenie katalogu `/home/LINUX/qt-everywhere-opensource-src-5.2.1/qtbase'
      make: *** [module-qtbase-make_first] BÅ‚Ä…d 2

      In my config.summary there is :
      zlib ................... yes (system library)

      Any advice?

      Delete
    4. I dont know, maybe different vesion of compiler? try this gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux

      My configure was
      #linux64 shared lib

      ./configure \
      -opengl es2 \
      -device linux-a20olimex-g++ \
      -device-option CROSS_COMPILE=/opt/qt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf- \
      -sysroot /opt/qt/qt5.3_ARM_sharedLibs_linux_x64/device \
      -opensource \
      -confirm-license \
      -optimized-qmake \
      -release \
      -make libs \
      -prefix /opt/qt/qt5.3_ARM_sharedLibs_linux_x64/host \
      -no-pch \
      -nomake examples \
      -nomake tests \
      -no-xcb \
      -skip webkit \
      -no-icu \
      -no-openssl \
      -fontconfig \
      -eglfs \
      -v

      Delete
    5. Hi, i solve this, aftere copying files from your rootfs to mine, i forgot to rerun fixQualifiedLibraryPaths. Runing it solves the problem. Thanks!

      Delete
  26. Hello Wick,
    First of all , thank you for making this manual, it is really helpful.
    My problem is I can not find this image file : /opt/qt5.cubieboard2A20.workbench/linaro.1211.ssvb.malifb.Qt511.QtWebkit.img
    I found a download url on cubie forum , but it is not provided anymore.
    Could you please create another valid one ?

    Thank you for help~

    Nan Jiao

    ReplyDelete
  27. Hi Nan,

    That image is deprecated, on its own wouldn't work as it needed the matching Qt binaries (qmake, etc) from the cross compile process, to be run on the build host. At the time, as I built it on a specific Ubuntu x64 system, it would mostly only work properly on a replica of it - dependencies installed and all. So I decided that for a full cross-compile environment, it would be more reliable to distribute the whole VM - and moved on to Qt5Box.

    If you're not into building Qt5 and dealing with all that jazz and just want to develop using it, then Qt5Box is a safer bet - apart from the longer download times.

    If you're into building your own setup, then this guide should help - and you should be able to adapt it to either your host system and your embedded system.

    ReplyDelete
  28. Hi Wick,
    Thanks for you reply.
    I am going to cross compile qt5 and put it to a cubieboard,
    I can also cross compile the qt5 with buildroot201402. The problem is when I launch the hello_egl , it is telling me something like eglfs error. By searching the error with google , I found your manual and the mentioned image. And also the qmake.conf inside patches is including the path which is mounted from the image. So that I thought it is very important for cross compiling qt5.

    Can I ask you something which confused me long time?
    If I configured the mali driver with framebuffer(no X11) and put the egl libs to the file system, how many layers is data going through when launching ./test ? Is it like this :
    ./qttest -> eglfs hooks-> egl libs(provided by sunxi-mali) -> sunxi-mali 400 driver -> goes to GPU. Is it necessary to put x11 , directfb, wayland for managing the events of above ?

    Sorry for disturbing you during vacation.

    Nan Jiao

    ReplyDelete
  29. Hi, using FB there are no x11, directfb, wayland components - as far as I know, it is direct from test > sunxi-mali libs > gpu

    ReplyDelete
    Replies
    1. Hi, ok, I will try again with your manual.
      Thank you.

      Delete
  30. Hello,

    I am a newbie on cross compiling and trying to compile Qt for my development board. My development board is Olimex A10Lime, it has ARM Cortex-a8 processor and using official images distributed from Olimex. I have just dd on SD card that image and it is perfectly booting and working.

    Those are my target's image specs;

    Linux a10Lime 3.4.90+ #3 PREEMPT Tue Jun 10 09:17:04 EEST 2014 armv7l GNU/Linux
    ldd (Debian EGLIBC 2.13-38+deb7u8) 2.13
    gcc (Debian 4.7.2-5) 4.7.2
    GNU ld (GNU Binutils for Debian) 2.22

    And on my host machine, I am using VBox to virtualize;

    Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u2 (2015-07-17) x86_64 GNU/Linux
    ldd (Debian GLIBC 2.19-18) 2.19
    gcc (Debian 4.9.2-10) 4.9.2
    GNU ld (GNU Binutils for Debian) 2.25

    and using gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf as toolchain

    Actually I would like to develop some Qt project on my host machine to run on my target machine in the future.

    So right now I am buiilding Qt from source. I've add my device to '/qt-everywhere-opensource-src-5.5.0/qtbase/mkspecs/devices/' and fixed my symlinks with cross compiler tools (

    fixQualifiedLibraryPaths).

    The problem show up when i start to run ./configure file (with parameters). It actually build qmake perfectly. But after it just start to 'Determining architecture... ()' everything starts to go wrong and it gives error like,

    /mnt/lime-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: undefined reference to `__clock_getcpuclockid@GLIBC_PRIVATE'

    or like,

    libjpeg.cpp:37:21: fatal error: jpeglib.h: No such file or directory


    (since there is so many error messages like that i would not to spam.. I guess those are enough to find out what is going worng :S)


    By the way, /mnt/lime-rootfs is where i am mounting my GNU/Linux image.

    At this point my question is, is this problem rises because of some missing dependencies? if it is yes, is there any list of dependencies and minimum version required for those? or any other suggestions for my case?


    Thanks for your helps,
    Sina

    ReplyDelete
  31. Hi,

    - try lowering your GCC release from Linaro. The librt.so library in the Debian olimex image isn't in synch with the Linaro GCC release you're using, so I'd suggest you do the following: check when was the olimex image generated/created and try using a Linaro GCC release from around that time, for armhf.

    - libjpeg.cpp:37:21: fatal error: jpeglib.h: No such file or directory < indeed some development headers seem to be missing, unfortunately you'll have to hunt those down as it is something directly related to the Olimex image you're using and the pre-installed/repository packages available for it.

    ReplyDelete
    Replies
    1. Hi Wick,

      Thank you so much for your quick and precise reply.

      - I'll follow your suggestions about lowering my crosstoolchain version and I'll post for the results.

      - Yeah I was actually aware of that I need to hunt those down, but I just want to be sure before if there is not any easier way.

      Thanks a lot again,
      Sina

      Delete
  32. Although cubieboard, olinuxino lime and others share the same SoC, unfortunately the Linux distributions that are made available aren't all the same, not even the kernel versions/build options, which means every set-up seems to have its own particular quirks... That was what I was trying to accomplish with Qt5Box, still working on it...!

    ReplyDelete
  33. This comment has been removed by the author.

    ReplyDelete
  34. It just worked Wick! Thanks for your helps!

    I had tried to lower my crosstoolchain but it didnt worked (because official olimex images have EGLIBC 2.13 which released at 2011! So there was no any toolchain which support C++11 while that has glibc <= 2.13) So i have just upgraded my target EGLIBC to 2.19 but i am not sure if it is a great idea..

    But for now I am cross compiling shared libs for my target, but because of the all symlinks are absolute path, it just fails(because i have mounted) so i am changing those to relative path when it fails..

    Btw, would it be a problem if i "make -j 5" after it fails without make clean or something else?

    Also I didn't know that Qt5Box project, and i have just looked, its great to know it, ill keep follow you to see it, good luck with your effort.

    Thanks for your help,
    Sina

    ReplyDelete
  35. Hello again,

    After some more tries, I found out that upgrading my EGLIBC was not a great idea. So I have back to my default setup with EGLIBC 2.13 and GCC 4.6.

    So at that point I am not able to upgrade it to jessie also. So I guess I won't be able to have C++11 support since it just starts with gcc-4.7.

    Would it be a problem for Qt if I cross compile Qt5.5 with gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux which has EGLIBC 2.13 and GCC 4.6 which completely same versions with my target OS.

    Thanks for your help,
    Sina

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. Hi Wick! Thank you very much for this tutorial!

    I have successfully built qt5.3 in linux with your cubie2fb.img mounted in /mnt/a20 with this:

    #linux shared

    ./configure \
    -opengl es2 \
    -device linux-a20olimex-g++ \
    -device-option CROSS_COMPILE=/home/aneox/compilers/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf- \
    -sysroot /mnt/a20/ \
    -opensource \
    -confirm-license \
    -optimized-qmake \
    -release \
    -make libs \
    -prefix /home/aneox/qt/qt5.3_cubie \
    -no-pch \
    -nomake examples \
    -nomake tests \
    -no-xcb \
    -skip webkit \
    -no-icu \
    -no-openssl \
    -fontconfig \
    -eglfs \
    -v

    but i need to build it for osx also. Because of osx not support ext linux fs, i have just rsync all rootfs from img to simple folder with same name /mnt/a20,
    find linaro arm-linux toolschain for osx and tried:

    ./configure \
    -opengl es2 \
    -device linux-a20olimex-g++ \
    -device-option CROSS_COMPILE=/usr/local/linaro/arm-linux-gnueabihf/bin/arm-linux-gnueabihf- \
    -sysroot /mnt/a20/ \
    -opensource \
    -confirm-license \
    -optimized-qmake \
    -release \
    -make libs \
    -prefix /Users/AneoX/compilers/qt5.3_cubie \
    -no-pch \
    -nomake examples \
    -nomake tests \
    -no-xcb \
    -skip webkit \
    -no-icu \
    -no-openssl \
    -fontconfig \
    -eglfs \
    -v

    but configure stops at:
    OpenGL ES 2.x auto-detection... ()
    /usr/local/linaro/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mtune=cortex-a7 -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=/mnt/a20/ -O2 -O3 -Wall -W -fPIE -I../../../mkspecs/devices/linux-a20olimex-g++ -I. -I/mnt/a20/usr/include/GLES2 -o opengles2.o opengles2.cpp
    /usr/local/linaro/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-O1 -o opengles2 opengles2.o -lrt -lpthread -ldl --sysroot=/mnt/a20/ -L/mnt/a20/usr/lib -lGLESv2 -lEGL
    /usr/local/linaro/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.1/../../../../arm-linux-gnueabihf/bin/ld: warning: libUMP.so.3, needed by /mnt/a20//usr/lib/libMali.so, not found (try using -rpath or -rpath-link)
    /mnt/a20/usr/lib/libEGL.so: undefined reference to `ump_close'
    /mnt/a20/usr/lib/libEGL.so: undefined reference to `ump_mapped_pointer_get'
    /mnt/a20/usr/lib/libEGL.so: undefined reference to `ump_secure_id_get'
    /mnt/a20/usr/lib/libEGL.so: undefined reference to `ump_mapped_pointer_release'
    /mnt/a20//usr/lib/libMali.so: undefined reference to `ump_reference_add'
    /usr/local/linaro/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.1/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17'
    /mnt/a20/usr/lib/libEGL.so: undefined reference to `ump_handle_create_from_secure_id'
    /mnt/a20//usr/lib/libMali.so: undefined reference to `ump_size_get'
    /mnt/a20/usr/lib/libEGL.so: undefined reference to `ump_reference_release'
    /mnt/a20/usr/lib/libEGL.so: undefined reference to `ump_open'
    collect2: error: ld returned 1 exit status
    make: *** [opengles2] Error 1
    OpenGL ES 2.x disabled.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /Users/AneoX/Downloads/qt-everywhere-opensource-src-5.3.0_mac/qtbase/mkspecs/devices/.....

    please help me

    ReplyDelete
  38. fixed paths and now stops like that:
    OpenGL ES 2.x auto-detection... ()
    /usr/local/linaro/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mtune=cortex-a7 -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=/mnt/a20 -O2 -O3 -Wall -W -fPIE -I../../../mkspecs/devices/linux-a20olimex-g++ -I. -I/mnt/a20/usr/include/GLES2 -o opengles2.o opengles2.cpp
    opengles2.cpp: In function ‘int main(int, char**)’:
    opengles2.cpp:50:31: error: ‘GLfloat’ was not declared in this scope
    glUniform1f(1, GLfloat(1.0));
    ^
    opengles2.cpp:50:32: error: ‘glUniform1f’ was not declared in this scope
    glUniform1f(1, GLfloat(1.0));
    ^
    opengles2.cpp:51:13: error: ‘GL_COLOR_BUFFER_BIT’ was not declared in this scope
    glClear(GL_COLOR_BUFFER_BIT);
    ^
    opengles2.cpp:51:32: error: ‘glClear’ was not declared in this scope
    glClear(GL_COLOR_BUFFER_BIT);
    ^
    make: *** [opengles2.o] Error 1
    OpenGL ES 2.x disabled.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in


    tried with linaro 2012 and 2014 toolchains

    ReplyDelete
  39. Hello,
    Thanks for great tutorial. I've compiled and prepared SD card with qt support but now i have few problems
    1. Iset up my qt creator (checked on 3.0.1 and 3.1.0 versions) but when i try to run app remotely or just press test in options i get error:
    error: Could not connect to host: SSH Protocol error: Server and client capabilities don't match. Client list was: aes128-cbc,3des-cbc.
    Server list was chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr.
    Is the device connected and set up for network access?
    2. And the second problem. I copy builded app to my board and when i am runing it i am getting:
    UMP: ump_arch_open() failed to open UMP device driver
    Could not initialize egl display

    EGL error


    Aplication is very simple (qt widget app)
    #include "mainwindow.h"
    #include

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
    }

    ReplyDelete
    Replies
    1. Hi, for ssh check out this thread https://www.google.pt/url?sa=t&source=web&rct=j&url=https://forum.qt.io/topic/49343/solved-error-while-connecting-qt-cretaor-to-raspberry-pi&ved=0CB0QFjABahUKEwjZmZOz9dbHAhWKbRQKHRaxCnc&usg=AFQjCNGjd6KxbagrjdJfw2-E3La5U-bEyw&sig2=_NsErq2btzSRoUrmo8mVRA

      For the error on libUMP, try running the app as root - if it works, give permissions for the ump device to the user you were using before, to run the app.

      Delete
    2. Hi, for ssh check out this thread https://www.google.pt/url?sa=t&source=web&rct=j&url=https://forum.qt.io/topic/49343/solved-error-while-connecting-qt-cretaor-to-raspberry-pi&ved=0CB0QFjABahUKEwjZmZOz9dbHAhWKbRQKHRaxCnc&usg=AFQjCNGjd6KxbagrjdJfw2-E3La5U-bEyw&sig2=_NsErq2btzSRoUrmo8mVRA

      For the error on libUMP, try running the app as root - if it works, give permissions for the ump device to the user you were using before, to run the app.

      Delete
  40. Hi.
    I've installed the sunxi-mali as the mentioned instruction.
    The problem is when i run the test program, the following error happens:
    Error: eglInitialise failed!
    I used the x11 not the framebuffer.
    The Display also sets for LCD.
    Any Suggestion?

    ReplyDelete
  41. hello

    Would you please send me download link for Qt5Box image. I need Qt5 on cubieboard 01. I tried to cross compile it according to your post http://wickwire2099.blogspot.com/2014/02/qt5-on-cubieboard-a10a20.html.
    and
    https://wiki.debian.org/crossToolChains#For_jessie-.28Debian_8.29

    but on debian 8 (jessie) using this command: sudo apt-get install crossbuild-essential-armhf
    I received this error:

    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    The following packages have unmet dependencies:
    crossbuild-essential-armhf : Depends: libc6-dev:armhf but it is not installable
    Depends: gcc-arm-linux-gnueabihf (>= 4.9.1-1) but it is not going to be installed
    Depends: g++-arm-linux-gnueabihf (>= 4.9.1-1) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.

    I will appreciate your help with this situation.
    thank you.
    shahnaz sehati
    shahnazsehati@gmail.com

    ReplyDelete
  42. Well-ordered directions to Solve QT-MySQL Connection Issue through Cognegic's MySQL Backup Database
    At whatever point customers attempting to connect with a MySQL database on neighborhood have through QT then they have to stand up to a type of particular affiliation issue and on account of this reason they are not prepared to comprehend work with their MySQL. In any case, with Cognegic's MySQL Remote Support or MySQL Remote Service you can without a doubt diminish your downtime, settle security and successfully propel the execution of your MySQL. So quickly contact to our MySQL Server 5.0 Support and handle your issues.
    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    ReplyDelete
  43. An impressive share! I have just forwarded this onto a co-worker who has been doing a little research on this. And he actually bought me dinner because I found it for him... lol. So let me reword this.... Thanks for the meal!! But yeah, thanks for spending some time to discuss this subject here on your blog.

    ReplyDelete