Re: shared libraries and libc6
On Sun, Oct 19, 1997 at 10:01:39PM +0200, Christoph Martin wrote:
> J.J.Troup@comp.brad.ac.uk (James Troup) writes:
>
> >
> > Christoph Martin <martin@uni-mainz.de> writes:
> >
> > > I just built some packages (socks4) including a shared library
> > > package. All binaries are well linked against libc6 but if I check
> > > the shared library ldd reports that it is only linked agains
> > > libc5. What is the problem?
> >
> > Have you read /usr/doc/debian-policy/libc6-migration.text.gz? Anyway,
> > you need to change socks so it links the shared library with
> > -lc. (Among other things)
>
> I did not find this anywhere. What do you mean by "Among other
> things"? Your statements below?
>
> > However socks seems to have some weird (IMO) ideas about how to make a
> > shared library, I tried adding -lc to the ld call which, rather
> > interestingly, results in
> >
> > ld -shared -lc -o libsocks.so.4.3 -soname libsocks.so.4 --whole-archive libsocks.a
> > ld: internal error ldlang.c 2941
> >
> > Woops. Is that because what I'm doing is stupid or is it a bug?
>
> It sounds correct, but is not working for me either.
Never use ld directly. GCC knows about certain system dependencies and
how to handle them. Instead do something like
gcc -shared -o libsocks.so.4.3 -Wl,-soname,libsocks.so.4 -Wl,--whole-archive \
libsocks.a -Wl,--no-whole-archive -lc
Note the -lc statement at the end, not the beginning. I suspect that's what
is blowing up your linker. Depending of the library making the DSO use
DT_SYMBOLIC might also be a good idea. Also note that the ld of binutils 2.7
will blow up when you link against lc. It will pull in the entire static
libc and produce a bad DSO.
Ralf
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: