[Qt-interest] Qt4.5 branch trying to build 64bit on 32bit linux

Thiago Macieira thiago.macieira at trolltech.com
Thu Jun 18 00:46:34 CEST 2009


Andreas Pakulat wrote:
>seems like there's been some change to the architecture-detection code
>in Qt's configure. The 4.5.1 I've built via kdesvn from qt-copy had no
>problems whatsoever, however I just fetched the 4.5 branch from git and
>that tries to build qmake for 64bit which of course doesn't work on my
>32bit system.
>
>The problem is that apparently the newer detection code relies on the
>output of uname -m which is not enough in my case. I'm running an amd64
>Kernel but the distribution itself is pure 32bit (so I can easily access
>the full 4GB of RAM). This means that uname -m prints x86_64, but
>compiling an application with the 64-bit flags will not work.
>
>I'd like to get some input on wether I just need to live with the
>setarch call before configuring or wether maybe configure should be
>extended (again?) to cope for that case.
>
>FWIW, cmake has no problem with my setup and will always create 32bit
>binaries.

The problem isn't cmake or qmake.

The problem is that Qt has assembly code that needs to be selected 
according to the architecture being built for. The x86 code does not work 
for x86-64, nor vice-versa.

The compiler knows what to produce and it knows therefore which #define 
macro to add (__i386__ or __x86_64__). However, Qt doesn't use that to 
determine what to build: since it needs to add a global #define 
(QT_ARCH_I386, for example), that is determined by configure. And the test, 
like you said, is uname -m.

Could it be better? Definitely. For example, by compiling a simple program 
and the program outputting the arch that it got compiled into, according 
to the standard #define's by the compiler.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090617/3148953d/attachment.bin 


More information about the Qt-interest-old mailing list