[PATCH] D46034: Support for distributed ThinLTO options

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 25 13:33:45 PDT 2018


pcc added inline comments.


================
Comment at: lld/ELF/Driver.cpp:1015
+      // With ThinLTOIndexOnly option, Thinlto needs to generate object files
+      // for all bitcode files(even with no symbols). After index files are
+      // created, we exit from linker and LTO Distributed Backend runs. This
----------------
The problem as I understand it is not related to files with no symbols but rather that if an object file between `--start-lib` and `--end-lib` is not selected using the usual rules for adding archive members to the link, the distributed build system will still want to see a `.thinlto.bc` file for it, even if it is unused.


================
Comment at: lld/ELF/Driver.cpp:1018
+      // distributed build system will want to confirm that all expected outputs
+      // are created based on all of the modules provided to the linker.
+      if (Config->ThinLTOIndexOnly)
----------------
This part seems to be equivalent to `writeEmptyDistributedBuildOutputs` in the gold plugin. It's unfortunate that we need this in order to work around a deficiency in the distributed build system, but if we are going to do this, can we instead do something equivalent to that in order to avoid linking more than we need?

I think we should be able to do this by keeping track of which `LazyObjFile`s have been added to the link, and emitting a `.thinlto.bc` file for every file that has not been added to the link.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D46034





More information about the llvm-commits mailing list