This is an archive of the discontinued LLVM Phabricator instance.

LibDriver, llvm-lib: introduce.
ClosedPublic

Authored by pcc on Jun 5 2015, 8:32 PM.

Details

Summary

llvm-lib is intended to be a lib.exe compatible utility that also
understands bitcode. The implementation lives in a library so that
lld can use it to implement /lib.

Diff Detail

Event Timeline

pcc updated this revision to Diff 27257.Jun 5 2015, 8:32 PM
pcc retitled this revision from to LibDriver, llvm-lib: introduce..
pcc updated this object.
pcc edited the test plan for this revision. (Show Details)
pcc added a reviewer: rafael.
pcc added subscribers: ruiu, Unknown Object (MLST).
rafael edited edge metadata.Jun 6 2015, 10:25 AM

The lib format is really similar to the .a format.

I guess the only question I have about this direction is how would it
compare with having lld fork+exec llvm-lib.exe and implementing
llvm-lib.exe in the same binary as llvm-ar.exe (similar to how we do
for llvm-ranlib.exe).

pcc updated this revision to Diff 27275.Jun 7 2015, 9:13 PM
pcc edited edge metadata.
  • Make llvm-lib an alias of llvm-ar, add Makefiles
pcc updated this revision to Diff 27325.Jun 8 2015, 12:47 PM
  • Add response file support

Why do you need LibDriver? Why not just put these files in tools/llvm-ar?

pcc added a comment.Jun 9 2015, 2:15 PM

I'll want to use the lib driver from lld, per our earlier discussion here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150601/280581.html

This is fine from the llvm side.

Rui, is this a convenient interface for lld to use?

lib/LibDriver/LibDriver.cpp
72

We really should just move the string saver that rui implemented to llvm and make it the one true string saver.
At least add a fixme about that.

+namespace {
+class StrDupSaver : public cl::StringSaver {

+ std::vector<char *> Dups;

We really should just move the string saver that rui implemented to llvm
and make it the one true string saver.
At least add a fixme about that.

Given we do it all over clang as well it'd be nice, yes.

-eric

pcc added a comment.Jun 9 2015, 2:45 PM

Rui, is this a convenient interface for lld to use?

D10347 is the lld side of this.

rafael accepted this revision.Jun 9 2015, 2:46 PM
rafael edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 9 2015, 2:46 PM
This revision was automatically updated to reflect the committed changes.
ruiu added a comment.Jun 9 2015, 2:56 PM

2015/06/09 午後2:31 "Rafael Ávila de Espíndola" <rafael.espindola@gmail.com>:

This is fine from the llvm side.

Rui, is this a convenient interface for lld to use?

Comment at: lib/LibDriver/LibDriver.cpp:71
@@ +70,3 @@
+namespace {
+class StrDupSaver : public cl::StringSaver {

+ std::vector<char *> Dups;

We really should just move the string saver that rui implemented to llvm

and make it the one true string saver.

At least add a fixme about that.

Let me do that. I'll send a patch later.

http://reviews.llvm.org/D10297

EMAIL PREFERENCES

http://reviews.llvm.org/settings/panel/emailpreferences/
  • We really should just move the string saver that rui implemented to llvm

and make it the one true string saver.

At least add a fixme about that.

I am giving that a try :-)

Cheers,
Rafael