[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hppa*64* and dependent libraries
From: |
Albert Chin |
Subject: |
Re: hppa*64* and dependent libraries |
Date: |
Thu, 19 Dec 2002 17:59:59 -0600 |
User-agent: |
Mutt/1.4i |
On Thu, Dec 19, 2002 at 06:22:58PM -0500, John David Anglin wrote:
> > /usr/ccs/bin/ld -b +h libpng.sl.2 -o .libs/libpng.sl.2.2 png.o
> > pngerror.o pngget.o pngmem.o pngpread.o pngrio.o pngread.o pngrtran.o
> > pngrutil.o pngset.o pngtrans.o pngwio.o pngwrite.o pngwtran.o
> > pngwutil.o -L/opt/TWWfsw/zlib11/lib/pa20_64
> > -L/opt/TWWfsw/zlib11/lib/pa20_64 -L/opt/TWWfsw/zlib11/lib/pa20_64
> > /opt/TWWfsw/zlib11/lib/pa20_64/libz.sl -lm -lc
>
> There's something strange in the '-L' options. How come three zlib11s
> and no libpng12?
Because we're *building* libpng. Here's what you get during the same
build for a test program linked against the newly-built libpng.sl:
...
/bin/sh ./libtool --mode=link cc +DD64 +O2 +ESlit +Onofltacc
+Oentrysched +Odataprefetch +Onolimit
-L/opt/TWWfsw/zlib11/lib/pa20_64 -o pngtest pngtest.o libpng.la -lz
-lm
cc +DD64 +O2 +ESlit +Onofltacc +Oentrysched +Odataprefetch +Onolimit
-o .libs/pngtest pngtest.o -L/opt/TWWfsw/zlib11/lib/pa20_64
./.libs/libpng.sl /opt/TWWfsw/zlib11/lib/pa20_64/libz.sl -lm
-L/opt/TWWfsw/libpng12/lib/pa20_64 -L/opt/TWWfsw/zlib11/lib/pa20_64
creating pngtest
...
> > $ elfdump -L .libs/libnpg.sl | grep Rpath
> > 4 Rpath
> > /opt/TWWfsw/zlib11/lib/pa20_64:/opt/TWWfsw/zlib11/lib/pa20_64:/opt/TWWfsw/zlib11/lib/pa20_64
> >
> > Ick!
>
> You might be able to see why the second /opt/TWWfsw/zlib11/lib/pa20_64
> occurs in the path using -Wl,-v.
Well, there are three -L's so you get three duplicate paths in Rpath.
Is this what you're talking about? I think +b /a:/a:/a would exhibit
the same problem.
> You are correct that "+b" is explicit and there may be times when you
> you don't want a "-L" directory in the embedded path. I wonder if
> libtool could check for a user "+b" option and append the specified
> path to the accumulated rpath.
We wrote http://freshmeat.net/projects/wrapld/?topic_id=46 for this
purpose but as it replaces /usr/ccs/bin/ld, it's not really an option.
If libtool did this for +b on HP-UX, it would have to do it for -rpath
on Tru64 UNIX and -blibpath on AIX as well.
The other thing I don't like about -L is that if someone has
LDFLAGS="-L[path to static library]", then this path gets added to
Rpath.
If I change the link line to the following (using libz.la rather than
-L[path to zlib] -lz):
...
/bin/sh ./libtool --mode=link cc +DD64 +O2 +ESlit +Onofltacc
+Oentrysched +Odataprefetch +Onolimit -o libpng.la -rpath
/opt/TWWfsw/libpng12/lib/pa20_64 -version-info 2:2:0 -module png.lo
pngerror.lo pngget.lo pngmem.lo pngpread.lo pngrio.lo pngread.lo
pngrtran.lo pngrutil.lo pngset.lo pngtrans.lo pngwio.lo pngwrite.lo
pngwtran.lo pngwutil.lo /opt/TWWfsw/zlib11/lib/pa20_64/libz.la -lm
rm -fr .libs/libpng.la .libs/libpng.* .libs/libpng.*
/usr/ccs/bin/ld -b +h libpng.sl.2 -o .libs/libpng.sl.2.2 png.o
pngerror.o pngget.o pngmem.o pngpread.o pngrio.o pngread.o pngrtran.o
pngrutil.o pngset.o pngtrans.o pngwio.o pngwrite.o pngwtran.o
pngwutil.o -L/opt/TWWfsw/zlib11/lib/pa20_64
-L/opt/TWWfsw/zlib11/lib/pa20_64 /opt/TWWfsw/zlib11/lib/pa20_64/libz.sl
-lm -lc
...
$ elfdump -L .libs/libpng.sl | grep Rpath
4 Rpath /opt/TWWfsw/zlib11/lib/pa20_64:/opt/TWWfsw/zlib11/lib/pa20_64
--
albert chin (address@hidden)