<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 22, 2016 at 9:23 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">tejohnson added a comment.<br>
<span class=""><br>
In <a href="https://reviews.llvm.org/D22677#492930" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22677#492930</a>, @davidxl wrote:<br>
<br>
> For the functional case, I meant the tests in <a href="https://reviews.llvm.org/D22356" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22356</a> -- that with this patch we don't end up with unsats in second link.<br>
<br>
<br>
</span>Right, for this patch to fix that case it needs gold v1.12, and there isn't a way to require a certain gold version on the bots.<br></blockquote><div><br></div><div><br></div><div>I thought one of the issue is that the first link does not drop any, but the second link drops it if the same command line is used.  If the first link does not drop any, is v1.12 still needed?</div><div><br></div><div>David </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><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><span class="">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>
</span>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>
<span class=""><br>
================<br>
Comment at: test/tools/gold/X86/thinlto_emit_linked_objects.ll:21<br>
@@ +20,3 @@<br>
+; RUN: cat %t3 | FileCheck %s<br>
+; CHECK: thinlto_emit_linked_objects.ll.tmp.o<br>
+; CHECK: thinlto_emit_linked_objects.ll.tmp2.o<br>
----------------<br>
</span><span class="">davidxl wrote:<br>
> tejohnson wrote:<br>
> > davidxl wrote:<br>
> > > Can the name between bitcode file and final object files be made more related ?<br>
> > The ThinLink gold invocation doesn't know the name of the final object files. But note that if a prefix replace path is specified (thinlto-prefix-replace=oldprefix:newprefix plugin option), then the names emitted will have the matching prefix path replaced with the new one. This can be used to get the paths to the final object files into the file, as long as the final objects use the same names but a different path (true in bazel). Otherwise the build system would need to do post-processing of the list to map to the final object files it is going to create - known by the build system but not by gold here.<br>
> This request is more about test case readability. Suppose --start-lib and --end-lib pair includes two bit code files, but one of them is dropped in the first link. In the second step, we need to be able to tell which one maps to the kept one..<br>
</span>Is the concern that it isn't obvious how %t.o and %t2.o map to lines in the CHECK? Note though that both are included in the link due to the gold version issue mentioned in the comments, so it should be pretty clear in this test case I think?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D22677" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22677</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>