Skip to content

Commit

Permalink
Changed to be able to support linking with lld-link.
Browse files Browse the repository at this point in the history
lld-link doesn't support the /manifestdependency coming from a #pragma comment instruction.
"lld-link.exe : error : /manifestdependency: is not allowed in .drectve"
https://github.com/llvm-mirror/lld/blob/bf86a304d1fee6d332c479bdb98cec1e44001f62/COFF/Driver.cpp#L284-L328
See https://bugs.llvm.org/show_bug.cgi?id=38797

The SupportsJustMyCode, GenerateDebugInformation, and LinkTimeCodeGeneration customizations seem like reasonable changes to the LLVM.Cpp.Common.targets file, but this seems like a lower barrier of entry.
(The GenerateDebugInformation change is because 'true' gets translated to FastLink in the Microsoft msbuild files.)
See https://bugs.llvm.org/show_bug.cgi?id=38799
  • Loading branch information
mwinterb committed Aug 31, 2018
1 parent 31632c5 commit d3b46f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
15 changes: 15 additions & 0 deletions UIforETW/UIforETW.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<AdditionalLibraryDirectories>..\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>ETWProviders.lib</AdditionalDependencies>
<AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
Expand Down Expand Up @@ -157,6 +158,7 @@
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<AdditionalLibraryDirectories>..\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>ETWProviders64.lib</AdditionalDependencies>
<AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
Expand Down Expand Up @@ -199,6 +201,7 @@
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<AdditionalLibraryDirectories>..\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>ETWProviders.lib</AdditionalDependencies>
<AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
Expand Down Expand Up @@ -242,6 +245,7 @@
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<AdditionalLibraryDirectories>..\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>ETWProviders64.lib</AdditionalDependencies>
<AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
Expand All @@ -256,6 +260,17 @@
<AdditionalManifestFiles>..\CompatibilityManifest.man</AdditionalManifestFiles>
</Manifest>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(UseClangCl)'=='true'">
<ClCompile>
<SupportJustMyCode>false</SupportJustMyCode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(UseLldLink)'=='true'">
<Link>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.md" />
<Text Include="StackWalkFlags.txt" />
Expand Down
10 changes: 0 additions & 10 deletions UIforETW/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,4 @@ const int WM_NEWVERSIONAVAILABLE = WM_USER + 11;
#define UIETWASSERT( x ) ATLASSERT( x )


#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif

#define IS_MFC_APP

0 comments on commit d3b46f0

Please sign in to comment.