summaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-ar/llvm-ar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-ar/llvm-ar.cpp')
-rw-r--r--llvm/tools/llvm-ar/llvm-ar.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index f7b29b884027..8842162f5216 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -90,6 +90,7 @@ OPTIONS:
--rsp-quoting - quoting style for response files
=posix - posix
=windows - windows
+ --thin - create a thin archive
--version - print the version and exit
@<file> - read options from <file>
@@ -118,7 +119,7 @@ MODIFIERS:
[P] - use full names when matching (implied for thin archives)
[s] - create an archive index (cf. ranlib)
[S] - do not build a symbol table
- [T] - create a thin archive
+ [T] - deprecated, use --thin instead
[u] - update only [files] newer than archive contents
[U] - use actual timestamps and uids/gids
[v] - be verbose about actions taken
@@ -390,8 +391,6 @@ static ArchiveOperation parseCommandLine() {
break;
case 'T':
Thin = true;
- // Thin archives store path names, so P should be forced.
- CompareFullPath = true;
break;
case 'L':
AddLibrary = true;
@@ -407,6 +406,10 @@ static ArchiveOperation parseCommandLine() {
}
}
+ // Thin archives store path names, so P should be forced.
+ if (Thin)
+ CompareFullPath = true;
+
// At this point, the next thing on the command line must be
// the archive name.
getArchive();
@@ -965,6 +968,8 @@ static void createSymbolTable(object::Archive *OldArchive) {
if (OldArchive->hasSymbolTable())
return;
+ if (OldArchive->isThin())
+ Thin = true;
performWriteOperation(CreateSymTab, OldArchive, nullptr, nullptr);
}
@@ -1202,6 +1207,11 @@ static int ar_main(int argc, char **argv) {
continue;
}
+ if (strcmp(*ArgIt, "--thin") == 0) {
+ Thin = true;
+ continue;
+ }
+
Match = matchFlagWithArg("format", ArgIt, Argv);
if (Match) {
FormatType = StringSwitch<Format>(Match)