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

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 14 00:25:27 PDT 2019


Author: maskray
Date: Sat Sep 14 00:25:27 2019
New Revision: 371920

URL: http://llvm.org/viewvc/llvm-project?rev=371920&view=rev
Log:
[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.

Modified:
    cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp

Modified: cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp?rev=371920&r1=371919&r2=371920&view=diff
==============================================================================
--- cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp (original)
+++ cfe/trunk/tools/clang-scan-deps/ClangScanDeps.cpp Sat Sep 14 00:25:27 2019
@@ -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) {




More information about the cfe-commits mailing list