[Top][All Lists]

[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


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

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 => /usr/lib/ (0x40027000) => /lib/ (0x4004f000)
        /lib/ => /lib/ (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 => /lib/ (0x40027000)
        /lib/ => /lib/ (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/

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


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/
/usr/bin/ld: cannot open bar: File format not recognized

reply via email to

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