Created attachment 654376 [details] compressed build log it is very difficult to find any information on how to cross compile any dev-qt/* stuff, so I just tried it and the cross-emerge wrappers fail as they rely on target /usr/bin/qmake rather than hosts binary: armv7a-unknown-linux-gnueabihf-g++ -o "../bin/qmake" main.o meta.o option.o project.o property.o ioutils.o proitems.o qmakebuiltins.o qmakeevaluator.o qmakeglobals.o qmakeparser.o qmakevfs.o pbuilder_pbx.o makefile.o makefiledeps.o metamakefile.o projectgenerator.o unixmake2.o unixmake.o mingw_make.o msbuild_objectmodel.o msvc_nmake.o msvc_objectmodel.o msvc_vcproj.o msvc_vcxproj.o winmakefile.o xmloutput.o qutfcodec.o qendian.o qglobal.o qlogging.o qmalloc.o qnumeric.o qoperatingsystemversion.o qrandom.o qabstractfileengine.o qbuffer.o qdatastream.o qdebug.o qdir.o qdiriterator.o qfile.o qfiledevice.o qfileinfo.o qfilesystemengine.o qfilesystementry.o qfsfileengine.o qfsfileengine_iterator.o qiodevice.o qsettings.o qtemporaryfile.o qtextstream.o qjsonarray.o qjson.o qjsondocument.o qjsonobject.o qjsonparser.o qjsonvalue.o qmetatype.o qsystemerror.o qvariant.o quuid.o qarraydata.o qbitarray.o qbytearray.o qbytearraylist.o qbytearraymatcher.o qcalendar.o qgregoriancalendar.o qromancalendar.o qcryptographichash.o qdatetime.o qhash.o qlist.o qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o qstringbuilder.o qstring.o qstringlist.o qversionnumber.o qvsnprintf.o qxmlstream.o qxmlutils.o qcore_unix.o qfilesystemengine_unix.o qfilesystemiterator_unix.o qfsfileengine_unix.o qlocale_unix.o qlibraryinfo.o -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/configure: line 847: /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2_build/bin/qmake: cannot execute binary file: Exec format error * ERROR: dev-qt/qtcore-5.14.2::gentoo failed (configure phase):
Created attachment 654378 [details] output from cross-emerge --info
is there a way to disable the bootstrap of qmake? I'm very unfamiliar with the qt5-build eclass
I dig
I've dug into the qt5-build eclass and the eclass is not cross-compile friendly. According to https://doc.qt.io/archives/qt-4.8/qt-embedded-crosscompiling.html, cross-compiling qt packages requires a specialized qmake build dedicated to cross-compilation. The current eclass build the qmake tool with the cross-compiler which is not working. Changing the eclass to detect the cross-compiling situation to make a suitable qmake tool might work, however it will not be possible to build qt packages natively on the target as the target qmake tool would not exist. Maybe fixing both `-xplatform` and `-platform` options to match the target when configuring the qmake tool would work. I'll try to have a look and tinker with the eclass to see if i can make cross-compilation work. Also, i think this bug should blocks https://bugs.gentoo.org/662714
Indeed, cross compilation has never been supported in qt5-build.eclass unfortunately.
Created attachment 711729 [details] modified eclass I modified the qt5-build eclass to make it cross-compile friendly. I managed to cross compile dev-qt/qtcore as well as other dev-qt packages with QT5_MODULE variable set to qtbase and qttools. However there is an issue with this modified version: it installs tools built for the host in the target directory /usr/${CHOST} (moc, qlalr, qmake, rcc), and as these tools are required to emerge some other dev-qt/ packages, it is not possible to natively compile these packages. I think it is possible to install those binaries in a separate folder of the target directory, like /usr/${CHOST}/usr/${CBUILD}/qt5/bin/, and cross-build qmake & co for the target, but i think the tools compiled for the build system should never end up in the target dir, and I don't know the "right" way to manage this problem.
/usr/aarch64-unknown-linux-gnu/tmp/portage/dev-qt/qtcore-5.15.2-r14/work/qtbase-f4ac0b55c37f2b594ffbe639db43dac365825c7c/configure: line 858: /usr/aarch64-unknown-linux-gnu/tmp/portage/dev-qt/qtcore-5.15.2-r14/work/qtbase-f4ac0b55c37f2b594ffbe639db43dac365825c7c_build/bin/qmake: cannot execute binary file: Exec format error
On upstream(not patched) portage tree
(In reply to tgyt from comment #8) > On upstream(not patched) portage tree As I said on the other bug, a fresh build.log and emerge --info please (on one bug, not both).
Created attachment 768367 [details] compressed build log from armv7-cross please find the compressed build log attached, here is the most interesting part of it: /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-qt/qtcore-5.15.2-r14/work/qtbase-f4ac0b55c37f2b594ffbe639db43dac365825c7c/configure: line 858: /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-qt/qtcore-5.15.2-r14/work/qtbase-f4ac0b55c37f2b594ffbe639db43dac365825c7c_build/bin/qmake: cannot execute binary file: Exec format error
Created attachment 846798 [details] build.log for aarch64-unknown-linux-gnu
Created attachment 846800 [details] aarch64-unknown-linux-gnu-emerge --info
Created attachment 846802 [details] build.log for armv7a-unknown-linux-gnueabihf
Created attachment 846804 [details] armv7a-unknown-linux-gnueabihf --info