libc++ on Windows (Rationale)

Hi,

I am trying to compile LibC++ on WinXP (32) using MinGW (GCC 4.6).

I’ve seen some extensions are used, as the “xlocale.h”, which makes it difficult to compile in Windows using MinGW. No way to use MSVC.

I wonder…, What is the goal of the creators of Clang and LibC++ in terms of portability? Is there any reason why Windows should not be supported? Or just a matter of time, is started by the Unix-Like operating systems?

I would like to contribute to the project, to make Clang and LibC++, in the future, the default compiler C++ for almost any platform.

Thanks and greetings.
Fernando.

I too support this. There is currently no decent c++ stdlib for
windows (sorry MinGW, but you don't count for me).

- Michael Spencer

Sorry for the double post, but I just realized I needed to clarify something.

I do not think that libc++ should attempt to be compatible with MSVC
where MSVC does not implement C++0x or makes things difficult. My main
concern is Clang+Windows compatibility when Clang gets C++0x support.

- Michael Spencer

VC++ is probably the released compiler which has made the most progress towards C++0x, in both the compiler and the library. I see no reason this should not continue.

This is of course not a reason why libc++ shouldn't support windows.

Chris

Admittedly, I did not take into account C++0x.
I support your opinion. The ideal option would be Clang+LibCxx in Windows as the default compiler.
It would be a great goal.

Regards,

I disagree. Any such compiler+library would be unable to link to any precompiled C++ code (which used the standard library) on Windows.

Chris

I can speak for libc++: libc++ is meant to be a high quality open source C++ standard library. The initial implementation has been targeted straight at Apple's platforms, with the notion that it should take advantage of the underlying OS when available and where appropriate (e.g. <xlocale.h>). One of the reasons for open sourcing this code however is so that others are free to port libc++ to other platforms where they can take advantage of other OS's features.

Porting <locale> is going to require significant effort and knowledge of the target OS, unless it is acceptable to the porters to support only a minimum "C" locale. Such minimal support was not acceptable to me for the Apple platforms.

At no time has it been envisioned that every line of code in libc++ shall be portable. Instead it is envisioned that libc++ will have to be adapted to different OS's to make the most out of each OS. The goal of any C++ standard library should be to (when necessary) consist of non-portable code so that its clients don't have to write non-portable code. Naturally though, libc++ code should not be gratuitously non-portable.

-Howard

Thanks Howard,

You said that libc++ is open for others to implement it on other platforms.
Did you mean that these other implementations should be separated from libc++?.
Or these implementations can be included in the libc++ code? (A single library with conditional compilation according to platform).

I offer my time to try to make libc++ cross-platform.

Regards,
Fernando.

> Hi,
>
> I am trying to compile LibC++ on WinXP (32) using MinGW (GCC 4.6).
>
> I've seen some extensions are used, as the "xlocale.h", which makes it difficult to compile in Windows using MinGW. No way to use MSVC.
>
> I wonder..., What is the goal of the creators of Clang and LibC++ in terms of portability? Is there any reason why Windows should not be supported? Or just a matter of time, is started by the Unix-Like operating systems?
>
> I would like to contribute to the project, to make Clang and LibC++, in the future, the default compiler C++ for almost any platform.

I can speak for libc++: libc++ is meant to be a high quality open source C++ standard library. The initial implementation has been targeted straight at Apple's platforms, with the notion that it should take advantage of the underlying OS when available and where appropriate (e.g. <xlocale.h>). One of the reasons for open sourcing this code however is so that others are free to port libc++ to other platforms where they can take advantage of other OS's features.

Porting <locale> is going to require significant effort and knowledge of the target OS, unless it is acceptable to the porters to support only a minimum "C" locale. Such minimal support was not acceptable to me for the Apple platforms.

At no time has it been envisioned that every line of code in libc++ shall be portable. Instead it is envisioned that libc++ will have to be adapted to different OS's to make the most out of each OS. The goal of any C++ standard library should be to (when necessary) consist of non-portable code so that its clients don't have to write non-portable code. Naturally though, libc++ code should not be gratuitously non-portable.

-Howard

Thanks Howard,

You said that libc++ is open for others to implement it on other platforms.
Did you mean that these other implementations should be separated from libc++?.
Or these implementations can be included in the libc++ code? (A single library with conditional compilation according to platform).

I meant the latter. There is already evidence in <__config> (http://llvm.org/svn/llvm-project/libcxx/trunk/include/__config) of people contributing to non-Apple platforms.

I offer my time to try to make libc++ cross-platform.

That's very generous of you, thanks!

-Howard

Hi,

I am trying to compile LibC++ on WinXP (32) using MinGW (GCC 4.6).

I’ve seen some extensions are used, as the “xlocale.h”, which makes it difficult to compile in Windows using MinGW. No way to use MSVC.

I wonder…, What is the goal of the creators of Clang and LibC++ in terms of portability? Is there any reason why Windows should not be supported? Or just a matter of time, is started by the Unix-Like operating systems?

I would like to contribute to the project, to make Clang and LibC++, in the future, the default compiler C++ for almost any platform.

I can speak for libc++: libc++ is meant to be a high quality open source C++ standard library. The initial implementation has been targeted straight at Apple’s platforms, with the notion that it should take advantage of the underlying OS when available and where appropriate (e.g. <xlocale.h>). One of the reasons for open sourcing this code however is so that others are free to port libc++ to other platforms where they can take advantage of other OS’s features.

Porting is going to require significant effort and knowledge of the target OS, unless it is acceptable to the porters to support only a minimum “C” locale. Such minimal support was not acceptable to me for the Apple platforms.

At no time has it been envisioned that every line of code in libc++ shall be portable. Instead it is envisioned that libc++ will have to be adapted to different OS’s to make the most out of each OS. The goal of any C++ standard library should be to (when necessary) consist of non-portable code so that its clients don’t have to write non-portable code. Naturally though, libc++ code should not be gratuitously non-portable.

-Howard

Thanks Howard,

You said that libc++ is open for others to implement it on other platforms.
Did you mean that these other implementations should be separated from libc++?.
Or these implementations can be included in the libc++ code? (A single library with conditional compilation according to platform).

I meant the latter. There is already evidence in <__config> (http://llvm.org/svn/llvm-project/libcxx/trunk/include/__config) of people contributing to non-Apple platforms.

Great !!!

I offer my time to try to make libc++ cross-platform.

That’s very generous of you, thanks!

What is the process to become a developer of the project?

Regards,
Fernando.

I don't honestly know what it takes to get write access to the LLVM Project, though I imagine that info is somewhere here:

http://llvm.org/

I know it is possible as I've seen others commit to libcxx.

Alternatively I have taken patches enclosed in emails here and integrated them myself.

-Howard

What is the process to become a developer of the project?

I don't honestly know what it takes to get write access to the LLVM Project, though I imagine that info is somewhere here:

http://llvm.org/

I know it is possible as I've seen others commit to libcxx.

As far as I know it is granted by Chris Lattner when he thinks you're ready (generally, after a few correct patches).
In the case of libstdc++ I expect he would do so if Howard asked him.

Alternatively I have taken patches enclosed in emails here and integrated them myself.

Yes, start out this way.

Thanks to all !