This is the mail archive of the gcc-help@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]

Shared libs and exceptions on AIX ?


Hi,

I'm trying to get shared libs working correctly on AIX 4.3.3 on a RS6000
system.
I've allready run into many problems, but let me summerize what I've tried.
I had some problems with the AIX linker and resolving symbols when using
templates, so I downloaded the cvs version of the gnu bintools, (2.90.11),
and
installed them without any trouble. This ld resolved all the symbols
correctly,
and I was on my way ... to another hell. The program was getting about 4
times
as big, and while still using static libs, the executable was going to be
around
300Mb (believe it or not). I never got this executable, because I was
running out
of memory (what a surprise!).
So the obvious answer was: shared libs. 1st I tried to create a simple
shared lib,
and it turned out just fine. So I made a shared lib of a normally a static
lib.
After some struggling I got it, and I linked an executable. Normally the
test exec
was around 16 Mb, and now I had a shared lib of 16 Mb and an exec of 5. So I
was
happy. But the exec didn't run as it should, and after some debugging I
found it
crashed with an "IOT/Abort trap (core dumped)" error whenever I throw an
exception.
Currently, this is my main problem! Once this is solved, I'm on my way ...
again.

Now I've read on this list that this behaviour with exceptions in a shared
lib
should disappear when I linked with a shared version of of libstdc++.
I didn't had it, as I installed the binary version of the gnu tools from
http://freeware.bull.net. So I decided to compile 2.95.3 myself, and try it
from
there ...

I first tried to compile it with the gcc from bull.net. But it didn't gave
me the
result I needed. The last configure command that worked was:

../gcc-2.95.3/configure --enable-shared --with-ld=/usr/ccs/bin/ld
--with-as=/usr/ccs/bin/as --disable-multilib --enable-langugages=c++

But now, I still had some trouble when compiling an example program. It
seemed the
--with-ld and --with-as made the compiler allways use these programs, in
stead of
using the first program encountered in the PATH environment. Anyway to fix
this
after gcc is installed, or do I need to recompile again with correct options
(which?)
I still got an shared lib and an executable, but still the IOT/Abort trap
remained.
No problem, I though, and ln -s the two programs to the correct gnu
versions.
But it didn't help for me, the problem with throwing exceptions from a
shared lib
still remained... The example lib and exec I created are now around 200 Kb,
against the 700 Kb version it was when using static libs (incl. static
stdc++ lib).
When running 'ldd test' I can see that it is linked with some libs:

$ ldd test
/usr/local/lib/gcc-lib/rs6000-ibm-aix4.3.3.0/2.95.3/libstdc++.a
./libLib.a
test
/usr/lib/libcrypt.a(shr.o)
/usr/lib/libc.a(shr.o)

Some other side question is what the (shr.o) means, and why only the AIX
libs got this "status".

/usr/local/lib/gcc-lib/rs6000-ibm-aix4.3.3.0/2.95.3/libstdc++.a is a
symbolic link to
/usr/local/lib/libstdc++.so.2.10.0, So I guess that's a good thing. In
/usr/local/lib, I've
three versions of the lib: libstdc++-ar.a.2.10.0 (own build version),
libstdc++.a.2.10.0
(bull.net version) and libstdc++.so.2.10.0 (own build shared version).

Can anybody tell if I overlooked something that I should've done, or still
can try to get
this mess running??

Thanks,
  John


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