Cross Compile Error
Unsolved
Mobile and Embedded
-
Hi all,
I am following this Qt article about how to cross compile Qt for Raspberry, but I am getting problems for generate the Qt 6 binaries for aarch64 using the Raspbery Sysroot. I am using Ubuntu 20.04 on a virtual machine and Qt 6.6.0.Compilation output :
adriano@cross-compiler:~/qtpi-build$ cmake --build . --parallel 6 [95/10141] Building CXX object qtshadertools/src/glslang/CMakeFiles/BundledGlslang_Spirv.dir/__/3rdparty/glslang/SPIRV/GlslangToSpv.cpp.o /home/adriano/qt5/qtshadertools/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp: In function ‘spv::Scope {anonymous}::TGlslangToSpvTraverser::TranslateMemoryScope(const spv::Builder::AccessChain::CoherentFlags&)’: /home/adriano/qt5/qtshadertools/src/3rdparty/glslang/SPIRV/GlslangToSpv.cpp:646:12: note: parameter passing for argument of type ‘const spv::Builder::AccessChain::CoherentFlags’ changed in GCC 9.1 646 | spv::Scope TGlslangToSpvTraverser::TranslateMemoryScope( | ^~~~~~~~~~~~~~~~~~~~~~ [241/10141] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/text/qlocale.cpp.o /home/adriano/qt5/qtbase/src/corelib/text/qlocale.cpp: In function ‘QLocalePrivate::codeToLanguage(QStringView, QLocale::LanguageCodeTypes)::<lambda(auto:33)> [with auto:33 = QLocalePrivate::codeToLanguage(QStringView, QLocale::LanguageCodeTypes)::<lambda(const LanguageCodeEntry&)>]::<lambda(const LanguageCodeEntry&)>’: /home/adriano/qt5/qtbase/src/corelib/text/qlocale.cpp:112:29: note: parameter passing for argument of type ‘const AlphaCode’ changed in GCC 9.1 112 | [=](const LanguageCodeEntry &i) { return f(i) == codeBuf; }); | ^ /home/adriano/qt5/qtbase/src/corelib/text/qlocale.cpp: In function ‘QLocalePrivate::codeToLanguage(QStringView, QLocale::LanguageCodeTypes)::<lambda(auto:33)> [with auto:33 = QLocalePrivate::codeToLanguage(QStringView, QLocale::LanguageCodeTypes)::<lambda(const LanguageCodeEntry&)>]::<lambda(const LanguageCodeEntry&)>’: /home/adriano/qt5/qtbase/src/corelib/text/qlocale.cpp:112:29: note: parameter passing for argument of type ‘const AlphaCode’ changed in GCC 9.1 [610/10141] Linking CXX shared library qtbase/lib/libQt6DBus.so.6.6.0 FAILED: qtbase/lib/libQt6DBus.so.6.6.0 : && /usr/bin/aarch64-linux-gnu-g++-9 --sysroot=/home/adriano/rpi-sysroot/ -fPIC -march=armv8-a -I/home/adriano/rpi-sysroot//usr/include -pipe -O2 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--no-undefined -Wl,--version-script,/home/adriano/qtpi-build/qtbase/src/dbus/DBus.version -Wl,--enable-new-dtags -shared -Wl,-soname,libQt6DBus.so.6 -o qtbase/lib/libQt6DBus.so.6.6.0 qtbase/src/dbus/CMakeFiles/DBus.dir/DBus_autogen/mocs_compilation.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbus_symbols.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusabstractadaptor.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusabstractinterface.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusargument.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusconnection.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusconnectioninterface.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbuscontext.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbuserror.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusextratypes.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusintegrator.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusinterface.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusinternalfilters.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusintrospection.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusmessage.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusmetaobject.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusmetatype.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusmisc.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbuspendingcall.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbuspendingreply.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusreply.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusserver.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusservicewatcher.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusunixfiledescriptor.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusutil.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusvirtualobject.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusxmlgenerator.cpp.o qtbase/src/dbus/CMakeFiles/DBus.dir/qdbusxmlparser.cpp.o -Wl,-rpath,/home/adriano/rpi-sysroot/:/home/adriano/qtpi-build/qtbase/lib: /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a qtbase/lib/libQt6Core.so.6.6.0 -lpthread && : /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a(libdbus_1_la-dbus-message.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `dbus_message_unref' which may bind externally can not be used when making a shared object; recompile with -fPIC /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a(libdbus_1_la-dbus-message.o): in function `_dbus_message_loader_unref': (.text+0x59d8): dangerous relocation: unsupported relocation /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a(libdbus_1_la-dbus-timeout.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_dbus_timeout_unref' which may bind externally can not be used when making a shared object; recompile with -fPIC /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a(libdbus_1_la-dbus-timeout.o): in function `_dbus_timeout_list_free': (.text+0x130): dangerous relocation: unsupported relocation /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a(libdbus_1_la-dbus-watch.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_dbus_watch_unref' which may bind externally can not be used when making a shared object; recompile with -fPIC /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a(libdbus_1_la-dbus-watch.o): in function `_dbus_watch_list_free': (.text+0x1b0): dangerous relocation: unsupported relocation /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a(libdbus_1_la-dbus-sysdeps-unix.o): in function `_dbus_listen_systemd_sockets': (.text+0x204c): undefined reference to `sd_listen_fds' /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: (.text+0x2090): undefined reference to `sd_is_socket' /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a(libdbus_1_la-dbus-userdb.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_dbus_group_info_unref' which may bind externally can not be used when making a shared object; recompile with -fPIC /home/adriano/rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a(libdbus_1_la-dbus-userdb.o): in function `_dbus_user_database_new': (.text+0x4e8): dangerous relocation: unsupported relocation collect2: error: ld returned 1 exit status [615/10141] Building CXX object qtbase/src/testlib/CMakeFiles/Test.dir/cmake_pch.hxx.gch ninja: build stopped: subcommand failed.
Best regards
-
@adrianomunin What are you using for cmake, did you apt install or build from source?