[cfe-dev] libc++ fails to link

Csaba Raduly via cfe-dev cfe-dev at lists.llvm.org
Fri Apr 27 03:31:10 PDT 2018


Hi all,

I have LLVM + clang + clang extra tools + compiler-rt + libc++ checked
out as suggested by https://clang.llvm.org/get_started.html

After configuring with

cmake -G Ninja \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_C_COMPILER=gcc \
	-DCMAKE_CXX_COMPILER=g++ \
	-DLLVM_INCLUDE_GO_TESTS=OFF \
	-DLLVM_TARGETS_TO_BUILD=X86 \
	../llvm

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
namespace)::__throw_runtime_error(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&)':
locale.cpp:(.text.unlikely._ZNSt3__112_GLOBAL__N_1L21__throw_runtime_errorERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+0xf):
undefined reference to `__cxa_allocate_exception'
locale.cpp:(.text.unlikely._ZNSt3__112_GLOBAL__N_1L21__throw_runtime_errorERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+0x33):
undefined reference to `__cxa_throw'
locale.cpp:(.text.unlikely._ZNSt3__112_GLOBAL__N_1L21__throw_runtime_errorERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+0x3e):
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':
locale.cpp:(.text._ZNKSt3__112ctype_bynameIwE8do_widenEc+0x43):
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)


Csaba
-- 
You can get very substantial performance improvements by not doing the
right thing.
   - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformat way
to get the wrong information: this is what you want. - Scott Meyers
(C++TDaWYK)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 111v
Type: application/octet-stream
Size: 162572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180427/d9433afd/attachment-0001.obj>


More information about the cfe-dev mailing list