This is an archive of the discontinued LLVM Phabricator instance.

Allow passing /manifestdependency via #pragma comment(linker, ...)
Needs RevisionPublic

Authored by ColinFinck on Feb 17 2021, 5:29 AM.

Details

Reviewers
thakis
Group Reviewers
lld
Summary

Linker commands added via #pragma comment(linker, ...) are passed to the linker via a .drectve section.
Current lld-link however rejects /manifestdependency arguments passed this way.
They are very common for enabling Visual Styles in Win32 GUI applications.

I have found https://bugs.llvm.org/show_bug.cgi?id=38797 opened over 2 years ago along with a simple one-liner patch.
I've updated this patch for latest lld as the bug still persists.

I have no LLVM commit access, so someone else has to commit this.
My author information: Colin Finck <colin@reactos.org>

Other involved authors from the bug report:

  • Roland Reichwein <mail@reichwein.it>
  • Jaromir Kuba <kuba@gdpr-pardubice.cz>

Diff Detail

Event Timeline

ColinFinck requested review of this revision.Feb 17 2021, 5:29 AM
ColinFinck created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2021, 5:29 AM
aganea added a comment.Mar 8 2021, 5:46 AM

@ColinFinck Would you mind adding test coverage for this? Either modify an existing test such as lld/test/COFF/directives.s or a add a new test.

rnk added a comment.Mar 8 2021, 11:05 AM

Your change will ignore these flags, though, and I don't think that's what MSVC will do, from looking at the docs.

As I understand it, it looks like we process manifest files at the very end, after we've loaded all objects in the usual fixpoint way, so I think we should go ahead and implement this flag, rather than ignoring it as a stop-gap.

pravic added a subscriber: pravic.May 24 2021, 12:13 PM
In D96862#2611861, @rnk wrote:

As I understand it, it looks like we process manifest files at the very end, after we've loaded all objects in the usual fixpoint way, so I think we should go ahead and implement this flag, rather than ignoring it as a stop-gap.

@rnk Any update on that?

rnk added a comment.May 27 2021, 3:09 PM

I don't have plans to work on this, but it's a pretty straightforward starter project if anyone is interested.

In D96862#2785942, @rnk wrote:

I don't have plans to work on this, but it's a pretty straightforward starter project if anyone is interested.

Sounds appealing. Any guidance for a volunteer?

thakis requested changes to this revision.Aug 25 2021, 12:26 PM

This patch here isn't quite enough. I fixed this in https://reviews.llvm.org/rG400a1de3ac4583794797852aab49aaa821c95b7d You can close this patch.

This revision now requires changes to proceed.Aug 25 2021, 12:26 PM