<html><head><style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}

p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style><style><!--
.EmailQuote {
margin-left:1pt;
padding-left:4pt;
border-left:#800000 2px solid;
}


--></style></head><body><div data-externalstyle="false" dir="ltr" style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:12pt;"><div><br>
>> When I was looking at libc++ it didn’t appear to support Windows except maybe under MinGW.  What would be a good place to start to get libc++ to work on Windows?<br>
<br>
>I've been working on this on and off. Here's a braindump of what's needed:<br>
<br>
>1. Port OS-specific things.<br>
<br>
>    This is rather small and I've done most of this already.<br>
<br>
>2. C Standard Library.<br>
<br>
>    Microsoft's CRT is a royal PITA. It doesn't support a lot of things<br>
>    required or expected, and other things have subtle differences.<br>
>    Which is why I wrote a new standard library to make point 1 easier.<br>
>    At first it was only a set of standard-compliant headers and<br>
>    implementation stubs to get it to compile, but I've since<br>
>    implemented certain parts. The hardest part for this route is, for<br>
>    me at least, libm, and I don't know any modern BSD-licensed libm<br>
>    that could be used.<br>
>    The other way would be to further try and shoehorn MSVCRT and give<br>
>    up C99- and full C++11-compatibility.<br>
<br>
>3. Implement full dllimport/dllexport semantics so that libc++ can be<br>
>    used as a DLL.<br>
<br>
>    Clang only support rudimentary dllimport/dllexport for functions.<br>
>    Making it work with classes is a rather large non-trivial change.<br>
>    I've been working on this and apart from vtable-handling and<br>
>    cleanups it's mostly finished. Depending on that last point I may<br>
>    put up some patches for review soon.<br>
<br>
>    This also requires changes to how libc++ applies those attributes.<br>
>    Using them like ELF visibility doesn't work correctly for templates.<br>
<br>
>4. Weak externals for PE to enable replacing operator new/delete.<br>
<br>
>    This was impossible with how dllimport was represented in LLVM<br>
>    before. If my patches are excepted, it should be doable, but I<br>
>    haven't looked into it again.<br>
<br>
>5. Port an ABI library like libc++abi.<br>
<br>
>    I've ported some parts of libc++abi, but it's incomplete and<br>
>    untested. It also needs an unwind library, which quickly leads<br>
>    to the next point:<br>
<br>
>6. Exception handling<br>
<br>
>    This is probably the biggest hurdle. There is some low-level support<br>
>    for 64-bit SEH directives in LLVM already. 32-bit has the additional<br>
>    Borland patent issue for SEH exception handling. The data structures<br>
>    used by MSVC are also undocumented.<br>
>    Implementing this for 64-bit by using the DWARF exception tables and<br>
>    providing an appropriate personality routine is the easiest case,<br>
>    and would also allow catching SEH exceptions from the OS.<br>
>    Maybe it's also possible to implement such DWARF-based table-based<br>
>    exception handling for 32-bit, without any way to catch SEH<br>
>    exceptions.<br>
<br>
>7. Some minor bugfixes I encountered along the way, like proper COMDAT<br>
>    linkage for EH sections, proper varargs handling. I'll try to get<br>
>    those committed soon.<br>
</div><div> </div><div>It seems like you really have a handle on the work that is needed.  It also seems that you have a good start on much of it.</div><div> </div><div>I am new to Clang, and relatively new to compilers.  I don’t suppose you could point out a smallish task or two that I could do in parallel with your efforts, could you?<br>
</div>


</div></body></html>