[llvm-bugs] [Bug 42260] New: Make ld.lld repeat undefined symbol message only once for each undefined symbol

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 12 12:39:00 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42260

            Bug ID: 42260
           Summary: Make ld.lld repeat undefined symbol message only once
                    for each undefined symbol
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

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)
>>> 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))
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()
>>> referenced by test.cc:2
>>>               /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-a3c919.o:(g())

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

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



We should teach it the same trick.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190612/fe904c86/attachment.html>


More information about the llvm-bugs mailing list