Building QT5 for i.MX53

Showing results for 
Show  only  | Search instead for 
Did you mean: 

Building QT5 for i.MX53

Building QT5 for i.MX53


The build is verified on prebuilt rootfs(based on LTIB) which can be downloaded from or built from Yocto fsl-image-gui

These steps are performed on the host:

1. Download the git respository for qt5:

$ git clone git:// qt5

    cd qt5
    Let us consider this as <QTDir>

2. Create a build directory to install for the qt5 packages. This directory can be  in any loctation. For example, 
$ mkdir /opt/qt5

sudo chown -R <username> /opt/qt5

Let us consider the the installdir as /opt/qt5

3. Enter the Qt5 directory and run the perl init-repository script to download all the source code for
   Qt5. To download all the source code will take about an hour.
$ perl init-repository

4. Download the attached linux-imx5-g++.tar.gz and copy to  qtbase/mkspecs/devices.
Will try to get updstreamed.

5. From the following path

$ gedit qtbase/mkspecs/devices/linux-imx5-g++/qmake.conf

6. At the top of the qmake.conf, there is a configure line. Copy and paste the configure line into a text file located
   in your build build directory. Edit the configure line to find your toolchain and filesystem. Also make sure to
   include the options -no-pch, -no-opengl, -opengl es2, Here is an example of
   a configure line.

    $ cd <QTDir>
    $ cd qtbase
    $  ./configure -v -opensource -confirm-license -no-pch -opengl es2 -make libs -device imx5 \
    -nomake examples -nomake demos \
-device-option CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi- \
-sysroot <rootfs> -no-gcc-sysroot \
-prefix <installdir>

7. Make the textfile that has the configure line and executable and run it. When the configure summary is shown make sure the Qt5
   has openGL ES 2.0 support. Do build  
    $make install

   When Qt5 has finished building, Qt5 will be installed in two places:
           1. <location of rootfs>/<installdir>
           2. <HOST Machine>/<install dir>

This is good because now all the libraries and binaries for Qt5 are installed on the host and the target filesystem. Therefore,
the target already has all the libraries and  binaries needed to run Qt5.

8. Also need to build qtjsbackend and qtdeclarative.

    $ cd <location to Qt5 git>
    $ cd qtjsbackend
    $ ../qtbase/bin/qmake -r
    $ make && make install

    $ $ cd <location to Qt5 git>
    $ cd qtdeclarative
    $ ../qtbase/bin/qmake -r
    $ make && make install

9. Run Qt apps on target
    - Boot the target either with NFS or SD Image
    - Ensure that folder <installdir> is copied on target file system at “/usr/local”.
    - Launch application using
    $ cd /usr/local/qt5/examples/opengl/hellogl_es2
    $ ./hellogl_es2 -platform eglfs

Labels (1)

Have you considered contributing the files back to the qt-project? I am aware that these do work with Qt 5 so it would be good if they could be contributed back :smileyhappy:

why don't you use litb to build qt5?

i am sorry to say that it has erros when i make it


hread -lgthread-2.0 -lrt -lglib-2.0

.obj/release-shared/qeventdispatcher_glib.o: In function `QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(_GMainContext*)':

qeventdispatcher_glib.cpp:(.text+0x7f0): undefined reference to `g_main_context_push_thread_default'

.obj/release-shared/qeventdispatcher_glib.o: In function `QEventDispatcherGlib::~QEventDispatcherGlib()':

qeventdispatcher_glib.cpp:(.text+0xbf0): undefined reference to `g_main_context_pop_thread_default'

.obj/release-shared/qeventdispatcher_glib.o: In function `QEventDispatcherGlib::~QEventDispatcherGlib()':

qeventdispatcher_glib.cpp:(.text+0xdd4): undefined reference to `g_main_context_pop_thread_default'

.obj/release-shared/qeventdispatcher_glib.o: In function `QEventDispatcherGlib::~QEventDispatcherGlib()':

qeventdispatcher_glib.cpp:(.text+0xfb0): undefined reference to `g_main_context_pop_thread_default'

.obj/release-shared/qeventdispatcher_glib.o: In function `QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(_GMainContext*)':

qeventdispatcher_glib.cpp:(.text+0x1114): undefined reference to `g_main_context_push_thread_default'

collect2: ld returned 1 exit status

make[2]: *** [../../lib/] Error 1

make[2]: Leaving directory `/home/mqy/qt5/qtbase/src/corelib'

need for help?

Had to add couple options to start compilation:

-no-xcb -no-c++11

but still got errors, first one:

make[2]: Entering directory `/home/user/git/qt5/qtbase/src/network'

/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-g++ -c -pipe -mfloat-abi=softfp -O2 -O2 -march=armv7-a -mfpu=neon -D_LINUX -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_LIBUDEV -DQT_NO_XCB -DQT_NO_XKBCOMMON -DQT_NO_USING_NAMESPACE -DQT_BUILD_NETWORK_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB -I../../mkspecs/devices/linux-imx5-g++ -I. -I../../include -I../../include/QtNetwork -I../../include/QtNetwork/5.1.0 -I../../include/QtNetwork/5.1.0/QtNetwork -Ikernel -I../../include/QtCore -I../../include/QtCore/5.1.0 -I../../include/QtCore/5.1.0/QtCore -I.moc/release-shared -I/home/user/ltib/rootfs/usr/include -o .obj/release-shared/qsslsocket_openssl.o ssl/qsslsocket_openssl.cpp

ssl/qsslsocket_openssl.cpp: In member function 'virtual void QSslSocketBackendPrivate::continueHandshake()':

ssl/qsslsocket_openssl.cpp:1414: error: 'q_SSL_ctrl' was not declared in this scope

make[2]: *** [.obj/release-shared/qsslsocket_openssl.o] Error 1

make[2]: Leaving directory `/home/user/git/qt5/qtbase/src/network'

make[1]: *** [sub-network-make_first] Error 2

make[1]: Leaving directory `/home/user/git/qt5/qtbase/src'

make: *** [sub-src-make_first] Error 2

I got the same error and as a workaround I commented out the lines under #if GLIB_CHECK_VERSION (2, 22, 0) macro

======== ./src/corelib/kernel/qeventdispatcher_glib.cpp ===========

QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)

    : mainContext(context)


    . . .

  #if GLIB_CHECK_VERSION (2, 22, 0)

      //g_main_context_push_thread_default (mainContext);


. . .




. . .

#if GLIB_CHECK_VERSION (2, 22, 0)

    //g_main_context_pop_thread_default (d->mainContext);


. . .


I use the option -no-openssl as a workaround to get rid off this error

./configure -v -opensource -confirm-license -no-pch -opengl es2 -make libs -device imx5 -no-openssl   -no-xcb -no-c++11   -device-option CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi-        -sysroot /home/juan/imx53/ltib/rootfs -no-gcc-sysroot        -prefix /opt/qt5

No ratings
Version history
Last update:
‎02-21-2013 01:02 PM
Updated by: