[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 02:11:21 PDT 2019


MaskRay added a comment.

If you need a makefile snippet: `{ echo -n 'a: '; clang a.o -o a -Wl,-t | sed 's/(.*//' | sort -u | sed '$!s/$/ \\/';} > a.d` (assuming there is no special character)...

If there is some special needs, maybe we can improve `-t` to add more customization?



================
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:
> > `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.


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