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

Ruben Van Boxem vanboxem.ruben at gmail.com
Sun Sep 25 07:13:30 PDT 2011


2011/9/23 Howard Hinnant <hhinnant at apple.com>

> On Sep 23, 2011, at 3:14 PM, Ruben Van Boxem wrote:
>
> > Can anything be done about this GCC incompatibility:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10980#c7 ? It is preventing me
> from linking a functional libc++ (as Clang is not capable of producing
> correct object files to be linked together), and of course, testing the
> beast :). To fix it, this basically needs the functions in question to not
> be declared as "always inline", because GCC produces an error in this case.
> If Clang does not inline in this case, it should really also produce an
> error instead of silently ignoring the attribute.
>
> Seems like the easiest thing to do would be to rewrite these without using
> va_list.  Only one or two arguments need to be supported.  Just make these
> always-inline templates.
>

Thanks for the valuable idea. Attached patch implements these for non-clang
compiles (#ifdef __clang__). I also used the available *_l function variants
for those that are available on Windows (MSVC++ runtime 8.0 and later). I
also fixed up the win32 support header stuff to work with the full <locale>
header things required.
I added a mingw bit to the lib/buildit script, that for now quite hackishly
links to libsupc++ and allows multiple definitions due to a missing
alternative. This will at least allow some testing to happen on the rest of
the libc++ code, that isn't compiled into the library itself.
I envision a full LLVM alternative to libgcc and libsupc++, but that is
still a looooong way off.

Comments and especially commits are very welcome!

Ruben

PS: the only thing holding back a test run is an undefined reference in
mingw-w64's winpthreads library.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110925/b0e48299/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: windows.patch
Type: application/octet-stream
Size: 7716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110925/b0e48299/attachment.obj>


More information about the cfe-dev mailing list