Closed Bug 1506848 Opened 6 years ago Closed 6 years ago

Use -Z7 by default for clang-cl builds

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox67 fixed)

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: ted, Assigned: ted)

References

Details

Attachments

(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: https://dxr.mozilla.org/mozilla-central/rev/237e4c0633fda8e227b2ab3ab57e417c980a2811/build/moz.configure/toolchain.configure#1135 but then we override it with -Z7 in mozconfig.cache (for sccache's benefit): https://dxr.mozilla.org/mozilla-central/rev/237e4c0633fda8e227b2ab3ab57e417c980a2811/build/mozconfig.cache#84 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)`: https://dxr.mozilla.org/mozilla-central/rev/237e4c0633fda8e227b2ab3ab57e417c980a2811/config/rules.mk#145-151 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:
http://clang.llvm.org/docs/UsersManual.html#id9

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 rules.mk, as well as the no-longer-necessary
overrides from mozconfig.cache.

Pushed by tmielczarek@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c1a1d4380a8e switch Windows debug flags from -Zi to -Z7. r=nalexander https://hg.mozilla.org/integration/autoland/rev/3a443a1bc66e remove some no-longer-necessary bits from mozconfig.cache. r=nalexander,glandium
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: