[llvm] r347731 - [llvm-objcopy] Hook up the -V alias to --version, output "GNU strip"

Martin Storsjo via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 22:51:50 PST 2018


Author: mstorsjo
Date: Tue Nov 27 22:51:50 2018
New Revision: 347731

URL: http://llvm.org/viewvc/llvm-project?rev=347731&view=rev
Log:
[llvm-objcopy] Hook up the -V alias to --version, output "GNU strip"

This allows libtool to detect the presence of llvm-strip and use
it with the options --strip-debug and --strip-unneeded.

Also hook up the -V alias for objcopy.

Differential Revision: https://reviews.llvm.org/D54936

Modified:
    llvm/trunk/test/tools/llvm-objcopy/objcopy-version.test
    llvm/trunk/test/tools/llvm-objcopy/strip-version.test
    llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp
    llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td
    llvm/trunk/tools/llvm-objcopy/StripOpts.td

Modified: llvm/trunk/test/tools/llvm-objcopy/objcopy-version.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/objcopy-version.test?rev=347731&r1=347730&r2=347731&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/objcopy-version.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/objcopy-version.test Tue Nov 27 22:51:50 2018
@@ -1,4 +1,5 @@
 # RUN: llvm-objcopy -version | FileCheck %s
 # RUN: llvm-objcopy --version | FileCheck %s
+# RUN: llvm-objcopy -V | FileCheck %s
 
 # CHECK: {{ version }}

Modified: llvm/trunk/test/tools/llvm-objcopy/strip-version.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/strip-version.test?rev=347731&r1=347730&r2=347731&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/strip-version.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/strip-version.test Tue Nov 27 22:51:50 2018
@@ -1,4 +1,6 @@
 # RUN: llvm-strip -version | FileCheck %s
 # RUN: llvm-strip --version | FileCheck %s
+# RUN: llvm-strip -V | FileCheck %s
 
-# CHECK: {{ version }}
+# CHECK-DAG: {{ version }}
+# CHECK-DAG: GNU strip

Modified: llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp?rev=347731&r1=347730&r2=347731&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/CopyConfig.cpp Tue Nov 27 22:51:50 2018
@@ -226,6 +226,7 @@ DriverConfig parseObjcopyOptions(ArrayRe
   }
 
   if (InputArgs.hasArg(OBJCOPY_version)) {
+    outs() << "llvm-objcopy, compatible with GNU objcopy\n";
     cl::PrintVersionMessage();
     exit(0);
   }
@@ -383,6 +384,7 @@ DriverConfig parseStripOptions(ArrayRef<
   }
 
   if (InputArgs.hasArg(STRIP_version)) {
+    outs() << "llvm-strip, compatible with GNU strip\n";
     cl::PrintVersionMessage();
     exit(0);
   }

Modified: llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td?rev=347731&r1=347730&r2=347731&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td (original)
+++ llvm/trunk/tools/llvm-objcopy/ObjcopyOpts.td Tue Nov 27 22:51:50 2018
@@ -165,3 +165,4 @@ defm prefix_symbols
 
 def version : Flag<["-", "--"], "version">,
               HelpText<"Print the version and exit.">;
+def V : Flag<["-"], "V">, Alias<version>;

Modified: llvm/trunk/tools/llvm-objcopy/StripOpts.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/StripOpts.td?rev=347731&r1=347730&r2=347731&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/StripOpts.td (original)
+++ llvm/trunk/tools/llvm-objcopy/StripOpts.td Tue Nov 27 22:51:50 2018
@@ -64,3 +64,4 @@ def x : Flag<["-"], "x">, Alias<discard_
 
 def version : Flag<["-", "--"], "version">,
               HelpText<"Print the version and exit.">;
+def V : Flag<["-"], "V">, Alias<version>;




More information about the llvm-commits mailing list