<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 - ld64.lld.darwinnew produces invalid debug info, causing lldb to err with "N_SO in symbol with UID 145239 has invalid sibling in debug map, please file a bug and attach the binary listed in this error""
   href="https://bugs.llvm.org/show_bug.cgi?id=48714">48714</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ld64.lld.darwinnew produces invalid debug info, causing lldb to err with "N_SO in symbol with UID 145239 has invalid sibling in debug map, please file a bug and attach the binary listed in this error"
          </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>Linux
          </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>nicolasweber@gmx.de
          </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>Known issue, but I figured I'd file a bug so that I can link to it. Possible
repro, extracted from <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - ld64.lld.darwinnew-linked Chromium Framework is somewhat crashy"
   href="show_bug.cgi?id=48657#c5">https://bugs.llvm.org/show_bug.cgi?id=48657#c5</a> (there are
likely way smaller repros):

1. Download
<a href="https://drive.google.com/file/d/1thKfcfKUMhyJ22HRSjorIKZjH42k3bnZ/view?usp=sharing">https://drive.google.com/file/d/1thKfcfKUMhyJ22HRSjorIKZjH42k3bnZ/view?usp=sharing</a>
(warning: large, 1GB compressed, 5.3GB unzipped -- but it links very quickly,
less than a second with both linkers).

2. Link as usual (`ld64.lld.darwinnew @response.txt`)

3. Run like e.g. so: `lldb -- ./mksnapshot --turbo_instruction_scheduling
--target_os=mac --target_arch=x64 --embedded_src embedded.S --embedded_variant
Default --random-seed 314159265 --startup_blob snapshot_blob.bin
--native-code-counters --verify-heap`

When loading the lld-linked binary into lldb, it prints many lines looking like

error: mksnapshot N_SO in symbol with UID 145239 has invalid sibling in debug
map, please file a bug and attach the binary listed in this error

This doesn't happen with ld.


(Once this is fixed, debug info isn't terribly useful without the actual source
files somewhere. Due to
<a href="https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html">https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html</a> one
has to run `settings set target.source-map ../.. actual/local/path/to/src` in
lldb even if src files are available locally somewhere.)</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>