This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
RE: Problems with AIX and shared libs
- To: Andrey Slepuhin <pooh at msu dot ru>
- Subject: RE: Problems with AIX and shared libs
- From: Didier dot Spezia at sip dot fr
- Date: Tue, 22 Jun 1999 14:46:20 +0200
- cc: egcs-bugs at egcs dot cygnus dot com, Laurent dot Villefranche at sip dot fr
Hi Andrey, many thanks for your answer.
I've checked the AIX documentation ( 4.1.5 and 4.2.1 ). Importing from main
executable in a shared lib seems to be a new feature of AIX 4.2, so it is
not available
on a 4.1.5 platform.
I've modified collect2.c the way you proposed and rebuilt EGCS. It works
very well.
We can now link against a shared stdc++ library without any problem.
We've performed a few tests with shared libs and exceptions. As you pointed
out,
it didn't work very well. If a shared library use exceptions, it must be
statically linked
with libgcc, therefore we got multiple defined symbols during the linking
of the main
program. We have noticed the following behavior :
- an exception raised in a function or method of the shared lib and caught
within the lib works as expected.
- an exception raised in a function or method in the library, not caught
within the library but in the main program results in a core dump. So the
main program can't catch exceptions generated in shared libs.
So, it's probably better to avoid C++ in shared libs on AIX 4.1.5. except
for
the stdc++ library. ( It doesn't use exceptions and RTTI, does it ? )
Best regards,
DS