Summary: | [Qt] [WK2] WebKit2 enabled build fails to link | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Laszlo Gombos <laszlo.gombos> | ||||
Component: | Platform | Assignee: | Andras Becsi <abecsi> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | abecsi, ossy | ||||
Priority: | P4 | Keywords: | Qt, QtTriaged | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Laszlo Gombos
2010-12-04 06:42:10 PST
Created attachment 76996 [details]
proposed fix
This patch also adds missing ENABLE(DATABASE) guards to fix the build.
The linking issue is caused by a more complex problem.
In a default WebKit2 build WebCore links to the static jscore library, and because some parts of WebCore (IconDatabase, ImageResizerThread, DatabaseThread, LocalStorageThread, WorkerThread) are using createThread, the linker doesn't remove the symbol so it is present afterwards when linking to the static webkit2 lib, but in a minimal build these parts are guarded by various ENABLE guards so because they are not needed in WebCore the linker removes the symbol, but the WebKit2 ThreadLauncher nonetheless needs the symbol, hence the linking fails.
This patch adds -whole-archive to JavaScriptCore.pri's addJavaScriptCoreLib to explicitly force the linker to keep all the symbols of the archive.
This is only a workaround and should serve as a temporary solution until we find a proper solution, how to refactor the build system.
(In reply to comment #1) > Created an attachment (id=76996) [details] > proposed fix > > This patch also adds missing ENABLE(DATABASE) guards to fix the build. > > The linking issue is caused by a more complex problem. > In a default WebKit2 build WebCore links to the static jscore library, and because some parts of WebCore (IconDatabase, ImageResizerThread, DatabaseThread, LocalStorageThread, WorkerThread) are using createThread, the linker doesn't remove the symbol so it is present afterwards when linking to the static webkit2 lib, but in a minimal build these parts are guarded by various ENABLE guards so because they are not needed in WebCore the linker removes the symbol, but the WebKit2 ThreadLauncher nonetheless needs the symbol, hence the linking fails. > This patch adds -whole-archive to JavaScriptCore.pri's addJavaScriptCoreLib to explicitly force the linker to keep all the symbols of the archive. > > This is only a workaround and should serve as a temporary solution until we find a proper solution, how to refactor the build system. The whole-archive change should be inside a webkit2 guard, but before I update the patch I'll wait for some opinions. This perhaps is another reason to _not_ build WebKit2 as a separate library - and instead build it into the WebKit library directly like many other WebKit features. Comment on attachment 76996 [details] proposed fix View in context: https://bugs.webkit.org/attachment.cgi?id=76996&action=review > JavaScriptCore/JavaScriptCore.pri:88 > - LIBS += -l$$JAVASCRIPTCORE_TARGET > + LIBS += -Wl,-whole-archive -l$$JAVASCRIPTCORE_TARGET -Wl,-no-whole-archive I think this change is different from the rest of this patch. Please split up. A workaround to use whole-archive was landed in r76263 which fixes the issue for now until the build system gets redesigned. (See https://bugs.webkit.org/show_bug.cgi?id=51339) Closing this bug. |