This is the mail archive of the
mailing list for the GCC project.
[libffi] Fix libffi.special/unwindtest.cc on Solaris
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 12 Jan 2005 00:31:17 +0100
- Subject: [libffi] Fix libffi.special/unwindtest.cc on Solaris
We have the following failure on Solaris/SPARC with the GNU tools:
FAIL: libffi.special/unwindtest.cc -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 <firstname.lastname@example.org>
* testsuite/libffi.special/special.exp (cxx_options): Add -shared-libgcc.
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
-set cxx_options " -lstdc++"
+set cxx_options " -shared-libgcc -lstdc++"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options ""