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

qmake property QT_SYSROOT treated as variable in qtwebengine/mkspecs/features/gn_generator.prf



    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.9.3, 5.10.0
    • Fix Version/s: 5.9.4
    • Component/s: WebEngine
    • Labels:
    • Environment:
    • Commits:



      please see line 151 in qtwebengine/mkspecs/features/gn_generator.prf (source: qt-everywhere-src-5.10.0.tar.xz):

        !isEmpty(QT_SYSROOT) {

      The QT_SYSROOT property is definitely non-empty in my cross-build setup, yet I noticed that this expression always evaluates to false and that the else-branch of this statement is processed.

      Correct me if I'm wrong, but this looks like a syntactical problem because QT_SYSROOT is a qmake property and not a variable (a few lines down in gn_generator.prf it's also properly treated as a property, indicated by the use of the $$[QT_SYSROOT] instead of just $$QT_SYSROOT).

      When adding a temporary variable assignment to this expression (this is semantically equal but with comprehensible access to the property's value) it yields true, as it's supposed to in my setup:

        !isEmpty(QT_SYSROOT_VALUE) {

      I'm sure there are better ways to go about this, but this modification works as a demonstration as well as a proven fix for my cross-build (tested with Qt 5.9.3 and 5.10.0).

      This specific code section of gn_generator.prf generates the values of the preprocessor variables QT_LIBDIR_EGL and QT_LIBDIR_GLES2 in <build>/qtwebengine/src/core/release/BUILD.gn (lines 439-440 in my case, use full-text search to locate them). Without the modification, the variable values are always prefixed with my host's QT_SYSROOT, otherwise not.

      These two variable values are later used at run-time (meaning on my cross-build target) in qtwebengine/src/core/surface_factory_qt.cpp (lines 101 and 107) to locate the two shared libraries libEGL.so.1 and libGLESv2.so.2.

      So without this modification, my host's QT_SYSROOT prefix ends up in the search path in libQt5WebEngineCore.so.5.10.0 when loading the two shared libraries at run-time on my cross-build target (which of course fails), while with it the QT_SYSROOT prefix is properly removed from that path.

      Note that removing the QT_SYSROOT prefix is what gn_generator.prf is actually doing in the true-branch of the expression.


          Issue Links

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



              michal Michal Klocek
              chschnell Christian Schnell
              0 Vote for this issue
              2 Start watching this issue



                  Gerrit Reviews

                  There are no open Gerrit changes