This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [MinGW] Pass the -lldmap flag through
AbandonedPublic

Authored by mstorsjo on Nov 1 2017, 2:45 PM.

Details

Reviewers
ruiu
martell
Summary

This is useful for debugging.

Alternatively, should there be some escape mechanism for passing any option through to the COFF driver?

Diff Detail

Event Timeline

mstorsjo created this revision.Nov 1 2017, 2:45 PM
ruiu edited edge metadata.Nov 1 2017, 2:47 PM

Alternatively, should there be some escape mechanism for passing any option through to the COFF driver?

That depends on how many options you want to do the same thing as -lldmap, and I think it's up to you.

In D39512#913184, @ruiu wrote:

Alternatively, should there be some escape mechanism for passing any option through to the COFF driver?

That depends on how many options you want to do the same thing as -lldmap, and I think it's up to you.

I think it might be useful, especially while debugging some thing, and figuring out I want to test using some LLD option that isn't yet hooked up, but that might not make sense in normal use (if there's no common mapping for it in GNU ld params).

I guess common patterns for this would be either like -Wl,-lldmap or -Xlinker -lldmap - I guess the latter is easier to implement using the options parser we use. What would be a sensible name for it, -Xlink, -Xlld-link? (When used via the clang frontend, it would end up like -Wl,-Xlld-link,-lldmap I think.)

ruiu added a comment.Nov 1 2017, 2:57 PM

There's a hidden path to pass information to the lld-link driver; LINK environment variable is interpreted and parsed as part of command line. Maybe you can use it for debugging?

In D39512#913189, @ruiu wrote:

There's a hidden path to pass information to the lld-link driver; LINK environment variable is interpreted and parsed as part of command line. Maybe you can use it for debugging?

Oh, I didn't know about that - that would have worked for the case when I needed -lldmap now at least. Despite that I think some less obscure way to pass things through the MinGW frontend would be good as well - I can try to implement it using e.g. -Xlink unless you think I shouldn't.

ruiu added a comment.Nov 1 2017, 3:10 PM

Implementing -Xlink sounds like a good idea.

mstorsjo abandoned this revision.Nov 3 2017, 12:20 AM

Abandoned in favor of D39528.