pranith@intel:~/libcpp/build$ make [ 3%] Generating include/cxxabi.h [ 6%] Generating include/bits/c++config.h [ 10%] Generating include/bits/os_defines.h [ 13%] Generating include/bits/cpu_defines.h [ 16%] Generating include/bits/cxxabi_tweaks.h [ 20%] Generating include/bits/cxxabi_forced.h [ 20%] Built target supcxx_headers [ 23%] Building CXX object lib/CMakeFiles/cxx.dir/__/src/new.cpp.o [ 26%] Building CXX object lib/CMakeFiles/cxx.dir/__/src/algorithm.cpp.o In file included from /home/pranith/devops/code/libcpp/libcxx/include/algorithm:594:0, from /home/pranith/devops/code/libcpp/libcxx/src/algorithm.cpp:10: /home/pranith/devops/code/libcpp/libcxx/include/memory:2478:49: error: function ‘std::__1::default_delete<_Tp>::default_delete()’ defaulted on its first declaration must not have an exception-specification /home/pranith/devops/code/libcpp/libcxx/include/memory:2497:49: error: function ‘std::__1::default_delete<_Tp []>::default_delete()’ defaulted on its first declaration must not have an exception-specification make[2]: *** [lib/CMakeFiles/cxx.dir/__/src/algorithm.cpp.o] Error 1 make[1]: *** [lib/CMakeFiles/cxx.dir/all] Error 2 make: *** [all] Error 2 pranith@intel:~/libcpp/build$ clang -v clang version 3.3 (trunk 174537) Target: x86_64-unknown-linux-gnu Thread model: posix
Is this possibly a clang bug? 8.4.2 [dcl.fct.def.default]/p2: An explicitly-defaulted function ... , and may have an explicit exception-specification only if it is compatible (15.4) with the exception- specification on the implicit declaration. I so far don't see anything that prohibits a compatible exception specification on an explicitly defaulted special member (and thus contradicts the quote above).
Err, that diagnostic is coming from gcc 4.6, not Clang, and it seems to have been fixed in gcc 4.7.
I configured it to build with clang as given in the build instructions as follows: CC=clang CXX=clang++ cmake -G "Unix Makefiles" -DLIBCXX_CXX_ABI=libsupc++ -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="/usr/include/c++/4.6/;/usr/include/c++/4.6/x86_64-linux-gnu/" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../libcxx/
Perhaps there's a bug in the libcxx CMake system? If so, try bringing it up on cfe-dev. I'm not familiar with CMake. But someone there will be.
cmake wants -DCMAKE_CXX_COMPILER=, not the CXX environment variable.
OK. I got the above command from this(http://libcxx.llvm.org/) page under the section "Build on Linux using CMake and libsupc++". Using the following command, it worked. May be the page above should be updated? cmake -DCMAKE_CXX_COMPILER=clang++ -G "Unix Makefiles" -DLIBCXX_CXX_ABI=libsupc++ -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="/usr/include/c++/4.6/;/usr/include/c++/4.6/x86_64-linux-gnu/" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../libcxx/
I find this odd, as the command on the site works for me and others. The CMake docs also explicitly state that CC and CXX work. The only issue is that you have to have these the first time you run cmake, it has no effect if there is already a CMakeCache.txt.
This issue has been raised on the cfe-commits list and is being looked into.