QtCreator on Windows to Cross Compile for Linux ARM with CodeSourcery Toolchain
-
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'* -
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.
-
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 -
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.
-
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'.
-
Yep, I think you are correct:
http://communities.mentor.com/mgcx/message/25589#25589 -
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!