llvm-ar: Don't try to extract from thin archives.

This matches the gnu ar behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242162 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-07-14 16:55:13 +00:00
parent 5c63c6a361
commit 6e9f427cb2
3 changed files with 9 additions and 0 deletions

View File

@@ -391,6 +391,11 @@ static bool shouldCreateArchive(ArchiveOperation Op) {
static void performReadOperation(ArchiveOperation Operation,
object::Archive *OldArchive) {
if (Operation == Extract && OldArchive->isThin()) {
errs() << "extracting from a thin archive is not supported\n";
std::exit(1);
}
bool Filter = !Members.empty();
for (const object::Archive::Child &C : OldArchive->children()) {
ErrorOr<StringRef> NameOrErr = C.getName();