How to Cross-compile QT for ARM (IMX6)
-
For the last week I have been trying to compile a QT program for running on a Freescale Hummingboard (IMX6 Processor). There are some guides around, but I've not been able to complete one with success.
The following 3 guides give me a compile error on ./configure
http://wiki.qt.io/RaspberryPi_Beginners_Guide
http://forum.solid-run.com/linux-on-cubox-i-and-hummingboard-f8/qt5-3-on-hummingboard-t2072.html
https://community.freescale.com/docs/DOC-94066
When I run the ./configure command (With recommended commands, I've tried this with a lot of possibilities for commands but got none working). I got a compile error for all the external libraries QT uses (zlib, libjpeg, libpng, etc.). So it's a dead end from there.I've tried a lot more stuff, I don't even remember all the stuff I've tried, but I got nothing working.
I'm trying to use mini-distribution for the Hummingboard. It's a system without window manager that is able to run QT applications (QT5). The build tool I'm trying to use is gcc-linaro-arm-linux-gnueabi, I'm using QT Creator. So I've got QT working on the Hummingboard, I just can't compile anything for it.
If anyone could give me any pointers or help that would be greatly appreciated because I'm pretty stuck.
-
Hi,
I dont know if this is helpful but I have successfully cross compiled Qt 5.3.2 for gentoo arm imx6 with the following configure options...
-prefix ${ROOT}usr -xplatform linux-arm-g++-cross -release -opensource \ -no-largefile -no-qml-debug -system-zlib -no-gif -qt-libpng -qt-libjpeg -qt-freetype \ -no-xcb -no-xkbcommon -no-pulseaudio -no-alsa -no-gtkstyle -nomake "examples tests" \ -no-rpath -no-nis -no-cups -no-fontconfig -no-kms -no-pch -no-directfb -no-sql-sqlite -no-xcb \ -eglfs -mtdev -opengl -tslib -skip qtactiveqt -skip qtconnectivity -skip qtdoc -skip qtenginio \ -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtsensors \ -skip qtserialport -skip qtsvg -v
Note we have created our own makespec for cross compiling which is below... You'd have to replace arm-gentoo-linux-gnueabi with gcc-linaro-arm-linux-gnueabi...
# # qmake configuration for building with arm-linux-gnueabi-g++ # MAKEFILE_GENERATOR = UNIX CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../common/linux.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf) EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_imx6.cpp #--sysroot=$(ROOT) QMAKE_CFLAGS = ${QMAKE_CFLAGS} -O2 -pipe -fomit-frame-pointer -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp -DLINUX=1 -DEGL_API_FB=1 QMAKE_CXXFLAGS = ${QMAKE_CXXFLAGS} -O2 -pipe -fomit-frame-pointer -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp -DLINUX=1 -DEGL_API_FB=1 QMAKE_LFLAGS = ${QMAKE_LFLAGS} -ldbus-1 -lglib-2.0 -lgthread-2.0 QMAKE_LIBS_EGL += -lEGL QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL # modifications to g++.conf QMAKE_CC = arm-gentoo-linux-gnueabi-gcc QMAKE_CXX = arm-gentoo-linux-gnueabi-g++ QMAKE_LINK = arm-gentoo-linux-gnueabi-g++ QMAKE_LINK_SHLIB = arm-gentoo-linux-gnueabi-g++ QMAKE_LINK_C = arm-gentoo-linux-gnueabi-gcc QMAKE_LINK_C_SHLIB = arm-gentoo-linux-gnueabi-gcc # modifications to linux.conf QMAKE_AR = arm-gentoo-linux-gnueabi-ar cqs QMAKE_OBJCOPY = arm-gentoo-linux-gnueabi-objcopy QMAKE_NM = arm-gentoo-linux-gnueabi-nm -P QMAKE_STRIP = arm-gentoo-linux-gnueabi-strip load(qt_config)
Regards, Phill.
-
Hi,
Before configure, I install graphical dependencies:
sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
Then, I can give you my configure command for IMX6 board :
sudo ./configure -opensource -confirm-license -developer-build -nomake examples -nomake tests -skip qtwebkit -device imx6 -prefix /usr/local/
You just have to include/exclude the component you need/dont' need.
-
@Phill-ONeill said:
-prefix $usr -xplatform linux-arm-g++-cross -release -opensource
-no-largefile -no-qml-debug -system-zlib -no-gif -qt-libpng -qt-libjpeg -qt-freetype
-no-xcb -no-xkbcommon -no-pulseaudio -no-alsa -no-gtkstyle -nomake "examples tests"
-no-rpath -no-nis -no-cups -no-fontconfig -no-kms -no-pch -no-directfb -no-sql-sqlite -no-xcb
-eglfs -mtdev -opengl -tslib -skip qtactiveqt -skip qtconnectivity -skip qtdoc -skip qtenginio
-skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtsensors
-skip qtserialport -skip qtsvg -vThis gives me the following error: linux-arm-g++-cross: unknown argument
@mokat said:
sudo ./configure -opensource -confirm-license -developer-build -nomake examples -nomake tests -skip qtwebkit -device imx6 -prefix /usr/local/
Running this command gives me this:
Creating qmake...
.Done.
Running configuration tests...
Failed to process makespec for platform 'devices/linux-imx6-g++'Which gives me:
Creating qmake...
make: Nothing to be done for `first'.
Running configuration tests...
Failed to process makespec for platform 'devices/linux-imx6-g++'
Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>
Could not read qmake configuration file /home/bob/qt5/qtbase/mkspecs/devices/linux-imx6-g++/qmake.conf.
Error processing project file: /dev/nullSo I add -device-option with: -device-option CROSS_COMPILE=/home/bob/Downloads/gcc-linaro-arm-linux-gnueabi/bin/arm-linux-gnueabi-
sudo ./configure -v -opensource -confirm-license -developer-build -nomake examples -nomake tests -skip qtwebkit -device imx6 -prefix /usr/local/ -device-option CROSS_COMPILE=/home/bob/Downloads/gcc-linaro-arm-linux-gnueabi/bin/arm-linux-gnueabi-
Which gives me the following Warnings:
Creating qmake...
.Done.
Running configuration tests...
Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.
Could not determine the target architecture!
Turn on verbose messaging (-v) to see the final report.
WARNING: Unable to find file .device.vars
No QPA platform plugin enabled!
If you really want to build without a QPA platform plugin you must pass
-no-qpa-platform-guard to configure. Doing this will
produce a Qt that can not run GUI applications.
The dependencies needed for xcb to build are listed in
src/plugins/platforms/xcb/READMEIf I check this readme it tells me the dependencies I need and suggest using -qt-xcb to reduce dependencies. I have the dependencies so I add -qt-xcb to the end of my command
sudo ./configure -v -opensource -confirm-license -developer-build -nomake examples -nomake tests -skip qtwebkit -device imx6 -prefix /usr/local/ -device-option CROSS_COMPILE=/home/bob/Downloads/gcc-linaro-arm-linux-gnueabi/bin/arm-linux-gnueabi- -qt-xcb
This spew this pile of errors: http://pastebin.com/uh9EYs1y
Would re-installing Ubuntu or something work? I'm really at the end of my options. Everywhere people seem to be able to run these ./configure commands with some options easily. For me it just spews lines of errors and stuff. As you can see above trying to get the command you use to work results in work followed by not working anywa