<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 - lld/mac should ignore invalid LC_LINKER_OPTIONS on successful links"
   href="https://bugs.llvm.org/show_bug.cgi?id=52388">52388</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld/mac should ignore invalid LC_LINKER_OPTIONS on successful links
          </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>All
          </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>MachO
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>keithbsmiley@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>gkm@fb.com, jezreel@gmail.com, llvm-bugs@lists.llvm.org, smeenai@fb.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In our iOS project we have an invalid modulemap file that specifies `link
"stdc++"` as well as `link "c++"`. The former is invalid on iOS so ld64.lld
fails with `ld64.lld: error: library not found for -lstdc++`

I traced back why this doesn't fail in ld64 and found that in this case ld64
ignores invalid LC_LOAD_COMMAND options (but not command line options) unless
the link fails, in which case it warns about the invalid option.

Reference:
<a href="https://github.com/keith/ld64/blob/2ff40b093f1b20dad35d48480da016bc380707dd/src/ld/InputFiles.cpp#L764-L765">https://github.com/keith/ld64/blob/2ff40b093f1b20dad35d48480da016bc380707dd/src/ld/InputFiles.cpp#L764-L765</a>

I think it's unlikely that many other folks hit this exact same issue, since it
requires an arguably broken build, but if the goal is to reproduce ld64 as
close as possible, we might want to mirror this behavior.</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>