[PATCH] D54936: [llvm-objcopy] Hook up the -V alias to --version, output "GNU strip"
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 27 01:39:22 PST 2018
mstorsjo created this revision.
mstorsjo added reviewers: alexshap, jakehehrlich, jhenderson.
Herald added a subscriber: rupprecht.
This allows libtool to detect the presence of llvm-strip and use it with the options --strip-debug and --strip-unneeded, see http://git.savannah.gnu.org/cgit/libtool.git/tree/m4/libtool.m4?h=v2.4.6#n2210.
Also hook up the -V alias for objcopy.
Repository:
rL LLVM
https://reviews.llvm.org/D54936
Files:
test/tools/llvm-objcopy/objcopy-version.test
test/tools/llvm-objcopy/strip-version.test
tools/llvm-objcopy/CopyConfig.cpp
tools/llvm-objcopy/ObjcopyOpts.td
tools/llvm-objcopy/StripOpts.td
Index: tools/llvm-objcopy/StripOpts.td
===================================================================
--- tools/llvm-objcopy/StripOpts.td
+++ tools/llvm-objcopy/StripOpts.td
@@ -64,3 +64,4 @@
def version : Flag<["-", "--"], "version">,
HelpText<"Print the version and exit.">;
+def V : Flag<["-"], "V">, Alias<version>;
Index: tools/llvm-objcopy/ObjcopyOpts.td
===================================================================
--- tools/llvm-objcopy/ObjcopyOpts.td
+++ tools/llvm-objcopy/ObjcopyOpts.td
@@ -165,3 +165,4 @@
def version : Flag<["-", "--"], "version">,
HelpText<"Print the version and exit.">;
+def V : Flag<["-"], "V">, Alias<version>;
Index: tools/llvm-objcopy/CopyConfig.cpp
===================================================================
--- tools/llvm-objcopy/CopyConfig.cpp
+++ tools/llvm-objcopy/CopyConfig.cpp
@@ -383,6 +383,7 @@
}
if (InputArgs.hasArg(STRIP_version)) {
+ outs() << "llvm-strip, compatible with GNU strip\n";
cl::PrintVersionMessage();
exit(0);
}
Index: test/tools/llvm-objcopy/strip-version.test
===================================================================
--- test/tools/llvm-objcopy/strip-version.test
+++ test/tools/llvm-objcopy/strip-version.test
@@ -1,4 +1,5 @@
# RUN: llvm-strip -version | FileCheck %s
# RUN: llvm-strip --version | FileCheck %s
+# RUN: llvm-strip -V | FileCheck %s
-# CHECK: {{ version }}
+# CHECK: GNU strip
Index: test/tools/llvm-objcopy/objcopy-version.test
===================================================================
--- test/tools/llvm-objcopy/objcopy-version.test
+++ test/tools/llvm-objcopy/objcopy-version.test
@@ -1,4 +1,5 @@
# RUN: llvm-objcopy -version | FileCheck %s
# RUN: llvm-objcopy --version | FileCheck %s
+# RUN: llvm-objcopy -V | FileCheck %s
# CHECK: {{ version }}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54936.175416.patch
Type: text/x-patch
Size: 1845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181127/7dad2acb/attachment.bin>
More information about the llvm-commits
mailing list