Chrome for Windows drops Microsoft compiler in favor of Clang

The Windows version of Google Chrome is ditching Microsoft's C++ Compiler and switching to Clang. The change brings Chrome for Windows in line with versions of the browser for macOS, Android and Linux.

The move not only makes complete sense for Google -- why not use the same compiler on all platforms, after all? -- it makes Chrome the first high-profile Windows app to make use of the open source compiler Clang.

See also:

The decision to move to Clang dates all the way back to 2013. The only problem was a lack of support -- a problem that Google set to work on addressing. After a few years work, and testing in Chrome's Canary, Developer and Beta channels, the stable version of the browser now uses the Clang compiler as of Chrome 64.

A post on the LLVM Project blog explains:

As of Chrome 64, Chrome for Windows is compiled with Clang. We now use Clang to build Chrome for all platforms it runs on: macOS, iOS, Linux, Chrome OS, Android, and Windows. Windows is the platform with the second most Chrome users after Android according to statcounter, which made this switch particularly exciting.

Clang is the first-ever open-source C++ compiler that’s ABI-compatible with Microsoft Visual C++ (MSVC) -- meaning you can build some parts of your program (for example, system libraries) with the MSVC compiler ("cl.exe"), other parts with Clang, and when linked together (either by MSVC's linker, "link.exe", or LLD, the LLVM project's linker) the parts will form a working program.

As explained by Ars Technica, the switch to Clang does not mean that Chrome for Windows has fully embraced the LLVM toolchain, but that's something that will come in time.

Image credit: tanuha2001 / Shutterstock