pg.ddx.io  pgsql-ports@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alan Stange <stange@rentec.com>
To: pgsql-ports@postgresql.org
Subject: solaris build problem with Sun compilers
Date: Thu, 11 May 2006 15:17:55 -0400
Message-ID: <44638DE3.6040507@rentec.com> (raw)

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



view thread (37+ messages)  latest in thread

Message-ID: <44638DE3.6040507@rentec.com>
Permalink:  ../44638DE3.6040507@rentec.com/
Also on:    postgresql.org/message-id/44638DE3.6040507@rentec.com

 · 

reply

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
  Subject: Re: solaris build problem with Sun compilers
  In-Reply-To: <44638DE3.6040507@rentec.com>
  References: <44638DE3.6040507@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