X-Original-To: pgsql-ports-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 8668A9FA293 for ; Thu, 18 May 2006 10:09:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 34560-01 for ; Thu, 18 May 2006 10:09:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from unicorn.rentec.com (unicorn.rentec.com [216.223.240.10]) by postgresql.org (Postfix) with ESMTP id 06BFB9F9C18 for ; Thu, 18 May 2006 10:09:39 -0300 (ADT) Received: from wren.rentec.com (wren [192.5.35.106]) by unicorn.rentec.com (8.13.6/8.12.1) with ESMTP id k4ID9QVr010926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 May 2006 09:09:26 -0400 (EDT) X-Source: non-mednet Received: from [172.26.132.145] (hoopoe.rentec.com [172.26.132.145]) by wren.rentec.com (8.13.1/8.12.1) with ESMTP id k4ID9OZE015375; Thu, 18 May 2006 09:09:25 -0400 (EDT) Message-ID: <446C7204.8030001@rentec.com> Date: Thu, 18 May 2006 09:09:24 -0400 From: Alan Stange Reply-To: stange@rentec.com Organization: Renaissance Technologies Corp. User-Agent: Mail/News 1.5.0.2 (X11/20060427) MIME-Version: 1.0 To: Theo Schlossnagle CC: Bruce Momjian , Tom Lane , pgsql-ports@postgresql.org Subject: Re: solaris build problem with Sun compilers References: <200605180004.k4I04Hj09317@candle.pha.pa.us> <8D4484B1-3256-41F4-AFD2-8ABFB4B914BE@omniti.com> In-Reply-To: <8D4484B1-3256-41F4-AFD2-8ABFB4B914BE@omniti.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Logged: Logged by unicorn.rentec.com as k4ID9QVr010926 at Thu May 18 09:09:26 2006 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/58 X-Sequence-Number: 2439 Theo Schlossnagle wrote: > > On May 17, 2006, at 8:04 PM, Bruce Momjian wrote: > >> Bruce Momjian wrote: >>> Tom Lane wrote: >>>> Alan Stange writes: >>>>> I believe the trick here is that Solaris 10 will only run on v9 >>>>> hardware >>>>> (or the sun4u systems), which all have the instruction. But the >>>>> v8 ABI >>>>> "model" doesn't have it. So, in some sense the ABI doesn't "allow" >>>>> this instruction, but the hardware does, so they can just slam it in >>>>> knowing that it'll work. >>>> >>>> Well, that might be OK for Sun's compiler since they know what a given >>>> version of Solaris will run on. But I don't think we can adopt the >>>> same >>>> attitude for our gcc code path; that has to work on Sparc-based Linuxen >>>> and BSDen. I don't think it's appropriate to kiss off support for v8 >>>> chips when we haven't seen any proof at all of a performance boost in >>>> return. >>>> >>>> Maybe the right answer is to leave the code as-is, ie, deliberately not >>>> the same for Sun and gcc compilers. >>> >>> OK, I have applied the following patch which documents that the Solaris >>> CC TAS ASM only works for sparc9. Hopefully either sparc8 is not needed >>> (unlikely) or someone will fix it. I have CC'ed the original >>> contributor who added "cas". >> >> Oh, I just found this email that has a simplified sparc8 asm: >> >> http://archives.postgresql.org/pgsql-ports/2006-05/msg00025.php >> >> Attached is the new solaris_sparc.s file with the #ifdef sparc8 test; >> applied. > > I don't think that asm does what you think it does. That hex encoding > of the cas instruction doesn't work on Sparcv8, only sparcv8plus. The > reason that it is hacked that way is that, for other reasons, they can't > use the -xarch=v8plus flag (despite compiling on v8plus capable chips). > Basically that code hardcodes a v8plus instruction into a v8 binary > "knowing" that it will never run on a non-v8plus capable chip. The > reason that they can do this is because they (as I understand it) open > solaris won't support any chips so old as to not run v8plus code. I think that's what was written above... > We shouldn't be suffering from that problem and -xarch=v8plus should be > used to produce 32-bit binaries and -xarch=v9 should be used to produce > 64-bit sparc binaries. I can't think of a reason to every compile the > Postgres source with -xarch=v8 instead of -xarch=v8plus, the latter will > produce much better code overall. linking the postgresql libpq with code compiled at v8 is the only reason that I can think of. v8plus has been the default in the Sun compilers for some time now, so this would only be an issue for an older binary. As far as I can tell, gcc still produces v7 code by default and knows nothing about v8plus. Even better would be using v8plusb with the Sun compilers. -- Alan