[Development] The sorry state of the Qt6 cross compile experience

Dominik Holland dominik.holland at qt.io
Thu Feb 25 11:40:30 CET 2021


Hi,

Am 2/25/21 um 11:07 AM schrieb Bogdan Vatra:
> Hi,
>
> În ziua de miercuri, 24 februarie 2021, la 17:32:57 EET, Dominik Holland a 
> scris:
>> Am 2/24/21 um 4:25 PM schrieb Joerg Bornemann:
>>> On 2/24/21 12:56 PM, Bogdan Vatra wrote:
>>>> Let me give you another non-android example:
>>>> You want to create a standalone SDK for linux armhf using yocto. You'll
>>>> generate the SDK with everything including Qt for host and for
>>>> target, the sdk
>>>> is a huge auto extract archive which can be shared with everyone. Can
>>>> this
>>>> archive contain only the Qt for the target? Nope because there is no
>>>> way to
>>>> know if and where the Qt for host is installed on everyone computers,
>>>> you also
>>>> need to know where the Qt for host it is in order to fix the
>>>> hardcoded paths.
>> Mhh, yocto builds both the host Qt and the target Qt and the SDK archive
>> will contain both Qt version. But this was already the case for Qt5 as
>> well. I don't think anything has changed here.
>>
> Vanilla yocto does NOT add Qt 5 for host, same for buildroot!
> You probably mean that you're forcing yocto to add Qt 5 for host as well. 
> Joust out of pure curiosity, what's the reason to add Qt 5 for host in the 
> yocto SDK?

I'm not sure whether we are talking about the same thing here. But if
you create a proper yocto SDK you want it to be usable standalone.
Which means the host part of the yocto SDK contains the cross-compiler,
gdb and other other host tools you need for the cross-compilation.
This also includes the host-tools like qmake, moc, uic etc. as those are
needed for cross-compiling to be executed on the host.

Yes, whether those host tools are part of the created SDK is on you to
decide, but so far all yocto SDKs i have used so far ship the qt host
tools in the SDK as well.

Yocto also uses the same host vs target build concept Qt6 is using now
and for Qt5 yocto forced us to do the same thing as well, it's just
behind the scenes:

 qtbase-native.bb: Native Qt build
 qtbase(-target).bb: cross Qt build (using the moc, uic and friends from
the native build)
 qtbase-nativesdk.bb: Special nativesdk Qt build (Which provides the
tools shiped with the SDK, this is not the same as the native build, as
you could create a SDK for different target architecture e.g. mingw)

Dominik



More information about the Development mailing list