Compiler construction 编译libc++;叮当作响++;在Ubuntu中

Compiler construction 编译libc++;叮当作响++;在Ubuntu中,compiler-construction,clang,ubuntu-11.04,llvm-clang,libc++,Compiler Construction,Clang,Ubuntu 11.04,Llvm Clang,Libc++,我的操作系统是Ubuntu-11.04 我成功地按照用户手册使用clang编译了llvm。 然后我尝试用clang++编译libcxx, 我通过阅读以下内容对$LIBCXX_DIR/lib/buildit.sh进行了修改 修改后的文件$LIBCXX_DIR/lib/buildit粘贴在错误消息之后 通过修改buildit.sh,我得到了以下错误。似乎clang++无法实现 要成功编译头文件“string”。 以下是完整的汇编报告: vmplanet@kubuntu-vm:~/usr/libcx

我的操作系统是Ubuntu-11.04 我成功地按照用户手册使用clang编译了llvm。 然后我尝试用clang++编译libcxx, 我通过阅读以下内容对$LIBCXX_DIR/lib/buildit.sh进行了修改

修改后的文件$LIBCXX_DIR/lib/buildit粘贴在错误消息之后

通过修改buildit.sh,我得到了以下错误。似乎clang++无法实现 要成功编译头文件“string”。 以下是完整的汇编报告:

vmplanet@kubuntu-vm:~/usr/libcxx/lib$ ./buildit 
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include
../src/algorithm.cpp
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include ../src/bind.cpp
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include ../src/chrono.cpp
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include
../src/condition_variable.cpp
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include
../src/exception.cpp
../src/exception.cpp:85:6: warning: #warning uncaught_exception not yet
implemented [-W#warnings]
    #warning uncaught_exception not yet implemented
     ^
../src/exception.cpp:119:6: warning: #warning exception_ptr not yet implemented
[-W#warnings]                                                                   
    #warning exception_ptr not yet implemented
     ^
../src/exception.cpp:130:6: warning: #warning exception_ptr not yet implemented
[-W#warnings]                                                                   
    #warning exception_ptr not yet implemented
     ^
../src/exception.cpp:146:6: warning: #warning exception_ptr not yet implemented
[-W#warnings]                                                                   
    #warning exception_ptr not yet implemented
     ^
../src/exception.cpp:181:6: warning: #warning exception_ptr not yet implemented
[-W#warnings]                                                                   
    #warning exception_ptr not yet implemented
     ^
../src/exception.cpp:193:6: warning: #warning exception_ptr not yet implemented
[-W#warnings]                                                                   
    #warning exception_ptr not yet implemented
     ^
6 warnings generated.                                                           
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include ../src/future.cpp
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include ../src/hash.cpp
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include ../src/ios.cpp
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include ../src/iostream.cpp
clang++ -c -g -Os -fPIC -std=c++0x -nostdinc++ -I../include ../src/locale.cpp
In file included from ../src/locale.cpp:10:
../include/string:2122:10: error: overload resolution selected deleted operator
'='
    __r_ = _STD::move(__str.__r_);
    ~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
../include/string:2133:5: note: in instantiation of member function
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >::__move_assign'      
      requested here
    __move_assign(__str, integral_constant<bool,
    ^
../src/locale.cpp:4772:10: note: in instantiation of member function
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >::operator='         
      requested here
    __c_ = __analyze('c', ct);
         ^
../include/memory:2050:7: note: candidate function (the implicit copy
assignment operator) has been explicitly deleted                                
class __compressed_pair
      ^
In file included from ../src/locale.cpp:10:                                     
../include/string:2122:10: error: overload resolution selected deleted operator
'='
    __r_ = _STD::move(__str.__r_);
    ~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
../include/string:2133:5: note: in instantiation of member function
'std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>,
std::__1::allocator<wchar_t>               
      >::__move_assign' requested here
    __move_assign(__str, integral_constant<bool,
    ^
../include/locale:2796:15: note: in instantiation of member function
'std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>,
std::__1::allocator<wchar_t> >::operator='
      requested here
        __nsn = __mp.negative_sign();
              ^
../include/memory:2050:7: note: candidate function (the implicit copy
assignment operator) has been explicitly deleted                                
class __compressed_pair
      ^
2 errors generated.

好吧,错误信息解释了自己,请参见Howard Hinnant对我的问题的回答: 我想那是同一个地方

#! /bin/sh
#
# Set the $TRIPLE environment variable to your system's triple before
# running this script.  If you set $CXX, that will be used to compile
# the library.  Otherwise we'll use clang++.

set -e

if [ `basename $(pwd)` != "lib" ]
then
  echo "current directory must be lib"
  exit 1
fi

CXX=clang++
CC=clang

if [ -z $RC_ProjectSourceVersion ]
then
  RC_ProjectSourceVersion=1
fi

EXTRA_FLAGS="-std=c++0x "
    EXTRA_FLAGS="-std=c++0x"
    LDSHARED_FLAGS="-o libc++.so.1.0 \
      -shared -nodefaultlibs -Wl,-soname,libc++.so.1 \
      -lpthread -lrt -lc -lstdc++"

    RC_CFLAGS="-fPIC"
    SOEXT=so

for FILE in ../src/*.cpp; do
  echo $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -nostdinc++ -I../include $FILE
  $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -nostdinc++ -I../include $FILE
done

$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS

#libtool -static -o libc++.a *.o

if [ -z $RC_XBS ]
then
    rm *.o
fi