Deds Castillo <deds@infiniteinfo.com> writes:

> Good day to you.  I've searched the net but I can't seem to find the solution 
> for this.  I've found a few more posts which are exactly the same as my error 
> but no solution was given.
> 
> The problem is when I install the postgresql-tcl rpm and I try to createlang 
> pltcl.  The error below occurs:
> 
> ERROR:  Load of file /usr/lib/pgsql/pltcl.so failed: /usr/lib/pgsql/pltcl.so: 
>  undefined symbol: Tcl_CreateSlave
> 
> So instead of executing createlang, I try to isolate the error using this 
> command:
> 
> testdb=# CREATE FUNCTION pltcl_call_handler () RETURNS OPAQUE AS
> '/usr/lib/pgsql/pltcl.so' LANGUAGE 'C';

During the build process, the tcl shared 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

specifying the soname "libtcl.so.0" and at the same time linking to
libtcl.so.0 (which is the name of the shared tcl library in RHL 7.2)
results in trouble when loading it later. 

Creating the module with a different so-name ("libtcl" seems like a
bad idea to use outside the main package) solves the problem and gives
you a module which loads

gcc -pipe -shared -Wl,-soname,libpgtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib -ltcl -ldl  -lieee -lm -lc

-- 
Trond Eivind Glomsrï¿½d
Red Hat, Inc.

09 Nov 2001 16:50:41 -0500
teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2
On Friday 09 November 2001 04:50 pm, Trond Eivind Glomsrï¿½d wrote:
> Creating the module with a different so-name ("libtcl" seems like a
> bad idea to use outside the main package) solves the problem and gives
> you a module which loads

> gcc -pipe -shared -Wl,-soname,libpgtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib
> -ltcl -ldl  -lieee -lm -lc

Will this cause any conflicts with the tcl client lib 'libpgtcl.so.x'?  
Should the soname be 'pltcl.so.0' ?

PeterE?
-- 
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Fri, 9 Nov 2001 17:14:06 -0500
Lamar Owen <lamar.owen@wgcr.org>
Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2
Lamar Owen <lamar.owen@wgcr.org> writes:

> On Friday 09 November 2001 04:50 pm, Trond Eivind Glomsrï¿½d wrote:
> > Creating the module with a different so-name ("libtcl" seems like a
> > bad idea to use outside the main package) solves the problem and gives
> > you a module which loads
> 
> > gcc -pipe -shared -Wl,-soname,libpgtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib
> > -ltcl -ldl  -lieee -lm -lc
> 
> Will this cause any conflicts with the tcl client lib 'libpgtcl.so.x'?  
> Should the soname be 'pltcl.so.0' ?

--- postgresql-7.1.3/src/pl/tcl/Makefile.tcldefs.tclsoname	Fri Nov  9 17:12:38 2001
+++ postgresql-7.1.3/src/pl/tcl/Makefile.tcldefs	Fri Nov  9 17:15:03 2001
@@ -19,7 +19,7 @@
 TCL_SHLIB_CFLAGS = -fPIC
 TCL_CFLAGS_WARNING = -Wall -Wconversion -Wno-implicit-int
 TCL_EXTRA_CFLAGS = 
-TCL_SHLIB_LD = gcc -pipe -shared -Wl,-soname,libtcl.so.0
+TCL_SHLIB_LD = gcc -pipe -shared -Wl,-soname,libpltcl.so.0
 TCL_STLIB_LD = ar cr
 TCL_SHLIB_LD_LIBS = ${LIBS}
 TCL_SHLIB_SUFFIX = .so


-- 
Trond Eivind Glomsrï¿½d
Red Hat, Inc.

09 Nov 2001 17:16:03 -0500
teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2
teg@redhat.com (Trond Eivind Glomsrï¿½d) writes:

> Lamar Owen <lamar.owen@wgcr.org> writes:
> 
> > On Friday 09 November 2001 04:50 pm, Trond Eivind Glomsrï¿½d wrote:
> > > Creating the module with a different so-name ("libtcl" seems like a
> > > bad idea to use outside the main package) solves the problem and gives
> > > you a module which loads
> > 
> > > gcc -pipe -shared -Wl,-soname,libpgtcl.so.0 -o pltcl.so pltcl.o -L/usr/lib
> > > -ltcl -ldl  -lieee -lm -lc
> > 
> > Will this cause any conflicts with the tcl client lib 'libpgtcl.so.x'?  
> > Should the soname be 'pltcl.so.0' ?
> 
> --- postgresql-7.1.3/src/pl/tcl/Makefile.tcldefs.tclsoname	Fri Nov  9 17:12:38 2001
> +++ postgresql-7.1.3/src/pl/tcl/Makefile.tcldefs	Fri Nov  9 17:15:03 2001
> @@ -19,7 +19,7 @@
>  TCL_SHLIB_CFLAGS = -fPIC
>  TCL_CFLAGS_WARNING = -Wall -Wconversion -Wno-implicit-int
>  TCL_EXTRA_CFLAGS = 
> -TCL_SHLIB_LD = gcc -pipe -shared -Wl,-soname,libtcl.so.0
> +TCL_SHLIB_LD = gcc -pipe -shared -Wl,-soname,libpltcl.so.0
>  TCL_STLIB_LD = ar cr
>  TCL_SHLIB_LD_LIBS = ${LIBS}
>  TCL_SHLIB_SUFFIX = .so

(scratch that - this file is generated when building) 

-- 
Trond Eivind Glomsrï¿½d
Red Hat, Inc.

09 Nov 2001 17:27:01 -0500
teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2
Trond Eivind Glomsrï¿½d writes:

> During the build process, the tcl shared 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
>
> specifying the soname "libtcl.so.0" and at the same time linking to
> libtcl.so.0 (which is the name of the shared tcl library in RHL 7.2)
> results in trouble when loading it later.

This must be a bug (feature?) in the Tcl package.  I see no such thing
happening here (RH 7.0, tcl-8.3.1-46):

gcc -pipe -shared -o pltcl.so pltcl.o -L/usr/lib -ltcl8.3 -ldl  -lieee -lm -lc

I don't know whose idea the soname was, but it surely wasn't a good one.

-- 
Peter Eisentraut   peter_e@gmx.net


Sun, 11 Nov 2001 16:38:48 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included