On Thu, Jun 6, 2013 at 12:59 PM, Jakub Jelinek <ja...@redhat.com> wrote: > On Thu, Jun 06, 2013 at 12:55:17PM +0400, Konstantin Serebryany wrote: >> > ubsan actually needs >> > U _ZTIN10__cxxabiv117__class_type_infoE@@CXXABI_1.3 >> > U _ZTIN10__cxxabiv120__si_class_type_infoE@@CXXABI_1.3 >> > U _ZTIN10__cxxabiv121__vmi_class_type_infoE@@CXXABI_1.3 >> > U _ZTISt9type_info@@GLIBCXX_3.4 >> > U __dynamic_cast@@CXXABI_1.3 >> >> These things are needed only for the C++-specific undefined behavior >> checking. >> At least, if I compile a C test using clang -fsanitize=undefined I >> don't see any of these. > > But that is only because of the statically linking everything approach.
Err. Yes, right. We don't link either of sanitizers dynamically. > When libubsan is a shared library, when any part of the library needs > libstdc++, you need it for everything, unless you do some weakref tricks and > use it only conditionally (but that might be harder when you use C++ > dynamic_cast, you'd need to call the runtime routine through weak symbol > instead by hand). > >> > plus all the libs have: >> > w __cxa_demangle@@CXXABI_1.3 >> >> This beast is declared as weak: > > Sure, I know very well what w means ;), was listing this just for > completeness. > > Jakub