This is an archive of the discontinued LLVM Phabricator instance.

[ELF2] Add -Bstatic and -Bdynamic command line switches
ClosedPublic

Authored by ikudrin on Sep 29 2015, 3:21 AM.

Details

Summary

These switches affect library searching for '-l' which follow them. Synonym forms are also supported:

  • -dy and -call_shared for -Bdynamic switch
  • -dn, -non_shared and -static for -Bstatic switch

Diff Detail

Event Timeline

ikudrin updated this revision to Diff 35952.Sep 29 2015, 3:21 AM
ikudrin retitled this revision from to [ELF2] Add -Bstatic and -Bdynamic command line switches.
ikudrin updated this object.
ikudrin added reviewers: rafael, ruiu.
ikudrin added a project: lld.
ikudrin added a subscriber: llvm-commits.
ikudrin updated this revision to Diff 35981.Sep 29 2015, 8:37 AM

Slightly reworked the handler for OPT_l and OPT_INPUT.

ruiu added inline comments.Sep 29 2015, 8:48 AM
ELF/Driver.cpp
129–136

Separate OPT_l and OPT_INPUT.

case OPT_l:
  Inputs.push_back(openFile(searchLibrary(Arg->getValue()));

case OPT_INPUT:
  Inputs.push_back(openFile(Arg->getValue());
ikudrin updated this revision to Diff 36083.Sep 30 2015, 4:09 AM
  • Rebased to the top.
  • Reworked OPT_l and OPT_INPUT handling.
ikudrin marked an inline comment as done.Sep 30 2015, 4:10 AM
ruiu accepted this revision.Sep 30 2015, 10:55 AM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Sep 30 2015, 10:55 AM
ikudrin updated this revision to Diff 36208.Oct 1 2015, 2:40 AM
ikudrin edited edge metadata.
  • Updated to the latest revision
ikudrin requested a review of this revision.Oct 1 2015, 2:43 AM
ikudrin edited edge metadata.

Could you please review it again, as it has significant changes because of rebasing.

ruiu added inline comments.Oct 1 2015, 8:34 AM
ELF/Driver.cpp
95–105

Delete this.

130–133

Sync after r249023 and use Driver::addFile() instead.

ELF/Options.td
48–53

Sort them alphabetically.

57–62

Ditto

ikudrin updated this revision to Diff 36251.Oct 1 2015, 8:48 AM
ikudrin edited edge metadata.
  • Updated to the tip
  • Sorted the switches
ikudrin marked 4 inline comments as done.Oct 1 2015, 8:48 AM
ruiu accepted this revision.Oct 1 2015, 8:55 AM
ruiu edited edge metadata.

LGTM

ELF/Driver.cpp
143

s/continue/break/ because other branches end with break. If only this thing is different, readers must stop here and think about what's the difference of break and continue in this context, which are actually the same.

test/elf2/libsearch.s
50

Indentation is two space width in other places, so do the same.

RUN: not lld ...
RUN:   | FileCheck ...
This revision is now accepted and ready to land.Oct 1 2015, 8:55 AM
ikudrin updated this revision to Diff 36258.Oct 1 2015, 9:31 AM
ikudrin edited edge metadata.
  • continue -> break
  • fix indentation
ikudrin marked 2 inline comments as done.Oct 1 2015, 9:32 AM
ikudrin updated this revision to Diff 36261.Oct 1 2015, 9:34 AM
  • fix indentation in Options.td
ikudrin closed this revision.Oct 1 2015, 9:43 AM