libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking against indirect dependencies


From: Szombathelyi György
Subject: Re: Linking against indirect dependencies
Date: Sat, 29 May 2004 03:31:57 +0200
User-agent: KMail/1.6.52

Friday 28 May 2004 09:27 dátummal ezt írta:

> And there's another problem.  When libtool passes -ldependency in the
> command line, the linker will look for libdependency in the
> directories where it looks for libraries (-L).  If libdependency is
> only brought in by another shared library that has it in DT_RPATH,
> libdependency will be looked for in the --rpath-link search path, and
> it will have to be a shared library, i.e., static libs will be
> ignored.
>
> Now consider the following scenario:
>
> - libfoo.la is linked with libdep.la, but libdep.la was PIC and
>   static-only.  Both are installed.
>
> - libdep is rebuilt as both static and shared, and reinstalled.
>
> - program links with libfoo.la, using symbols from libdep.la that
>   weren't brought into libfoo.la
>
> - libtool sees libdep.la is available as a shared lib, so it drops it
>   from the link command.  Link fails because libfoo.so doesn't bring
>   in libdep.a.
AFAIK it's possible to link in libdep to libfoo if libdep is static (at least 
I'm succeeded with a small test case), and then the program not need to link 
with libdep.

I tried:
gcc -c libdep.c
gcc -c libfoo.c
ar q libdep.a libdep.o
ld libfoo.o -o libfoo.so -shared -ldep -L.
gcc prog.c -o prog -lfoo -L.

Or am I wrong?

Bye,
György

____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a 
FreeStarttol.
Probald ki most! http://www.freestart.hu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]