Hi, 

I just compiled and installed Postgres 6.5.1 on Slackware 4.0 (kernel 2.2.6,
cpu: PIII@450) whithout changing anything on the code. The regression tests had
some strange failures, so i'm sending you the .out and .diff files.

Thanks for your efforts on Postgres,

T.

-- 
Theodore=J.=Soldatos=_\_="There=is=always=a=bug=somewhere",=said==HAL=to=the==
=  theodore@eexi.gr =_/_==Ultimate=Programmer,=and=turned=off=the=air=supply.=
=   bafh@hellug.gr  =_\_="Everybody=knows=the=war=is=over,====================
==== Scientific =====_/_==everybody=knows=the=good=guys=lost"===Leonard=Cohen=
= Publications Ltd. =_\_============ http://w4u.eexi.gr/~theodore ============
==== Finger: theodore@msfree.scientificpublications.gr or @aurora.eexi.gr ====
Tue, 31 Aug 1999 17:37:06 +0300
"Theodore J. Soldatos" <theodore@eexi.gr>
Postgres 6.5.1 on Slackware 4.0
There is a problem with libpq++.so on IRIX 6.5 (MIPSpro 7.2.1, -n32). 
If you compile and link a simple program like the following:

#include "libpq++/pgdatabase.h"
 
main(int argc, char **argv)
{
  PgDatabase *db = new PgDatabase("dbname=mydb");
  db->Exec("SELECT * FROM TEST");
  db->PrintTuples();
  delete db;
}

and run it, you'll get the following error:

46407:./a.out: rld: Error: unresolvable symbol in
/5xxRoot/ALG/pgsql/lib/libpq++.so.3.0:
__node_allocator_lock__Q2_3std45__default_alloc_template__pt__13_XCbL11XCiL10
46407:./a.out: rld: Error: unresolvable symbol in
/5xxRoot/ALG/pgsql/lib/libpq++.so.3.0:
free_list__Q2_3std45__default_alloc_template__pt__13_XCbL11XCiL10
46407:./a.out: rld: Fatal Error: this executable has unresolvable symbols

I think this has to do with some quirks of the SGI MIPSpro compiler when
creating libraries for C++. For shared library, instead of "ld -shared",
"CC -shared" should be used to enable pre-linking (for template
instantiation). And for static library, "CC -ar" should be used instead
of "ar" (although right now if I use the static library the run-time error
does not occur).

I'm not sure whether using "CC" to create libraries for the pure C
modules would work (my guess is it should and I'll try it). If it does
then it'll be easy to patch the IRIX makefile template. But then the
downside is people will be required to have the C++ compiler even if
they don't care about libpq++.

--Yu Cao





Fri, 3 Sep 1999 22:41:49 -0700 (PDT)
Yu Cao <yucao@falcon.kla-tencor.com>
PostgreSQL 6.5.1: libpq++ libraries on IRIX 6.5
Yu Cao <yucao@falcon.kla-tencor.com> writes:
> I'm not sure whether using "CC" to create libraries for the pure C
> modules would work (my guess is it should and I'll try it). If it does
> then it'll be easy to patch the IRIX makefile template. But then the
> downside is people will be required to have the C++ compiler even if
> they don't care about libpq++.

Not necessarily.  Since 6.4 or so, the "template" files are not just
static assignments of variable values --- they can actually contain
arbitrary fragments of shell script (see configure.in's code that
reads them).  So you could do something like
	if [ -x /usr/bin/CC ]
	then
		CC= CC
	else
		CC= cc
	fi
in the IRIX template.

			regards, tom lane

Sat, 04 Sep 1999 11:18:06 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] PostgreSQL 6.5.1: libpq++ libraries on IRIX 6.5 
Hi Tom, thanks for the tip. I ended up just adding a few lines to
Makefile.shlib. Attached is the context diff. The patch has been
tested on IRIX 6.5.2 with MIPSpro C and C++ compiler version 7.2.1
using -n32 ABI.

--Yu Cao

On Sat, 4 Sep 1999, Tom Lane wrote:

> Yu Cao <yucao@falcon.kla-tencor.com> writes:
> > I'm not sure whether using "CC" to create libraries for the pure C
> > modules would work (my guess is it should and I'll try it). If it does
> > then it'll be easy to patch the IRIX makefile template. But then the
> > downside is people will be required to have the C++ compiler even if
> > they don't care about libpq++.
> 
> Not necessarily.  Since 6.4 or so, the "template" files are not just
> static assignments of variable values --- they can actually contain
> arbitrary fragments of shell script (see configure.in's code that
> reads them).  So you could do something like
> 	if [ -x /usr/bin/CC ]
> 	then
> 		CC= CC
> 	else
> 		CC= cc
> 	fi
> in the IRIX template.
> 
> 			regards, tom lane
> 
> ************
> 
> 
>
Sun, 5 Sep 1999 23:55:56 -0700 (PDT)
Yu Cao <yucao@falcon.kla-tencor.com>
Re: [HACKERS] PostgreSQL 6.5.1: libpq++ libraries on IRIX 6.5
Yu Cao <yucao@falcon.kla-tencor.com> writes:
> Hi Tom, thanks for the tip. I ended up just adding a few lines to
> Makefile.shlib. Attached is the context diff. The patch has been
> tested on IRIX 6.5.2 with MIPSpro C and C++ compiler version 7.2.1
> using -n32 ABI.

That fix bothers me, because it would interfere with someone trying
to use gcc/g++, wouldn't it?  Seems safer to just alter configure's
default...

			regards, tom lane

Mon, 06 Sep 1999 11:05:48 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] PostgreSQL 6.5.1: libpq++ libraries on IRIX 6.5 
That's a good point (about interfering with gcc/g++). But I'm still
a bit hesitant about changing the default AR and LD for all other
libraries (although in theory it shouldn't do any harm). And if we
changed the default, gcc/g++ users (who happen to have CC installed
on their system) would again have to find a way to override it. So
attached is another try: I put the mods in interfaces/libpq++/Makefile.in.
That file already had some checks on PORTNAME (for windows) and CXX (for
g++), so it seems adding more checks (for irix5 and CC) doesn't make it
uglier and also gets the job done with minimal impact on other things.

--Yu Cao

On Mon, 6 Sep 1999, Tom Lane wrote:

> Yu Cao <yucao@falcon.kla-tencor.com> writes:
> > Hi Tom, thanks for the tip. I ended up just adding a few lines to
> > Makefile.shlib. Attached is the context diff. The patch has been
> > tested on IRIX 6.5.2 with MIPSpro C and C++ compiler version 7.2.1
> > using -n32 ABI.
> 
> That fix bothers me, because it would interfere with someone trying
> to use gcc/g++, wouldn't it?  Seems safer to just alter configure's
> default...
Mon, 6 Sep 1999 16:39:27 -0700 (PDT)
Yu Cao <yucao@falcon.kla-tencor.com>
Re: [HACKERS] PostgreSQL 6.5.1: libpq++ libraries on IRIX 6.5 
Yu Cao <yucao@falcon.kla-tencor.com> writes:
> attached is another try: I put the mods in interfaces/libpq++/Makefile.in.
> That file already had some checks on PORTNAME (for windows) and CXX (for
> g++), so it seems adding more checks (for irix5 and CC) doesn't make it
> uglier and also gets the job done with minimal impact on other things.

That looks good to me; will commit it.  Thanks.

			regards, tom lane

Tue, 07 Sep 1999 09:18:02 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] PostgreSQL 6.5.1: libpq++ libraries on IRIX 6.5 