<div dir="ltr">Define a lit.local.cfg and add checks there. For instance: projects/compiler-rt/test/profile/Linux/lit.local.cfg<div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 22, 2016 at 12:04 PM, Teresa Johnson <span dir="ltr"><<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Jul 22, 2016 at 11:46 AM, Xinliang David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Can we have a subdir in the test that requires latest version of gold -- so that more tests can be added?</div></blockquote><div><br></div></span><div>AFAICT there is no way to require a specific version of gold via Lit currently, but I think I see how such a requirement could be added (there is something similar for the python version, in utils/lit/tests/lit.cfg, although I don't see it being used anywhere). Let me try to do that.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Teresa</div></font></span><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span class="m_8294644804025924270gmail-m_4979397496248333934HOEnZb"><font color="#888888"><div><br></div><div>David</div></font></span></div><div class="m_8294644804025924270gmail-m_4979397496248333934HOEnZb"><div class="m_8294644804025924270gmail-m_4979397496248333934h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 22, 2016 at 11:41 AM, Teresa Johnson <span dir="ltr"><<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span>tejohnson added inline comments.<br>
<br>
================<br>
Comment at: test/tools/gold/X86/thinlto_emit_linked_objects.ll:18<br>
@@ +17,3 @@<br>
+; RUN:    %t.o \<br>
+; RUN:    --start-lib %t2.o --end-lib<br>
+<br>
----------------<br>
</span><div><div class="m_8294644804025924270gmail-m_4979397496248333934m_-4199974608856750904h5">tejohnson wrote:<br>
> mehdi_amini wrote:<br>
> > tejohnson wrote:<br>
> > > tejohnson wrote:<br>
> > > > tejohnson wrote:<br>
> > > > > mehdi_amini wrote:<br>
> > > > > > tejohnson wrote:<br>
> > > > > > > tejohnson wrote:<br>
> > > > > > > > davidxl wrote:<br>
> > > > > > > > > tejohnson wrote:<br>
> > > > > > > > > > davidxl wrote:<br>
> > > > > > > > > > > tejohnson wrote:<br>
> > > > > > > > > > > > davidxl wrote:<br>
> > > > > > > > > > > > > Perhaps add test case about real archive case as well.<br>
> > > > > > > > > > > > For a distributed build the build system needs to extract the constituent objects (otherwise the combined index paths will not point to an object file)<br>
> > > > > > > > > > > I think this feature is more about two step link (not about a particular distributed build system). It is possible that some other distributed build system uses archive, right?<br>
> > > > > > > > > > Using archives directly with a distributed build won't work - the combined index module paths need to point to an object file for the distributed backends to import from. The build system needs to extract the objects (e.g. into a temp dir) and pass those.<br>
> > > > > > > > > ><br>
> > > > > > > > > > Note that archives passed to a non-distributed build work fine because we load the modules from the offset within the archive passed to the plugin from gold and serve those to the importer.<br>
> > > > > > > > > how about thin archive?<br>
> > > > > > > > Gold does not seem to like thin archives (regardless of LTO vs ThinLTO). I get an error (from gold, not the plugin) like:<br>
> > > > > > > ><br>
> > > > > > > > error: foo.a: no archive symbol table (run ranlib)<br>
> > > > > > > ><br>
> > > > > > > > (even when I run ranlib)<br>
> > > > > > > Note this issue is specific to bitcode files in the archive - gold with regular native objects in a thin archive works just fine. Looks like ranlib doesn't work on an archive of bitcode files, and that seems to be needed with a thin archive.<br>
> > > > > > Do you mean "ranlib doesn't work on a *thin* archive of bitcode files"?<br>
> > > > > > Otherwise how do you build LLVM itself with LTO?<br>
> > > > > According to <a href="http://llvm.org/docs/GoldPlugin.html" rel="noreferrer" target="_blank">http://llvm.org/docs/GoldPlugin.html</a> it isn't supported for archives of bitcode files at all, but apparently isn't needed for a whole (non-thin) archive:<br>
> > > > ><br>
> > > > > "export RANLIB=/bin/true #ranlib is not needed, and doesn't support .bc files in .a"<br>
> > > > So I can't get gold to work with a (non-thin) archive created by ar, it gives the same error. Maybe it needs to take the -plugin option? In any case, a non-thin archive created via llvm-ar is accepted and works fine. I don't see an llvm-ar option to create a thin archive though?<br>
> > > Aha - llvm-ar does support thin archives, it's just that the T option is not documented in the help. =)<br>
> > ><br>
> > > With that, it does work for llvm-ar thin archives! Will add another case to the new test that does the same for thin archives before submitting.<br>
> > > According to <a href="http://llvm.org/docs/GoldPlugin.html" rel="noreferrer" target="_blank">http://llvm.org/docs/GoldPlugin.html</a> it isn't supported for archives of bitcode files at all.<br>
> ><br>
> > Documentation patch?<br>
> Reading through that page some more, it gives instructions earlier on getting the plugin to work with ar:<br>
> "ar and nm also accept the -plugin option and it’s possible to to install LLVMgold.so to /usr/lib/bfd-plugins for a seamless setup. If you built your own gold, be sure to install the ar and nm-new you built to /usr/bin."<br>
><br>
> So I think it is ok. I just took the latter comment out of context.<br>
><br>
> However, I will send a patch to document the llvm-ar T modifier<br>
> With that, it does work for llvm-ar thin archives! Will add another case to the new test that does the same for thin archives before submitting.<br>
<br>
</div></div>And, removed in r276453 due to bot failure - looks like gold v1.11 does not like the thin archive (gold v1.12 is fine though!).<br>
<div class="m_8294644804025924270gmail-m_4979397496248333934m_-4199974608856750904HOEnZb"><div class="m_8294644804025924270gmail-m_4979397496248333934m_-4199974608856750904h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D22677" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22677</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div></div></div><br><br clear="all"><span class=""><div><br></div>-- <br><div class="m_8294644804025924270gmail-m_4979397496248333934gmail_signature"><span style="font-family:times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> <a href="tel:408-460-2413" value="+14084602413" target="_blank">408-460-2413</a></td></tr></tbody></table></span></div>
</span></div></div>
</blockquote></div><br></div>