[Development] Cross compiling Qt 5

Holger Hans Peter Freyther holger at freyther.de
Thu Aug 23 01:40:00 CEST 2012


On Mon, Aug 20, 2012 at 11:22:29AM -0700, Romain Pokrzywka wrote:
> On Sunday, August 19, 2012 11:51:05 AM Peter =?ISO-8859-1?Q?K=FCmmel?= wrote:

Hi,

adding my two cents here as well. There is and should be nothing special
about cross-compiling. With sane systems the only difference between native
and cross builds is the configuration stage. You can only build but not run
the tests when cross-compiling.

In fact in Yocto/Poky we are using a custom mkspec that allows us to target
7 different CPU architectures. I would be very happy if Qt would use autoconf
(and pkg-config) for the configuration step on Unix/Posix (it supports injecting
test results, has support for cross compilation, writes a detailed log file).


> > Here a proposal:
> >   1. -target-mkspec  : specify mkspec name
> >   2. -target         : specify toolchain prefix
> 
> -toolchain-prefix sounds much more appropriate than -target (which to me means 
> the target hardware platform)

Follow autoconf here. Use the GNU triplet for the host and target compiler.

> 
> What about platform options, QPA plugins to build, etc. ?
> 
> That said, I agree that in second look the -device-options solution isn't 
> great, and offloads work to the mkspecs which isn't the right thing to do.
> I'd much prefer discrete options like we had for QWS, e.g. -plugin-mouse-tslib 
> and so on.

Well, -device-options/device[1] is not for selecting what to build but dealing
with BSPs of vendors (that might not have a sane pkg-config setup) and the need
of hooking up platform code where a proper abstraction does not exist (yet).
E.g. if tslib wouldn't have plugins and you would need to invert x/y
coordinates on each sample.. the -device could provide a hook to manipulate
these before being passed to the QPA layer. It is a pragmatic approach and the
alternative would be to keep patches somewhere else and this would complicate
CI[2] a lot. 

cheers
	holger

[1] http://qt-project.org/wiki/DeviceProfileProposal
[2] http://qt-jenkins.moiji-mobile.com/jenkins/job/QtBase/



More information about the Development mailing list