This is an archive of the discontinued LLVM Phabricator instance.

llvm-lib: add a feature to merge library files.
Needs ReviewPublic

Authored by ruiu on Sep 6 2017, 4:48 PM.

Details

Reviewers
pcc
Summary

If an input file is actually an archive file, MSVC lib.exe doesn't add
that file to a resulting archive file. Instead, it will add its members
to a resulting archive. Therefore, by giving archive files to lib.exe,
you can merge them without extracting-and-rearchiving them.

This patch is to add the same functionality to llvm-lib, which is our
version of lib.exe.

Event Timeline

ruiu created this revision.Sep 6 2017, 4:48 PM
pcc added inline comments.Sep 6 2017, 5:41 PM
llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
181

Is this correct for thin archives? I believe that memory buffers for members of thin archives are owned by the Archive object.

Speaking of thin archives, we probably need to prevent this feature from being used with /llvmlibthin unless all input archives are thin.