Live data from Hacker News

Clang Is Now Used to Build Chrome for Windows

blog.llvm.org

51–60 of 105 posts

Re: Clang Is Now Used to Build Chrome for Windows

#51
post #34
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) ABI compatibility is not present. With clang-cl you can compile half of your object files with MSVC and half with clang-cl, and link them together. That's very powerful. You might be thinking "but who is really gonna do that anyway?" However, there is more to the ABI than just this. For example, consider what happens if you need to use Structured Exception Handling. Well, with GCC, you can't. 2) Debug Information.…

> if you need to use Structured Exception Handling. Well, with GCC, you can't

You can on 64 bit.

Re: Clang Is Now Used to Build Chrome for Windows

#52

Earlier quoted context omitted.

clang-cl is just a compiler. It relies on VS to provide the C and C++ standard libraries. VS 2017 has the filesystem library and it should work with clang-cl 6.

To elaborate on that, if you want to build Chromium for Windows you currently still need to install Visual Studio. We don't use its compiler anymore but we use its linker and other tools, its header files, and its libraries. Many Chromium developers also use it for editing code, and for debugging code. Chrome is currently built using VS 2017 15.3 (that's update 3). Eventually we will probably upgrade to VS 2017 15.7…

You need the MSVC build tools and the Windows SDK. You don't need the entire Visual Studio.

Re: Clang Is Now Used to Build Chrome for Windows

#53
With Microsoft producing MSVC/C2 compiler with Clang frontend, I am surprised they did not abandon the MSVC at all - they have a hard times even at supporting C99, not to mention modern C++ technologies. And all those tools and plugins built around Clang/LLVM. MSVC is a legacy of XX century and should be abandoned for good.

Re: Clang Is Now Used to Build Chrome for Windows

#54

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

I think it is mainly due to their concerns over the Tivoization clause which is added to GPLv3

That's true for any developer of embedded software. Any one who makes hardware of any kind will avoid trying to put any GPLv3 licensed code on their hardware.

Re: Clang Is Now Used to Build Chrome for Windows

#55
post #49
post #32

Earlier quoted context omitted.

mingw-w64 llvm maintainer/developer here. Over the past 2-3 years, with great help from a few other LLVM devs I have slowly pushed for native clang support for mingw-w64. With the current in tree HEAD you can now build and bootstrap mingw-w64 with a llvm-only toolchain (no binutils or gcc, thus no disregard of the PECOFF SPEC) The stack is as follows. LLVM+CLANG+LLD+COMPILER-RT+LIBCXX+LIBCXXABI+LIBUNWIND+MINGW-W64. T…

Excellent work. I like to ignore visual studio completely and pretend it doesn't exist, but that's just me :) I've used cygwin's cross-compiler x86_64-w64-mingw32-clang package once in a while, though I find more projects' build systems choke on it and do the wrong thing (libgmp as a notable example) than with x86_64-w64-mingw32-gcc.

I tend to ignore both gcc and MSVC. Clang is really good at bootstrapping itself with this setup even when cross compiling without any real complexity. Without diverting into a cmake vs autotools battle I like that llvm and clang just work and bootstrap so easily. Gone are the days of messing around with gmp isl and co to bootstrap a toolchain.

Re: Clang Is Now Used to Build Chrome for Windows

#56
post #32
post #7

> if your project is Windows-only, you can get a second compiler’s opinion on your code, and Clang’s warnings might find bugs GCC (mingw.org and mingw-w64 triples) has existed and been able to do this, including and especially cross-compiling, for a long time. No need to manually download a Windows SDK either. edited to add: to be fair, it's not ABI compatible with MSVC. But it deserves a mention and it's an easier o…

mingw-w64 llvm maintainer/developer here. Over the past 2-3 years, with great help from a few other LLVM devs I have slowly pushed for native clang support for mingw-w64. With the current in tree HEAD you can now build and bootstrap mingw-w64 with a llvm-only toolchain (no binutils or gcc, thus no disregard of the PECOFF SPEC) The stack is as follows. LLVM+CLANG+LLD+COMPILER-RT+LIBCXX+LIBCXXABI+LIBUNWIND+MINGW-W64. T…

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.

Re: Clang Is Now Used to Build Chrome for Windows

#57
post #32
post #7

> if your project is Windows-only, you can get a second compiler’s opinion on your code, and Clang’s warnings might find bugs GCC (mingw.org and mingw-w64 triples) has existed and been able to do this, including and especially cross-compiling, for a long time. No need to manually download a Windows SDK either. edited to add: to be fair, it's not ABI compatible with MSVC. But it deserves a mention and it's an easier o…

mingw-w64 llvm maintainer/developer here. Over the past 2-3 years, with great help from a few other LLVM devs I have slowly pushed for native clang support for mingw-w64. With the current in tree HEAD you can now build and bootstrap mingw-w64 with a llvm-only toolchain (no binutils or gcc, thus no disregard of the PECOFF SPEC) The stack is as follows. LLVM+CLANG+LLD+COMPILER-RT+LIBCXX+LIBCXXABI+LIBUNWIND+MINGW-W64. T…

Thanks for your work. mingw-w64 is amazing!

Re: Clang Is Now Used to Build Chrome for Windows

#58
post #45
post #3

Last time I tried to build Chrome/Chromium I had to mess about with this build system called Ninja. (Which worked well it was just awkward to set up on Windows). Is that still in play?

Can you elaborate on the difficulty on Windows? If you go to the home page there is a section "Getting Ninja" that links to a page with a zip file... ?

It was too long ago for me to remember specifics. Once ninja was up and running the build process was pleasant.

Re: Clang Is Now Used to Build Chrome for Windows

#59
post #53

With Microsoft producing MSVC/C2 compiler with Clang frontend, I am surprised they did not abandon the MSVC at all - they have a hard times even at supporting C99, not to mention modern C++ technologies. And all those tools and plugins built around Clang/LLVM. MSVC is a legacy of XX century and should be abandoned for good.

My impression was that problem with C99 support was that Microsoft was not willing, not that Microsoft was not capable.

Re: Clang Is Now Used to Build Chrome for Windows

#60
post #53

With Microsoft producing MSVC/C2 compiler with Clang frontend, I am surprised they did not abandon the MSVC at all - they have a hard times even at supporting C99, not to mention modern C++ technologies. And all those tools and plugins built around Clang/LLVM. MSVC is a legacy of XX century and should be abandoned for good.

IMHO, Microsoft has been doing a pretty good job. I don't think it's as bad as you make it out to be:

https://msdn.microsoft.com/en-us/library/hh567368.aspx

Post reply on HN