[clang-scan-deps] Add -M to work around -MT issue after r371918

gcc will complain if -MT is used but neither -M nor -MM is specified:

> cc1: error: to generate dependencies you must specify either -M or -MM

r371918 changed our behavior to match GCC, but apparently
clang-scan-deps is not happy.

llvm-svn: 371920
This commit is contained in:
Fangrui Song 2019-09-14 07:25:27 +00:00
parent 55abd2b295
commit 8f6d40e9b1
1 changed files with 1 additions and 0 deletions

View File

@ -242,6 +242,7 @@ int main(int argc, const char **argv) {
AdjustedArgs.push_back("-o");
AdjustedArgs.push_back("/dev/null");
if (!HasMT && !HasMQ) {
AdjustedArgs.push_back("-M");
AdjustedArgs.push_back("-MT");
// We're interested in source dependencies of an object file.
if (!HasMD) {