Qt cross compile problem

alef
Hi,

I would like to build Qt libs for an arm architecture but I encounter
strange problem.

I first adapted my mkspecs/qws/linux-arm-g++/qmake.conf file so that my
arm-gcc cross-compiler is correclty used. 

Here is a copy of my qmake.conf file :
@
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

# modifications to g++.conf
#QMAKE_CC                = arm-linux-gcc
#QMAKE_CXX               = arm-linux-g++
#QMAKE_LINK              = arm-linux-g++
#QMAKE_LINK_SHLIB        = arm-linux-g++

QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++

# modifications to linux.conf
#QMAKE_AR                = arm-linux-ar cqs
#QMAKE_OBJCOPY           = arm-linux-objcopy
#QMAKE_STRIP             = arm-linux-strip
 
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_RANLIB = arm-none-linux-gnueabi-ranlib
@

Here are the binaries of my cross-compiler :
@
arm-none-linux-gnueabi-addr2line  arm-none-linux-gnueabi-g++       
arm-none-linux-gnueabi-gprof    arm-none-linux-gnueabi-readelf
arm-none-linux-gnueabi-ar         arm-none-linux-gnueabi-gcc       
arm-none-linux-gnueabi-ld       arm-none-linux-gnueabi-size
arm-none-linux-gnueabi-as         arm-none-linux-gnueabi-gcc-4.3.2 
arm-none-linux-gnueabi-nm       arm-none-linux-gnueabi-sprite
arm-none-linux-gnueabi-c++        arm-none-linux-gnueabi-gcov      
arm-none-linux-gnueabi-objcopy  arm-none-linux-gnueabi-strings
arm-none-linux-gnueabi-c++filt    arm-none-linux-gnueabi-gdb       
arm-none-linux-gnueabi-objdump  arm-none-linux-gnueabi-strip
arm-none-linux-gnueabi-cpp        arm-none-linux-gnueabi-gdbtui    
arm-none-linux-gnueabi-ranlib
@

Then I typed this command to configure :
@
./configure
--prefix=/home/azmodai/devel/friendlyarm/mini2440-bootstrap/arm-2008q3
-opensource -embedded arm -xplatform qws/linux-arm-g++ -no-cups -no-webkit
-qt-libtiff -qt-libmng  -qt-mouse-pc -no-mouse-linuxtp
@

Everything is Ok up to now, but when I launch the building by typing make,
I get this error about 10 or 15 mins later :

@
g++ -fno-exceptions -Wl,-O1
-Wl,-rpath,/home/azmodai/devel/friendlyarm/mini2440-bootstrap/arm-2008q3/lib
-Wl,-rpath,/home/azmodai/devel/friendlyarm/mini2440-bootstrap/arm-2008q3/lib
-o ../../../bin/moc release-shared/moc.o release-shared/preprocessor.o
release-shared/generator.o release-shared/parser.o release-shared/token.o
release-shared/main.o    
-L/home/azmodai/devel/digicode/friendlyarm/qt/arm-qte-4.6.3/qt-everywhere-openso
urce-src-4.6.3/src/tools/bootstrap
-lbootstrap 
/usr/bin/ld:
/home/azmodai/devel/digicode/friendlyarm/qt/arm-qte-4.6.3/qt-everywhere-opensour
ce-src-4.6.3/src/tools/bootstrap/libbootstrap.a(compress.o):
Relocations in generic ELF (EM: 40)
/home/azmodai/devel/digicode/friendlyarm/qt/arm-qte-4.6.3/qt-everywhere-opensour
ce-src-4.6.3/src/tools/bootstrap/libbootstrap.a:
could not read symbols: File in wrong format
collect2: ld a retourné 1 code d'état d'exécution
make[1]: *** [../../../bin/moc] Erreur 1
make[1] : on quitte le répertoire «
/home/azmodai/devel/digicode/friendlyarm/qt/arm-qte-4.6.3/qt-everywhere-opensour
ce-src-4.6.3/src/tools/moc
»
make: *** [sub-moc-make_default-ordered] Erreur 2
@

It looks to be a link problem. about a wrong format of binary ... 

Last thing : I decide to remove the "-m64" flags of the linux-x68_64-g++
specs, and I did not replace -m64 by the non-updated equivalent, because I
did not the equivalent.

Have you ever experienced such a problem ? And have you any idea ?

Thanks a lot !

davef
The ol' libbootstrap.a problem.  Yes.

Sorry, but I may have some notes on this at home, so I can't tell you for
sure how I got around this one.

I recall deleting qmake.cache files from previous builds.

The procedure that got me the furthest is here:

http://mini2440vietnam.blogspot.co.nz/2011/04/upgrade-qt462-in-mini2440....

Good luck!

Alef
Ok Im going to look at this procedure and i keep you in touch.
Thanks

Dave Festing
Attachment: Qt installation.zip (39 KB)
These are my installation notes.  Rename the file to Qt installation.doc

The comment about qmake.cache was related to using the Pengutronix BSP,
also see below:
******
If you need to re-compile Arora or any other Qt application you MAY need to
delete four .qmake.cache files in the BSP.
******

Maybe, have a look for any .qmake.cache files and try deleting them. 

I found that I that first time I built the project from clean installation,
it would work.  Subsequent rebuilds always seemed to fail.

Also, if you delete any Qt files to TRASH go and empty the TRASH.  I recall
still being able to "see" these deleted files in .local in the home
directory. Paranoid, maybe!

Fortunately, I got /demo/browser cross-compiled once and working and
haven't had to re-visit Qt.

Good luck!