This is an archive of the discontinued LLVM Phabricator instance.

Print out "suppoted targets" and "supported emulations".
ClosedPublic

Authored by ruiu on Mar 21 2017, 1:59 PM.

Details

Summary

This is to improve compatibility with the GNU linkers for those
who expect these strings in a message for the -help option.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Mar 21 2017, 1:59 PM
ruiu added a comment.Mar 21 2017, 2:01 PM

I chose to print out all the targets and emulations that LLD actually supports, instead of printing out supported target: elf, because I found that the message is useful not only for Libtool-generated scripts but for human as well.

emaste added inline comments.Mar 21 2017, 5:14 PM
lld/ELF/DriverUtils.cpp
130–133 ↗(On Diff #92540)

Is there some way we can ensure this list stays in sync with the ones LLD accepts? I think it would be too easy to forget to update this when adding a new target / emulation.

ruiu added inline comments.Mar 21 2017, 5:20 PM
lld/ELF/DriverUtils.cpp
130–133 ↗(On Diff #92540)

Some target strings occur only here in the entire LLVM source code, I'd say there's no easy way to keep this string in sync with the actual behavior. But I think we don't need to worry too much about it because adding a new target is rather rare.

ruiu updated this revision to Diff 92716.Mar 22 2017, 2:36 PM
  • Do not print out "supported emulations".
emaste added inline comments.Mar 22 2017, 4:39 PM
lld/ELF/DriverUtils.cpp
124 ↗(On Diff #92716)

Right now this will remain true for any upcoming libtool releases, so maybe we want to say something like Scripts generated by Libtool versions up to at least 2.4.6 expect ...?

This revision was automatically updated to reflect the committed changes.