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

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 10:13:56 PDT 2016


tejohnson added inline comments.

================
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:
> > tejohnson wrote:
> > > davidxl wrote:
> > > > 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?
> > > 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.
> > > 
> > > 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.
> > how about thin archive?
> Gold does not seem to like thin archives (regardless of LTO vs ThinLTO). I get an error (from gold, not the plugin) like:
> 
> error: foo.a: no archive symbol table (run ranlib)
> 
> (even when I run ranlib)
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.


https://reviews.llvm.org/D22677





More information about the llvm-commits mailing list