Renate Bahnemann
2003-10-24 11:45:11 UTC
Hi
I would like to understand the results that I'm geting from ldd on AIX
5.2.
Also, I don't quite understand how AIX shared libraries are shipper.
It seems as though the shared object is held inside an archive (.a)
file.
I am trying to rebuild and ship a 3rd party library (zlib) that is
already installed in /usr/lib. There it is found as /usr/lib/libz.a
I've rebuilt zlib it in another directory from its .configure script.
My build environment contains the following:
export PATH=/bin:/usr/bin:/usr/sbin
export LDSHARED="cc -G"
export CC=xlc_r
./configure --prefix=targetdir --shared
This produces:
libz.so@ -> libz.so.1.1.4
libz.so.1@ -> libz.so.1.1.4
libz.so.1.1.4
(It was only when I added the LDSHARED setting that I managed to get a
shared lib. Before, I always built a static library.)
When I do 'dump -H myapp' I see that the path to zlib is showing my
directory.
However when I do
ldd myapp
I get:
...
/usr/lib/zlib.a(shr.o)
...
I've tried setting LIBPATH to point to my homegrown library first. But
it didn't help.
I was wondering whether the reason is that the one library is inside a
.a file whereas in the other one it is the shared object itself. And
that AIX prefers the .a format?
Any AIX guru's out there who wouldn't mind explaining this to me?
The reason why I am trying to do this is that I am building something
for 4 different UNIX platforms and am trying to be consistent across
all (AIX, Solaris, HPUX and Linux).
BTW ldd behaves strangely on our system. One has to be logged in as
root to run it.
Thanks
Renate
I would like to understand the results that I'm geting from ldd on AIX
5.2.
Also, I don't quite understand how AIX shared libraries are shipper.
It seems as though the shared object is held inside an archive (.a)
file.
I am trying to rebuild and ship a 3rd party library (zlib) that is
already installed in /usr/lib. There it is found as /usr/lib/libz.a
I've rebuilt zlib it in another directory from its .configure script.
My build environment contains the following:
export PATH=/bin:/usr/bin:/usr/sbin
export LDSHARED="cc -G"
export CC=xlc_r
./configure --prefix=targetdir --shared
This produces:
libz.so@ -> libz.so.1.1.4
libz.so.1@ -> libz.so.1.1.4
libz.so.1.1.4
(It was only when I added the LDSHARED setting that I managed to get a
shared lib. Before, I always built a static library.)
When I do 'dump -H myapp' I see that the path to zlib is showing my
directory.
However when I do
ldd myapp
I get:
...
/usr/lib/zlib.a(shr.o)
...
I've tried setting LIBPATH to point to my homegrown library first. But
it didn't help.
I was wondering whether the reason is that the one library is inside a
.a file whereas in the other one it is the shared object itself. And
that AIX prefers the .a format?
Any AIX guru's out there who wouldn't mind explaining this to me?
The reason why I am trying to do this is that I am building something
for 4 different UNIX platforms and am trying to be consistent across
all (AIX, Solaris, HPUX and Linux).
BTW ldd behaves strangely on our system. One has to be logged in as
root to run it.
Thanks
Renate