Bug 105818 - [Qt] Can't link Qt5WebKit.dll - wrong library linking order
Summary: [Qt] Can't link Qt5WebKit.dll - wrong library linking order
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 103747
  Show dependency treegraph
 
Reported: 2012-12-27 23:02 PST by Jonathan Liu
Modified: 2013-01-03 06:15 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.60 KB, patch)
2012-12-29 17:21 PST, Jonathan Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Liu 2012-12-27 23:02:01 PST
Compiler: MinGW-builds GCC 4.7.2 64-bit rev 5
Configuration: Qt 5 stable branch with desktop OpenGL (ANGLE is disabled)

mingw32-make[3]: Entering directory 'C:/Work/git/qt5/qtwebkit/Source'
g++ -shared -Wl,--out-implib,C:\Work\git\qt5\qtbase\lib\libQt5WebKitd.a -o C:\Work\git\qt5\qtbase\lib\Qt5WebKitd.dll .obj/debug_shared/qrc_WebCore.o .obj/debug_shared/qrc_WebKit.o .obj/debug_shared/qrc_InspectorBackendCommands.o  -lglu32 -lopengl32 -lgdi32 -luser32 -LC:\Qt\qt5_deps\icu\dist\lib -LC:\Qt\qt5_deps\openssl-1.0.1c\dist\lib -LC:\Qt\qt5_deps\icu\dist\lib -LC:\Qt\qt5_deps\openssl-1.0.1c\dist\lib -LC:/Work/git/qt5/qtbase/lib -lQt5Networkd -LC:/Work/git/qt5/qtbase/lib -lQt5Guid -LC:/Work/git/qt5/qtbase/lib -lQt5Cored .obj\debug_shared\Qt5WebKitd_resource_res.o -Wl,-whole-archive -lWebKit1d -Wl,-no-whole-archive -LC:/Work/git/qt5/qtwebkit/Source/WebKit/debug -Wl,-whole-archive -lWebCored -Wl,-no-whole-archive -LC:/Work/git/qt5/qtwebkit/Source/WebCore/debug -ladvapi32 -lgdi32 -lshell32 -lshlwapi -luser32 -lversion -lgdi32 -lole32 -luser32 -Wl,-whole-archive -lJavaScriptCored -Wl,-no-whole-archive -LC:/Work/git/qt5/qtwebkit/Source/JavaScriptCore/debug -lwinmm -Wl,-whole-archive -lWTFd -Wl,-no-whole-archive -LC:/Work/git/qt5/qtwebkit/Source/WTF/debug -licuin -licuuc -licudt -lwinmm -lgdi32 -LC:/Work/git/qt5/qtbase/lib -lQt5Guid -LC:/Work/git/qt5/qtbase/lib -lQt5Sqld -LC:/Work/git/qt5/qtbase/lib -lQt5Cored
mingw32-make[3]: Entering directory 'C:/Work/git/qt5/qtwebkit/Source'
g++ -Wl,-s -shared -Wl,--out-implib,C:\Work\git\qt5\qtbase\lib\libQt5WebKit.a -o C:\Work\git\qt5\qtbase\lib\Qt5WebKit.dll .obj/release_shared/qrc_WebCore.o .obj/release_shared/qrc_WebKit.o .obj/release_shared/qrc_InspectorBackendCommands.o  -lglu32 -lopengl32 -lgdi32 -luser32 -LC:\Qt\qt5_deps\icu\dist\lib -LC:\Qt\qt5_deps\openssl-1.0.1c\dist\lib -LC:\Qt\qt5_deps\icu\dist\lib -LC:\Qt\qt5_deps\openssl-1.0.1c\dist\lib -LC:/Work/git/qt5/qtbase/lib -lQt5Network -LC:/Work/git/qt5/qtbase/lib -lQt5Gui -LC:/Work/git/qt5/qtbase/lib -lQt5Core .obj\release_shared\Qt5WebKit_resource_res.o -Wl,-whole-archive -lWebKit1 -Wl,-no-whole-archive -LC:/Work/git/qt5/qtwebkit/Source/WebKit/release -Wl,-whole-archive -lWebCore -Wl,-no-whole-archive -LC:/Work/git/qt5/qtwebkit/Source/WebCore/release -ladvapi32 -lgdi32 -lshell32 -lshlwapi -luser32 -lversion -lgdi32 -lole32 -luser32 -Wl,-whole-archive -lJavaScriptCore -Wl,-no-whole-archive -LC:/Work/git/qt5/qtwebkit/Source/JavaScriptCore/release -lwinmm -Wl,-whole-archive -lWTF -Wl,-no-whole-archive -LC:/Work/git/qt5/qtwebkit/Source/WTF/release -licuin -licuuc -licudt -lwinmm -lgdi32 -LC:/Work/git/qt5/qtbase/lib -lQt5Gui -LC:/Work/git/qt5/qtbase/lib -lQt5Sql -LC:/Work/git/qt5/qtbase/lib -lQt5Core
C:/Work/git/qt5/qtwebkit/Source/WebKit/release/libWebKit1.a(QWebPageAdapter.o):QWebPageAdapter.cpp:(.text+0x950): undefined reference to `__imp__ZN21QNetworkAccessManagerC1EP7QObject'
C:/Work/git/qt5/qtwebkit/Source/WebKit/release/libWebKit1.a(QWebFrameAdapter.o):QWebFrameAdapter.cpp:(.text+0x270b): undefined reference to `__imp__ZNK15QNetworkRequest3urlEv'
C:/Work/git/qt5/qtwebkit/Source/WebKit/release/libWebKit1.a(QWebFrameAdapter.o):QWebFrameAdapter.cpp:(.text+0x2943): undefined reference to `__imp__ZNK15QNetworkRequest9attributeENS_9AttributeERK8QVariant'
C:/Work/git/qt5/qtwebkit/Source/WebKit/release/libWebKit1.a(QWebFrameAdapter.o):QWebFrameAdapter.cpp:(.text+0x29c2): undefined reference to `__imp__ZNK15QNetworkRequest13rawHeaderListEv'
C:/Work/git/qt5/qtwebkit/Source/WebKit/release/libWebKit1.a(QWebFrameAdapter.o):QWebFrameAdapter.cpp:(.text+0x2bad): undefined reference to `__imp__ZNK15QNetworkRequest9rawHeaderERK10QByteArray'
C:/Work/git/qt5/qtwebkit/Source/WebKit/release/libWebKit1.a(QWebFrameAdapter.o):QWebFrameAdapter.cpp:(.text+0x33f2): undefined reference to `__imp__ZNK15QNetworkRequest9attributeENS_9AttributeERK8QVariant'
c:/mingw64-4.7.2/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Work/git/qt5/qtwebkit/Source/WebKit/release/libWebKit1.a(QWebFrameAdapter.o): bad reloc address 0x0 in section `.pdata$_ZN3JSC14SourceProvider16cacheSizeChangedEi'
collect2.exe: error: ld returned 1 exit status
Makefile.api.Release:81: recipe for target 'C:\Work\git\qt5\qtbase\lib\Qt5WebKit.dll' failed
mingw32-make[3]: *** [C:\Work\git\qt5\qtbase\lib\Qt5WebKit.dll] Error 1
mingw32-make[3]: Leaving directory 'C:/Work/git/qt5/qtwebkit/Source'

It seems that -lQt5Network is in the wrong place. It needs to be specified after -lWebKit1 and -lWebCore.
In Tools/qmake/mkspecs/features/default_post.prf, the creating_module scope moves libraries from LIBS to LIBS_PRIVATE which places -lWebKit1 and -lWebCore after the Qt libraries.
Comment 1 Jonathan Liu 2012-12-29 17:21:35 PST
Created attachment 180948 [details]
Patch
Comment 2 Jonathan Liu 2013-01-03 03:19:18 PST
Ping.
Comment 3 WebKit Review Bot 2013-01-03 06:15:02 PST
Comment on attachment 180948 [details]
Patch

Clearing flags on attachment: 180948

Committed r138707: <http://trac.webkit.org/changeset/138707>
Comment 4 WebKit Review Bot 2013-01-03 06:15:05 PST
All reviewed patches have been landed.  Closing bug.