libc++ fails to link

Hi all,

I have LLVM + clang + clang extra tools + compiler-rt + libc++ checked
out as suggested by Clang - Getting Started

After configuring with

cmake -G Ninja \

and running "ninja all check-all" , I get a bunch of errors like:

projects/libcxx/lib/CMakeFiles/cxx_objects.dir/__/src/locale.cpp.o: In
function `std::__1::(anonymous
std::__1::char_traits<char>, std::__1::allocator<char> > const&)':
undefined reference to `__cxa_allocate_exception'
undefined reference to `__cxa_throw'
undefined reference to `__cxa_free_exception'
projects/libcxx/lib/CMakeFiles/cxx_objects.dir/__/src/locale.cpp.o: In
function `std::__1::ctype_byname<wchar_t>::do_widen(char) const':
undefined reference to `__cxa_call_unexpected'

(see the attachment)

This used to work 2-3 months ago ; the build would finish with the
unittests (of which five used to fail ; one got fixed since then).

Platform: Ubuntu 17.10
gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3.2)


111v (159 KB)

The easiest way to fix this would be to also check out libc++abi. An alternative would be to configure libc++ to use an alternative ABI library (either -DLIBCXX_CXX_ABI=libstdc++ or -DLIBCXX_CXX_ABI=libsupc++ ought to work), but I think libc++abi is the simplest route to go.

Are you trying to compile libc++abi as well?