<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Improve -O argument handling"
   href="https://bugs.llvm.org/show_bug.cgi?id=34311">34311</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Improve -O argument handling
          </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>enhancement
          </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>Blocks</th>
          <td>23214
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I am currently working through the build failures found in a FreeBSD ports
build using lld as the linker. A few ports are failing due to differences in
treatment of the -O option.

1. -O with no argument

Although not documented, ld.bfd accepts -O without an argument. Example
invocation:

% ld.bfd -O string-lib.o -x -r string-lib.o
%

Because -O is documented as taking a number it seems reasonable to reject an
invocation with no argument. Our error message could be improved though:

% ld.lld -O
ld.lld: error: -O: number expected, but got

Even "number expected, but got ''" as produced by parseInt (vs getInteger) is a
bit more clear.

2. Space before argument

Linking is sometimes performed with something like -Wl,-O,2 passed to the
compiler driver, resulting in

% ld.bfd -O 2 string-lib.o -x -r string-lib.o

-O should just be JoinedOrSeparate perhaps?

Example failing ports: archivers/lua51-zlib, www/cgihtml</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [META] Using LLD as FreeBSD's system linker"
   href="https://bugs.llvm.org/show_bug.cgi?id=23214">Bug 23214</a>] [META] Using LLD as FreeBSD's system linker
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>