[Top][All Lists]

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

Re: totally confused by versioning system of libtool...

From: Daniel Reed
Subject: Re: totally confused by versioning system of libtool...
Date: Fri, 13 May 2005 11:16:01 -0400 (EDT)

On Fri, 13 May 2005, Ed Hartnett wrote:
Bob Friesenhahn <address@hidden> writes:
On Fri, 13 May 2005, Ed Hartnett wrote:
How does the version number get used in this situation? That is, is
there any time on the users machine that the linker notices that he is
now linking to 1.0.0 instead of 0.0.0?
That implies that when I install a new version, the old version says
around. Is that correct?

Then, if the user re-links his program, the linker will find the most
recent version of the library to link to? Is that correct?

In general, the linker will look for the file, which is usually created as a symlink to or or whatever was most recently installed (not necessarily newest).

If the program is linked using -lexample while points to, the program will expect to be able to find when it is run.

If the program is linked while points to, it will expect to find when it is run, even if is changed to point to in the mean time.

When linking the program inside a Libtool wrapper (using "libtool --mode=link gcc -o program -lexample" instead of just "gcc -o program -lexample"), the existence of a file can cause Libtool to override the linker's default behavior, having it explicitly link to even if points to, or whatever, as in:

address@hidden:~/cc# gcc blah.c -o blah -L. -lexample
address@hidden:~/cc# LD_LIBRARY_PATH=. ldd blah => ./ (0xb7fe9000) => /lib/ (0xb7ea4000)
        /lib/ => /lib/ (0xb7fec000)
address@hidden:~/cc# rm blah
address@hidden:~/cc# libtool --mode=link gcc blah.c -o blah -L. -lexample
gcc blah.c -o blah  -L/root/cc /root/cc/ -Wl,--rpath 
-Wl,/root/cc -Wl,--rpath -Wl,/root/cc
address@hidden:~/cc# ldd blah => /root/cc/ (0xb7fe9000) => /lib/ (0xb7ea4000)
        /lib/ => /lib/ (0xb7fec000)

Daniel Reed <address@hidden>
It is so easy to miss pretty trivial solutions to problems deemed
complicated. The goal of a scientist is to find an interesting problem,
and live off it for a while. The goal of an engineer is to evade
interesting problems :) -- Vadim Antonov <address@hidden> on NANOG

reply via email to

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