QtCreator on Windows to Cross Compile for Linux ARM with CodeSourcery Toolchain
-
wrote on 12 Jul 2012, 17:56 last edited by
Nevermind - I was able to build Qt 4.8 with the CodeSourcery toolchain. Now I need to figure out how to get it in the Qt Creator IDE.
Here are my notes if it helps anyone:
Run from the top level >> configure
Then go to \tools\configure and run >> qmake && mingw32-make
Modify the makespec in mkspecs\linux-arm-gnueabi-g++ via the blog post http://c2143.blogspot.com/?view=classic
Then go to back to top level and run:configure.exe -debug -embedded -arch arm -neon -platform win32-win32-g++ -xplatform linux-arm-gnueabi-g++
Now there is a Makefile in the top level , invoke mingw32-make
Go to movie and dinner and come back... -
wrote on 12 Jul 2012, 17:57 last edited by
Woops just saw your reply - thanks for the info!
-
wrote on 12 Jul 2012, 18:01 last edited by
You may need a newer QtCreator like 2.5.0. There you go to "Tools" menu, "Options", "Qt4". There you'll find a Toolchain tab (afaik - don't have one here), in this tab you can set the toolchain options, including the makespec.
-
wrote on 13 Jul 2012, 15:04 last edited by
Would you have any insight on this problem? I've used the CodeSourcery toolchain to build the Qt 4.8 library with no error and I have the .so files in the /lib directory. Now I am trying to hook in the CodeSourcery compiler and built Qt 4.8 to Qt Creator so I can build an example app for the target board.
I read the articles you sent describing how to add a Qt version new toolchain to Qt Creator. Please see the images attached for how I've configured Qt Creator. I am using Qt Creator 2.4.1.
I could only post images here --> http://stackoverflow.com/questions/11420984/qtcreator-on-windows-to-cross-compile-for-linux-arm-with-codesourcery-toolchain
I'm getting an error without much information pasted below... Any thoughts on this or my configuration?
09:51:07: Running build steps for project analogclock...
09:51:07: Configuration unchanged, skipping qmake step.
09:51:07: Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe"
arm-none-linux-gnueabi-g++ -c -pipe -march=armv7-a -mtune=cortex-a8 -mthumb -mfpu=neon -mfloat-abi=softfp -Wa,-mimplicit-it=thumb -O2 -Wall -W -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I"..\qt-4.8-src\include\QtCore" -I"..\qt-4.8-src\include\QtNetwork" -I"..\qt-4.8-src\include\QtGui" -I"..\qt-4.8-src\include" -I"." -I"c:\QtSDK\Examples\4.7\widgets\analogclock" -I"." -I"..\qt-4.8-src\mkspecs\default" -o analogclock.obj c:\QtSDK\Examples\4.7\widgets\analogclock\analogclock.cpp
arm-none-linux-gnueabi-g++ -c -pipe -march=armv7-a -mtune=cortex-a8 -mthumb -mfpu=neon -mfloat-abi=softfp -Wa,-mimplicit-it=thumb -O2 -Wall -W -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I"..\qt-4.8-src\include\QtCore" -I"..\qt-4.8-src\include\QtNetwork" -I"..\qt-4.8-src\include\QtGui" -I"..\qt-4.8-src\include" -I"." -I"c:\QtSDK\Examples\4.7\widgets\analogclock" -I"." -I"..\qt-4.8-src\mkspecs\default" -o main.obj c:\QtSDK\Examples\4.7\widgets\analogclock\main.cpp
C:\Users\pclass\Desktop\qt_creator_toolchain\qt-4.8-src\bin\moc.exe -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I"..\qt-4.8-src\include\QtCore" -I"..\qt-4.8-src\include\QtNetwork" -I"..\qt-4.8-src\include\QtGui" -I"..\qt-4.8-src\include" -I"." -I"c:\QtSDK\Examples\4.7\widgets\analogclock" -I"." -I"..\qt-4.8-src\mkspecs\default" c:\QtSDK\Examples\4.7\widgets\analogclock\analogclock.h -o moc_analogclock.cpp
mingw32-make.exe: *** [moc_analogclock.cpp] Error -1073741515
09:51:09: The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project analogclock (target: Desktop)
When executing build step 'Make'* -
wrote on 13 Jul 2012, 15:17 last edited by
Two items:
- Apply the right mkspec to the toolchain now it seems to be ”..\qt-4.8-src\mkspecs\default”
- Right-click on the project and select "run qmake" or similar, so qmake will create the appropriate makefiles with the right makespec in.
- Did you add the path to mingw/bin and qt/bin to your PATH environment? moc.exe depends on two or three dlls out of that folders.
-
wrote on 13 Jul 2012, 15:39 last edited by
Thank you.. I added mingw to the path and then did a build and it succeeded. If I do a 'file' command on the example it gives me the following, which looks promising. Now to try it on the board.
$ file analogclock
analogclock: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped -
wrote on 16 Jul 2012, 20:39 last edited by
I've tried to run the executable on the board after copying it and the CodeSourcery sysroot to the board. I get the following error:
./analogclock
@Inconsistency detected by ld.so: dl-deps.c: 622: _dl_map_object_deps: Assertion `nlist > 1' failed!@
On an Ubuntu VM I can see the following information about the executables:
@user@ubuntu:~/exported/test_build$ readelf -l analogclock| grep "program interpreter"
[Requesting program interpreter: /CodeSourcery-sysroot/lib/ld-linux.so.3]
user@ubuntu:~/exported/test_build$
user@ubuntu:~/exported/test_build$ ldd analogclock
not a dynamic executable@I've tried to investigate but am not sure what dependencies are missing. Do you have any insight here? Thanks alot.
-
wrote on 16 Jul 2012, 21:28 last edited by
Maybe a "bug":http://sourceware.org/bugzilla/show_bug.cgi?id=12454 in the toolchain (glibc)?
I.e. search on "Google":http://www.google.com for '_dl_map_object_deps'.
-
wrote on 17 Jul 2012, 12:45 last edited by
Yep, I think you are correct:
http://communities.mentor.com/mgcx/message/25589#25589 -
wrote on 18 Jul 2012, 16:01 last edited by
Why are you using CodeSourcery? Are there specific feratures you use? As I know there are several other IDE/embedded tools providers.
-
wrote on 9 Aug 2012, 19:15 last edited by
I also thought I was experiencing an issue with the glibc toolchain, but our resident toolchain guru set me straight. We quickly built up the "strace" tool and added that to our embedded system. It immediately told us there was a library dependency that was not being met (libQtOpenGL in our case). This may not be your issue, but I wanted to share how we dissected the error to identify the root cause.
Good Luck!