Re: Problem compiling postgres sql --with-tcl

Started by Zeugswetter Andreas SB SDover 24 years ago12 messageshackers
Jump to latest
#1Zeugswetter Andreas SB SD
ZeugswetterA@spardat.at

I want to compile libpgtcl on a AIX 4.3.2 RS6000 but I have
problem at the linking phase.
I ran the ./configure like that:
$ sh ./configure --with-CC=gcc --with-includes=/usr/local/include
--with-libraries=/usr/local/lib --with-tclconfig=/usr/local/lib
--with-tkconfig=/usr/local/lib

After everything whent fine until time for libpgtcl.so I had those errors.
Can you help me
Thank you
Jacques Talbot

gcc -O2 -pipe -Wall -Wmissing-prototypes
-Wmissing-declarations -Wl,-H512
-Wl,-bM:SRE -Wl,-bI:../../../src/backend/postgres.imp
-Wl,-bE:libpgtcl.exp -o
libpgtcl.so libpgtcl.a -L../../../src/interfaces/libpq -lpq -lc

.....

ld: 0711-317 ERROR: Undefined symbol: .Tcl_DStringInit
ld: 0711-317 ERROR: Undefined symbol: .Tcl_DStringStartSublist
collect2: ld returned 8 exit status
make[3]: *** [libpgtcl.so] Error 1

configure unfortunately does not include the tcl library
for linking libpgtcl.so on AIX :-(

In the meantime Jacques, your tcl installation should have a shared
tcl library (libtcl8.2.so) or better yet an *.exp, which you can include
in the above link command.

In the shell manually execute the link, like:

cd src/pl/tcl
gcc -O2 -pipe -Wall -Wmissing-prototypes \
-Wmissing-declarations -Wl,-H512 \
-Wl,-bM:SRE -Wl,-bI:../../../src/backend/postgres.imp \
-Wl,-bE:libpgtcl.exp -o \
libpgtcl.so libpgtcl.a -L../../../src/interfaces/libpq -lpq -lc \
-L/usr/local/lib -Wl,-bI:/usr/local/lib/libtcl8.2.exp

The above addition could be generated with TCL_LIB_SPEC.
The -L/usr/local/lib is also essential to avoid runtime hassles,
why is this actually not automatic, since --with-libraries was used ?

Would a patch for src/pl/tcl/Makefile still be accepted for 7.2 ?

Andreas

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Zeugswetter Andreas SB SD (#1)

"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:

Would a patch for src/pl/tcl/Makefile still be accepted for 7.2 ?

If it's simple and low-risk, probably so. Please submit it anyway,
so we'll have it on file even if the decision is to hold it till
7.3.

regards, tom lane

#3Zeugswetter Andreas SB SD
ZeugswetterA@spardat.at
In reply to: Tom Lane (#2)

Tom wrote:

Would a patch for src/pl/tcl/Makefile still be accepted for 7.2 ?

If it's simple and low-risk, probably so. Please submit it anyway,
so we'll have it on file even if the decision is to hold it till
7.3.

Unfortunately the issue is in both interfaces/libpgtcl and pl/tcl.
libpgtcl is not prepared for the tclConfig.sh stuff, thus it would be
more than a few lines.

Second I do not understand why the Makefile in pl/tcl is so complicated,
and not similar e.g. to the plpython one, so the first task should be to
simplify the Makefile to use Makefile.shlib, and not cook it's own soup.

Basically:
NAME=pltcl
OBJS=pltcl.o
SHLIB_LINK=$(TCL_LIB_SPEC) $(TCL_LIBS)
all: all-lib

Third unfortunately my daughter is sick and my wife asked me to come home,
so I won't be able to work on it till Monday :-(

Andreas

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Zeugswetter Andreas SB SD (#3)

Zeugswetter Andreas SB SD writes:

Second I do not understand why the Makefile in pl/tcl is so complicated,
and not similar e.g. to the plpython one, so the first task should be to
simplify the Makefile to use Makefile.shlib, and not cook it's own soup.

All the oddities in that makefile are there because presumably some system
needed them in the past. Personally, I think the whole makefile is one
big bug, but I wasn't too eager to touch it because it seemed to work.
Now that we have an actual case where it doesn't I guess we need to look
at it.

Basically:
NAME=pltcl
OBJS=pltcl.o
SHLIB_LINK=$(TCL_LIB_SPEC) $(TCL_LIBS)
all: all-lib

That seems about right. Please try it out at your convenience.

--
Peter Eisentraut peter_e@gmx.net

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#4)

Peter Eisentraut <peter_e@gmx.net> writes:

Zeugswetter Andreas SB SD writes:

Second I do not understand why the Makefile in pl/tcl is so complicated,
and not similar e.g. to the plpython one, so the first task should be to
simplify the Makefile to use Makefile.shlib, and not cook it's own soup.

All the oddities in that makefile are there because presumably some system
needed them in the past.

No, it's a historical thing: the Makefile.shlib stuff didn't exist when
pltcl was developed. I'm not entirely sure why I didn't try to fold
pltcl in with the Makefile.shlib approach when we started doing that.
Possibly I was just thinking "don't fix what ain't broken". But now
I'd vote for changing over.

regards, tom lane

#6Zeugswetter Andreas SB SD
ZeugswetterA@spardat.at
In reply to: Tom Lane (#5)
Re: [HACKERS] Problem compiling postgres sql --with-tcl

Tom writes:

Peter Eisentraut <peter_e@gmx.net> writes:

Zeugswetter Andreas SB SD writes:

Second I do not understand why the Makefile in pl/tcl is so complicated,
and not similar e.g. to the plpython one, so the first task should be to
simplify the Makefile to use Makefile.shlib, and not cook it's own soup.

All the oddities in that makefile are there because presumably some system
needed them in the past.

No, it's a historical thing: the Makefile.shlib stuff didn't exist when
pltcl was developed. I'm not entirely sure why I didn't try to fold
pltcl in with the Makefile.shlib approach when we started doing that.
Possibly I was just thinking "don't fix what ain't broken". But now
I'd vote for changing over.

Here is a patch per above thread.
I tested the getDBs function in pgtclsh and a simple pltcl function.

I duplicated the file mkMakefile.tcldefs.sh which is probably not good,
but bin/pgtclsh already did it like that, so ...

Andreas

Attachments:

tcl.patchapplication/octet-stream; name=tcl.patchDownload+69-73
#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Zeugswetter Andreas SB SD (#6)
Re: [HACKERS] Problem compiling postgres sql --with-tcl

"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:

Here is a patch per above thread.

Why did you change libpgtcl's build process? AFAIK no one was claiming
that was broken.

This does not seem the right time to be making undiscussed changes in
Makefile.shlib, either. What's with that?

regards, tom lane

#8Zeugswetter Andreas SB SD
ZeugswetterA@spardat.at
In reply to: Tom Lane (#7)
Re: [HACKERS] Problem compiling postgres sql --with-tcl

"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:

Here is a patch per above thread.

Why did you change libpgtcl's build process? AFAIK no one was claiming
that was broken.

It was definitely broken on AIX, and was also the original complaint.
Since the make stopped there the next failure in pl/tcl was not reported.

This does not seem the right time to be making undiscussed changes in
Makefile.shlib, either. What's with that?

I was presuming, that the patch was at this stage not applied without further
review and testing on some other port.

It is not a real big problem, but for some targets "make clean" fails to
clean libxxx.2.0 (depending on what $(shlib) is on that port) and the
libxxx.exp file without the patch.
The patch brings "clean-lib" inline with "uninstall-lib".

Unfortunately it misses to clean xxx.dll on Windows, very sorry :-(
I thought I tripplechecked. Incremental patch attached.

Andreas

Attachments:

shlib.patchapplication/octet-stream; name=shlib.patchDownload+3-2
#9Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#7)
Re: [PATCHES] Problem compiling postgres sql --with-tcl

Tom Lane writes:

"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:

Here is a patch per above thread.

Why did you change libpgtcl's build process? AFAIK no one was claiming
that was broken.

This does not seem the right time to be making undiscussed changes in
Makefile.shlib, either. What's with that?

I wasn't under the impression that we wanted to get this patch into 7.2.
AFAIK, the Tcl stuff has not built on AIX for quite a while, so it's not a
regression from a previous release. Moreover, the chances that any
significant number of people will test the Tcl build in the remaining test
period is nearly zero.

--
Peter Eisentraut peter_e@gmx.net

#10Zeugswetter Andreas SB SD
ZeugswetterA@spardat.at
In reply to: Peter Eisentraut (#9)
Re: [PATCHES] Problem compiling postgres sql --with-tcl

Here is a patch per above thread.

Why did you change libpgtcl's build process? AFAIK no one was claiming
that was broken.

This does not seem the right time to be making undiscussed changes in
Makefile.shlib, either. What's with that?

I wasn't under the impression that we wanted to get this patch into 7.2.
AFAIK, the Tcl stuff has not built on AIX for quite a while, so it's not a
regression from a previous release. Moreover, the chances that any
significant number of people will test the Tcl build in the remaining test
period is nearly zero.

It would have been nice, if you would have stated your concern when I asked
if this patch had chance for inclusion, because if I had known that, I would
have worked at a patch after new year, because we are quite busy here with
the Euro coming.

Andreas

#11Peter Eisentraut
peter_e@gmx.net
In reply to: Zeugswetter Andreas SB SD (#10)
Re: [PATCHES] Problem compiling postgres sql --with-tcl

Zeugswetter Andreas SB SD writes:

It would have been nice, if you would have stated your concern when I asked
if this patch had chance for inclusion, because if I had known that, I would
have worked at a patch after new year, because we are quite busy here with
the Euro coming.

Sorry, I was always assuming you were working for a future release, since
you indicated that you wouldn't have much time anyway. But you must
understand that the Tcl code gets really little testing. The patch is
still available for other interestd AIX users, so the work is not in vain.

--
Peter Eisentraut peter_e@gmx.net

#12Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Zeugswetter Andreas SB SD (#10)
Re: [PATCHES] Problem compiling postgres sql --with-tcl

It would have been nice, if you would have stated your concern
when I asked
if this patch had chance for inclusion, because if I had known
that, I would
have worked at a patch after new year, because we are quite busy
here with
the Euro coming.

I saw a show about the first meeting to perhaps form an African Union. My
friend then suggested that if it goes ahead, they should called their
unified currency the 'Afro' :)

Merry Christmas all,

Chris