[PATCH] D22677: [ThinLTO/gold] Support for getting list of included objects from gold

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 09:17:48 PDT 2016


davidxl added a comment.

For the functional case, I meant the tests in https://reviews.llvm.org/D22356 -- that with this patch we don't end up with unsats in second link.


================
Comment at: test/tools/gold/X86/thinlto_emit_linked_objects.ll:18
@@ +17,3 @@
+; RUN:    %t.o \
+; RUN:    --start-lib %t2.o --end-lib
+
----------------
tejohnson wrote:
> davidxl wrote:
> > Perhaps add test case about real archive case as well.
> 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)
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?

================
Comment at: test/tools/gold/X86/thinlto_emit_linked_objects.ll:21
@@ +20,3 @@
+; RUN: cat %t3 | FileCheck %s
+; CHECK: thinlto_emit_linked_objects.ll.tmp.o
+; CHECK: thinlto_emit_linked_objects.ll.tmp2.o
----------------
tejohnson wrote:
> davidxl wrote:
> > Can the name between bitcode file and final object files be made more related ? 
> 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.
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..


https://reviews.llvm.org/D22677





More information about the llvm-commits mailing list