Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670060 - qt5-build.eclass does not work with crossdev
Summary: qt5-build.eclass does not work with crossdev
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-11-01 00:06 UTC by Nicolas Chappe
Modified: 2022-04-01 13:02 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
qt5-build.eclass patch (qt5-build-eclass-cross-compile.patch,6.93 KB, patch)
2018-11-01 00:06 UTC, Nicolas Chappe
Details | Diff
dev-qt/qtcore-5.11.2-r1 patch (qtcore-cross-compile.patch,559 bytes, patch)
2018-11-01 00:08 UTC, Nicolas Chappe
Details | Diff
dev-qt/qtcore-5.11.2-r1 additional patch (qtcore-5.11.2-cross-qfloat16-tables.patch,712 bytes, patch)
2018-11-01 00:09 UTC, Nicolas Chappe
Details | Diff
qt5-build.eclass patch v2 (fixed ar invocation) (qt5-build-eclass-cross-compile.patch,6.93 KB, patch)
2018-11-02 16:51 UTC, Nicolas Chappe
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Chappe 2018-11-01 00:06:32 UTC
Created attachment 553796 [details, diff]
qt5-build.eclass patch

The qt5-build eclass does not work with crossdev.
The attached patches fix cross-compilation of qtbase 5.11.2 libraries.
My approach is different from the one taken for Qt 4 in bug 327827, since I build Qt tools for the target system.

With my approach, the build will fail if the corresponding Qt packages are not installed on the host (because of qmake, moc, etc), but I don't know how to add that to BDEPEND without creating circular dependencies in the non-cross case.
A tool needed special handling: qfloat16-tables is normally compiled and executed during the build of qtcore but not installed, so the host doesn't have it. The patches add a QT5_COMPILE_FOR_HOST_SUBDIR variable and a qt5_qmake_host function to the eclass as a hack to handle that, but I'm not sure this is the right approach.

Related bugs:
- During the configure tests, the reloadSpec function of configure.pri reloads the mkspec platform file, so it overrides some Gentoo-provided variables, including QMAKE_CXX and QMAKE_CXXFLAGS (bugs 639494, 649420). Then the wrong compiler is called and platform detection does not work as intended. To work around that, the relevant variables are written directly to the mkspec.
- Some installed files reference the build environment, for instance the pkgconfig files contain "prefix = /usr/${CHOST}/usr", this is related to bug 610782.

The attached patches do not cover non-qtbase Qt libraries for now. qtdeclarative builds fine but some install paths are wrong unless an appropriate qt.conf is given to qmake.
Comment 1 Nicolas Chappe 2018-11-01 00:08:26 UTC
Created attachment 553798 [details, diff]
dev-qt/qtcore-5.11.2-r1 patch
Comment 2 Nicolas Chappe 2018-11-01 00:09:38 UTC
Created attachment 553800 [details, diff]
dev-qt/qtcore-5.11.2-r1 additional patch
Comment 3 Nicolas Chappe 2018-11-02 16:51:56 UTC
Created attachment 553856 [details, diff]
qt5-build.eclass patch v2 (fixed ar invocation)
Comment 4 tgyt 2022-04-01 12:52:28 UTC
Indeed. Upstream qtcore-5.15.2-r14 fails to compile. Not tried this patches, but confirm such problem. On amd64 cross-compile to aarch64-unknown-linux-gnu.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-01 12:53:06 UTC
(In reply to tgyt from comment #4)
> Indeed. Upstream qtcore-5.15.2-r14 fails to compile. Not tried this patches,
> but confirm such problem. On amd64 cross-compile to
> aarch64-unknown-linux-gnu.

A fresh build.log would be helpful.