Bug 204831 - [Win] lld-link: error: /manifestdependency: is not allowed in .drectve
Summary: [Win] lld-link: error: /manifestdependency: is not allowed in .drectve
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on: 209597
Blocks: 171618
  Show dependency treegraph
 
Reported: 2019-12-03 18:35 PST by Fujii Hironori
Modified: 2020-03-26 21:15 PDT (History)
20 users (show)

See Also:


Attachments
Patch (6.15 KB, patch)
2020-03-25 17:26 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (9.32 KB, patch)
2020-03-26 19:52 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (5.68 KB, patch)
2020-03-26 19:55 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2019-12-03 18:35:38 PST
[Win] lld-link: error: /manifestdependency: is not allowed in .drectve

I tried LLVM-9.0.0-r363781-win64.exe to build WinCairo today, and see the following linkage errors.

> [1696/5123] Linking CXX executable bin64\testRegExp.exe
> FAILED: bin64/testRegExp.exe 
> cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=Source\JavaScriptCore\shell\CMakeFiles\testRegExp.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests  -- C:\tools\llvm\bin\lld-link.exe /nologo Source\JavaScriptCore\shell\CMakeFiles\testRegExp.dir\DLLLauncherMain.cpp.obj  /out:bin64\testRegExp.exe /implib:lib64\testRegExp.lib /pdb:bin64\testRegExp.pdb /version:0.0  /machine:x64 /DEBUG /OPT:ICF /OPT:REF /OPT:NOREF /OPT:NOICF /INCREMENTAL:NO /debug /INCREMENTAL /INCREMENTAL:NO /subsystem:console -LIBPATH:C:\webkit\gb\WebKitBuild\Debug\lib64   -LIBPATH:C:\webkit\gb\WebKitLibraries\win\lib64 shlwapi.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
> LINK Pass 1: command "C:\tools\llvm\bin\lld-link.exe /nologo Source\JavaScriptCore\shell\CMakeFiles\testRegExp.dir\DLLLauncherMain.cpp.obj /out:bin64\testRegExp.exe /implib:lib64\testRegExp.lib /pdb:bin64\testRegExp.pdb /version:0.0 /machine:x64 /DEBUG /OPT:ICF /OPT:REF /OPT:NOREF /OPT:NOICF /INCREMENTAL:NO /debug /INCREMENTAL /INCREMENTAL:NO /subsystem:console -LIBPATH:C:\webkit\gb\WebKitBuild\Debug\lib64 -LIBPATH:C:\webkit\gb\WebKitLibraries\win\lib64 shlwapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:Source\JavaScriptCore\shell\CMakeFiles\testRegExp.dir/intermediate.manifest Source\JavaScriptCore\shell\CMakeFiles\testRegExp.dir/manifest.res" failed (exit code 1) with the following output:
> lld-link: error: /manifestdependency: is not allowed in .drectve
Comment 1 Fujii Hironori 2019-12-03 18:35:47 PST
The following files has /manifestdependency.

Tools/TestWebKitAPI/win/main.cpp
Source/JavaScriptCore/shell/DLLLauncherMain.cpp
Tools/win/DLLLauncher/DLLLauncherMain.cpp

> #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='" PROCESSORARCHITECTURE "' publicKeyToken='6595b64144ccf1df' language='*'\"")
Comment 2 Fujii Hironori 2019-12-03 18:36:00 PST
LLVM bug ticket:

38797 – lld-link compatibility: reading manifestdependency from .drectve
https://bugs.llvm.org/show_bug.cgi?id=38797
Comment 3 Fujii Hironori 2019-12-03 19:03:59 PST
(In reply to Fujii Hironori from comment #0)
> I tried LLVM-9.0.0-r363781-win64.exe to build WinCairo today, and see the

LLVM-9.0.0-r363781-win64.exe is too old.
I tried LLVM-10.0.0-r375090-win64.exe, and observed the issue still happen.
Comment 4 Fujii Hironori 2019-12-03 19:41:46 PST
CMake prefers lld-link over link.exe if Clang is used.
https://gitlab.kitware.com/cmake/cmake/commit/079b8e29168dc081f37f79f3577a5c0690bb7051

I need to remove lld-link.exe in my PATH to make CMake choose link.exe.
Comment 5 Fujii Hironori 2020-03-25 17:26:16 PDT
Created attachment 394563 [details]
Patch
Comment 6 Ross Kirsling 2020-03-25 19:23:28 PDT
Comment on attachment 394563 [details]
Patch

Nice. I take it we don't care about ia64, whatever that is?
Comment 7 Fujii Hironori 2020-03-25 23:44:54 PDT
Comment on attachment 394563 [details]
Patch

Clearing flags on attachment: 394563

Committed r259035: <https://trac.webkit.org/changeset/259035>
Comment 8 Fujii Hironori 2020-03-25 23:44:58 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2020-03-25 23:45:16 PDT
<rdar://problem/60907396>
Comment 10 WebKit Commit Bot 2020-03-26 07:29:10 PDT
Re-opened since this is blocked by bug 209597
Comment 11 Fujii Hironori 2020-03-26 19:52:32 PDT
Created attachment 394694 [details]
Patch
Comment 12 Fujii Hironori 2020-03-26 19:55:19 PDT
Created attachment 394695 [details]
Patch
Comment 13 Fujii Hironori 2020-03-26 21:14:58 PDT
Comment on attachment 394695 [details]
Patch

Clearing flags on attachment: 394695

Committed r259102: <https://trac.webkit.org/changeset/259102>
Comment 14 Fujii Hironori 2020-03-26 21:15:02 PDT
All reviewed patches have been landed.  Closing bug.