Re: Pl/Tcl problem - Mailing list pgsql-general

From Tom Lane
Subject Re: Pl/Tcl problem
Date
Msg-id 8990.1008436421@sss.pgh.pa.us
Whole thread Raw
In response to Re: Pl/Tcl problem  (Trond Eivind Glomsrød <teg@redhat.com>)
Responses Re: Pl/Tcl problem
List pgsql-general
=?ISO-8859-1?Q?Trond_Eivind_Glomsr=F8d?= <teg@redhat.com> writes:
> On Sat, 15 Dec 2001, Tom Lane wrote:
>> teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=) writes:
>>> Nah, the problem is that the module is created like this:
>>> gcc -pipe -shared -Wl,-soname,libtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib -ltcl -ldl  -lieee -lm -lc
>>> The pltcl.so module thus has soname libtcl.so.0. That leads to
>>> problems, as the same soname is used by the tcl library.
>>
>> Ugh.  Is this our fault, or Tcl's?

> I'm not sure. One thing which probably affects it, is that we have a
> proper soname for libtcl (in addition to the nonstandard library name),
> which we're trying to upstream. What I'm not sure of is where soname for
> the postgresql tcl module comes from - "libtcl.so.0" is not a sane one to
> use.

It looks like src/pl/tcl/Makefile uses this to build pltcl.so:

%$(TCL_SHLIB_SUFFIX): %.o
    $(TCL_SHLIB_LD) -o $@ $< $(TCL_LIB_SPEC) $(SHLIB_EXTRA_LIBS)

where TCL_SHLIB_LD is taken verbatim from tclConfig.sh.  I infer that
on your platform, TCL_SHLIB_LD expands to
    gcc -pipe -shared -Wl,-soname,libtcl.so.0
which is a somewhat reasonable thing for it to expand to when building
libtcl.so, but not really what we want for pltcl :-(

Perhaps we should abandon the idea of relying on Tcl's definitions to
tell us how to build the shlib.  IIRC, that decision was made a long
time ago before we had the present Makefile.shlib support, when it made
sense to assume Tcl might know more than we do about how to build
shlibs.

But I'm not sure that this has anything to do with Alvaro's problem.
The bogus choice of soname has doubtless been that way for awhile,
and yet we've not had other complaints.

            regards, tom lane

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Pl/Tcl problem
Next
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: Pl/Tcl problem