From: Alan Stange <stange@rentec.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: pgsql-ports@postgresql.org
Subject: Re: solaris build problem with Sun compilers
Date: Fri, 12 May 2006 16:12:29 -0400
Message-ID: <4464EC2D.6080406@rentec.com> (raw)
In-Reply-To: <15883.1147460750@sss.pgh.pa.us>
References: <200605112316.k4BNGeB17324@candle.pha.pa.us>
<4463D639.3030802@rentec.com>
<4464B653.1040301@rentec.com>
<5470.1147451501@sss.pgh.pa.us>
<4464C950.40906@rentec.com>
<12675.1147457431@sss.pgh.pa.us>
<4464DAB0.70900@rentec.com>
<15883.1147460750@sss.pgh.pa.us>
Tom Lane wrote:
> Alan Stange <stange@rentec.com> writes:
>> I'm fairly sure CAS was included in the v9 instruction set. I was
>> actually surprised to see that you had allowed it in just for this
>> reason. I'm fairly sure this will break any program that needs to link
>> against the postgresql libs using a "v8" 32 bit version.
>
> I brought up exactly this question when the patch was submitted, and as
> far as I recall it was just brushed aside. Can you tell us anything
> about whether v8 chips are still in use in the field? I'm more than
> ready to revert to ldstub if there's any significant risk of breaking
> real users.
I think the vast majority of hardware in active use will be based on
"v9" instruction set hardware (meaning UltraSparc, Sparc64, etc.).
Someone running postgresql on an old sparc5 would be best off spending
$50 and getting something 10x faster from Ebay.
So, one can assume the hardware can all run "v8plus" or "v9", but the
hurdle is that some compilers will generate "generic" or "v8" binaries
still. That may be the reason why the "cas" variant wasn't comitted for
the gcc compiler as the "cas" instructions are illegal on a v8 platform.
If I try to compile the snapshot with the v62 compiler it fails:
cc -Xa -v -DSUNOS4_CC -O -c tas_cpp.s -o tas.o
/opt/spro62/SUNWspro/bin/../WS6U2/bin/fbe: "tas_cpp.s", line 1: error:
statement syntax
/opt/spro62/SUNWspro/bin/../WS6U2/bin/fbe: "tas_cpp.s", line 2: error:
unknown opcode "solaris_sparc.s"
/opt/spro62/SUNWspro/bin/../WS6U2/bin/fbe: "tas_cpp.s", line 2: error:
statement syntax
/opt/spro62/SUNWspro/bin/../WS6U2/bin/fbe: "tas_cpp.s", line 3: error:
statement syntax
/opt/spro62/SUNWspro/bin/../WS6U2/bin/fbe: "tas_cpp.s", line 13: error:
cannot use v8plus instructions in a non-v8plus target binary
cc: assembler failed for tas_cpp.s
as the default target on the older compiler is "generic". From the
spro9 compiler up to spro11 the default platform is "v8plus", for which
the cas instruction would be valid.
I modified the code that gcc would generate to use a cas instruction and
the build failed because "gcc -mv8plus" makes a call to gas using
"-xarch=v8". Needless to say, it crapped out. I was using gcc-4.0.2.
Take aways:
- postgresql HEAD when using the Solaris compilers spro9 or newer will
only run on v9 based hardware using v8plus or v9 platform.
- postgresql HEAD when using gcc will run on anything as they generate
code for the v7 platform by default and the cas instruction isn't used
in any assembler code in postgresql.
-- Alan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-ports@postgresql.org
Cc: stange@rentec.com, tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us
Subject: Re: solaris build problem with Sun compilers
In-Reply-To: <4464EC2D.6080406@rentec.com>
References: <200605112316.k4BNGeB17324@candle.pha.pa.us> <4463D639.3030802@rentec.com> <4464B653.1040301@rentec.com> <5470.1147451501@sss.pgh.pa.us> <4464C950.40906@rentec.com> <12675.1147457431@sss.pgh.pa.us> <4464DAB0.70900@rentec.com> <15883.1147460750@sss.pgh.pa.us> <4464EC2D.6080406@rentec.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox