Qt4.8 Cross-Compile to IMX6
I have been having a real hard time compiling Qt4 embedded for my IMX6 board. ( qt-everywhere-opensource-src-4.8.6.tar.gz )
I have a Host machine running Linux(Ubuntu 14) and I want to code and compile on this machine and then send the binary to my IMX machine for execution. Snag is I have to use QWS and Debian 7 as the OS on the IMX6 board.
So far I have been trying the following to make this work.
I have installed and tried arm-linux-gcc-4.3.2.tgz
Also gcc-arm-none-eabi-5_4 which when exported crashed with an error saying it can not find arm-none-linux-gcc.
Also tried gcc-linaro-arm-linux-gnueabi-2012 ...it had the same problem.
I have also installed a TON of libs to try and make it work.
None of this worked.
I have changed my PATH variable several times with no luck... I can not even remember half of the stuff I tried.
I use the ./config command like this -> " ./configure -embedded arm -xplatform qws/linux-arm-gnueabi-g++ -no-webkit -little-endian "
So finally I have tried using arm-linux-gcc-4.3.2.tgz which is really old
with PATH="/usr/local/arm/4.3.2/bin:/usr/local/gcc-arm-none-eabi-5_4/bin/:/usr/local/gcc-arm-none-eabi-5_4/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games "
and it got the furthest so far but still crashed with the following.
obj/release/UStringImpl.o: In function
QTWTF::CrossThreadRefCounted<QTWTF::OwnFastMallocPtr<unsigned short> >::deref()': UStringImpl.cpp:(.text._ZN5QTWTF21CrossThreadRefCountedINS_16OwnFastMallocPtrItEEE5derefEv[QTWTF::CrossThreadRefCounted<QTWTF::OwnFastMallocPtr<unsigned short> >::deref()]+0x28): undefined reference to__sync_sub_and_fetch_4'
collect2: ld returned 1 exit status
make: *** [../../lib/libQtScript.so.4.8.6] Error 1
make: Leaving directory `/home/gss/QtEmbedded/src/script'
make: *** [sub-script-make_default-ordered] Error 2
I have make cleanconf before starting the process all over again before this crash.
Anyway I do not know what to do anymore. I have been at this for 2 days now and I need to go sleep.
If anyone can please help me I would greatly appreciate it.
Hi and welcome to devnet,
AFAIK, Ubuntu has packages for cross-compiler. Try
sudo apt-get install gcc-arm-linux-gnueabihf, it should get you the basic stuff in. But before, you should check whether you have a hard float Debian installed.
Hope it helps
Thanks allot for the reply!
I have indeed installed the package named " gcc-arm-linux-gnueabihf " but the compiler complained about missing arm-none-linux-gnueabi-gcc or arm-none-linux-gnueabi-g++ .
I dont understand why Qt would use such ancient packages anyway though? Is there any way of fooling the OS to rather use some newer of from the stock Arm tool chain at least?
Because that's what you are asking for on your configure command line.
You also have to realize that Qt 4.8.6 is pretty old by now and that if you can't go on Qt 5 which is currently in 5.8 Beta you should at least go with 4.8.7.
If you want (or have) to use hard-float, then just copy the linux-arm-gnueabi-g++ mkspec and modify qmake.conf to use the cross-compiler you just installed.
Ok soo i have come a long way since last time.
I managed to compile QT4.8 with gcc-arm-linux-gnueabihf-4.9 by manipulating the symbolic links.
After quite some time I have managed to make Qt connect to my Target Board and display/run a basic Qt Application.
But when try and load an example from the QtExamples file I get the following.
Failed to upload file " /home/user/QtProjFile/examples/dialogs/README ".
That is the one problem.
The other problem is that I can not seem to DEBUG " Step through " the code running on the board since it just comes back with an error 127.
Even if the code runs when I click run it will still come back with error 127 if I try and debug.
I have to initialize the gdbserver but I have no idea how to do that. If I do that then I can not manage to mix my program with it somehow.
Why can I not debug?
Why can I only send over some projects files instead of all of them?
Do you have gdbserver install on your target ?
It is installed but it does not launch automatically and I can not seem to get it started up correctly.
Also if I give i a IP:PORT it just sits there and waits fora connection and I try to then run the program from HOST but nothing happens.
So I installed GDBServer on the Target.
Now when I debug it says.
Listening on port 10001
Remote debugging from host 192.168.0.237
Process /home/bunutu/project/untitled9 created; pid = 15963
Architecture rejected target-supplied description
Killing process(es): 15963
Are you sure you are build your application for the right architecture ?