[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 11:10:57 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201784

David Chisnall <theraven at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |theraven at FreeBSD.org

--- Comment #3 from David Chisnall <theraven at FreeBSD.org> ---
This is a known issue (I can't find the closed bug report for it at the
moment).  If you don't link with -Wl,-export-dynamic, then the RTTI symbols
will not be merged.  This then means that the pointer comparison in libcxxrt
will fail.  The work-around that libsupc++ implements replaces the pointer
comparison with string comparison.  This adds a noticeable performance hit in
all dynamic_casts.  We decided not to impose a performance hit on all C++
programs just to benefit people who can pass different linker flags to avoid a
bug.

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


More information about the freebsd-standards mailing list