[cfe-dev] FW: Using C++11 in clang-tools-extra Round 2

Vane, Edwin edwin.vane at intel.com
Mon Jan 7 16:59:35 PST 2013



-----Original Message-----
From: thakis at google.com [mailto:thakis at google.com] On Behalf Of Nico Weber
Sent: Monday, January 07, 2013 7:13 PM
To: Vane, Edwin
Subject: Re: [cfe-dev] Using C++11 in clang-tools-extra Round 2

On Mon, Jan 7, 2013 at 12:34 PM, Vane, Edwin <edwin.vane at intel.com> wrote:
> Nico wrote:
> libstdc++ is not part of tools-extra. But if you want to build C++11
> code with clang on linux, you need to use libc++ because clang can't 
> parse libstd++ (the default c++ library) in c++11 mode. And if you use
> libc++, users now have to have libc++ to run the tools-extra binaries.
>
> [Edwin] I checked with coworkers here and they have built llvm/clang with c++11 support with libstd++ before. To qualify that, they use configure, specify --enable-cxx11, and build llvm/clang.

Sure, you can build clang itself, but building programs that use c++11 don't Just Work as far as I can tell:

thakis at yearofthelinuxdesktop:/usr/local/google/chrome/src$ cat test.cc #include <iostream>

int main() {}
thakis at yearofthelinuxdesktop:/usr/local/google/chrome/src$
third_party/llvm-build/Release+Asserts/bin/clang++ test.cc thakis at yearofthelinuxdesktop:/usr/local/google/chrome/src$
third_party/llvm-build/Release+Asserts/bin/clang++ test.cc  -std=c++11 In file included from test.cc:1:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/iostream:39:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/ostream:39:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/ios:39:
In file included from
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/exception:148:
/usr/lib/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/exception_ptr.h:143:13:
error: unknown type name
      'type_info'
      const type_info*
            ^
1 error generated.

> If libc++ really is necessary that can be an extra requirement. It's easy enough to check out and build oneself.

libc++ is probably a system-level shared library if it's installed
through a package manager. A self-built libc++ would probably clash with that. It's also not that easy to build, as it depends on a libcppsup and an unwind library, which too might clash with system libraries.

>
>>
>>>
>>> --
>>> Edwin Vane
>>>   Software Developer
>>>   Intel of Canada, Inc.
>>>
>>>
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list