Link xul.dll in 20 seconds with this one weird trick!
clang-cl builds of Firefox have come a long way, from being a hobby project
of a few developers to running static analysis in CI for more than a year
now. The tools are in really good shape and should be ready for broader use
within Mozilla at this point.
Bug 1443590 is looking into what it would take to ship official builds with
clang-cl and lld-link, but in the meantime it's possible to do local builds
already. I'd like to invite people who develop on Windows to give it a try.
*** Reasons to use clang-cl and lld-link locally ***
- Speed! lld is known for being very fast. I'm serious about 20-second
libxuls. That's a non-incremental link, with identical code folding
enabled. For comparison, MSVC takes me over two minutes.
- Speed again! clang-cl will integrate with upcoming sccache/icecream work.
- Much clearer and more actionable error messages than MSVC
- Make your own ASan and static analysis builds (the latter need an LLVM
before r318304, see bug 1427808)
- Help ship Firefox with clang-cl by getting more eyes and machines on
*** Reasons not to use clang-cl and lld-link locally (yet) ***
- You are testing codegen-level fixes or optimizations and need to see the
exact bits that will be going out to users
- lld-link currently doesn=E2=80=99t support incremental linking -- but wit=
linking being so fast, this might not matter
- You do artifact builds that don't use a local compiler
*** How do I get started? ***
A number of build system changes have landed that make these builds much
easier than before. For example you no longer need to use old versions of
Note that clang-cl builds still depend on an MSVC installation for headers,
libraries, and auxiliary build tools, so don't go uninstalling your Visual
Studio just yet.
If you run into any problems, please stop by #build or visit the shiny new
Firefox Build System product in Bugzilla (formerly Core :: Build Config).