This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

RE: Problems with AIX and shared libs



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




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