Using clang-cl to ship Windows builds

Bug 1443590 is switching our official Windows builds to use clang-cl
as the compiler.

Please keep an eye out for regressions and file a blocking bug for
anything that might be fallout from this change. I'm especially
interested in hearing about the quality of the debugging experience.

It's possible that the patch may bounce and we'll go back and forth to
MSVC for a while. You can check your build's compiler at
`about:buildconfig`. Treeherder is running an additional set of MSVC
jobs on mozilla-central to make sure we can fall back to a green MSVC
if needed.

Watch for more toolchain changes to come. The next steps after this
will be to switch to lld-link and enable ThinLTO. That will open the
door to a cross-language LTO that could inline calls between Rust and
C++. In the longer term we can look into cross-compiling from Linux.

But for now, shipping our most-used platform with an open-source
compiler is a huge milestone in and of itself. Big thanks to everyone
who has contributed to this effort on the Mozilla side, and also big
thanks to the developers of LLVM and Chromium who helped make clang on
Windows a realistic possibility.
0
David
7/10/2018 1:01:01 AM
mozilla.dev.platform 6457 articles. 0 followers. Post Follow

5 Replies
27 Views

Similar Articles

[PageSpeed] 23

On 07/10/2018 01:29 PM, David Major wrote:
> Bug 1443590 is switching our official Windows builds to use clang-cl
> as the compiler.

Another great effect of this change is that it finally fixes the issue
of constantly running out of virtual address space when linking Win32
builds: https://bugzilla.mozilla.org/show_bug.cgi?id=709193

This was, for example, blocking AV1 support on Win32 until today. Thanks
for the great work!
0
Thomas
7/11/2018 4:48:23 PM
On Wed, Jul 11, 2018 at 09:48:23AM -0700, Thomas Daede wrote:
> On 07/10/2018 01:29 PM, David Major wrote:
> > Bug 1443590 is switching our official Windows builds to use clang-cl
> > as the compiler.
> 
> Another great effect of this change is that it finally fixes the issue
> of constantly running out of virtual address space when linking Win32
> builds: https://bugzilla.mozilla.org/show_bug.cgi?id=709193
> 
> This was, for example, blocking AV1 support on Win32 until today. Thanks
> for the great work!

That will still block it, until clang-cl actually becomes the compiler
we use to ship. At the moment, it's not certain it will stay that way,
so we need to keep MSVC builds working, including PGO.

Mike
0
Mike
7/11/2018 10:00:20 PM
On Wednesday, July 11, 2018 at 3:01:04 PM UTC-7, Mike Hommey wrote:
> On Wed, Jul 11, 2018 at 09:48:23AM -0700, Thomas Daede wrote:
> > On 07/10/2018 01:29 PM, David Major wrote:
> > > Bug 1443590 is switching our official Windows builds to use clang-cl
> > > as the compiler.
> > 
> > Another great effect of this change is that it finally fixes the issue
> > of constantly running out of virtual address space when linking Win32
> > builds: https://bugzilla.mozilla.org/show_bug.cgi?id=709193
> > 
> > This was, for example, blocking AV1 support on Win32 until today. Thanks
> > for the great work!
> 
> That will still block it, until clang-cl actually becomes the compiler
> we use to ship. At the moment, it's not certain it will stay that way,
> so we need to keep MSVC builds working, including PGO.
> 
> Mike

I hope that both Firefox and Chrome continue to keep the build and tests running on MSVC. It would suck if for example we can't build Firefox with MSVC.

Will the Firefox team publish builds of Firefox from both MSVC and Clang with symbols so we can profile ourselves and compare which is faster for the webpages we use?
0
halivingston
7/12/2018 3:50:38 AM
On Thursday, 12 July 2018 15:50:40 UTC+12, halivi...@gmail.com  wrote:
> I hope that both Firefox and Chrome continue to keep the build and tests running on MSVC. It would suck if for example we can't build Firefox with MSVC.

I can't comment on Chrome.

> Will the Firefox team publish builds of Firefox from both MSVC and Clang with symbols so we can profile ourselves and compare which is faster for the webpages we use?

The MSVC nightly builds will likely continue until we fully commit to clang-cl. It is expensive to maintain MSVC workarounds and given that cross-language LTO[1] is compelling for Firefox, it is unlikely we'd return to MSVC.

Anthony

[1] https://github.com/rust-lang/rust/issues/49879
0
Anthony
7/12/2018 6:34:52 AM
On Wed, Jul 11, 2018 at 11:34:52PM -0700, Anthony Jones wrote:
> On Thursday, 12 July 2018 15:50:40 UTC+12, halivi...@gmail.com  wrote:
> > I hope that both Firefox and Chrome continue to keep the build and
> > tests running on MSVC. It would suck if for example we can't build
> > Firefox with MSVC.
> 
> I can't comment on Chrome.
> 
> > Will the Firefox team publish builds of Firefox from both MSVC and
> > Clang with symbols so we can profile ourselves and compare which is
> > faster for the webpages we use?
> 
> The MSVC nightly builds will likely continue until we fully commit to
> clang-cl. It is expensive to maintain MSVC workarounds and given that
> cross-language LTO[1] is compelling for Firefox, it is unlikely we'd
> return to MSVC.

Actually, I don't think we do produce MSVC nightly builds. We *do* MSVC
build on automation, but they're not exactly nightlies. You won't find
them along other nightlies. And until bug 1474756 lands, those builds
aren't even with PGO enabled.

Mike
0
Mike
7/12/2018 7:03:18 AM
Reply: