<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Mar 16, 2017 at 2:36 PM Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">What program did you use to test the feature, and what was missing information? I'd like to file that as a bug so that we can fix this later.</div></blockquote><div><br></div><div>I was using GDB 7.9 (a google internal build, not sure how much that matters - there might be some things that didn't make it upstream) to debug LLVM's 'llc' binary on an assert-failure.<br><br>The backtrace was missing source information from some frames:<br><br>Not the best representation of it, but here's a chunk of my debugging session:<br><br><div>#9 0x00000000037d9278 in llvm::DwarfCompileUnit::constructVariableDIEImpl (this=0x540a390, DV=..., Abstract=false) at /usr/local/google/hom</div><div>e/blaikie/dev/llvm/src/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:543</div><div>(gdb)</div><div>#10 0x00000000037d8c6c in llvm::DwarfCompileUnit::constructVariableDIE (this=0x540a390, DV=..., Abstract=false) at /usr/local/google/home/bl</div><div>aikie/dev/llvm/src/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:479</div><div>(gdb)</div><div>#11 0x00000000037d97b6 in llvm::DwarfCompileUnit::constructVariableDIE (this=0x540a390, DV=..., Scope=..., ObjectPointer=@0x7fffffffb488: 0x</div><div>0) at /usr/local/google/home/blaikie/dev/llvm/src/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:560</div><div>(gdb)</div><div>#12 0x00000000037d8231 in llvm::DwarfCompileUnit::createScopeChildrenDIE (this=0x540a390, Scope=0x5482df0, Children=llvm::SmallVector of len</div><div>gth 0, capacity 8, ChildScopeCount=0x0) at /usr/local/google/home/blaikie/dev/llvm/src/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:572</div><div>(gdb)</div><div>#13 0x00000000037d99b7 in llvm::DwarfCompileUnit::createAndAddScopeChildren (this=0x540a390, Scope=0x5482df0, ScopeDIE=...) at /usr/local/go</div><div>ogle/home/blaikie/dev/llvm/src/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:614</div><div>(gdb)</div><div>#14 0x00000000037d98a4 in llvm::DwarfCompileUnit::constructSubprogramScopeDIE (this=0x540a390, Sub=0x53cd568, Scope=0x5482df0) at /usr/local</div><div>/google/home/blaikie/dev/llvm/src/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:594</div><div>(gdb) </div><div>#15 0x000000000376a087 in llvm::DwarfDebug::endFunctionImpl (this=0x54082c0, MF=0x5439b60) at /usr/local/google/home/blaikie/dev/llvm/src/li</div><div>b/CodeGen/AsmPrinter/DwarfDebug.cpp:1240</div><div>(gdb) </div><div>#16 0x00000000037c93c9 in llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*) ()</div><div>(gdb) </div><div>#17 0x0000000003733d6a in llvm::AsmPrinter::EmitFunctionBody (this=0x53fa9a0) at /usr/local/google/home/blaikie/dev/llvm/src/lib/CodeGen/Asm</div><div>Printer/AsmPrinter.cpp:1083</div><div>(gdb) </div><div>#18 0x0000000003107e61 in llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) ()</div><div>(gdb) </div><div>#19 0x0000000003a263b1 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) ()</div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Thu, Mar 16, 2017 at 2:34 PM, David Blaikie <span dir="ltr" class="gmail_msg"><<a href="mailto:dblaikie@gmail.com" class="gmail_msg" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">FWIW - selfhosting I did find that GDB wasn't able to find the source code for some functions when using LLD's gdb_index, so I've switched back to gold+gdb_index for now (given the performance problems you mentioned, sounds like I wasn't gaining much/anything in terms of link time by using lld anyway).<div class="gmail_msg"><div class="m_-8323872767417839575h5 gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Thu, Mar 16, 2017 at 11:17 AM Rui Ueyama <<a href="mailto:ruiu@google.com" class="gmail_msg" target="_blank">ruiu@google.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div class="gmail_extra m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div class="gmail_quote m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">I personally haven't tried gdb_index, and I don't know the quality of the produced index. Most of the code was written by George.</div><div class="gmail_quote m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"></div><div class="gmail_quote m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">One thing I noticed about the feature (and filed as <a href="http://bugs.llvm.org/show_bug.cgi?id=32228" class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" target="_blank">http://bugs.llvm.org/show_bug.cgi?id=32228</a>) is that our gdb_index feature is much slower than the gold. Apparently there's room for improvement.</div></div></div><div dir="ltr" class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div class="gmail_extra m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div class="gmail_quote m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"></div><div class="gmail_quote m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">On Thu, Mar 16, 2017 at 8:35 AM, David Blaikie <span dir="ltr" class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><<a href="mailto:dblaikie@gmail.com" class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><blockquote class="gmail_quote m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">Any idea of the quality/completeness of the gdb_index support? I've started using gdb_index recently (reduces GDB startup time for Clang from 50 seconds to 3 seconds - though I haven't measure how much it increases link time*) & it's really handy. Would love to have some assurance it's expected to work for LLD.<br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">Simple experiments seem to indicate that it's OK/good. Though a quick llvm-dwarfdump of gdb_index between the two linkers shows about a 10% disparity in size (LLD's is smaller) given the same inputs. (219MB v 196MB of text dumped - I didn't compare the actual section sizes)<div class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">*though honestly I'd be willing to trade startup time for link time 1:1 even, because builds/links are already long enough that I go off and do something else - whereas getting GDB start down to 3 seconds, I can start writing my breakpoint command, etc, in those 3 seconds and be all but unaffected by it - at 50 seconds I basically have to go off and do something else/context switch/etc.<br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div class="gmail_quote m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765h5 m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div dir="ltr" class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">On Tue, Mar 14, 2017 at 11:40 AM Rui Ueyama via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"></div></div></div><blockquote class="gmail_quote m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765h5 m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><div dir="ltr" class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">Hi all,<div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"></div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">LLVM 4.0.0 is out, and I can say that LLD/ELF is now ready for production use at least for x86-64 (and probably for AArch64 and MIPS). I believe you've heard a few good news about the linker -- it <a href="http://lld.llvm.org/#features" class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" target="_blank">just works</a> and is <a href="http://lld.llvm.org/#performance" class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" target="_blank">very fast</a>, clean, compact and supported by the active community. I don't think I need to reiterate why having a good linker is important for us as the LLVM community.</div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"></div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">There's one thing you can help us without writing even a line of code. Please use it!</div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"></div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">Using LLD to link LLVM/clang/etc is easy. You need to check out the LLD repository just like you probably already did for clang, build it, and then install it. LLD will be installed as ld.lld (and it won't be used by default.) After that, re-run cmake with -DLLVM_ENABLE_LLD=On along with your usual options so that LLD will be used to build LLVM.</div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"></div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">For the details of the build process, please see <a href="http://lld.llvm.org/#build" class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" target="_blank">http://lld.llvm.org/#build</a>.</div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"><br class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"></div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">Thanks,</div><div class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">Rui</div></div></div></div><span class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">
_______________________________________________<br class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">
LLVM Developers mailing list<br class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="m_-8323872767417839575m_6120452465377505700m_2919265252878672118gmail-m_3190918606171948765m_-8711519152332253609gmail_msg m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg">
</span></blockquote></div></div></div>
</blockquote></div><br class="m_-8323872767417839575m_6120452465377505700gmail_msg gmail_msg"></div></div></blockquote></div></div></div></div>
</blockquote></div><br class="gmail_msg"></div>
</blockquote></div></div>