<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 - Make ld.lld repeat undefined symbol message only once for each undefined symbol"
   href="https://bugs.llvm.org/show_bug.cgi?id=42260">42260</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Make ld.lld repeat undefined symbol message only once for each undefined symbol
          </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>ELF
          </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>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If there are multiple references to an undefined symbol, lld-link prints only
one error line and then list all symbols. This is a nice feature and makes the
output more concise:


$ cat test.cc
int f();
void g() { f(); }
void h() { f(); }
void j() { f(); }

$ out/gn/bin/clang-cl /Zi test.cc -fuse-ld=lld /link /dll /noentry
/nodefaultlib
lld-link: error: undefined symbol: int __cdecl f(void)
<span class="quote">>>> referenced by /Users/thakis/src/chrome/src/test.cc:2
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-96be76.obj:(void __cdecl g(void))
>>> referenced by /Users/thakis/src/chrome/src/test.cc:3
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-96be76.obj:(void __cdecl h(void))
>>> referenced by /Users/thakis/src/chrome/src/test.cc:4
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-96be76.obj:(void __cdecl j(void))</span >
clang: error: linker command failed with exit code 1 (use -v to see invocation)


The ELF port isn't able to do this:

$ out/gn/bin/clang --target=x86_64-linux -nostartfiles -nodefaultlibs test.cc
-fuse-ld=lld -g
ld.lld: error: undefined symbol: f()
<span class="quote">>>> referenced by test.cc:2
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-a3c919.o:(g())</span >

ld.lld: error: undefined symbol: f()
<span class="quote">>>> referenced by test.cc:3
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-a3c919.o:(h())</span >

ld.lld: error: undefined symbol: f()
<span class="quote">>>> referenced by test.cc:4
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-a3c919.o:(j())</span >
clang: error: linker command failed with exit code 1 (use -v to see invocation)



We should teach it the same trick.</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>