
Chromium Windows builds now use Clang by default - evmar
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/Y3OEIKkdlu0
======
blinkingled
Hmm. I went through the thread and could not find an answer to the question -
why? Using platform's default compiler would be the safest thing to do and MS
is making good progress with VC as far as adding standards support goes. They
have been receptive of bug reports and relatively quick at fixing them too as
far as I remember. Switching to clang also takes away the nice VS IDE based
debugging experience [turns out it doesn't, I misread the post as saying you
can still compile and debug with VS].

So what is Chromium gaining from switching to clang-cl? Perhaps just less
amount of compiler specific code/hacks/quirks/workarounds etc?

Edit: This being Google I was expecting interesting data or at least somewhat
thorough reasoning. The post just felt like a fyi for switching to clang.
Nonetheless some good possible reasons in below replies.

~~~
microcolonel
As far as I'm aware, there are no downsides to switching to Clang on Windows.
Clang produces VS-compatible debug info, it's integrated perfectly fine into
VS. In addition, you don't need a VS license to compile the desired 64-bit
Windows binaries. In addition, the code generated is typically faster and
smaller. They get to use new C++ features without waiting for a major VC++
release. They can hope to do cross compilation on an operating system with a
filesystem that isn't outrageously slow. They can stop having to put in VS-
specific warning disables and go with the GCC-Clang standard ones. Clang is
also just faster to run in general. They get to use one compiler on every
platform, and when they improve the compiler, it helps all of their platforms.

Seems like a win on every level to me.

~~~
blinkingled
But on the other hand Microsoft's compiler, linker, headers, debuggers are
tested together for the OS releases they support. clang-cl doesn't have that
advantage. I guess Google is picking up clang-cl maintenance to make sure it
remains compatible with various dependencies MS changes.

~~~
microcolonel
Microsoft endorses and works on clang-cl, though I wouldn't say they give it
as much attention as their own compiler. As for compatibility, I don't think
it's a huge issue, if they never changed the compiler again, it would probably
still generate working binaries for the next decade, including PDBs.

------
myrryr
They can distribute the build over multiple machines easier with clang. That
is reason enough for the move.

------
kodablah
Uh oh, I have been putting a lot of effort embedding Chromium with Qt (which
does not AFAIK have a clang build). I am afraid this is really going to slow
me down. I wonder how this will harm other developers using CEF [0] w/ MSVC.

0 -
[https://bitbucket.org/chromiumembedded/cef](https://bitbucket.org/chromiumembedded/cef)

Edit: Now that I think about it, the Qt stuff is all in shared libs, so less
worried there. But with CEF, the C++ wrapper is statically linked. What is
MSVC's linker's ability to consume clang objs and vice versa I wonder. If not
an issue, maybe I'm just fine.

~~~
to3m
I did a CEF-based project last year. I didn't built Chromium myself; I used a
pre-build copy, from Spotify I think. The CEF build process sets this all up
for you, so I expect this is typical. So this should mean that provided the
clang builds of Chromium look the same to the outside world as the VC++ builds
of Chromium, there won't be a problem.

(It works well. The PDB files and the corresponding source code are available,
so you can step through the Chromium code in Visual Studio and so on.)

CEF is built as part of your program using whatever compiler you're using. I
don't know what the mechanics of it are... I assume it uses the Chromium stuff
via an import library? I didn't look very closely at this aspect of it.

~~~
kodablah
Right, but CEF uses cmake w/ msvc customizations IIRC. And the spotify builds
do ship with the DLLs already built. I asked on the CEF forum just now, we'll
see.

------
chaz6
Hopefully this is a step towards QtWebEngine (Blink) on the open source
distribution of Qt on Windows. Right now you are limited to QtWebKit.

------
grondilu
Clang targets webassembly, doesn't it? If so, does that mean it will soon be
possible to browse the web with chromium running inside other browsers? That'd
be fun.

~~~
floatboth
[https://trevorlinton.github.io/](https://trevorlinton.github.io/)

~~~
d33
That is scary when you consider the DRM implications.

------
GoodAdmiral
Wasn't it STL who said recently that clang/cl experimentation is finished and
recommended to use clang from llvm for windows instead?

~~~
dkozhevnikov
The mentioned clang-cl is the clang driver with MSCV-compatible options and
LLVM backend, not the clang/c2 with the MSVC backend.

