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

NEW
Unassigned

Status

()

Core
Build Config
10 months ago
10 months ago

People

(Reporter: froydnj, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
All
Windows
Points:
---

Firefox Tracking Flags

(firefox54 affected)

Details

Attachments

(1 attachment)

We have this wrapper that invokes cl for us:

http://dxr.mozilla.org/mozilla-central/source/config/config.mk#122
http://dxr.mozilla.org/mozilla-central/source/python/mozbuild/mozbuild/action/cl.py#1

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 (https://github.com/llvm-mirror/clang/blob/master/include/clang/Driver/Options.td#L348-L364) 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.