[lld] r298568 - Print out "suppoted targets".

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 18:00:22 PDT 2017


Author: ruiu
Date: Wed Mar 22 20:00:22 2017
New Revision: 298568

URL: http://llvm.org/viewvc/llvm-project?rev=298568&view=rev
Log:
Print out "suppoted targets".

This is to improve compatibility with GNU Libtool that expect
/supported targets:.* elf/ in a message for the -help option.

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

Modified:
    lld/trunk/ELF/DriverUtils.cpp
    lld/trunk/test/ELF/driver.test

Modified: lld/trunk/ELF/DriverUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/DriverUtils.cpp?rev=298568&r1=298567&r2=298568&view=diff
==============================================================================
--- lld/trunk/ELF/DriverUtils.cpp (original)
+++ lld/trunk/ELF/DriverUtils.cpp Wed Mar 22 20:00:22 2017
@@ -119,6 +119,19 @@ opt::InputArgList ELFOptTable::parse(Arr
 void elf::printHelp(const char *Argv0) {
   ELFOptTable Table;
   Table.PrintHelp(outs(), Argv0, "lld", false);
+  outs() << "\n";
+
+  // Scripts generated by Libtool versions up to at least 2.4.6 (the most
+  // recent version as of March 2017) expect /supported targets:.* elf/ in
+  // a message for the -help option. If it doesn't match, the scripts
+  // assume that the linker doesn't support very basic features such as
+  // shared libraries. Therefore, we need to print out at least "elf".
+  // Here, we print out all the targets that we support.
+  outs() << Argv0 << ": supported targets: "
+         << "elf32-i386 elf32-iamcu elf32-littlearm elf32-powerpc "
+         << "elf32-tradbigmips elf32-tradlittlemips elf32-x86-64 "
+         << "elf64-amdgpu elf64-littleaarch64 elf64-powerpc "
+         << "elf64-tradbigmips elf64-tradlittlemips elf64-x86-64\n";
 }
 
 // Reconstructs command line arguments so that so that you can re-run

Modified: lld/trunk/test/ELF/driver.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/driver.test?rev=298568&r1=298567&r2=298568&view=diff
==============================================================================
--- lld/trunk/test/ELF/driver.test (original)
+++ lld/trunk/test/ELF/driver.test Wed Mar 22 20:00:22 2017
@@ -15,6 +15,7 @@
 
 # RUN: ld.lld --help 2>&1 | FileCheck -check-prefix=HELP %s
 # HELP: USAGE:
+# HELP: ld.lld: supported targets: {{.*}} elf
 
 # RUN: ld.lld --version 2>&1 | FileCheck -check-prefix=VERSION %s
 # VERSION: LLD {{.*}} (compatible with GNU linkers)




More information about the llvm-commits mailing list