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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 05:20:00 PDT 2019


MaskRay added a comment.

In D65430#1606209 <https://reviews.llvm.org/D65430#1606209>, @emaste wrote:

> In D65430#1605980 <https://reviews.llvm.org/D65430#1605980>, @peter.smith wrote:
>
> > My understanding is that many developers use makefile/ninja generation systems such as cmake rather than hand-write the file themselves. As such would this get much use unless it was integrated into these generators? May be worth approaching them to see if they have any requirements/observations about the option?
>
>
> Having it integrated into e.g. cmake would be a great project for someone to take on, but for us (FreeBSD) it would be useful by itself. Our build is about 175K lines of hand-written Makefiles and we could plug it in with a small change in a couple of places. In any case we shouldn't hold up lld support waiting on prospective cmake changes IMO.


Ed, does `ld.lld a.o -o /dev/null | sed 's/(.*//' | sort -u | sed '$!s/$/ \\/';}` generate a usable Makefile fragment? I think the scenarios where people write Makefile are not very common now (think cmake/bazel/meson/scons/buck/...). Makefile and build.ninja are mostly used as an "assembly language". I think a dependency graph feature will be useful, but a Makefile fragment is probably not the best format. (I actually like Makefile more than the alternatives but I know the trend is that people are moving away from hand-written Makefile) At least it looks like the output can be easily generated from `ld.lld -t` output.


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