use GCC-style dependency generation with clang-cl, rather than the wrapper we have now




Build Config
10 months ago
10 months ago


(Reporter: froydnj, Unassigned)


(Blocks: 1 bug)


Firefox Tracking Flags

(firefox54 affected)



(1 attachment)

We have this wrapper that invokes cl for us:

so that we can get at the includes via /showincludes and write the GCC-style dependency files we want for |make|.  Doing this adds an extra process invocation on every compiler invocation on Windows, which is reasonably expensive.

We can avoid this with clang-cl, though!  clang-cl is just clang, after all, and clang knows how to write out GCC-style dependency files directly.  We can therefore ditch our wrapper (and /showincludes) and win back some compilation time.

Passing the necessary options will probably have to be done through -Xclang, as IIRC the clang-cl binary doesn't understand the options we need.

Comment 1

10 months ago
The compiler's not happy about forwarding the arguments:

$ clang -MP -MD -MF bar foo.cpp

$ clang-cl -Xclang -MP -Xclang -MD -Xclang -MF -Xclang bar foo.cpp
error: unknown argument: '-MD'
error: unknown argument: '-MF'

$ clang --driver-mode=cl -Xclang -MP -Xclang -MD -Xclang -MF -Xclang bar ../foo.cpp
error: unknown argument: '-MD'
error: unknown argument: '-MF'

Why no complaint about -MP? The difference in those flags ( is that -MP has "Flags<[CC1Option]>" while the others don't.

I'm out of my expertise here, so I'm guessing: does this mean -MD and -MF are gcc-driver options that can't be used because the clang-cl pipeline is just "cl-driver -> cc1" ?

Comment 2

10 months ago
Created attachment 8839312 [details] [diff] [review]
Failed patch (don't land)
You need to log in before you can comment on or make changes to this bug.