<div dir="ltr">Hi!<div><br></div><div style>I'm trying to build libcxx on Linux (Ubuntu Precise) using the following command:</div><div><br></div><div>cmake -DLIBCXX_CXX_ABI=libsupc++ '-DLIBCXX_LIBSUPCXX_INCLUDE_PATHS=/usr/include/c++/4.6;/usr/include/c++/4.6/x86_64-linux-gnu/.;' -DLIBCXX_ENABLE_EXCEPTIONS=OFF -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_RTTI=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/tmp.boBpS5zFqt/libcxx_inst /tmp/tmp.boBpS5zFqt/libcxx<br>
</div><div><br></div><div style>and I want the result to be "hermetic" in the sense that resulting static library libc++.a doesn't reference undefined symbols from std::</div><div style>However, I see the following problems: </div>
<div><br></div><div><div>(libc++.a.new.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/new.cpp:function std::bad_alloc::~bad_alloc(): error: undefined reference to 'std::exception::~exception()'</div><div>(libc++.a.new.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/new.cpp:function std::bad_array_new_length::~bad_array_new_length(): error: undefined reference to 'std::exception::~exception()'</div>
<div>(libc++.a.new.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/new.cpp:function std::bad_array_new_length::~bad_array_new_length(): error: undefined reference to 'std::exception::~exception()'</div><div>(libc++.a.ios.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/ios.cpp:function std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush(): error: undefined reference to 'std::uncaught_exception()'</div>
<div>(libc++.a.ios.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/ios.cpp:function std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::flush(): error: undefined reference to 'std::uncaught_exception()'</div>
<div>(libc++.a.ios.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/ios.cpp:function std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry(): error: undefined reference to 'std::uncaught_exception()'</div>
<div>(libc++.a.ios.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/ios.cpp:function std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry(): error: undefined reference to 'std::uncaught_exception()'</div>
<div>(libc++.a.memory.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/memory.cpp:function std::__1::bad_weak_ptr::~bad_weak_ptr(): error: undefined reference to 'std::exception::~exception()'</div><div>(libc++.a.memory.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/memory.cpp:function vtable for std::__1::__shared_weak_count: error: undefined reference to 'std::__1::__shared_weak_count::__get_deleter(std::type_info const&) const'</div>
<div>(libc++.a.thread.cpp.o):/tmp/tmp.boBpS5zFqt/libcxx/src/thread.cpp:function std::__1::thread::~thread(): error: undefined reference to 'std::terminate()'</div><div><br></div><div style>What is the correct way to for that? I have the patch (attached) that works for me, but I'm not really sure it's correct</div>
<div style>(especially the first part).</div><div style><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>