Qt cross-compilation issue

Hi everyone,

I have a big problem with Qt libraries cross-compilation. My objective is to develop some Qt-apps for my BeagleBoard-xM on my host machine running Ubuntu 12.04 LTS. I found some nice tutorials, e.g.:

http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html

but the toolchain, which Trey used (angstrom-2010.4-test-20100422-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.2), it just disappeared, so I tried some toolchains from Ubuntu repository (gcc-arm-linux-gnueabi, gcc-arm-linux-gnueabihf). And now, when I run ‘configure’ (with all parameters from Trey’s tutorial) and then try to run ‘make’, it breaks with this error:

/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/lib/../lib/crt1.o: In function_start’:
(.text+0x30): undefined reference to `main’
collect2: ld returned 1 exit status
make[1]: *** […/…/lib/libQtCoreE.so.4.8.5] Error 1

`

I found somewhere, that it might be some linking issue, but I have completely no idea, what to do with that…

Maybe someone has similar problem and could give me some advice?

Regards
jerzu

Did you adapt the qmake.conf to the location of your compiler and linker?
In the output you posted I can’t find any linker command.

Thanks for the answer!

Yes, I have edited ‘qmake.conf’ file just like Trey described in his tutorial. Everything looks correct for me, but maybe you will find some mistake… Here is my current version of ‘qmake.conf’:

qmake configuration for building with arm-linux-g++

include(…/…/common/g+±unix.conf)
include(…/…/common/linux.conf)
include(…/…/common/qws.conf)

modifications to g++.conf

Toolchain

#Compiler Flags to take advantage of the ARM architecture
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

QMAKE_CC = /usr/bin/arm-linux-gnueabi-gcc
QMAKE_CXX = /usr/bin/arm-linux-gnueabi-g++
QMAKE_LINK = /usr/bin/arm-linux-gnueabi-g++
QMAKE_LINK_SHLIB = /usr/bin/arm-linux-gnueabi-g++

modifications to linux.conf

QMAKE_AR = /usr/bin/arm-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = /usr/bin/arm-linux-gnueabi-objcopy
QMAKE_STRIP = /usr/bin/arm-linux-gnueabi-strip

load(qt_config)

I replaced ‘g++.conf’ with ‘g+±unix.conf’. All the paths are correct.

Can you post the whole output of the make command?

I made ‘configure’ report too, so here is ‘configure’ output:

http://shrib.com/q28bxrfb

…and ‘make’ output:

http://shrib.com/NN6TUZKR

I have some warnings in ‘configure’, but I suppose that it’s not a reason of compilation fail.

Can you try to do a “make clean” and then a “make” again?

I did ‘make confclean’ and ‘make clean’, then I try to ‘configure’ and ‘make’ again, but it ends exactly in the same way… Here are both outputs:

  1. configure:

http://shrib.com/1IbUjLe3

  1. make:

http://shrib.com/oTn2WtrY

Wait, it looks like the outputs I have posted above are not complete… They are too big for shrib :wink: I’ll try to attach the text files here.

ConfigReport.txt (104 KB)

MakeReport.txt (265 KB)

And now something new about arm-linux-gnueabihf toolchain - when I’m using it, I get some extra errors:

/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/lib/../lib/crt1.o: In function_start’:
(.text+0x30): undefined reference to main' .obj/release-shared-emb-arm/qtconcurrentiteratekernel.o: In function QtConcurrent::BlockSizeManager::timeBeforeUser()’:
qtconcurrentiteratekernel.cpp:(.text+0x14a): undefined reference to clock_gettime' .obj/release-shared-emb-arm/qtconcurrentiteratekernel.o: In function QtConcurrent::BlockSizeManager::timeAfterUser()’:
qtconcurrentiteratekernel.cpp:(.text+0x260): undefined reference to `clock_gettime’
collect2: ld returned 1 exit status
make[1]: *** […/…/lib/libQtCoreE.so.4.8.5] Error 1

`

Any ideas…?

Is there anyone here who has succesful compiled Qt-libs with OTHER ARM-linux-toolchain than angstrom-linux-toolchain…?

Or maybe someone has got 32-bit angstrom-linux-toolchain (for Qt) and can just send me it?

I shared my compiler, qt-Source and conf file.
Perhaps this will help.

Thank you very much, Tux! I downloaded your files and so far compilation runs quite well, no errors at the moment :wink: Thank you once more for your help, I hope that I will be finally able to make something more on my Beagle :wink:

It looks like my problem was this part of ‘qmake.conf’:

#Compiler Flags to take advantage of the ARM architecture
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

because only when I’ve deleted these statements from it, the ‘make’ command started to work well. I see, that there are some floating point unit parameters (‘neon’, ‘mfloat-abi’), so it may be the reason that FPU (thus some graphic apps too) will be much slower… Am I right?