[Bug 201784] [libcxxrt] C++ dynamic_cast does not recognize same types across dynamically loaded modules when downcasting

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jul 23 12:57:40 UTC 2015


--- Comment #8 from Dimitry Andric <dim at FreeBSD.org> ---
(In reply to Marcin Cieślak from comment #6)
> By the way, our <bsd.lib.mk> always uses ${CC} when linking shared library
> (and it's silenced with @). Is this okay for C++ libs?

Not if you specify the lib using LIB_CXX, like in the libatf-c++ Makefile:

LIB_CXX= atf-c++

We used to do a 'deep' comparison of the typeinfo earlier, but only in head
from r256642 onwards, and we eventually reverted it in r278010.  As Jörg
Sonnenberger noted in a private mail conversation:

"... there are three different problematic situations:

(1) A type is used in the main program and it is linked without

(2) A type is used by two different DSOs and both are loaded with

(3) Two independent types of the same name are defined in two different

The hack makes the first two work to a degree and fails misserable on
the last. IMO (2) and (3) should be considered the same and (1) is just
a bug."

(N.B.: with 'the hack' he meant doing the deep comparison.)

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-standards mailing list