Closed Bug 1506848 Opened 5 years ago Closed 5 years ago

Use -Z7 by default for clang-cl builds


(Firefox Build System :: General, enhancement)

Not set


(firefox67 fixed)

Tracking Status
firefox67 --- fixed


(Reporter: ted, Assigned: ted)




(2 files)

clang doesn't actually support -Zi (for generating debug info into a separate PDB file while compiling a source file), it treats it as an alias for -Z7, which generates debug info into the object file.

We still pass -Zi to clang-cl though:

but then we override it with -Z7 in mozconfig.cache (for sccache's benefit):

We should just switch to using -Z7 directly for clang-cl builds, which will make using sccache for local clang-cl builds straightforward.
While we're at it, we could probably also wrap the whole block that sets COMPILE_PDB_FLAG in `ifneq ($(CC_TYPE),clang)`:

That would let us just drop that whole section from mozconfig.cache.
Blocks: 1318370
Assignee: nobody → ted

We default to -Zi for Windows debug flags, which is for generating debug info
into a PDB file, but clang-cl doesn't actually implement that so -Zi is
an alias for -Z7 in clang-cl:

sccache has special handling for -Zi because multiple compiles writing
to the same PDB file is not cacheable, so we've always overridden -Zi with -Z7
in CI when using sccache.

Given that everyone should be using clang-cl nowadays and MSVC will no longer
be supported soon, this patch changes the default and removes some PDB
file name flag setting from, as well as the no-longer-necessary
overrides from mozconfig.cache.

Pushed by
switch Windows debug flags from -Zi to -Z7. r=nalexander
remove some no-longer-necessary bits from mozconfig.cache. r=nalexander,glandium
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.