Live data from Hacker News

Clang Is Now Used to Build Chrome for Windows

blog.llvm.org

101–105 of 105 posts

Re: Clang Is Now Used to Build Chrome for Windows

#101
post #8

And why not use mingw gcc? Do they find somthing wrong with it? Edit Mingw-w64 its quite nice and includes gcc without all stuff cgwin does.

1. Not abi compatible

2. Not performant (Relative to other solutions)

3. Would be the odd man out. Literally all other development was on clang/llvm at this point.

Supporting mingw would have meant duplicating all performance/etc work for GCC.

4. Chrome also wanted other benefits that clang/LLVM would bring them (easy ability to build various forms of refactoring and analysis tooling, etc)

Re: Clang Is Now Used to Build Chrome for Windows

#102

Great work by the Clang team, well done! I'm a bit surprised to see that build times in Clang are worse, and that resulting binary performance is comparable. Maybe that will change when the Clang build starts to use LTCG, as the article mentions.

Yeah, just things that aren't optimized yet. Windows headers, etc have very different hot spots and need different paths to be fast than linux/mac ones. For reference, in distributed builds, the build times are ridiculously faster using clang. (it shaves many hours off the time).

Is that due to the use of PCH in MSVC, so the hotspots only happen if the headers change?

What does clang offer in this regard? Is incremental build sufficient?

Re: Clang Is Now Used to Build Chrome for Windows

#103
post #102

Earlier quoted context omitted.

Yeah, just things that aren't optimized yet. Windows headers, etc have very different hot spots and need different paths to be fast than linux/mac ones. For reference, in distributed builds, the build times are ridiculously faster using clang. (it shaves many hours off the time).

Is that due to the use of PCH in MSVC, so the hotspots only happen if the headers change? What does clang offer in this regard? Is incremental build sufficient?

No, clang offers precompiled headers as well.

It's literally things like "parsing large numbers of pragmas is slower in clang because nobody has bothered to optimize it".

This is not uncommon for very different codebases.

Clang was, for a long time, many times slower at compiling the linux kernel, for example, because the linux kernel headers have a huge amount of inline assembly and nobody ever bothered to optimize the parsing paths for inline assembly. (now somewhat fixed).

This is just the very typical "hey, when you change the use cases dramatically, you may need to retune/rethink how certain things are done"

I think people just may not realize how wildly different these types of codebases are in what types of statements/things occur.

Re: Clang Is Now Used to Build Chrome for Windows

#104

Interesting. It seems Google is moving away from anything gpl/gnu lately (fuchsia, etc...)

So, as the person responsible for deciding to make just about all of the compiler switches happen (and i used to run opensource licensing for Google), this is just coincidence[1]. In this case, we just felt clang/llvm was a better architecture to build on at this point. These are also many-year projects. I was a GCC/gdb/etc maintainer for many years, so i've got nothing against GPL software. [1] Well, part of it is t…

Thank you for taking the time to shed some light on this. I understand your point about a multi-year project. I actually worked on a debugger before (to support a proprietary complier) so I know decisions in that area are far from random.

As a note for myself, I should check out llvm in greater detail.

Re: Clang Is Now Used to Build Chrome for Windows

#105

Earlier quoted context omitted.

Great work! We with Nixpkgs/NixOS have over the past year overhauled cross compilation, culminating recently with a bunch of parallel efforts recently including Windows cross compilation. People have built Nix with cygwin in the past, it would be nice to get it working in MSYS2/mingw-w64 too.

Are you targeting Linux, building on Windows?

No reason we couldn't expand into doing that!
Post reply on HN