As reported in PR libitm/51822, the libitm.c++/eh-1.C test FAILs on Solaris with
terminate called after throwing an instance of 'int' I found that the failures are for two different reasons: * Enabling ld.so.1 debugging (LD_DEBUG=bindings), it turned out that the 64-bit failures on Solaris 10 and 11 happen since _Unwind_RaiseException from libc is used: 25243: 1: binding file=../../../gcc/amd64/libgcc_s.so.1 (0xfffffd7fc21e6910:0x16910) at plt[27]:full to file=/lib/64/libc.so.1 (0xfffffd7fff05a250:0x12a250): symbol '_Unwind_RaiseException' Unlike SPARC and the 32-bit libc, the 64-bit one provides an implementation of the unwinder, which seems to break this test. Linking the test with -shared-libgcc fixes it. * The 32-bit failures on Solaris 8 to 10 have a different root cause: _Unwind_Find_FDE returns NULL for an address in _ZGTtL2f1v (f1()). It turns out that there are two copies of the unwinder in eh-1.exe: one from libgcc_s.so.1, and another one from libgcc_eh.a. eh-1.o has a reference to _Unwind_Resume (don't yet know why), which is resolved from libgcc_eh.a. This doesn't happen on Solaris 11, which uses the dl_iterate_phdr based unwinder, thus no __register_frame_info_bases. Again, linking with shared-libgcc allows the testcase to succeed. Bootstrapped without regressions on i386-pc-solaris2.11. Ok for mainline? Rainer 2012-01-15 Rainer Orth <r...@cebitec.uni-bielefeld.de> PR libitm/51822 * testsuite/libitm.c++/eh-1.C: Add -shared-libgcc on *-*-solaris2*.
# HG changeset patch # Parent b41d70648bc4d3ba4c7930a694c0100973a1ed01 Link eh-1.exe with -shared-libgcc on Solaris (PR libitm/51822) diff --git a/libitm/testsuite/libitm.c++/eh-1.C b/libitm/testsuite/libitm.c++/eh-1.C --- a/libitm/testsuite/libitm.c++/eh-1.C +++ b/libitm/testsuite/libitm.c++/eh-1.C @@ -1,4 +1,5 @@ // { dg-do run } +// { dg-options "-shared-libgcc" { target *-*-solaris2* } } extern "C" void abort ();
-- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University