[cfe-dev] [libc++] Running tests from cmake?

David Chisnall csdavec at swan.ac.uk
Mon Sep 19 09:26:13 PDT 2011


On 19 Sep 2011, at 17:14, Ruben Van Boxem wrote:

> 2011/9/19 David Chisnall <theraven at sucs.org>
> On 19 Sep 2011, at 16:14, Ruben Van Boxem wrote:
> 
> > > > I've been working on the FreeBSD port of libc++, and have now finished implementing all of the xlocale APIs that libc++ requires
> >
> > How applicable is that BSD code to, say, Windows?
> 
> Unless someone wants to port FreeBSD libc to Windows... not very.  It's pretty deeply interwoven with standard libc functionality, so it would be very difficult to extract it as a stand-alone library.
> 
> So if I understand what you did correctly, you implemented some/most of the functions listed here:
> http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/xlocale.3.html

Yes.

> And then libc++ locale stuff works?

Well, it compiles.  Once I've got the tests working, I'll know if it works, but I want to add a couple of things to libcxxrt to support exception_ptr and tweak libc++ to be able to use libcxxrt easily before I get that far.

> Anything else that might be necessary and unpresent on win32?

Well, exceptions are a very platform-specific, they'd likely need a lot of work to run on Win32.  I'd be more inclined to look at Win64, since it has a vaguely sane EH ABI (win32 has 3, mutually incompatible, EH ABIs, none of which is even approximately sane).

I also had to add some stubs to FreeBSD's libm[1], since it lacks a lot of the long double variants of functions that were added with C99.  Since Windows doesn't come with a C99 implementation, I wouldn't be surprised if these were missing there too, although a quick look on MSDN indicates that they do.  

Those were the only two places where libc++ didn't work out of the box on FreeBSD.  That doesn't necessarily mean anything for porting to other platforms though - there's very little divergence between Darwin and FreeBSD userlands, so code is generally easier to port between the two than between any other pair of operating systems.

David

[1] Any Apple people: it would be really great if Darwin's libm could be BSD, MIT, or UIUC licensed - these functions are present (and look to be quite nicely optimised) in the Darwin version, but Apple's slapped an APSL on them so we can't use them.



More information about the cfe-dev mailing list