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 516C59FA2CB for ; Thu, 11 May 2006 16:42:25 -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 63320-04-5 for ; Thu, 11 May 2006 16:42:19 -0300 (ADT) X-Greylist: delayed 00:24:14.409385 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 0410F9FA2C8 for ; Thu, 11 May 2006 16:42:17 -0300 (ADT) Received: from unicorn.rentec.com (unicorn.rentec.com [216.223.240.10]) by svr4.postgresql.org (Postfix) with ESMTP id DA8115B3E8C for ; Thu, 11 May 2006 19:18:00 +0000 (GMT) Received: from wren.rentec.com (wren [192.5.35.106]) by unicorn.rentec.com (8.13.6/8.12.1) with ESMTP id k4BJHtRZ003755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 May 2006 15:17:56 -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 k4BJHtrF011288; Thu, 11 May 2006 15:17:55 -0400 (EDT) Message-ID: <44638DE3.6040507@rentec.com> Date: Thu, 11 May 2006 15:17:55 -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: pgsql-ports@postgresql.org Subject: solaris build problem with Sun compilers Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Logged: Logged by unicorn.rentec.com as k4BJHtRZ003755 at Thu May 11 15:17:56 2006 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/13 X-Sequence-Number: 2394 Hello all, it appears that there's a problem building postgresql with --enable-debug on Solaris with the Sun compilers. noisy$ /opt/spro11/SUNWspro/bin/cc -Xa -v -DSUNOS4_CC -I../../../../src/include -g -c s_lock.c /opt/spro11/SUNWspro/prod/bin/fbe: "/tmp/yabeAAAdBaiW5", line 484: error: can't compute difference between symbols in different segments Failure in /opt/spro11/SUNWspro/prod/bin/fbe, status = 0x100 Fatal Error exec'ing /opt/spro11/SUNWspro/prod/bin/fbe cc: acomp failed for s_lock.c It appears that explicitly adding "-xO0" to the compile statement resolves this problem. In fact, any optimization level seems to make this error go away which is why it's not seen in a normal build. The core of the problem seems to be a .size tas_dummy,(.-tas_dummy) directive which is emitted by the compiler. Without the any -xO specifier this directive ends up in a different .section due to the two .section directives in the s_lock.c code. Adding any -xO options relocates the code so that the section mismatch isn't a problem. This brings up the question: why are the two .section directives there at all in s_lock.c:299? asm(".section \"data\""); asm(".section \"text\""); I don't see what they add and they're confusing assembler (fbe actually). The data section obviously isn't needed and given this code is already nested in a function, the text section is redundant too. Anyway, seems we have two solutions: 1) explicitly specify a -xO0 option along with -g or 2) remove the .section specifiers Comments? -- Alan