[PATCH] D56508: [llvm-ar] Flatten thin archives.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 9 11:34:03 PST 2019


rupprecht created this revision.
rupprecht added reviewers: mstorsjo, pcc, ruiu.
Herald added a subscriber: llvm-commits.

Normal behavior for GNU ar is to flatten thin archives when adding them to another thin archive, i.e. add the members directly instead of nesting the archive.

Some refactoring done as part of this patch to ease things:

- Consolidate `addMember`/`addLibMember` methods
- Rename `addMember` to `addChildMember` to make it more visibly different at the call site that an archive child is passed instead of a regular member
- Pass in a separate vector and splice it back into position instead of passing a vector + optional Pos (which makes expanding libs tricky)

This fixes PR37530 as raised by https://github.com/ClangBuiltLinux/linux/issues/279.


Repository:
  rL LLVM

https://reviews.llvm.org/D56508

Files:
  test/tools/llvm-ar/Inputs/a-plus-b.a
  test/tools/llvm-ar/Inputs/a.txt
  test/tools/llvm-ar/Inputs/b.txt
  test/tools/llvm-ar/Inputs/c.txt
  test/tools/llvm-ar/Inputs/d.txt
  test/tools/llvm-ar/Inputs/nested-thin-archive.a
  test/tools/llvm-ar/flatten-thin-archive-recursive.test
  test/tools/llvm-ar/flatten-thin-archive.test
  tools/llvm-ar/llvm-ar.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56508.180892.patch
Type: text/x-patch
Size: 8289 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190109/42a1ac08/attachment.bin>


More information about the llvm-commits mailing list