Summary: | [Win][CMake] Build WebCore as an OBJECT library for WinCairo port | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Fujii Hironori <Hironori.Fujii> | ||||||||||||||
Component: | CMake | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Normal | CC: | achristensen, annulen, bfulgham, commit-queue, don.olmstead, ews-watchlist, gyuyoung.kim, pvollan, ross.kirsling, ryuan.choi, sergio | ||||||||||||||
Priority: | P2 | ||||||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||
OS: | Unspecified | ||||||||||||||||
Attachments: |
|
Description
Fujii Hironori
2019-10-30 22:15:58 PDT
Any methods of ServiceWorkerThreadProxy which are marked with WEBCORE_EXPORT and WEBCORE_TESTSUPPORT_EXPORT aren't exported from WebKit.dll because any symbols in a object file of ServiceWorkerThreadProxy.cpp are not referenced in WebKit.dll. This is a similar issue with Bug 196866. There are 3 ways to solve: 1. bundle SWContextManager.cpp and ServiceWorkerThreadProxy.cpp as Unified source build 2. Use OBJECT library for WebCore (Bug 196866 Comment 4) 3. Use /WHOLEARCHIVE:WebCore.lib (Bug 196866 Comment 4) 4. Uninline some method of ServiceWorkerThreadProxy which are used by SWContextManager Created attachment 382428 [details]
WIP patch for approach #4
I prefer OBJECT library approach because it doesn't generate unnecessary WebCore.lib and WebCoreTestSupport.lib, and it can really solve this issue. However, a caveat of is Apple Internal builds can't use OBJECT library for WebCore because it doesn't generate the static libs. I'm going to use OBJECT library only for non-intenal builds. Linking TestWebCoreLib.dll reports a lot of warnings because WebCoreTestSupport is importing WebCore symbols by using dllimport, but those symbols are not exported by WebCore itself. [11/11] Linking CXX shared library bin64\TestWebCoreLib.dll Creating library lib64\TestWebCoreLib.lib and object lib64\TestWebCoreLib.exp LINK : warning LNK4217: symbol '?mockScrollbarsEnabled@DeprecatedGlobalSettings@WebCore@@SA_NXZ (public: static bool __cdecl WebCore::DeprecatedGlobalSettings::mockScrollbarsEnabled(void))' defined in 'UnifiedSource-767013ce-3.cpp.obj' is imported by 'InternalSettings.cpp.obj' in function '"public: __cdecl WebCore::InternalSettings::Backup::Backup(class WebCore::Settings &)" (??0Backup@InternalSettings@WebCore@@QEAA@AEAVSettings@2@@Z)' LINK : warning LNK4217: symbol '?areImagesEnabled@Settings@WebCore@@QEBA_NXZ (public: bool __cdecl WebCore::Settings::areImagesEnabled(void)const )' defined in 'Settings.cpp.obj' is imported by 'InternalSettings.cpp.obj' in function '"public: __cdecl WebCore::InternalSettings::Backup::Backup(class WebCore::Settings &)" (??0Backup@InternalSettings@WebCore@@QEAA@AEAVSettings@2@@Z)' LINK : warning LNK4286: symbol '?areImagesEnabled@Settings@WebCore@@QEBA_NXZ (public: bool __cdecl WebCore::Settings::areImagesEnabled(void)const )' defined in 'Settings.cpp.obj' is imported by 'InternalSettingsGenerated.cpp.obj' LINK : warning LNK4217: symbol '?shouldDeactivateAudioSession@PlatformMediaSessionManager@WebCore@@SA_NXZ (public: static bool __cdecl WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession(void))' defined in 'UnifiedSource-3c72abbe-12.cpp.obj' is imported by 'InternalSettings.cpp.obj' in function '"public: __cdecl WebCore::InternalSettings::Backup::Backup(class WebCore::Settings &)" (??0Backup@InternalSettings@WebCore@@QEAA@AEAVSettings@2@@Z)' (...) TestWebCoreLib shouldn't link WebCoreTestSupport. Created attachment 382431 [details]
Patch
GTK and WPE port EWS can't compile TestWebCore. > DerivedSources/ForwardingHeaders/WebCore/GUniquePtrSoup.h:26:10: fatal error: libsoup/soup.h: No such file or directory > DerivedSources/ForwardingHeaders/WebCore/HbUniquePtr.h:29:10: fatal error: hb.h: No such file or directory WebCoreTestSupport has a public include path to WebCore_SYSTEM_INCLUDE_DIRECTORIES. > target_include_directories(WebCoreTestSupport SYSTEM PUBLIC ${WebCoreTestSupport_SYSTEM_INCLUDE_DIRECTORIES} ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}) Hmm.. Created attachment 382451 [details]
Patch
Committed r251908: <https://trac.webkit.org/changeset/251908> committed a workaround patch. Created attachment 382562 [details]
Patch
Comment on attachment 382562 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382562&action=review > Source/WebCore/CMakeLists.txt:1237 > +if (NOT WTF_OS_WINDOWS) > + list(APPEND WebCoreTestSupport_LIBRARIES WebCore) > +endif () Is this part not needed for Apple-internal Windows builds? Comment on attachment 382562 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382562&action=review >> Source/WebCore/CMakeLists.txt:1237 >> +endif () > > Is this part not needed for Apple-internal Windows builds? Nope. Apple internal builds invokes CMake under each sub-directory. This is irrelevant for it. AppleWin EWS failed:
> WebCoreTestSupport.vcxproj -> C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\Source\WebCore\WebCoreTestSupport.dir\Release\WebCoreTestSupport.lib
> Creating library C:/cygwin/home/buildbot/WebKit/WebKitBuild/Release/lib32/WebKit.lib and object C:/cygwin/home/buildbot/WebKit/WebKitBuild/Release/lib32/WebKit.exp
> StructuredExceptionHandlerSuppressor.obj : error LNK2019: unresolved external symbol _exceptionHandlerThunk@0 referenced in function "public: __thiscall WebCore::StructuredExceptionHandlerSuppressor::StructuredExceptionHandlerSuppressor(struct WebCore::ExceptionRegistration &)" (??0StructuredExceptionHandlerSuppressor@WebCore@@QAE@AAUExceptionRegistration@1@@Z) [C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\Source\WebKitLegacy\WebKitLegacy.vcxproj]
> C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\bin32\WebKit.dll : fatal error LNK1120: 1 unresolved externals [C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\Source\WebKitLegacy\WebKitLegacy.vcxproj]
Created attachment 382801 [details]
Patch
AppleWin build fails because WebCore Object library is missing makesafeseh.obj. > if (CMAKE_SIZEOF_VOID_P EQUAL 4) > list(APPEND WebCore_SOURCES ${WebCore_DERIVED_SOURCES_DIR}/makesafeseh.obj) > add_custom_command( > OUTPUT ${WebCore_DERIVED_SOURCES_DIR}/makesafeseh.obj > DEPENDS ${WEBCORE_DIR}/platform/win/makesafeseh.asm > COMMAND ml /safeseh /c /Fo ${WebCore_DERIVED_SOURCES_DIR}/makesafeseh.obj ${WEBCORE_DIR}/platform/win/makesafeseh.asm > VERBATIM) > endif () If enable_language(ASM_MASM) is used, the problem of r194434 will reoccur. Created attachment 382815 [details]
Patch
Comment on attachment 382815 [details] Patch Clearing flags on attachment: 382815 Committed r252086: <https://trac.webkit.org/changeset/252086> All reviewed patches have been landed. Closing bug. Committed r252118: <https://trac.webkit.org/changeset/252118> r252086 causes a bug that WinCairo DumpRenderTree.exe and WebKitTestRunner.exe can't start at all. Bug 203879 – [Win] DumpRenderTree.exe and WebKitTestRunner.exe shouldn't link with WebCoreTestSupport |