Re: [HACKERS] Bug in linking in old libraries - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Bug in linking in old libraries
Date
Msg-id 17827.894641693@sss.pgh.pa.us
Whole thread Raw
In response to Bug in linking in old libraries  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Bug in linking in old libraries
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> 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.

This strikes me as just plain brain fade in src/bin/pgtclsh/Makefile.
Instead of

# try to find libpgtcl.a in either directory
LIBPGTCL= -L$(SRCDIR)/interfaces/libpgtcl -L$(LIBDIR) -lpgtcl
LIBPQ= -L$(LIBPQDIR) -L$(LIBDIR) -lpq

it should just have

LIBPGTCL= -L$(SRCDIR)/interfaces/libpgtcl -lpgtcl
LIBPQ= -L$(LIBPQDIR) -lpq

There's no good reason to be referencing the library install directory,
since even if it exists it may contain an incompatible down-rev library.

On some machines there is an issue of telling the executable to look for
shared libraries in LIBDIR at run time, but that is handled by different
switches that Makefile.port supplies via LDFLAGS.

A quick grep for LIBDIR shows no indication that the same mistake has
been made anywhere else.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] compile problem in libpq
Next
From: "Jackson, DeJuan"
Date:
Subject: RE: [QUESTIONS] Using psql \f to change delimiter to space