Cross Compilation Qt6.3.1 for Raspberry Pi 4
-
Hi, I'm trying to cross compile Qt6.3.1 for Raspberry Pi 4. I am following this guide https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi.
I have got this working previously with a Raspberry Pi OS Bullseye install but now it is not working and I haven't changed anything particularly.
I have gotten several different issues that I've pushed past through. I will list some of them for context and if anyone has answers towards:
-
Toolchain.cmake does not work with Linaro aarch64 compilers, but it works with the gcc arm compilers installed through apt repository.
-
I tried to compile with target ARM Ubuntu 20.04 Server version as well but that was also unsuccessful.
-
When it was working previously, I could only use LinuxFB. For some reason EGLFS was not working.
-
This is my current blocking issue. Using TARGET: Raspberry Pi Bullseye Sysroot and HOST: Ubuntu 20.04 x86.
After successfully configuring, but then it fails during building.
sudo ../../qt6source/configure -release -opengl es2 -nomake examples -nomake tests -qt-host-path $HOME/hostQt/install -prefix /usr/local/qt6 -extprefix $HOME/rpi/install -device-option CROSS_COMPILE=aarch64-linux-gnu- -- -DCMAKE_TOOLCHAIN_FILE=$HOME/rpi/tools/toolchain.cmake -DQT_FEATURE_xcb=ON -DFEATURE_xcb_xlib=ON -DQT_FEATURE_xlib=ON -DTEST_egl_brcm=ON + mkdir -p qtbase + cd qtbase + exec /home/shady/qt6source/qtbase/configure -top-level -release -opengl es2 -nomake examples -nomake tests -qt-host-path /home/shady/hostQt/install -prefix /usr/local/qt6 -extprefix /home/shady/rpi/install -device-option CROSS_COMPILE=aarch64-linux-gnu- -- -DCMAKE_TOOLCHAIN_FILE=/home/shady/rpi/tools/toolchain.cmake -DQT_FEATURE_xcb=ON -DFEATURE_xcb_xlib=ON -DQT_FEATURE_xlib=ON -DTEST_egl_brcm=ON '/usr/bin/cmake' '-DQT_HOST_PATH=/home/shady/hostQt/install' '-DCMAKE_TOOLCHAIN_FILE=/home/shady/rpi/tools/toolchain.cmake' '-DQT_FEATURE_xcb=ON' '-DFEATURE_xcb_xlib=ON' '-DQT_FEATURE_xlib=ON' '-DTEST_egl_brcm=ON' '-DCMAKE_INSTALL_PREFIX=/usr/local/qt6' '-DCMAKE_STAGING_PREFIX=/home/shady/rpi/install' '-DQT_BUILD_EXAMPLES=FALSE' '-DQT_BUILD_TESTS=FALSE' '-DCMAKE_BUILD_TYPE=Release' '-DQT_QMAKE_DEVICE_OPTIONS=CROSS_COMPILE=aarch64-linux-gnu-' '-DINPUT_opengl=es2' '-G' 'Ninja' '/home/shady/qt6source' -- The CXX compiler identification is GNU 9.4.0 -- The C compiler identification is GNU 9.4.0 -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/aarch64-linux-gnu-gcc-9 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++-9 - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc-9 - skipped -- Detecting C compile features -- Detecting C compile features - done Checking dependencies of submodule 'qtbase' Checking dependencies of submodule 'qtimageformats' Checking dependencies of submodule 'qtlanguageserver' Checking dependencies of submodule 'qtshadertools' Checking dependencies of submodule 'qtsvg' Checking dependencies of submodule 'qtdeclarative' Skipping optional dependency 'qtimageformats' of 'qtdeclarative', because qtimageformats's CMakeLists.txt couldn't be found. Skipping optional dependency 'qtlanguageserver' of 'qtdeclarative', because qtlanguageserver's CMakeLists.txt couldn't be found. Skipping optional dependency 'qtsvg' of 'qtdeclarative', because qtsvg's CMakeLists.txt couldn't be found. Checking dependencies of submodule 'qt5compat' Configuring submodule 'qtbase' -- Could NOT find double-conversion (missing: double-conversion_DIR) -- Could NOT find md4c (missing: md4c_DIR) CMake Warning (dev) at qtbase/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake:180 (message): XINPUT from XCB was requested: this is EXPERIMENTAL and is likely to unavailable on many systems! Call Stack (most recent call first): qtbase/cmake/QtFindPackageHelpers.cmake:130 (find_package) qtbase/src/gui/configure.cmake:123 (qt_find_package) qtbase/cmake/QtFeature.cmake:573 (include) qtbase/src/CMakeLists.txt:12 (qt_feature_evaluate_features) This warning is for project developers. Use -Wno-dev to suppress it. -- Could NOT find double-conversion (missing: double-conversion_DIR) -- Could NOT find md4c (missing: md4c_DIR) CMake Warning (dev) at qtbase/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake:180 (message): XINPUT from XCB was requested: this is EXPERIMENTAL and is likely to unavailable on many systems! Call Stack (most recent call first): qtbase/cmake/QtFindPackageHelpers.cmake:130 (find_package) qtbase/src/gui/configure.cmake:123 (qt_find_package) qtbase/cmake/QtModuleHelpers.cmake:572 (include) qtbase/src/gui/CMakeLists.txt:53 (qt_internal_add_module) This warning is for project developers. Use -Wno-dev to suppress it. Configuring submodule 'qtimageformats' Configuring submodule 'qtlanguageserver' Configuring submodule 'qtshadertools' -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes Configuring submodule 'qtsvg' Configuring submodule 'qtdeclarative' Configuring submodule 'qt5compat' -- The following packages have been found: * QtBuildInternals * WrapSystemZLIB (required version >= 1.0.8) * DBus1 (required version >= 1.2) * WrapDBus1 (required version >= 1.2) * Libudev * Backtrace * OpenSSL * JPEG * ZLIB * PNG * OpenGL * WrapPCRE2 * WrapZLIB * WrapBacktrace * ICU * WrapRt * WrapSystemPCRE2 (required version >= 10.20) * WrapBrotli * WrapOpenSSLHeaders * WrapOpenSSL * GLIB2, Event loop and utility library, <https://wiki.gnome.org/Projects/GLib> * WrapHarfbuzz * WrapPNG * ATSPI2 * DirectFB * WrapSystemFreetype (required version >= 2.2.0) * gbm, Mesa gbm library., <http://www.mesa3d.org> * WrapSystemJpeg * WrapSystemPNG * WrapOpenGL * Wayland, C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients, <http://wayland.freedesktop.org> * Freetype * Fontconfig * X11 * X11_XCB, A compatibility library for code that translates Xlib API calls into XCB calls, <http://xorg.freedesktop.org/> * XCB (required version >= 1.12), X protocol C-language Binding, <http://xcb.freedesktop.org> * XKB_COMMON_X11 (required version >= 0.5.0) * XRender (required version >= 0.6) * Libinput, Library to handle input devices in Wayland compositors and to provide a generic X.Org input driver., <http://www.freedesktop.org/wiki/Software/libinput/> * Mtdev * Libdrm, Userspace interface to kernel DRM services., <https://wiki.freedesktop.org/dri/> * SQLite3 * Interbase, Interbase client library, <https://www.embarcadero.com/products/interbase> * PostgreSQL * WrapFreetype * WrapJpeg * Tslib * Cups * Qt6WidgetsTools (required version >= 6.3.1) * Qt6Widgets (required version >= 6.3.1) * Qt6OpenGLWidgets (required version >= 6.3.1) * Qt6Sql (required version >= 6.3.1) * Qt6Concurrent (required version >= 6.3.1) * Qt6ShaderToolsTools (required version >= 6.3.1) * Qt6ShaderTools (required version >= 6.3.1) * Python * Qt6Test (required version >= 6.3.1) * Qt6BuildInternals (required version >= 6.3.1) * WrapAtomic * Qt6CoreTools (required version >= 6.3.1) * Qt6Core (required version >= 6.3.1) * Qt6Network (required version >= 6.3.1) * Qt6Xml (required version >= 6.3.1) * EGL, A platform-agnostic mechanism for creating rendering surfaces for use with other graphics libraries, such as OpenGL|ES and OpenVG., <https://www.khronos.org/egl/> * GLESv2 * PkgConfig * XKB (required version >= 0.5.0), XKB API common to servers and clients., <http://xkbcommon.org> * Qt6DBusTools (required version >= 6.3.1) * Qt6DBus (required version >= 6.3.1) * Qt6Gui (required version >= 6.3.1) * Qt6QmlTools (required version >= 6.3.1) * Qt6QmlModels (required version >= 6.3.1) * Threads * Qt6OpenGL (required version >= 6.3.1) * Qt6Quick (required version >= 6.3.1) * Qt6 (required version >= 6.3.1) * Qt6HostInfo * WrapIconv -- The following OPTIONAL packages have not been found: * zstd * WrapZSTD (required version >= 1.3), ZSTD compression library, <https://github.com/facebook/zstd> * PCRE2 * unofficial-brotli * double-conversion * WrapDoubleConversion * Libsystemd * Libb2 * Slog2 * Libproxy * GSSAPI, Generic Security Services Application Program Interface * harfbuzz (required version >= 2.6.0) * WrapSystemHarfbuzz (required version >= 2.6.0) * md4c * WrapSystemMd4c * Vulkan * WrapVulkanHeaders * GTK3 (required version >= 3.6) * DB2, IBM DB2 client library, <https://www.ibm.com> * MySQL, MySQL client library, <https://www.mysql.com> * Oracle, Oracle client library, <https://www.oracle.com> * ODBC * Qt6LanguageServerPrivate (required version >= 6.3.1) * Qt6LinguistTools (required version >= 6.3.1) * LTTngUST * Qt6QmlCompilerPlusPrivate -- Configuration summary has been written to /home/shady/rpi/build/config.summary -- Configure with --log-level=STATUS or higher to increase the output verbosity. -- Configure summary: Building for: linux-g++ (arm64, CPU features: cx16 neon) Compiler: gcc 9.4.0 Build options: Mode ................................... release Optimize release build for size ........ no Fully optimize release builds (-O3) .... no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++17 Using ccache ........................... no Using new DTAGS ........................ yes Relocatable ............................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: Intrinsics without compiler architecture option yes Extensions ........................... NEON Sanitizers: Addresses ............................ no Threads .............................. no Memory ............................... no Fuzzer (instrumentation only) ........ no Undefined ............................ no Build parts ............................ libs Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... yes Qt Gui ................................. yes Qt Network ............................. yes Qt PrintSupport ........................ yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... yes udev ................................... yes Using system zlib ...................... yes Zstandard support ...................... no Thread support ......................... yes Common build options: Linker can resolve circular dependencies yes Qt Core: backtrace .............................. yes DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... yes ICU .................................... yes Using system libb2 ..................... no Built-in copy of the MIME database ..... yes cpp/winrt base ......................... no Tracing backend ........................ <none> Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no PCRE2 .................................. yes Using system PCRE2 ................... yes CLONE_PIDFD support in forkfd .......... yes Qt Sql: SQL item models ........................ yes Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ yes DTLS ................................... yes OCSP-stapling .......................... yes SCTP ................................... no Use system proxies ..................... yes GSSAPI ................................. no Brotli Decompression Support ........... yes Core tools: Android deployment tool ................ no macOS deployment tool .................. no Windows deployment tool ................ no qmake .................................. yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ yes HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. yes Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... yes PNG .................................. yes Using system libpng ................ yes Text formats: HtmlParser ........................... yes CssParser ............................ yes OdfWriter ............................ yes MarkdownReader ....................... yes Using system libmd4c ............... no MarkdownWriter ....................... yes EGL .................................... yes OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no OpenGL ES 2.0 ........................ yes OpenGL ES 3.0 ........................ yes OpenGL ES 3.1 ........................ yes OpenGL ES 3.2 ........................ yes Vulkan ................................. no Session Management ..................... yes Features used by QPA backends: evdev .................................. yes libinput ............................... yes HiRes wheel support in libinput ........ no INTEGRITY HID .......................... no mtdev .................................. yes tslib .................................. yes xkbcommon .............................. yes X11 specific: xlib ................................. yes XCB Xlib ............................. yes EGL on X11 ........................... yes xkbcommon-x11 ........................ yes xcb-sm ............................... yes QPA backends: DirectFB ............................... no EGLFS .................................. yes EGLFS details: EGLFS OpenWFD ........................ no EGLFS i.Mx6 .......................... no EGLFS i.Mx6 Wayland .................. no EGLFS RCAR ........................... no EGLFS EGLDevice ...................... yes EGLFS GBM ............................ yes EGLFS VSP2 ........................... no EGLFS Mali ........................... no EGLFS Raspberry Pi ................... yes EGLFS X11 ............................ yes LinuxFB ................................ yes VNC .................................... yes VK_KHR_display ......................... no QNX: lgmon ................................ no IMF .................................. no XCB: Using system-provided xcb-xinput ..... no GL integrations: GLX Plugin ......................... no XCB GLX .......................... no EGL-X11 Plugin ..................... yes Windows: Direct 2D ............................ no Direct 2D 1.1 ........................ no DirectWrite .......................... no DirectWrite 3 ........................ no Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows Qt Testlib: Tester for item models ................. yes Qt PrintSupport: CUPS ................................... yes Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. yes MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. yes SQLite ................................. yes Using system provided SQLite ......... no Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML just-in-time compiler .............. yes QML sequence object .................... yes QML XML http request ................... yes QML Locale ............................. yes Qt QML Models: QML list model ......................... yes QML delegate model ..................... yes Qt Quick: AnimatedImage item ..................... yes Canvas item ............................ yes Support for Qt Quick Designer .......... yes Flipable item .......................... yes GridView item .......................... yes ListView item .......................... yes TableView item ......................... yes TreeView item .......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes Repeater item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Calendar support ....................... yes Qt Quick Controls 2: Styles ................................. Basic Fusion Imagine Material Universal macOS Windows Qt 5 Compatibility Libraries: iconv .................................. no -- Qt is now configured for building. Just run 'cmake --build . --parallel' Once everything is built, you must run 'cmake --install .' Qt will be installed into '/usr/local/qt6' To configure and build other Qt modules, you can use the following convenience script: /home/shady/rpi/install/bin/qt-configure-module If reconfiguration fails for some reason, try removing 'CMakeCache.txt' from the build directory -- Configuring done -- Generating done -- Build files have been written to: /home/shady/rpi/build ```ter item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Calendar support ....................... yes Qt Quick Controls 2: Styles ................................. Basic Fusion Imagine Material Universal macOS Windows Qt 5 Compatibility Libraries: iconv .................................. no -- Qt is now configured for building. Just run 'cmake --build . --parallel' Once everything is built, you must run 'cmake --install .' Qt will be installed into '/usr/local/qt6' To configure and build other Qt modules, you can use the following convenience script: /home/shady/rpi/install/bin/qt-configure-module If reconfiguration fails for some reason, try removing 'CMakeCache.txt' from the build directory -- Configuring done -- Generating done -- Build files have been written to: /home/shady/rpi/buildAnd here is the failure:
FAILED: qtbase/lib/libQt6DBus.so.6.3.1 qtbase/src/dbus/DBus.version /home/shady/rpi/build/qtbase/src/dbus/DBus.version cd /home/shady/qt6source/qtbase/src/dbus && /usr/bin/perl /home/shady/qt6source/qtbase/mkspecs/features/data/unix/findclasslist.pl < /home/shady/rpi/build/qtbase/src/dbus/DBus.version.in > /home/shady/rpi/build/qtbase/src/dbus/DBus.version && cd /home/shady/rpi/build && /usr/bin/aarch64-linux-gnu-g++-9 --sysroot=/home/shady/rpi/piOSsysroot -fPIC -I/home/shady/rpi/piOSsysroot/usr/include -pipe -O2 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -ldbus-1 -Wl,--version-script,/home/shady/rpi/build/qtbase/src/dbus/DBus.version -Wl,--no-undefined -Wl,--enable-new-dtags -shared -Wl,-soname,libQt6DBus.so.6 -o qtbase/lib/libQt6DBus.so.6.3.1 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/shady/rpi/piOSsysroot:/home/shady/rpi/build/qtbase/lib: /home/shady/rpi/piOSsysroot/usr/lib/aarch64-linux-gnu/libdbus-1.a qtbase/lib/libQt6Core.so.6.3.1 -lpthread && : /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/shady/rpi/piOSsysroot/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/shady/rpi/piOSsysroot/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/shady/rpi/piOSsysroot/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/shady/rpi/piOSsysroot/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/shady/rpi/piOSsysroot/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/shady/rpi/piOSsysroot/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/shady/rpi/piOSsysroot/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/shady/rpi/piOSsysroot/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/shady/rpi/piOSsysroot/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 [605/4156] Building C object qtbase/sr...r/__/__/__/3rdparty/sqlite/sqlite3.c.o ninja: build stopped: subcommand failed.Any insight or help would be appreciated!!! Please let me know if you need more information.
-
-
From known issues in https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi:
This could happen when the libdbus inside the initial sysroot is not a dynamically shared objects. This is normally fixable by doing a clean reinstall of Raspberry Pi OS (reformat microSD card, then install Raspberry Pi OS again through the Imager). Another recommendation is to try to reinstall libdbus-1-dev package. But if the problem persists and you don't need dbus, you can disable the dbus feature by adding -DFEATURE_dbus=OFF flag in the CMake configuration command.
Another walkaround worth trying is to change
from:
set(QT_LINKER_FLAGS "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed")to:
set(QT_LINKER_FLAGS "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -ldbus-1")Additionally make sure that link to rpi-sysroot/usr/lib/aarch64-linux-gnu/libdbus-1.so is valid. It should be linking to libdbus-1.so.3.19.13 in the same directory.
Note: You'll need DBus to have Bluetooth module working.
-
Broken Link in sysroot/usr/lib/aarch64-linux-gnu/libdbus-1 just fix the symbolic link and away you go.