Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-138085

Issues Building with Static Boot2Qt SDK: CMake/QtQuick Project Fails & Documentation Gaps

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.3
    • Build System
    • None
    • Linux/Yocto

    Description

      Hello,

      I've been working on building a static version of Boot2Qt using Yocto/BitBake. After considerable effort, I managed to build an image with static Qt libraries. However, I found that the official documentation (Building Static Version of Qt) is missing several key details:

      • If you simply set PACKAGECONFIG += "static" in a qt6_git.bbappend and build with bitbake meta-b2qt-embedded-qbsp, the build fails at qtapplicationmanager. I had to remove wayland and vulkan from DISTRO_FEATURES to skip building qtapplicationmanager. I also removed webengine to reduce build complexity.
      • It appears qtapplicationmanager does not support static builds—a fact which should be documented, alongside any other unsupported modules or special requirements.
      • Moreover, I also tried to set PACKAGECONFIG = "ltcg" and/or PACKAGECONFIG += +"optimize-size". Both resulting in errors.

      After building, I attempted to install the resulting QBSP via Qt MaintenanceTool. However, MaintenanceTool does not distinguish between standard and static QBSP packages and seems to get confused if both are present in parallel. I believe that when building a static SDK (with PACKAGECONFIG += "static"), the resulting SDK, image, and QBSP should clearly indicate it is static—much like how wasm variants are labeled (e.g., wasm-singlethreaded/multithreaded).

      To avoid these issues, I manually installed the generated toolchain using the .sh installer. I then tried to build a simple QtQuick project from the command line (using the sourced toolchain environment). However, when running cmake, the configuration process fails with various errors relating to Qt6/QtQuick, even though the libraries are present and the environment appears correct. This makes it impossible to build even basic applications for Boot2Qt using the static toolchain.

      Steps to Reproduce:
      1. Build a static Boot2Qt image and SDK using Yocto/BitBake:
        - Set required variables in a custom meta-layer (PACKAGECONFIG += "static", DISTRO_FEATURES:remove = "webengine wayland vulkan", etc.).
        - Build succeeds and produces an image/toolchain containing static Qt libraries.
      2. Install the generated SDK and source the environment script.
      3. Create a simple QtQuick project (e.g., using Qt Creator template or a minimal main.cpp/main.qml).
      4. Run cmake .. in the project directory.

      Result:
      CMake configuration fails with errors related to Qt6/QtQuick (even though the static libs are present and the toolchain appears to be set up correctly).

      What I Have Tried/Checked:
      1. Verified the SDK toolchain environment is active.
      2. Confirmed static libraries (libQt6Core.a, libQt6Quick.a, etc.) exist in the expected path.
      3. Rebuilt both SDK and application from scratch—issue persists.
      4. Tried removing the standard QBSP from MaintenanceTool and installing only the static one: CMake and Qt Creator builds still fail.

      Yocto/SDK/Qt Versions:

      • Yocto version: 5.0.7
      • Qt version: 6.8.3
      • Host OS: Ubuntu 22.04 LTS
      • Target: Raspberry Pi 4 (MACHINE=raspberrypi-armv8)

      Questions:

      • Is a static Boot2Qt build officially supported?
      • Are there known issues or extra steps needed to use the SDK’s static Qt for cross-building applications with CMake?
      • Should I pass additional CMake options or flags for static builds?
      • Am I missing any configuration to get a static Boot2Qt SDK/toolchain working properly with MaintenanceTool or Qt Creator?

      Any guidance, documentation, or suggestions on how to proceed would be greatly appreciated. Thank you for your support.

      Best regards,

      Romain Donzé

      Attachments

        1. CMakeLogs.txt
          18 kB
        2. test.zip
          2 kB
        3. log.do_configure.521839
          21 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtbuildsystem Qt Build System Team
              romain.donze Romain Donzé
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes