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

Provide a way to directly embed resources into binaries

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • Build System
    • None

    Description

      In a Qt context, rcc is commonly used to embed resources into binaries. This works by creating a .cpp file containing the resources byte-by-byte in a big char[] (plus some actual code to access it), which is then picked up by the normal buildsystem activities.

      This process does not scale, and hit compiler limits for resources bigger than a few megabytes.

      To work around this limitation, the "big resources" hack exist: This creates an array of the right size with a 'magic marker' "QRC_DATA" in the beginning and (implicit) \0's at the end. That's no problem for compilers. in the second phase the array of is found by searching for the magic marker and the marker and the \0's are replaced by the actual resource data.

      However, this second phase (binary patching) is fragile and does not work at all in some setups, see e.g. https://bugreports.qt.io/browse/QTBUG-41301

      Some toolchains have the possibility of embedding binary blobs directly into the output, which is not only more robust but also much faster then the deviation through the .cpp+compilation/

      Tasks:

      1. Investigated whether there is a way to embed binaries for all supported toolchains.
      2. provide a means in Qt's buildsystem to use direct binary embedding where possible.

       

       

      Attachments

        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
              hjk hjk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes