llvm.org GIT mirror llvm / 6e9f427
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 Rafael Espindola 4 years ago
3 changed file(s) with 9 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
182182 };
183183
184184 Kind kind() const { return (Kind)Format; }
185 bool isThin() const { return IsThin; }
185186
186187 child_iterator child_begin(bool SkipInternal = true) const;
187188 child_iterator child_end() const;
4444
4545 RUN: not llvm-ar x %p/Inputs/GNU.a foo.o 2>&1 | FileCheck --check-prefix=NOTFOUND %s
4646 NOTFOUND: foo.o was not found
47
48 RUN: not llvm-ar x %p/Inputs/thin.a foo.o 2>&1 | FileCheck %s --check-prefix=THINEXTRACT
49 THINEXTRACT: extracting from a thin archive is not supported
390390
391391 static void performReadOperation(ArchiveOperation Operation,
392392 object::Archive *OldArchive) {
393 if (Operation == Extract && OldArchive->isThin()) {
394 errs() << "extracting from a thin archive is not supported\n";
395 std::exit(1);
396 }
397
393398 bool Filter = !Members.empty();
394399 for (const object::Archive::Child &C : OldArchive->children()) {
395400 ErrorOr NameOrErr = C.getName();