<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - ld.lld -v reports "no input files" error, conflicts with libtool test"
   href="https://llvm.org/bugs/show_bug.cgi?id=31582">31582</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ld.lld -v reports "no input files" error, conflicts with libtool test
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>ELF
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>emaste@freebsd.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>libtool has some rather fragile code to check the linker in use, based on the
output from -v:

      # Check to see if the program is GNU ld.  I'd rather use --version,
      # but apparently some variants of GNU ld only accept -v.
      # Break only if it was the GNU/non-GNU ld that we prefer.
      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in

ld.bfd -v and ld.gold -v (with no other args) reports the version and then
exits:

% ld.bfd -v
GNU ld 2.17.50 [FreeBSD] 2007-07-03

ld.lld emits an error:

% build-nodebug/bin/ld.lld -v
LLD 4.0.0 (<a href="http://llvm.org/git/lld">http://llvm.org/git/lld</a> 6a0a1412fb7e571c8d7843ab7ecf802291bff4c5)
build-nodebug/bin/ld.lld: error: no input files
build-nodebug/bin/ld.lld: error: target emulation unknown: -m or at least one
.o file required

See also the resolved PR 31057 for the same issue with the related --version
arg. With --version all three linkers (lld, bfd, gold) currently print the
version and exit, even if provided with a link command line.

With -v all three linkers print the version and then carry on with the link if
specified by remaining cmdline args:

% ld.bfd -v foo.o
ld.bfd: warning: cannot find entry symbol _start; defaulting to
0000000000400078

The only differing case is ld.lld -v with no other args.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>