Commit Graph

4 Commits

Author SHA1 Message Date
Petr Hosek 81eeabbd97 [ELF] Add --dependency-file option
Clang and GCC have a feature (-MD flag) to create a dependency file
in a format that build systems such as Make or Ninja can read, which
specifies all the additional inputs such .h files.

This change introduces the same functionality to lld bringing it to
feature parity with ld and gold which gained this feature recently.
See https://sourceware.org/bugzilla/show_bug.cgi?id=22843 for more
details and discussion.

The implementation corresponds to -MD -MP compiler flag where the
generated dependency file also includes phony targets which works
around the errors where the dependency is removed. This matches the
format used by ld and gold.

Fixes PR42806

Differential Revision: https://reviews.llvm.org/D82437
2020-08-03 16:59:13 -07:00
Petr Hosek 0bd918c828 Revert "[ELF] Add --dependency-file option"
This reverts commit b4c7657ba6 which
seems to be breaking certain bots with assertion error.
2020-07-31 01:12:59 -07:00
Wolfgang Pieb 9f02258942 Make a test case more flexible on Windows wrt the number of backslashes. 2020-07-30 20:38:12 -07:00
Petr Hosek b4c7657ba6 [ELF] Add --dependency-file option
Clang and GCC have a feature (-MD flag) to create a dependency file
in a format that build systems such as Make or Ninja can read, which
specifies all the additional inputs such .h files.

This change introduces the same functionality to lld bringing it to
feature parity with ld and gold which gained this feature recently.
See https://sourceware.org/bugzilla/show_bug.cgi?id=22843 for more
details and discussion.

The implementation corresponds to -MD -MP compiler flag where the
generated dependency file also includes phony targets which works
around the errors where the dependency is removed. This matches the
format used by ld and gold.

Fixes PR42806

Differential Revision: https://reviews.llvm.org/D82437
2020-07-30 12:31:20 -07:00