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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 06:12:50 PDT 2019


ruiu added a comment.

In D65430#1614557 <https://reviews.llvm.org/D65430#1614557>, @MaskRay wrote:

> 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.


I mentioned Makefile because `-MD` was created with that usage in mind (at least originally), but I guess that file format can be understood by other build tools. Am I missing something? Even though some build tools can understand C/C++ file dependencies without using a compiler, there's still some languages that the build systems cannot read, but still they can read auto-generated Makefile-compatible dependency file, no?


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