LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 15182 - g++ 4.6 cannot build libc++
Summary: g++ 4.6 cannot build libc++
Status: RESOLVED INVALID
Alias: None
Product: clang
Classification: Unclassified
Component: C++11 (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-06 15:41 PST by Pranith Kumar
Modified: 2013-02-07 13:29 PST (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pranith Kumar 2013-02-06 15:41:39 PST
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
Comment 1 Howard Hinnant 2013-02-06 16:15:26 PST
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).
Comment 2 Richard Smith 2013-02-06 16:33:09 PST
Err, that diagnostic is coming from gcc 4.6, not Clang, and it seems to have been fixed in gcc 4.7.
Comment 3 Pranith Kumar 2013-02-06 16:59:46 PST
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/
Comment 4 Howard Hinnant 2013-02-06 17:07:16 PST
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.
Comment 5 Richard Smith 2013-02-06 17:16:10 PST
cmake wants -DCMAKE_CXX_COMPILER=, not the CXX environment variable.
Comment 6 Pranith Kumar 2013-02-06 18:33:38 PST
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/
Comment 7 Michael Spencer 2013-02-07 13:22:31 PST
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.
Comment 8 Howard Hinnant 2013-02-07 13:29:31 PST
This issue has been raised on the cfe-commits list and is being looked into.