Live data from Hacker News

Clang Is Now Used to Build Chrome for Windows

blog.llvm.org

21–30 of 105 posts

Re: Clang Is Now Used to Build Chrome for Windows

#22
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.

Lack of PDB support is one reason:

https://stackoverflow.com/questions/19269350/how-to-generate...

Lack of VC++ ABI support would be another reason.

Re: Clang Is Now Used to Build Chrome for Windows

#23
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…

One of mingw{,-w64}'s major contributions is a gcc-compatible replacement set of headers and import libraries, instead of using the Windows SDK or MSVC versions.

These work great most of the time, but if you start hooking deeply into windows, you realise they are a little bit outdated or incompatible. e.g. I get a lot of errors like

    #warning COM interfaces layout in this header has not been verified.
    #warning COM interfaces with incorrect layout may not work at all.
    #pragma message: Interface Ifoo has unverified layout.
in COM code, and some ATL things it is unable to build at all.

Re: Clang Is Now Used to Build Chrome for Windows

#25
post #21

Did the LLVM folks fix the C++ structured exception handling incompatibility between MSVC compiled DLLs/programs and LLVM compiled ones? This was a problem for many years.

Clang 7 documentation has a section on MSVC compatibility, https://clang.llvm.org/docs/MSVCCompatibility.html

From that document:

Asynchronous Exceptions (SEH): Partial. Structured exceptions (__try / __except / __finally) mostly work on x86 and x64. LLVM does not model asynchronous exceptions, so it is currently impossible to catch an asynchronous exception generated in the same frame as the catching __try.

Re: Clang Is Now Used to Build Chrome for Windows

#26
post #21

Did the LLVM folks fix the C++ structured exception handling incompatibility between MSVC compiled DLLs/programs and LLVM compiled ones? This was a problem for many years.

Yes.

(To the extent possible. There are some edge cases left, but they're very rare. Essentially all the real-world code we've seen works now.)

Re: Clang Is Now Used to Build Chrome for Windows

#27
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.

Why use it? llvm is the future anyway and lots of players have a stake in it and contribute to it. In fact, there are way too many c++ compilers if you ask me. I would gladly accept a world where clang is the one and only.

> In fact, there are way too many c++ compilers if you ask me. I would gladly accept a world where clang is the one and only.

Not me, IMO clang is where it is due to competition.

Re: Clang Is Now Used to Build Chrome for Windows

#29
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…

Does this option give you full debug information? My impression was that it does not. I require full debug information for debugging and profiling, and with clang-cl I get that (context: I work on Chromium)

My memory is that it supports DWARF debug info. So you get full debug info in DWARF and can use the mingw port of GDB on Windows.

Still, this is very different from the first-class support for compatible debug info that Clang provides.

Re: Clang Is Now Used to Build Chrome for Windows

#30
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.

Why use it? llvm is the future anyway and lots of players have a stake in it and contribute to it. In fact, there are way too many c++ compilers if you ask me. I would gladly accept a world where clang is the one and only.

[deleted]
Post reply on HN