[cfe-dev] [PATCH] Libc++ Windows fixes

David Chisnall theraven at sucs.org
Fri Sep 23 07:04:32 PDT 2011


On 23 Sep 2011, at 14:22, Ruben Van Boxem wrote:

>    - Redo newlocale to accept a third parameter. Functionality should be ok, as the third parameter is always 0 in libc++.

Don't expect this to remain the same in the future.  My brief profiling of libc++ showed that it's calling newlocale() far more than it should - 8 times to construct a single std::locale object.  I'd expect that it should be calling newlocale() once here, and maybe duplocale() a few times.  Calling newlocale() with a NULL third parameter is the most expensive of all of the locale-related functions that libc++ makes, so reducing this is something I plan on investigating.

> On the other hand, Clang fails linking the dll due to a bunch of undefined references, among which cxxabi stuff, and C std library stuff. I'll investigate


Not sure about the C library stuff.  I seem to recall something weird on Windows there, but I'm not sure what.  The ABI stuff is going to be a problem on Windows.  In the long term, you probably want to be using Microsoft's RTTI and exception ABIs - the latter especially - but neither is supported by clang or gcc yet.  You may be able to use libcxxrt or GNU libc++sup, but then you're using code that won't interoperate with other C++ libraries on Windows nicely...

David

--
This email complies with ISO 3103





More information about the cfe-dev mailing list