[cfe-dev] Clang for Windows and Boost

Óscar Fuentes ofv at wanadoo.es
Fri Mar 18 20:23:36 PDT 2011


John McCall <rjmccall at apple.com> writes:

>> Structured Exception Handling != C++ exceptions.
>
> Yes, but "Windows" means the Microsoft C++ implementation unless
> otherwise specified (moreso because the question was asking about MSVC),
> and none of the other EH implementations interoperate with that.

I don't think the OP was asking about MSVC interoperability at the ABI
level. He just wanted to build and run his code.

The Windows C++ compiler landscape is not so homogeneous as Linux, where
being bug-compatible with g++ is a must. VC++, Borland and MinGW are
mutually incompatible. Only Intel C++ works as a drop-in replacement for
VC++ (as it does for g++ on Linux). Clang being ABI-incompatible with
VC++ is perfectly acceptable. Furthermore, LLVM has some limitations
that makes impossible to match VC++ on X86 for argument passing (see
PR5058 and PR5064).

What is missing for a working Clang on Windows is, right now, complete
language support (add EH) and an usable C++ Standard Library.

[snip]

> We produce binaries that will link and run with libstdc++ and its EH runtime
> on a good variety of other platforms; that's a reasonable goal on MinGW, too.
> I just don't know how mingw's requirements for the EH tables differ from, say,
> Linux's.

IIRC g++ uses some key functionality present on libc that is absent from
MSVCRT (the VC++ C runtime used by MinGW).

Dwarf EH was implemented on MinGW and works (except for that case when a
non-gcc stack frame must be unwinded which, IIRC, is one of the cases
where libc provides key assistance on Linux). MinGW always had very few
resources. At the time when Dwarf support was added only one guy, very
devoted but time-starved, was working on the compiler. I don't recall if
he got a helping hand from some g++ expert, but in any case if MinGW
acquired Dwarf EH I'm sure that Clang can do the same with less effort.

[snip]



More information about the cfe-dev mailing list