This allows reporting undefined symbols before LTO codegen is
run. Since LTO codegen can take a long time, this improves user
experience by avoiding that time spend if the link is going to
fail with undefined symbols anyway.
Fixes PR32400.
| Paths 
 |  Differential  D62434  
[lld-link] diagnose undefined symbols before LTO when possible ClosedPublic Authored by inglorion on May 24 2019, 3:51 PM. 
Details Summary This allows reporting undefined symbols before LTO codegen is Fixes PR32400. 
Diff Detail 
 Event Timelineinglorion retitled this revision from [WIP][lld-link] diagnose undefined symbols before LTO if possible to [lld-link] diagnose undefined symbols before LTO when possible.Comment Actions Ready for review now. Comment Actions The basic idea here is: reportRemainingUndefines did two things: it attempts to resolve undefined symbols, and it reports any that remain undefined. This splits reportRemainingUndefines into two functions, one which reports symbols which we know are unresolvable (reportUnresolvable, which we run before LTO) and one which actually does the resolution (resolveRemainingUndefines, which we run after LTO). Then there is a little bit of added code report undefined symbols in bitcode files. 
 
 Comment Actions Linking ThinLTO chrome.dll with an undefined symbol: Without this change: ~13 minutes. Comment Actions Generally looking ogod. 
 Comment Actions LGTM 
 This revision is now accepted and ready to land.Jul 24 2019, 12:10 PM inglorion added inline comments. 
 Closed by commit rL367136: [lld-link] diagnose undefined symbols before LTO when possible (authored by inglorion).  ·  Explain WhyJul 26 2019, 10:57 AM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 211970 lld/trunk/COFF/Driver.cpp
 lld/trunk/COFF/SymbolTable.h
 lld/trunk/COFF/SymbolTable.cpp
 lld/trunk/test/COFF/unresolved-lto-bitcode.ll
 lld/trunk/test/COFF/unresolved-lto.ll
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A bot notices:
lld/COFF/SymbolTable.cpp:329:18: warning: unused variable ‘d’ [-Wunused-variable] if (Defined *d = undef->getWeakAlias()) ^I'd just remove d but I'm not sure if you intended to do something with it.