[Interest] Cross-compiling Qt-4.8

Thiago Macieira thiago.macieira at intel.com
Thu Jul 12 18:46:11 CEST 2012


On quinta-feira, 12 de julho de 2012 12.37.48, Christian Gagneraud wrote:
> > Error 1: it's missing a const or const_cast. Add it. Upgrading to 4.8 is
> > also recommended since those issues might have been fixed there.
> 
> I'm actually using 4.8. I didn't expect to have to fix these kind of
> errors as Qt on ARM/Linux is widely used.
> 
> I do understand what's the problem here, but I don't see where the cast
> should take place.
> 
> It all starts with this line in qdbusintegrator.cpp:
> Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString,
> (QLatin1String(DBUS_SERVICE_DBUS)))
> 
> Should I change this:
> bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *, void *,
> void *);
> 
> to this:
> bool QBasicAtomicPointer_testAndSetOrdered(void * volatile * const, void
> *, void *);

This problem has been fixed in many architectures. See commits:
f668407b30868ef137016b70011ce888e7950d4e
8108650b24adbe03543eb29015ea9bda86d0068e
a444061bf8044776ae7266a2a9f63dc8eb534d79
faba550d704312a29d9485bcaaa506331f102301

All of those commits are caused by that "const QString" global static, which 
revealed missing const somewhere in the atomic declaration. They will tell you 
exactly where the const are needed.

Note that faba550d fixes qatomic_arm.h and a444061b fixes qatomic_armv5.h. You 
should not be getting those errors anymore. There's something else wrong with 
your build.

In addition:

> > Error 2: you forgot to pass an -arch flag to configure to let it know what
> > 
> > architecture you're compiling to. You probably want one of:
> > 	-arch arm
> > 	-arch armv6
> > 	-arch mips
> 
> I tried that one, but it complained because i'm using "-embedded openwrt".

I don't know much about the -embedded option. I've barely played with QWS and 
I remember only once where I had to build it for release testing while working 
for Trolltech.

But from what I remember and from a cursory search in the configure reveal that 
the -embedded option should be given only a known device name (which openwrt 
isn't) or an architecture name. Maybe you want -embedded arm or -embedded 
mips.

Really, you must *not* use the generic atomics. They are meant only as a 
porting tool, until someone comes and writes the atomics for a given platform 
-- unnecessary in Qt 5 since we have C++11 and GCC generics now. The Qt 4 
generics are *dog* *slow*. Never use them.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120712/1bd0b095/attachment.sig>


More information about the Interest mailing list