This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[libffi] Fix libffi.special/ on Solaris


We have the following failure on Solaris/SPARC with the GNU tools:
FAIL: libffi.special/  -lstdc++ execution test

The unwinder doesn't find any unwind information registered for libffi so the 
exception cannot get out of libstdc++ and ends up invoking terminate instead.

The problem is that shared libraries are built with -shared-libgcc on Solaris, 
including libffi.  Now unwindtest is built with the gcc driver, and not the 
g++ driver, so it is linked against the static EH machinery.  The most 
correct solution would be to build it with g++; however, this doesn't fit 
nicely with the testsuite harness so the patch uses the other alternative 
described in the docs, that is to explicitly pass -shared-libgcc.

[Amazingly enough, this doesn't fail with the Sun tools because the unwinder 
manages to find a bridge between libstdc++ and libffi.  Not sure what's going 
on here, maybe an ordering issue.]

Tested on sparc64-sun-solaris2.9, sparc-sun-solaris2.8 and 
amd64-mandrake-linux-gnu.  OK for mainline?

2005-01-11  Eric Botcazou  <>

	* testsuite/libffi.special/special.exp (cxx_options): Add -shared-libgcc.

Eric Botcazou
Index: testsuite/libffi.special/special.exp
RCS file: /cvs/gcc/gcc/libffi/testsuite/libffi.special/special.exp,v
retrieving revision 1.1
diff -u -p -r1.1 special.exp
--- testsuite/libffi.special/special.exp	4 Sep 2003 14:47:48 -0000	1.1
+++ testsuite/libffi.special/special.exp	11 Jan 2005 23:18:48 -0000
@@ -25,7 +25,7 @@ global srcdir subdir
 global cxx_options
-set cxx_options " -lstdc++"
+set cxx_options " -shared-libgcc -lstdc++"
 dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options ""

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]