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

Debug and Release build use the same directory for QtWebEngineCore objects while building in debug_and_release mode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.6.2, 5.7.1, 5.8.0
    • WebEngine
    • None
    • OS X 10.11.6
      Xcode 7.3.1
      Apple LLVM version 7.3.0 (clang-703.0.31)

    Description

      This issue affects all platforms (Linux, Windows, OS X) and results linker issue for shadow developer build.

      The directory structure is the following for my OS X build:

      • source directory: /Users/stampho/work/Qt/qt5-dev-src
      • build directory: /Users/stampho/work/Qt/qt5-dev-dev

      I have attached the output of qmake -query to justify it.

      The Qt build is configured as following:

      ../qt5-dev-src/configure \
          -qt-libpng \
          -developer-build \
          -confirm-license \
          -opensource
      

      Since this is a developer-build and neither release nor debug mode were specified this configuration will result debug_and_release build on OS X.
      The linkage of the QtWebEngineCore debug library results the following error:

      Undefined symbols for architecture x86_64:
        "logging::BaseInitLoggingImpl_built_with_NDEBUG(logging::LoggingSettings const&)", referenced from:
            QtWebEngineCore::ContentMainDelegateQt::PreSandboxStartup() in QtWebEngineCore.content_main_delegate_qt.o
      ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      make[4]: *** [/Users/stampho/work/Qt/qt5-dev-dev/qtbase/lib/QtWebEngineCore.framework/QtWebEngineCore_debug] Error 1
      make[3]: *** [debug-all] Error 2
      make[2]: *** [sub-core_module-pro-make_first] Error 2
      make[1]: *** [sub-core-make_first] Error 2
      make: *** [sub-src-make_first] Error 2
      

      The reason for this linker error is the following: base.logging.o object should contain the missing symbol. It is built at qt5-dev-dev/qtwebengine/src/core/Debug/obj/src/3rdparty/chromium/base/base.logging.o and built without the NDEBUG macro as it is expected for a debug build. The QtWebEngineCore.content_main_delegate_qt.o object is built at qt5-dev-dev/qtwebengine/src/qt5-dev-src/qtwebengine/src/core/QtWebEngineCore.content_main_delegate_qt.o and built with the NDEBUG macro which is expected for release build. The linker tries to link these which leads to an error.

      The build system should build two QtWebEngineCore.content_main_delegate_qt.o objects: one for release (with NDEBUG) and one for debug (without NDEBUG). Since there is a common path (qt5-dev-dev/qtwebengine/src/qt5-dev-src/qtwebengine/src/core/) for release and debug core objects this may lead to linker problems while building Qt WebEngine in debug_and_release mode.

      As you can see the source directory path appears in the build directory structure and this seems to be unexpected and generated on other host platforms too (Linux and Windows). Here is a list for these suspicious path in build directory:

      ./src/core/Debug/obj/qt5-dev-dev
      ./src/core/Debug_x64/obj/qt5-dev-dev
      ./src/core/qt5-dev-dev
      ./src/core/qt5-dev-src
      ./src/core/Release/obj/qt5-dev-dev
      ./src/core/Release_x64/obj/qt5-dev-dev
      ./src/qt5-dev-src
      

      Most probably fixing these paths in the build system would fix the linker issue to.

      After the investigation I've found that the path problem is resulted by the following commit:

      commit b6a0cd76dbb29e288bb041aca3125801126f8810
      Author: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
      Date:   Fri Jul 1 15:54:16 2016 +0200
      
          Move core_generated.gyp to build directory
      
          Changes core_generated.gyp from being generated in the source directory
          to being generated in the build directory.
      
          Task-number: QTBUG-43014
          Change-Id: Ia67df47bfadbf5dfca6e60a613dcf7b162b468fd
          Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
      

      Corresponding bug report: https://bugreports.qt.io/browse/QTBUG-43014
      Corresponding gerrit review: https://codereview.qt-project.org/#/c/164284/

      Attachments

        1. qmake.query
          3 kB
        2. build.log
          1.13 MB
        3. Compile64bit_Windows10_WithPatch.log
          2.88 MB
        4. QtWebEngineCore.ninja
          130 kB
        5. CompileLogQt58_OliverNiebuhr_53basedMod_22092016.log
          3.17 MB

        Issue Links

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

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              pvarga Peter Varga
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes