Cross-compilation failed due to undefined references
Unsolved
Installation and Deployment
-
Hi everybody,
I am trying to cross-compile Qt 5 for the Raspberry Pi 3 model B. I followed this article from the wiki but also checked out this and this ones.
I tried with multiple versions of Qt: 5.15.3, 5.15.2 and 5.12.12 but all of these end up giving me the following error during the build:/usr/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/opt/orion-qt5/sysroot -Wl,--no-undefined -Wl,--version-script,QtCore.version -Wl,-O1 -Wl,--enable-new-dtags -Wl,-rpath-link,/opt/orion-qt5/sysroot/opt/vc/lib -Wl,-rpath-link,/opt/orion-qt5/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/opt/orion-qt5/sysroot/lib/arm-linux-gnueabihf -shared -Wl,-soname,libQt5Core.so.5 -o libQt5Core.so.5.15.3 .obj/minimum-linux.o .obj/qstring_compat.o .obj/qabstractanimation.o .obj/qvariantanimation.o .obj/qpropertyanimation.o .obj/qanimationgroup.o .obj/qsequentialanimationgroup.o .obj/qparallelanimationgroup.o .obj/qpauseanimation.o .obj/qendian.o .obj/qglobal.o .obj/qlibraryinfo.o .obj/qmalloc.o .obj/qnumeric.o .obj/qfloat16.o .obj/qoperatingsystemversion.o .obj/qlogging.o .obj/qrandom.o .obj/qhooks.o .obj/qversiontagging.o .obj/qrunnable.o .obj/qthread.o .obj/qthread_unix.o .obj/qatomic.o .obj/qmutex.o .obj/qreadwritelock.o .obj/qsemaphore.o .obj/qthreadpool.o .obj/qthreadstorage.o .obj/qwaitcondition_unix.o .obj/qexception.o .obj/qfutureinterface.o .obj/qfuturewatcher.o .obj/qresultstore.o .obj/qarraydata.o .obj/qbitarray.o .obj/qcryptographichash.o .obj/qfreelist.o .obj/qhash.o .obj/qline.o .obj/qlinkedlist.o .obj/qlist.o .obj/qpoint.o .obj/qmap.o .obj/qmargins.o .obj/qmessageauthenticationcode.o .obj/qcontiguouscache.o .obj/qrect.o .obj/qrefcount.o .obj/qringbuffer.o .obj/qshareddata.o .obj/qsharedpointer.o .obj/qsimd.o .obj/qsize.o .obj/qversionnumber.o .obj/qcommandlineoption.o .obj/qcommandlineparser.o .obj/bignum.o .obj/bignum-dtoa.o .obj/cached-powers.o .obj/diy-fp.o .obj/double-conversion.o .obj/fast-dtoa.o .obj/fixed-dtoa.o .obj/strtod.o .obj/qeasingcurve.o .obj/qtimeline.o .obj/qbytearray.o .obj/qbytearraylist.o .obj/qbytearraymatcher.o .obj/qcollator.o .obj/qlocale.o .obj/qlocale_tools.o .obj/qregexp.o .obj/qstring.o .obj/qstringbuilder.o .obj/qstringlist.o .obj/qstringview.o .obj/qtextboundaryfinder.o .obj/qunicodetools.o .obj/qvsnprintf.o .obj/qlocale_unix.o .obj/qlocale_icu.o .obj/qcollator_icu.o .obj/qregularexpression.o .obj/harfbuzz-buffer.o .obj/harfbuzz-gdef.o .obj/harfbuzz-gsub.o .obj/harfbuzz-gpos.o .obj/harfbuzz-impl.o .obj/harfbuzz-open.o .obj/harfbuzz-stream.o .obj/harfbuzz-shaper-all.o .obj/qharfbuzz.o .obj/qdatetime.o .obj/qcalendar.o .obj/qgregoriancalendar.o .obj/qjuliancalendar.o .obj/qmilankoviccalendar.o .obj/qromancalendar.o .obj/qhijricalendar.o .obj/qislamiccivilcalendar.o .obj/qjalalicalendar.o .obj/qtimezone.o .obj/qtimezoneprivate.o .obj/qtimezoneprivate_tz.o .obj/qtimezoneprivate_icu.o .obj/qdatetimeparser.o .obj/qabstractfileengine.o .obj/qbuffer.o .obj/qdataurl.o .obj/qtldurl.o .obj/qdebug.o .obj/qdir.o .obj/qdiriterator.o .obj/qfile.o .obj/qfiledevice.o .obj/qfileinfo.o .obj/qipaddress.o .obj/qiodevice.o .obj/qlockfile.o .obj/qnoncontiguousbytedevice.o .obj/qstorageinfo.o .obj/qtemporarydir.o .obj/qtemporaryfile.o .obj/qresource.o .obj/qresource_iterator.o .obj/qsavefile.o .obj/qstandardpaths.o .obj/qurl.o .obj/qurlidna.o .obj/qurlquery.o .obj/qurlrecode.o .obj/qfsfileengine.o .obj/qfsfileengine_iterator.o .obj/qfilesystementry.o .obj/qfilesystemengine.o .obj/qfileselector.o .obj/qloggingcategory.o .obj/qloggingregistry.o .obj/qfilesystemwatcher.o .obj/qfilesystemwatcher_polling.o .obj/qfilesystemwatcher_inotify.o .obj/qprocess.o .obj/qprocess_unix.o .obj/qsettings.o .obj/qfsfileengine_unix.o .obj/qfilesystemengine_unix.o .obj/qlockfile_unix.o .obj/qfilesystemiterator_unix.o .obj/forkfd_qt.o .obj/qstandardpaths_unix.o .obj/qstorageinfo_unix.o .obj/qabstractitemmodel.o .obj/qitemselectionmodel.o .obj/qabstractproxymodel.o .obj/qconcatenatetablesproxymodel.o .obj/qidentityproxymodel.o .obj/qsortfilterproxymodel.o .obj/qtransposeproxymodel.o .obj/qstringlistmodel.o .obj/qfactoryinterface.o .obj/qpluginloader.o .obj/qfactoryloader.o .obj/quuid.o .obj/qlibrary.o .obj/qelfparser_p.o .obj/qmachparser.o .obj/qlibrary_unix.o .obj/qabstracteventdispatcher.o .obj/qabstractnativeeventfilter.o .obj/qbasictimer.o .obj/qdeadlinetimer.o .obj/qelapsedtimer.o .obj/qeventloop.o .obj/qcoreapplication.o .obj/qcoreevent.o .obj/qmetaobject.o .obj/qmetatype.o .obj/qmetaobjectbuilder.o .obj/qmimedata.o .obj/qobject.o .obj/qobjectcleanuphandler.o .obj/qsignalmapper.o .obj/qsocketnotifier.o .obj/qtimer.o .obj/qtranslator.o .obj/qvariant.o .obj/qcoreglobaldata.o .obj/qsharedmemory.o .obj/qsystemsemaphore.o .obj/qpointer.o .obj/qmath.o .obj/qsystemerror.o .obj/qtestsupport_core.o .obj/qcore_unix.o .obj/qeventdispatcher_unix.o .obj/qtimerinfo_unix.o .obj/qelapsedtimer_unix.o .obj/qeventdispatcher_glib.o .obj/qsharedmemory_posix.o .obj/qsharedmemory_systemv.o .obj/qsharedmemory_unix.o .obj/qsystemsemaphore_posix.o .obj/qsystemsemaphore_systemv.o .obj/qsystemsemaphore_unix.o .obj/qutfcodec.o .obj/qlatincodec.o .obj/qsimplecodec.o .obj/qtextcodec.o .obj/qisciicodec.o .obj/qtsciicodec.o .obj/qicucodec.o .obj/qcborcommon.o .obj/qcbordiagnostic.o .obj/qcborvalue.o .obj/qdatastream.o .obj/qjsoncbor.o .obj/qjsondocument.o .obj/qjsonobject.o .obj/qjsonarray.o .obj/qjsonvalue.o .obj/qjsonwriter.o .obj/qjsonparser.o .obj/qtextstream.o .obj/qxmlstream.o .obj/qxmlutils.o .obj/qcborstreamreader.o .obj/qcborstreamwriter.o .obj/qbinaryjson.o .obj/qbinaryjsonarray.o .obj/qbinaryjsonobject.o .obj/qbinaryjsonvalue.o .obj/qstatemachine.o .obj/qabstractstate.o .obj/qstate.o .obj/qfinalstate.o .obj/qhistorystate.o .obj/qabstracttransition.o .obj/qsignaltransition.o .obj/qeventtransition.o .obj/qmimedatabase.o .obj/qmimetype.o .obj/qmimemagicrulematcher.o .obj/qmimetypeparser.o .obj/qmimemagicrule.o .obj/qmimeglobpattern.o .obj/qmimeprovider.o .obj/moc_qcalendar.o .obj/moc_qobjectdefs.o .obj/moc_qmimetype.o -lpthread -lm -lz -licui18n -licuuc -licudata -ldl /opt/orion-qt5/qtbase/lib/libqtpcre2.a -L/opt/orion-qt5/sysroot/usr/lib/arm-linux-gnueabihf -lgthread-2.0 -lglib-2.0 /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: .obj/qrandom.o: in function `QRandomGenerator::SystemGenerator::generate(unsigned int*, unsigned int*) [clone .constprop.36]': qrandom.cpp:(.text+0x30): undefined reference to `getentropy' /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: qrandom.cpp:(.text+0x50): undefined reference to `getentropy' /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: .obj/qrandom.o: in function `QRandomGenerator::SystemGenerator::generate(unsigned int*, unsigned int*)': qrandom.cpp:(.text+0x88): undefined reference to `getentropy' /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: qrandom.cpp:(.text+0xa8): undefined reference to `getentropy' /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: .obj/qfilesystemengine_unix.o: in function `QFileSystemEngine::fillMetaData(int, QFileSystemMetaData&)': qfilesystemengine_unix.cpp:(.text+0x23e): undefined reference to `statx' /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: .obj/qfilesystemengine_unix.o: in function `QFileSystemEngine::fillMetaData(QFileSystemEntry const&, QFileSystemMetaData&, QFlags<QFileSystemMetaData::MetaDataFlag>)': qfilesystemengine_unix.cpp:(.text+0xb00): undefined reference to `statx' /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: qfilesystemengine_unix.cpp:(.text+0xeac): undefined reference to `statx' /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/bin/ld: .obj/qfilesystemengine_unix.o: in function `QFileSystemEngine::renameFile(QFileSystemEntry const&, QFileSystemEntry const&, QSystemError&)': qfilesystemengine_unix.cpp:(.text+0x1c2a): undefined reference to `renameat2' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:1267: ../../lib/libQt5Core.so.5.15.3] Error 1 make[2]: Leaving directory '/opt/orion-qt5/qtbase/src/corelib' make[1]: *** [Makefile:226: sub-corelib-make_first] Error 2 make[1]: Leaving directory '/opt/orion-qt5/qtbase/src' make: *** [Makefile:51: sub-src-make_first] Error 2
I am compiling from Debian 10 in Docker.
This is the configuration I'm using
./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -sysroot /opt/orion-qt5/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/orion-qt5/sysroot -hostprefix /opt/orion-qt5/sysroot -v -no-use-gold-linker
and these the versions:
# arm-linux-gnueabihf-g++ -v Using built-in specs. COLLECT_GCC=arm-linux-gnueabihf-g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabihf/8/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-2' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- --includedir=/usr/arm-linux-gnueabihf/include Thread model: posix gcc version 8.3.0 (Debian 8.3.0-2) # arm-linux-gnueabihf-cpp --version arm-linux-gnueabihf-cpp (Debian 8.3.0-2) 8.3.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I have to mention that, to be sure, I directly mounted the root of the SD card to my
sysroot
directory since I doubted some library could have been missed by rsync but nothing changed.
Any clue?
Also the EGLFS, which is quite crucial, is always disabled by the configure script:QPA backends: DirectFB ............................... no EGLFS .................................. no LinuxFB ................................ yes VNC .................................... yes
Thanks in advance!