[Bug libitm/55693] [4.8 Regression] libitm.c++/eh-1.C execution test fails on darwin from r193271

howarth at nitro dot med.uc.edu gcc-bugzilla@gcc.gnu.org
Wed Jan 23 16:45:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55693

--- Comment #26 from Jack Howarth <howarth at nitro dot med.uc.edu> 2013-01-23 16:44:51 UTC ---
Iain,
   The initial comments from the darwin linker developer were...

  That test case is dying because a.out contains its own copy of
__cxa_allocate_exception which just returns NULL.   How was a.out built?  It
looks like it linked with some bogus static copy of the libc++ runtime.

Are you expecting that because these bogus cxa functions are weak, they will be
overridden at runtime by the real version?  Weak linking does not work quite
that way on darwin.  For performance, the only symbols which dyld checks for
weak coalescing are those which the static linker marked as needing weak
binding.  You can see those with "dyldinfo -weak_bind".   In a.out
__cxa_allocate_exception is marked for weak binding check, but in
libc++abi.dylib does not mark those as weak, so dyld is not coalescing those
symbols and the a.out wind up running with its own bogus implementation.  Can
you just not link a.out with the bogus implementation?



More information about the Gcc-bugs mailing list