libcxx+clang ToT Build Failures

Hi Everyone,

Has anybody lately been able to build libcxx (top of trunk) with clang
(top of trunk)? I'm encountering the following errors:

+ clang++ -c -g -Os -arch i386 -arch x86_64 -std=c++0x
-U__STRICT_ANSI__ -nostdinc++ -I../include ../src/iostream.cpp
../src/iostream.cpp:16:1: error: C++ requires a type specifier for all
declarations
alignas (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)];
^~~~~~~
../src/iostream.cpp:16:28: error: expected ';' after top level declarator
alignas (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)];
                           ^
                           ;
../src/iostream.cpp:17:1: error: C++ requires a type specifier for all
declarations
alignas (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
^~~~~~~
../src/iostream.cpp:17:28: error: expected ';' after top level declarator
alignas (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
                           ^
                           ;
../src/iostream.cpp:18:1: error: C++ requires a type specifier for all
declarations
alignas (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
^~~~~~~
../src/iostream.cpp:18:28: error: expected ';' after top level declarator
alignas (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
                           ^
                           ;
../src/iostream.cpp:19:1: error: C++ requires a type specifier for all
declarations
alignas (__stdinbuf<wchar_t> ) static char __wcin [sizeof(__stdinbuf
<wchar_t>)];
^~~~~~~
../src/iostream.cpp:19:31: error: expected ';' after top level declarator
alignas (__stdinbuf<wchar_t> ) static char __wcin [sizeof(__stdinbuf
<wchar_t>)];
                              ^
                              ;
../src/iostream.cpp:20:1: error: C++ requires a type specifier for all
declarations
alignas (__stdoutbuf<wchar_t>) static char
__wcout[sizeof(__stdoutbuf<wchar_t>)];
^~~~~~~
../src/iostream.cpp:20:31: error: expected ';' after top level declarator
alignas (__stdoutbuf<wchar_t>) static char
__wcout[sizeof(__stdoutbuf<wchar_t>)];
                              ^
                              ;
../src/iostream.cpp:21:1: error: C++ requires a type specifier for all
declarations
alignas (__stdoutbuf<wchar_t>) static char
__wcerr[sizeof(__stdoutbuf<wchar_t>)];
^~~~~~~
../src/iostream.cpp:21:31: error: expected ';' after top level declarator
alignas (__stdoutbuf<wchar_t>) static char
__wcerr[sizeof(__stdoutbuf<wchar_t>)];
                              ^
                              ;
../src/iostream.cpp:23:1: error: C++ requires a type specifier for all
declarations
alignas (istream) char cin [sizeof(istream)];
^~~~~~~
../src/iostream.cpp:23:18: error: expected ';' after top level declarator
alignas (istream) char cin [sizeof(istream)];
                 ^
                 ;
../src/iostream.cpp:24:1: error: C++ requires a type specifier for all
declarations
alignas (ostream) char cout[sizeof(ostream)];
^~~~~~~
../src/iostream.cpp:24:18: error: expected ';' after top level declarator
alignas (ostream) char cout[sizeof(ostream)];
                 ^
                 ;
../src/iostream.cpp:25:1: error: C++ requires a type specifier for all
declarations
alignas (ostream) char cerr[sizeof(ostream)];
^~~~~~~
../src/iostream.cpp:25:18: error: expected ';' after top level declarator
alignas (ostream) char cerr[sizeof(ostream)];
                 ^
                 ;
../src/iostream.cpp:26:1: error: C++ requires a type specifier for all
declarations
alignas (ostream) char clog[sizeof(ostream)];
^~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

I'm following the instructions at http://libcxx.llvm.org/ -- I've also
been trying to build it using CMake but I'm not getting far with clang
either.

Build environment is Mac OS X 10.6.8, clang is built with the stock GCC.

Is this a known issue and if it is, is anybody working on it?

Cheers

Don't get issue with the same config and clang TOT.

Make sure you are using the freshly build clang binary (using clang --version).

-- Jean-Daniel

Oh, D'oh -- yes, you're right. I had been assuming that `sudo make
install` for clang was replacing the clang installed in /usr/bin when
in fact the newly built clang is clang-3.1.

I've remedied this by doing:

CXX=clang-3.1 ./buildit

Instead of the instructions from the website.

Thanks for the hint!

Cheers