Bug in linking in old libraries - Mailing list pgsql-hackers

From Bruce Momjian
Subject Bug in linking in old libraries
Date
Msg-id 199805081433.KAA05359@candle.pha.pa.us
Whole thread Raw
Responses Re: [HACKERS] Bug in linking in old libraries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I have found a problem with libpgtcl and cases where the linking brings
in the old libpq libraries in the current installed directory, rather
than the one in the current source.

Here is the link line:

gcc2 -O2 -m486 -pipe -I../../include -I../../backend   -I/u/readline
-g -Wall -pg -I/usr/X11R6/include -I../../interfaces/libpgtcl -o pgtclsh
pgtclAppInit.o -L../../interfaces/libpgtcl -L/usr/local/pgsql/lib -lpgtcl
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^^^^
-L../../interfaces/libpq -L/usr/local/pgsql/lib -lpq -ltcl -lm -L/u/readline
-L/usr/contrib/lib -lcompat -lln -lipc -ldl -lm -lreadline -lhistory -ltermcap
-lcurses

The active items are highlighted.  The link is looking to the source
libpgtcl first, then the one in the install directory.  When the libpq
link comes up, it searches the install lib directory FIRST, rather than
the one in the current source tree.

The cause is that the libpgtcl is added as a group before the libpq
stuff, and over-rides it.

Any ideas on a solution?  Someone else mentioned that perl has a problem
where you can only create it AFTER you do an install.  Any reason we are
using the install lib directory in the link?


--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] compile problem in libpq
Next
From: Andreas Zeugswetter
Date:
Subject: Re: [HACKERS] connection names