Bug 214170

Summary: [WinCairo][MediaFoundation] r264188 introduced linker warning: LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: Tools / TestsAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, annulen, don.olmstead, ews-watchlist, gyuyoung.kim, pvollan, ross.kirsling, ryuan.choi, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP patch
none
WIP patch
none
Patch achristensen: review+

Description Fujii Hironori 2020-07-09 18:14:12 PDT
[WinCairo][MediaFoundation] r264188 introduced linker warning: LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll

r264188 added the linker flag /DELAYLOAD:mf.dll to WebCore.
It should be propagated to WebKit.dll and WebKit2.dll, but not to other dll and exe files.


[5115/5276] Linking CXX executable bin64\WebKitWebProcess.exe
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
[5116/5276] Linking CXX executable bin64\WebKitNetworkProcess.exe
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
[5117/5276] Building RC object Tools\MiniBrowser\win\CMakeFiles\MiniBrowser.dir\MiniBrowser.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[5118/5276] Building RC object Tools\MiniBrowser\win\CMakeFiles\MiniBrowserLib.dir\MiniBrowserLib.rc.res
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

[5145/5276] Linking CXX shared library bin64\MiniBrowserLib.dll
   Creating library lib64\MiniBrowserLib.lib and object lib64\MiniBrowserLib.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
   Creating library lib64\MiniBrowserLib.lib and object lib64\MiniBrowserLib.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
[5151/5276] Linking CXX executable bin64\MiniBrowser.exe
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
[5199/5276] Linking CXX shared library bin64\TestRunnerInjectedBundle.dll
   Creating library lib64\TestRunnerInjectedBundle.lib and object lib64\TestRunnerInjectedBundle.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
   Creating library lib64\TestRunnerInjectedBundle.lib and object lib64\TestRunnerInjectedBundle.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
[5215/5276] Linking CXX shared library bin64\WebKitTestRunnerLib.dll
   Creating library lib64\WebKitTestRunnerLib.lib and object lib64\WebKitTestRunnerLib.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
   Creating library lib64\WebKitTestRunnerLib.lib and object lib64\WebKitTestRunnerLib.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
[5227/5276] Linking CXX shared library bin64\TestWebKitAPIInjectedBundle.dll
   Creating library lib64\TestWebKitAPIInjectedBundle.lib and object lib64\TestWebKitAPIInjectedBundle.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
   Creating library lib64\TestWebKitAPIInjectedBundle.lib and object lib64\TestWebKitAPIInjectedBundle.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
[5275/5276] Linking CXX shared library bin64\TestWebKitLib.dll
   Creating library lib64\TestWebKitLib.lib and object lib64\TestWebKitLib.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
   Creating library lib64\TestWebKitLib.lib and object lib64\TestWebKitLib.exp
LINK : warning LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll
LINK : warning LNK4199: /DELAYLOAD:mfplat.dll ignored; no imports found from mfplat.dll
[5276/5276] Linking CXX executable bin64\TestWebKit.exe
Comment 1 Fujii Hironori 2020-07-10 16:22:01 PDT
Created attachment 404018 [details]
WIP patch

This patch makes WebKit links with WebCore as PRIATE.
/DELAYLOAD are propagated only to WebKit.dll, WebKit2.dll, and TestWebCoreLib.dll as expected.
But, causes other error:

FAILED: Source/WebKit/CMakeFiles/NetworkProcess.dir/NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp.obj 
C:\PROGRA~2\MICROS~2\2019\PROFES~1\VC\Tools\MSVC\1426~1.288\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILDING_NetworkProcess -DBUILDING_WEBKIT -DBUILDING_WITH_CMAKE=1 -DHAVE_CONFIG_H=1 -DNOCRYPT -DNOMINMAX -DSTATICALLY_LINKED_WITH_PAL=1 -DUNICODE -DUSE_CAIRO=1 -DUSE_CURL=1 -DWINVER=0x601 -DWTF_PLATFORM_WIN_CAIRO=1 -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_UNICODE -D_WIN32_WINNT=0x601 -D_WINDOWS -D_WINSOCKAPI_="" -I..\..\WebKitLibraries\win\include -I. -IWebCore\PrivateHeaders -IWebKit\Headers -IWebKit\DerivedSources -IWebKit\DerivedSources\include -I..\..\Source\WebKit -I..\..\Source\WebKit\GPUProcess -I..\..\Source\WebKit\GPUProcess\graphics -I..\..\Source\WebKit\GPUProcess\media -I..\..\Source\WebKit\GPUProcess\webrtc -I..\..\Source\WebKit\NetworkProcess -I..\..\Source\WebKit\NetworkProcess\Classifier -I..\..\Source\WebKit\NetworkProcess\Cookies -I..\..\Source\WebKit\NetworkProcess\CustomProtocols -I..\..\Source\WebKit\NetworkProcess\Downloads -I..\..\Source\WebKit\NetworkProcess\FileAPI -I..\..\Source\WebKit\NetworkProcess\IndexedDB -I..\..\Source\WebKit\NetworkProcess\ServiceWorker -I..\..\Source\WebKit\NetworkProcess\WebStorage -I..\..\Source\WebKit\NetworkProcess\cache -I..\..\Source\WebKit\NetworkProcess\watchos -I..\..\Source\WebKit\NetworkProcess\webrtc -I..\..\Source\WebKit\Platform -I..\..\Source\WebKit\Platform\IPC -I..\..\Source\WebKit\PluginProcess -I..\..\Source\WebKit\Shared -I..\..\Source\WebKit\Shared\API -I..\..\Source\WebKit\Shared\API\c -I..\..\Source\WebKit\Shared\ApplePay -I..\..\Source\WebKit\Shared\Authentication -I..\..\Source\WebKit\Shared\CoreIPCSupport -I..\..\Source\WebKit\Shared\Databases -I..\..\Source\WebKit\Shared\Databases\IndexedDB -I..\..\Source\WebKit\Shared\FileAPI -I..\..\Source\WebKit\Shared\Gamepad -I..\..\Source\WebKit\Shared\Plugins -I..\..\Source\WebKit\Shared\Plugins\Netscape -I..\..\Source\WebKit\Shared\Plugins\Netscape\x11 -I..\..\Source\WebKit\Shared\RemoteLayerTree -I..\..\Source\WebKit\Shared\WebsiteData -I..\..\Source\WebKit\UIProcess -I..\..\Source\WebKit\UIProcess\API -I..\..\Source\WebKit\UIProcess\API\C -I..\..\Source\WebKit\UIProcess\API\cpp -I..\..\Source\WebKit\UIProcess\Authentication -I..\..\Source\WebKit\UIProcess\Automation -I..\..\Source\WebKit\UIProcess\Downloads -I..\..\Source\WebKit\UIProcess\Gamepad -I..\..\Source\WebKit\UIProcess\GPU -I..\..\Source\WebKit\UIProcess\Inspector -I..\..\Source\WebKit\UIProcess\Inspector\Agents -I..\..\Source\WebKit\UIProcess\Launcher -I..\..\Source\WebKit\UIProcess\Network -I..\..\Source\WebKit\UIProcess\Network\CustomProtocols -I..\..\Source\WebKit\UIProcess\Notifications -I..\..\Source\WebKit\UIProcess\Plugins -I..\..\Source\WebKit\UIProcess\RemoteLayerTree -I..\..\Source\WebKit\UIProcess\UserContent -I..\..\Source\WebKit\UIProcess\WebAuthentication -I..\..\Source\WebKit\UIProcess\WebAuthentication\Mock -I..\..\Source\WebKit\UIProcess\WebsiteData -I..\..\Source\WebKit\WebProcess -I..\..\Source\WebKit\WebProcess\ApplePay -I..\..\Source\WebKit\WebProcess\ApplicationCache -I..\..\Source\WebKit\WebProcess\Automation -I..\..\Source\WebKit\WebProcess\Cache -I..\..\Source\WebKit\WebProcess\Databases -I..\..\Source\WebKit\WebProcess\Databases\IndexedDB -I..\..\Source\WebKit\WebProcess\FileAPI -I..\..\Source\WebKit\WebProcess\FullScreen -I..\..\Source\WebKit\WebProcess\Gamepad -I..\..\Source\WebKit\WebProcess\Geolocation -I..\..\Source\WebKit\WebProcess\GPU -I..\..\Source\WebKit\WebProcess\GPU\graphics -I..\..\Source\WebKit\WebProcess\GPU\media -I..\..\Source\WebKit\WebProcess\GPU\webrtc -I..\..\Source\WebKit\WebProcess\IconDatabase -I..\..\Source\WebKit\WebProcess\InjectedBundle -I..\..\Source\WebKit\WebProcess\InjectedBundle\API -I..\..\Source\WebKit\WebProcess\InjectedBundle\API\c -I..\..\Source\WebKit\WebProcess\InjectedBundle\DOM -I..\..\Source\WebKit\WebProcess\Inspector -I..\..\Source\WebKit\WebProcess\Launching -I..\..\Source\WebKit\WebProcess\MediaCache -I..\..\Source\WebKit\WebProcess\MediaStream -I..\..\Source\WebKit\WebProcess\Network -I..\..\Source\WebKit\WebProcess\Network\webrtc -I..\..\Source\WebKit\WebProcess\Notifications -I..\..\Source\WebKit\WebProcess\OriginData -I..\..\Source\WebKit\WebProcess\Plugins -I..\..\Source\WebKit\WebProcess\Plugins\Netscape -I..\..\Source\WebKit\WebProcess\ResourceCache -I..\..\Source\WebKit\WebProcess\Storage -I..\..\Source\WebKit\WebProcess\UserContent -I..\..\Source\WebKit\WebProcess\WebCoreSupport -I..\..\Source\WebKit\WebProcess\WebPage -I..\..\Source\WebKit\WebProcess\WebPage\RemoteLayerTree -I..\..\Source\WebKit\WebProcess\WebStorage -I..\..\Source -I..\..\WebKitLibraries -I..\..\Source\WebKit\Platform\classifier -I..\..\Source\WebKit\Platform\generic -I..\..\Source\WebKit\PluginProcess\win -I..\..\Source\WebKit\Shared\API\c\win -I..\..\Source\WebKit\Shared\CoordinatedGraphics -I..\..\Source\WebKit\Shared\CoordinatedGraphics\threadedcompositor -I..\..\Source\WebKit\Shared\Plugins\win -I..\..\Source\WebKit\Shared\win -I..\..\Source\WebKit\UIProcess\API\C\cairo -I..\..\Source\WebKit\UIProcess\API\C\curl -I..\..\Source\WebKit\UIProcess\API\C\win -I..\..\Source\WebKit\UIProcess\API\cpp\win -I..\..\Source\WebKit\UIProcess\API\win -I..\..\Source\WebKit\UIProcess\CoordinatedGraphics -I..\..\Source\WebKit\UIProcess\Inspector\socket -I..\..\Source\WebKit\UIProcess\Inspector\win -I..\..\Source\WebKit\UIProcess\Plugins\win -I..\..\Source\WebKit\UIProcess\win -I..\..\Source\WebKit\WebProcess\InjectedBundle\API\win -I..\..\Source\WebKit\WebProcess\InjectedBundle\API\win\DOM -I..\..\Source\WebKit\WebProcess\Inspector\win -I..\..\Source\WebKit\WebProcess\WebCoreSupport\win -I..\..\Source\WebKit\WebProcess\WebPage\CoordinatedGraphics -I..\..\Source\WebKit\WebProcess\WebPage\win -I..\..\Source\WebKit\win -I..\..\Source\WebKit\NetworkProcess\curl -I..\..\Source\WebKit\WebProcess\WebCoreSupport\curl -I..\..\Source\WebKit\UIProcess\socket /W4 /DWIN32 /D_WINDOWS  /GR- /EHs- /EHc-  /MD /Zi /Ob0 /Od /RTC1   /wd4018 /wd4068 /wd4099 /wd4100 /wd4127 /wd4138 /wd4146 /wd4180 /wd4189 /wd4201 /wd4206 /wd4244 /wd4251 /wd4267 /wd4275 /wd4288 /wd4291 /wd4305 /wd4309 /wd4344 /wd4355 /wd4389 /wd4396 /wd4456 /wd4457 /wd4458 /wd4459 /wd4481 /wd4503 /wd4505 /wd4510 /wd4512 /wd4530 /wd4610 /wd4611 /wd4646 /wd4702 /wd4706 /wd4722 /wd4800 /wd4819 /wd4951 /wd4952 /wd4996 /wd6011 /wd6031 /wd6211 /wd6246 /wd6255 /wd6387 /wd4091 /Zi /GS /EHa- /EHc- /EHs- /fp:except- /analyze- /bigobj /utf-8 /validate-charset -std:c++17 /showIncludes /FoSource\WebKit\CMakeFiles\NetworkProcess.dir\NetworkProcess\EntryPoint\win\NetworkProcessMain.cpp.obj /FdSource\WebKit\CMakeFiles\NetworkProcess.dir\ /FS -c ..\..\Source\WebKit\NetworkProcess\EntryPoint\win\NetworkProcessMain.cpp
C:\home\webkit\gc\Source\WebKit\config.h(31): fatal error C1083: Cannot open include file: 'JavaScriptCore/JSExportMacros.h': No such file or directory
Comment 2 Fujii Hironori 2020-07-10 17:29:23 PDT
Created attachment 404028 [details]
WIP patch
Comment 3 Fujii Hironori 2020-07-10 18:00:59 PDT
Comment on attachment 404028 [details]
WIP patch

View in context: https://bugs.webkit.org/attachment.cgi?id=404028&action=review

> Source/WebKit/CMakeLists.txt:266
> +list(APPEND WebKit_PRIVATE_LIBRARIES WebKit::WebCore)

I changed my mind. This change goes in a wrong direction.
WebKit should link with WebKit::WebCore as PUBILC because WebKit2.dll exports WebCore API for WebKitAPITest.
Comment 4 Fujii Hironori 2020-09-14 00:21:48 PDT
Created attachment 408683 [details]
Patch
Comment 5 Don Olmstead 2020-09-14 10:21:57 PDT
Comment on attachment 408683 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408683&action=review

> Source/WebCore/PlatformWinCairo.cmake:57
> +add_library(MediaFoundation INTERFACE)

I like this idea with a lot of the Windows stuff!

Could we maybe do some kind of namespacing here though? Maybe Windows::MediaFoundation?
Comment 6 Fujii Hironori 2020-09-14 13:10:39 PDT
Comment on attachment 408683 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408683&action=review

>> Source/WebCore/PlatformWinCairo.cmake:57
>> +add_library(MediaFoundation INTERFACE)
> 
> I like this idea with a lot of the Windows stuff!
> 
> Could we maybe do some kind of namespacing here though? Maybe Windows::MediaFoundation?

A namespace prefix (Windows::) can't be added to a INTERFACE library. I have to use a IMPORTED library.
Unfortunately, there is no IMPORTED_LINK_OPTIONS property, but INTERFACE_LINK_OPTIONS property.
https://cmake.org/cmake/help/latest/prop_tgt/INTERFACE_LINK_OPTIONS.html
I think I can't use a IMPORTED library.
Comment 7 Fujii Hironori 2020-09-14 13:17:57 PDT
Committed r267034: <https://trac.webkit.org/changeset/267034>
Comment 8 Radar WebKit Bug Importer 2020-09-14 13:18:18 PDT
<rdar://problem/68874261>