Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] Unable to properly cross-compile Qt for embedded Linux
I've been struggling for days trying to get this to work.
- My host environment is Ubuntu 12.04 32-bit.
- My target is an embedded ARM Linux (AM335x EVMSK)
- My target's root is an NFS export at /home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS
- My sysroot is at /ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi.
- I extracted the source for Qt 5.2.1, and copied the Beagleboard device (qtbase/mkspecs/devices/linux-beagleboard-g++) to another directory and modified it slightly to enable hard floating point.
Then, I ran configure (I've tried a few different ways of specifying -prefix and -extprefix):
@./configure -debug -opengl es2 -device linux-am335x-g++ -device-option CROSS_COMPILE=/home/steve/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf- -sysroot /home/steve/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi -prefix /home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS -extprefix /home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS -no-glib -qpa eglfs -opensource -confirm-license -make libs -nomake examples -nomake tools@
I then did make and make install. Seems to work to this point.
Now, I go to Creator and try to setup my kit. When I point Creator to the qtbase/bin/qmake executable, I get a little yellow "!" and a message "Non-installed -prefix build - for internal development only". When I attempt to build a QtQuick application using this kit, I get "Unknown module(s) in QT: quick qml".
The following are the variables from qmake as displaying within the options of Creator:
Those paths look fishy to me - those are NOT the installation paths. But, then again, I don't know what they're supposed to be.
When I run "./qmake -query QT_INSTALL_PREFIX", I get back something different than what is listed above - I get "/home/steve/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/home/steve/ti-sdk-am335x-evm-07.00.00.00/targetNFS", which makes me think Qt is confused about paths for some reason. Did I run configure wrong?
How do I resolve this? (my ultimate goal is to build and debug a QtQuick app from Creator on the host to the application on the target).
As it turns out, I needed to point Creator to the qmake of the target, not to qtbase/bin/qmake in my build tree.
Which them leads to a new question: How does Creator make use of a binary built for a different architecture?!? It's definately not running "qmake -query QT_SOME_VAR" on my embedded device!
qmake is not cross-compiled but is setup to use your newly built Qt
[quote author="SGaist" date="1402439205"]Hi,
qmake is not cross-compiled but is setup to use your newly built Qt[/quote]
I'm not sure I understand what you mean. Two "qmake" binaries were generated during the build, one for i386 and one for ARM. I must point Creator at the ARM binary:
The output of file for i386:
@qt-arm-5.2.1/qtbase/bin/qmake: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x73a6421d68935224aa23e8a2b5ea7a2239b45467, not stripped@
The output of file for ARM:
@ti-sdk-am335x-evm-07.00.00.00/targetNFS/usr/bin/qmake: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.31, BuildID[sha1]=0x86f82ddf304e92e6c0496daea0a9aabc5c1eae3c, stripped@
That's a cross-compiled qmake.
AFAIK, there should only be one generated