[cfe-dev] How to build libc++ under Linux

Michael Spencer bigcheesegs at gmail.com
Mon Jan 14 11:16:05 PST 2013


On Mon, Jan 14, 2013 at 4:55 AM, Bruce Stephens
<bruce.r.stephens at gmail.com> wrote:
> Michael Spencer <bigcheesegs-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
> writes:
>
>> On Wed, Jan 9, 2013 at 6:14 AM, Bruce Stephens
>> <bruce.r.stephens-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
>
> [...]
>
>>> That still crashes if you output to std::cerr, doesn't it? (Presumably
>>> there are other crashes, but that's the one that I noticed first.)
>>>
>>
>> No, it works fine here (x86-64 Linux Kubuntu 12.10 clang trunk + libc++ trunk).
>>
>> Also there are updated install docs on http://libcxx.llvm.org/
>
> OK, with the docs there I can confirm it works fine for me, too. (I
> thought I'd done all the right things, but obviously I missed something
> out.)
>
> (It ends up linking against libstdc++, whereas (IIRC, anyway) using
> libcxxrt does not. So I'm not sure which I prefer. Likely it doesn't
> make that much difference either way; primarily I want to be able to
> build against another standard library (to try to catch errors), and
> either build will work fine for that.)

Linking against libsupc++ currently requires actually linking against
libstdc++ because libsupc++ defines a different set of type info than
libc++ expects. It could be fixed by conditionally adding that type
info to libc++.

You are correct that linking against libcxxrt does not require this.
The intent of the CMake build is to allow linking against both
libcxxabi and libcxxrt, but I have yet to add support for them.

- Michael Spencer



More information about the cfe-dev mailing list