Re: 64 bit PostgreSQL 8.3.6 build on AIX 5300-09-02-0849 with IBM XL C/C++ 10.1.0.1 - initdb fails (could not dump unrecognized node type: 650)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mihai Criveti <cmihai(at)boreas(dot)ro>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 64 bit PostgreSQL 8.3.6 build on AIX 5300-09-02-0849 with IBM XL C/C++ 10.1.0.1 - initdb fails (could not dump unrecognized node type: 650)
Date: 2009-02-09 16:04:04
Message-ID: 15898.1234195444@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mihai Criveti <cmihai(at)boreas(dot)ro> writes:
> OK, I've compiled a 64 bit optimized version, and it works great! No issues
> what so ever in configure, make or install. Thanks a lot for all the support
> :-).

> PostgreSQL rocks!

> What I've used to build it:

> CC="xlc_r -q64 -qnoansialias"

Hmm. I think -qnoansialias corresponds to gcc's -fno-strict-aliasing,
which we *know* is necessary to build a working Postgres on recent gcc
versions. I have not checked the exact symptoms of -fstrict-aliasing
recently, but what you're reporting is definitely consistent with the
idea that the compiler is improperly reordering some assignments, which
is basically what the aliasing business is about. So that switch seems
like the critical issue here.

I see that configure knows about that switch, but it only tries to use
it if CC = xlc:

elif test x"${CC}" = x"xlc"; then
# AIX xlc has to have strict aliasing turned off too
PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias])
fi

So it seems we have a couple of problems here. Using xlc_r or xlC_r
or adding -q64 to CC (rather than CFLAGS which is where it really
belongs) will confuse this check. It also seems a bit schizophrenic
to have this bit of knowledge wired into configure itself while there
are some other AIX-specific switches in src/template/aix.

Would it be reasonable to change the test quoted above to

elif test "$PORTNAME" = "aix"; then ...

that is try -qnoansialias anytime the compiler isn't gcc and the
platform is aix? Is xlc used on any platform other than aix?

Also, has anyone got a clue what the switches selected in
src/template/aix actually do, and whether they still make sense
for modern AIX versions?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-02-09 16:08:38 Re: WIP: fix SET WITHOUT OIDS, add SET WITH OIDS
Previous Message Marko Kreen 2009-02-09 15:55:22 Re: WIP: fix SET WITHOUT OIDS, add SET WITH OIDS