[PATCH] D65430: Add `--dependency-files` option, which is equivalent to compiler option -MD.

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 12:40:20 PST 2019


bd1976llvm added a comment.

Hi All, Apologies that I missed the request for input here.

Great summary @MaskRay. I like the examples. Worth being careful as dependency graph problems are tricky (I find).

Firstly, the problem that you have raised here is already addressed for header files with -MP, no? Therefore, I think that in lld we simply need to implement the following set: -M, -MM, -MF, -MG, -MP, -MQ, -MD, -MMD. We can presumably reuse the clang code for this so it won't be too bad.

Secondly, you have a point about these being make specific options; however, that is the well established standard. I would support implementing make specific output now and then implementing whatever more generic format build systems standardize on later. Just my 2 cents.

Incidentally, autolinking was modeled on the Microsoft feature where this problem does not exist - thanks to the infamous tracker.exe.

Finally, I don't think that this is as useful a feature (as header file dep generation) because, unlike header files which are not build outputs (usually), libraries are often build outputs. So, although implementing the -M options in LLD would handle incremental builds, you still need to add explicit edges to your makefiles to handle the initial build. If you are having to modify your makefiles then "comment lib" pragmas seem less useful. As I understand it autolinking is intended for linking libraries that are not built by your makefiles e.g. system libraries, or libraries supplied by thirdparty vendors.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65430/new/

https://reviews.llvm.org/D65430





More information about the llvm-commits mailing list