Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.6.2, 5.7.1, 5.8.0
-
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
Issue Links
- is duplicated by
-
QTBUG-56842 Link error with MSVC2013
-
- Closed
-
- relates to
-
QTBUG-47313 Qt build fails if parent of source/build directories contains "-release" suffix
-
- Closed
-