[tahoe-dev] GCC 4.5 fixes typeinfo/exception handling across SO bug (making pycryptopp happier?)

Jack Lloyd lloyd at randombit.net
Wed Mar 10 07:52:33 PST 2010


I noticed in the release notes for the upcoming GCC 4.5 the following:

The default behavior for comparing typeinfo names has changed, so in
<typeinfo>, __GXX_MERGED_TYPEINFO_NAMES now defaults to zero.

Pretty sparse, but a comment in 4.5's <typeinfo> gives further hints:

"""
Determine whether typeinfo names for the same type are merged (in
which case comparison can just compare pointers) or not (in which case
strings must be compared), and whether comparison is to be implemented
inline or not.  We used to do inline pointer comparison by default if
weak symbols are available, but even with weak symbols sometimes names
are not merged when objects are loaded with RTLD_LOCAL, so now we
always use strcmp by default.
[...]
The compiler's target configuration can override the defaults by
defining __GXX_TYPEINFO_EQUALITY_INLINE to 1 or 0 to indicate whether
or not comparison is inline, and __GXX_MERGED_TYPEINFO_NAMES to 1 or 0
to indicate whether or not pointer comparison can be used.
"""

Currently (GCC svn head), no target config is choosing to turn on
typeinfo merging, though a number already had it set to 0 to force
use of strcmp.

I can't find the relevant thread at the moment, but I believe this
typeinfo merging was a problem pycryptopp was running into with
RTTI/exceptions across shared object boundaries?

-Jack


More information about the tahoe-dev mailing list