libtool
[Top][All Lists]
Advanced

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

--mode=link does not honour -L flags


From: Steve M. Robbins
Subject: --mode=link does not honour -L flags
Date: Sat, 14 Sep 2002 12:58:15 -0400
User-agent: Mutt/1.4i

Hi,

Suppose I have multiple copies of libA installed.  I can choose the
one with which to link using "cc -L/path/to/it -lA".  However,
"libtool --mode=link cc -L/path/to/it -lA" doesn't work in the same
way.

Here's an example.


Link with libgmp, for illustration.  The standard linking invocation
picks up the copy in /usr/lib.

address@hidden null.c -o null -lgmp
address@hidden null
        libgmp.so.3 => /usr/lib/libgmp.so.3 (0x40027000)
        libc.so.6 => /lib/libc.so.6 (0x4004f000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Make a second copy of libgmp and link against it.

address@hidden bar
address@hidden /usr/lib/libgmp.a bar
address@hidden null.c -o null -Lbar -lgmp
address@hidden null
        libc.so.6 => /lib/libc.so.6 (0x40027000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Here we see that the link with /usr/lib/libgmp is gone.  But
if I repeat the last line in libtool, it explicitly links
against the wrong libgmp:

address@hidden --mode=link gcc null.c -o null -Lbar -lgmp
gcc null.c -o null  -L/home/steve/foo/bar /usr/lib/libgmp.so


This is a bug, isn't it?  I'm using libtool built from CVS.


-S

P.S.  A minor nit: gcc allows "-Lbar" or "-L bar", but libtool
chokes on the latter.

address@hidden --mode=link gcc null.c -o null -L bar -lgmp
gcc null.c -o null bar  -L/home/steve/foo /usr/lib/libgmp.so
/usr/bin/ld: cannot open bar: File format not recognized




reply via email to

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