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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 03:38:45 PDT 2019


MaskRay added inline comments.


================
Comment at: lld/ELF/Driver.cpp:1393
+// because you don't know the exact paths of libraries, even though
+// statically-linked system libraries are technically a part of your
+// program. By using --write-dependencies option, you can make lld to dump
----------------
ruiu wrote:
> MaskRay wrote:
> > ruiu wrote:
> > > MaskRay wrote:
> > > > `statically-linked` -> ``
> > > > 
> > > > a.o/b.a/c.so are not statically linked..
> > > Yeah, and in that case, c.so is not part of your program, and it is not wrong to say that your executable does not really depend on c.so at link-time as long as c.so maintains a stable API.
> > I think the phrase "statically-linked system libraries" is not accurate. Neither a system `.a` nor a system `.so` is statically linked.
> I feel it is colloquially OK, but precisely speaking, you are right. How about this? "even though system libraries that are linked to your executable statically are a part of your program." 
>  "even though system libraries that are linked to your executable statically are a part of your program."

This looks good.

The code looks good but my main question is if we should add a new option, rather than improve an existing option (-t/--trace), which has a fairly similar feature. What --write-dependencies does can be easily implemented with some sed commands. With a small modification, it can be adjusted to Ninja output (and probably dependency format used by other build systems).


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